Ken
884e24f782
*facepalm*
2017-08-11 02:23:43 +12:00
Ken
28e61dbf48
Cleaned up
2017-08-11 01:58:59 +12:00
Ken
328514ae63
This kinda doesn’t make sense, but ok
2017-08-11 01:46:26 +12:00
Ken
5af99566fa
Wait includes is case sensitive
...
Made it convert to lowercase before comparing
2017-08-11 01:27:31 +12:00
Ken
3b601e8595
Add string contains string
2017-08-11 00:52:41 +12:00
Paul Kaplan
44298fd71b
Use soundId instead of md5 for playing sounds
2017-07-25 12:20:32 -04:00
Paul Kaplan
2ddb6215fd
Add tests and fixes for set instrument and play drum
2017-07-06 14:56:46 -04:00
Paul Kaplan
1b6baf8114
Make playSound use one indexing
2017-07-06 14:28:11 -04:00
Chris Willis-Ford
47fc38fd9a
Merge pull request #619 from cwillisf/clone-custom-state
...
Clone custom state
2017-06-27 22:37:30 -07:00
Eric Rosenbaum
01f801a2a2
Remove all audio effects except pitch and pan
2017-06-19 14:56:29 -04:00
Christopher Willis-Ford
06d5994a32
Use targetWasCreated
event to clone pen state
...
Remove explicit cloning of `_customState` in favor of smarter,
state-specific cloning.
2017-06-16 14:22:51 -07:00
DD Liu
fb986effe6
Merge pull request #593 from fsih/fixWaitCalledEveryFrame
...
Change wait to use a promise instead of being called every frame
2017-06-08 15:35:48 -04:00
Chris Willis-Ford
d41997b58b
Merge pull request #556 from cwillisf/wedo2-blocks
...
Add WeDo 2.0 blocks
2017-06-07 09:57:36 -07:00
DD Liu
e237d24846
fix lint
2017-06-06 10:21:27 -04:00
DD Liu
ab0cef52eb
Change wait to use a promise instead of being called every frame
2017-06-05 16:55:15 -04:00
Christopher Willis-Ford
cbfbc5d600
Convert motor duration: seconds -> milliseconds
...
The block takes seconds, whereas the device takes milliseconds. Turning
on a motor for 1 millisecond isn't very dramatic.
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
06fe701624
Implement WeDo 2.0 blocks
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
2625529ebe
Create WeDo 2.0 device communication classes
2017-05-24 16:40:55 -07:00
Ray Schamp
548aa6dd70
Fix no-useless-call todo
...
The linter is correct that `devObject[func].call(devObject, args)` is unnecessary because it's equivalent to `devObject[func](args)`.
@tmickel probably either meant to allow passing an array of arguments to be applied, or to call the function with the provided argument. Since we probably want to be able to use multi-argument functions, use `apply` and fix the one place that uses `ioQuery` with an argument.
2017-05-15 21:11:38 -07:00
Ray Schamp
a4f095db5e
Use ES6 style classes
2017-04-17 19:42:48 -04:00
Ray Schamp
e01c4ae108
Pass with --fix
2017-04-17 15:10:04 -04:00
Rasmus Haglund
b693d4f4ef
Fix rounded get size reporting
2017-04-08 19:35:29 +02:00
Eric Rosenbaum
092084cc6b
Merge pull request #513 from ericrosenbaum/feature/loudness
...
Add loudness block
2017-04-07 14:06:18 -04:00
Eric Rosenbaum
b74c03dbbd
Loudness returns -1 if no audio engine exists
...
To match Scratch 2.0 behavior
2017-03-27 13:20:44 -04:00
Silly Inventor
77775cdadb
Switch to using number directly, instead of toNumber for costume switch ( #499 )
2017-03-23 18:34:04 -04:00
Eric Rosenbaum
b4a94c266f
Add loudness block
2017-03-20 17:01:44 -04:00
Eric Rosenbaum
106db6a024
Clamp range for each audio effect
2017-03-20 14:53:04 -04:00
Eric Rosenbaum
c9338f37ed
Clamp tempo range
...
The function in AudioEngine for change tempo can now be removed
2017-03-17 18:13:33 -04:00
Eric Rosenbaum
f2ac365859
Clamp beat durations for play note, play drum and rest
2017-03-17 17:29:23 -04:00
Eric Rosenbaum
1ba7ad0218
Clamp range for “play note” input
...
Clamp to 36-96, which is C2-C7.
This is a temporary fix to prevent errors, until we have a new instrument player implementation, which may have a different range.
2017-03-17 17:23:53 -04:00
Chris Willis-Ford
a56db95aba
Merge pull request #446 from magmaboat/hasownproperty
...
Perform hasOwnProperty validation
2017-02-22 13:55:54 -08:00
Eric Rosenbaum
99be466aa7
Merge pull request #444 from ericrosenbaum/bugfix/playnote-volume
...
Pass volume to audioengine playnote
2017-02-10 14:09:55 -05:00
Magmaboat
85eee4f18e
Perform hasOwnProperty validation
2017-02-09 21:12:47 -05:00
Eric Rosenbaum
cd750b5dda
pass volume to audioengine playnote
2017-02-09 14:52:15 -05:00
Chris Willis-Ford
cde9ebd6bf
Merge pull request #442 from griffpatch/bug/PenColorOpacity
...
Bug pen opacity reset
2017-02-09 07:53:15 -08:00
griffpatch
2ba177aa0f
Bug - Return pen opacity to opaque
...
When setting the pen color using pen blocks, the opacity should be reset
to fully opaque if no alpha is supplied.
2017-02-09 08:50:37 +00:00
griffpatch
9cb595312e
Implement "Stop this script" function
...
Existing implementation incorrectly terminates the entire thread.
See: http://llk.github.io/scratch-vm/#144142535
2017-02-08 09:44:10 +00:00
Andrew Sliwinski
92ff57de7d
Add basic test coverage for the sound blocks
2017-02-03 17:39:36 -05:00
Eric Rosenbaum
9741dc2e35
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-02-02 16:37:07 -05:00
Ray Schamp
727fcc7875
Lint for eslint-config-scratch@3
2017-02-01 16:27:55 -05:00
Eric Rosenbaum
0947775a31
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-02-01 10:18:01 -05:00
SillyInventor
1ac89f5aa4
Added new util function that sends tan function infinities correctly
...
Changed mathop to call new math util
Changed sin & cos to round correctly (to get 0)
Added testing for the new math util function
Added testing for the new mathop functions
2017-01-31 19:05:54 -05:00
Eric Rosenbaum
53127f6320
use customstate for sound volume, instrument, effects
2017-01-31 18:33:32 -05:00
Eric Rosenbaum
2d8491123e
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-01-30 11:28:52 -05:00
Eric Rosenbaum
dd30e07052
comments on getSoundIndex
2017-01-30 10:56:50 -05:00
Eric Rosenbaum
9d8819ddc7
audio engine handles rest block
2017-01-30 10:56:31 -05:00
Eric Rosenbaum
cb4209b27a
target handles playnote via audio engine
2017-01-30 10:56:06 -05:00
Eric Rosenbaum
5966a46bbd
target manages instrument setting
2017-01-30 10:54:24 -05:00
Eric Rosenbaum
4e4b0b86e1
target manages audio effect values
2017-01-30 10:53:12 -05:00
Eric Rosenbaum
4e57ab561d
move playsound function to target
2017-01-30 10:45:15 -05:00
griffpatch
0dcaa46107
Fix lint issues
...
Had to update the test scripts to handle the alpha channel, also I note
that all the hex tests are using CSS notation, not scratch notation
(which is 0x not #)
2017-01-27 17:05:17 +00:00
griffpatch
b856041d9a
Fix for Support ARGB for pen #393
...
Requires fix to scratch-render before this will work (see:
6f5acfee7b961d71237f1fd50bb3d5a5139c527e)
2017-01-27 13:45:16 +00:00
Christopher Willis-Ford
88cc50aa18
Code review: more docs, move constants, clone util
...
Changes include:
- Added missing JSDoc for items in `scratch3_pen.js` and `target.js`.
- Moved constants used by `Scratch3PenBlocks` into the class.
- Created a constant for minimum and maximum pen size.
- Added `util/clone.js` to host cloning functionality.
- Pen blocks now check for the renderer before trying to use it.
- The pen integration test covers all blocks, though `clear`, `stamp`,
and `pen down` will skip some of their functionality when there is no
renderer.
2017-01-20 11:26:18 -08:00
Christopher Willis-Ford
a6190da774
Lint fixes and related cleanup
2017-01-19 12:50:46 -08:00
Christopher Willis-Ford
369c02b5d5
Implement pen blocks
...
These blocks implement pen features as found in Scratch 2.0
Supporting changes include:
- `Target` is now an event emitter
- `RenderedTarget` now emits an event when it moves
- `Target` can now store arbitrary "extra" data, called "custom state"
in the code, using a `Target`'s `setCustomState` and `getCustomState`
methods. This is used to store per-target pen state without requiring
`Target` or `RenderedTarget` to know anything about the pen.
- `Cast` can now cast to an RGB color object.
- `Color` now has functions to convert between RGB and HSV, constants
for for black & white, and a `mixRgb` function to lerp between two
colors.
2017-01-19 11:51:22 -08:00
Eric Rosenbaum
9cc1c316d6
wrapclamp drum and instrument to num available
2017-01-11 11:41:21 -05:00
Eric Rosenbaum
f2ad364b90
vm converts one-indexing of drums and instruments to zero-indexing
2017-01-11 11:23:39 -05:00
Eric Rosenbaum
71339874de
fix name of DRUM arg
2017-01-11 11:22:58 -05:00
Eric Rosenbaum
76a475c31c
cast args to numbers
2017-01-10 18:00:33 -05:00
Eric Rosenbaum
4d7ff97011
instrument number is zero-indexed inside audio engine
2017-01-09 15:48:31 -05:00
Eric Rosenbaum
ce8b069140
include volume reporter
2017-01-09 15:48:02 -05:00
Eric Rosenbaum
2d7cfd128a
use a single global tempo owned by audioengine
2017-01-09 15:47:29 -05:00
Eric Rosenbaum
fec9e5b91a
add audio to playground
2017-01-06 11:49:25 -05:00
Eric Rosenbaum
9350baef3b
add current volume block
2017-01-06 10:31:11 -05:00
Eric Rosenbaum
dbe2cef93c
move promise into audio engine
...
changes to play note, play drum and rest blocks so their promises to wait are returned by the audio engine
2017-01-06 10:31:01 -05:00
Eric Rosenbaum
c0d57b4b6b
separate out main audioengine from audioplayer for each clone
2017-01-04 18:37:55 -05:00
Eric Rosenbaum
5a1386f727
remove redundant type check
2017-01-04 14:42:00 -05:00
Eric Rosenbaum
3bf9238e0c
treat numeric input to sound name as 1-indexed
2017-01-04 14:41:14 -05:00
Eric Rosenbaum
7a49a3ae43
lint
2017-01-03 23:41:49 -05:00
Eric Rosenbaum
f2793a1d59
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
...
# Conflicts:
# package.json
# src/engine/runtime.js
# src/sprites/clone.js
2016-12-21 15:29:57 -05:00
Tim Mickel
b99f089ae7
Fix #327 , "switch costume to [next/previous]" ( #330 )
2016-11-09 11:22:17 -05:00
Eric Rosenbaum
1e5555e96d
add volume and tempo blocks
2016-10-27 11:31:22 -04:00
Tim Mickel
28a0831e8d
Fix 1-1 in daysSince2000
2016-10-26 10:26:03 -04:00
Liam
f75577bcbe
Implement '(attribute) of' sensing block ( #311 )
...
* Implement '(attribute) of' sensing block
* Remove unused util parameter
2016-10-24 20:37:27 -04:00
Eric Rosenbaum
90867cd14e
convert string to number for sound index
2016-10-24 17:00:51 -04:00
Ray Schamp
63cfa4229a
Fix space-infix-ops
...
http://eslint.org/docs/rules/space-infix-ops
2016-10-24 11:19:07 -04:00
Ray Schamp
7712b2902f
Fix quote-props
2016-10-24 11:02:19 -04:00
Ray Schamp
f6c0064235
All linting other than console statements
2016-10-23 22:20:29 -04:00
Ray Schamp
68ed110b49
Pass with eslint --fix
...
Resolved whitespace issues, e.g., space-before-function-paren and key-spacing
2016-10-23 12:41:45 -04:00
Eric Rosenbaum
0858a22ffb
adding theremin block and set instrument
2016-10-19 15:44:30 -04:00
Tim Mickel
e49f076fa1
Interpreter fixes, enhancements, features ( #280 )
...
* Thread stepping rework; interp.redraw equivalent
* Add turbo mode and pause mode
* Yielding behavior to match Scratch 2.0
* Implement warp-mode procedure threads
* Add check for recursive call
* Inline wait block timer
* Revert to setInterval and always drawing
* Restore yielding in glide
* 30TPS compatibility mode
* 5-call count recursion limit
* Removing dead primitive code
* To simplify, access runtime.threads inline in `stepThreads`.
* Warp mode/timer fixes; recursive check fixes; clean-up
* Add basic single-stepping
* Add single-stepping speed slider
* Allow yielding threads to run in single-stepping
* Restore inactive threads tracking for block glows
* Add clock pausing during pause mode
* Documentation and clean-up throughout
* Don't look for block glows in `thread.topBlock`.
* Add null check for block glows; rename `_updateScriptGlows` to reflect block glowing
* Use the current executed block for glow, instead of stack
* Add more comments to `stepToProcedure`, and re-arrange to match 2.0
* Tweak to Blocks.prototype.getTopLevelScript
* Revert previous
* Fix threads array to be resilient to changes during `stepThreads`
* Restore inactive threads filtering
* Fix typo in "procedure"
* !! instead of == true
2016-10-17 23:23:16 -04:00
Tim Mickel
060d1ab2a5
Updated blocks for new renderer features ( #257 )
...
* Add "touching" block, layers blocks
* Keep in fence, if on edge bounce, fix to touching edge
* Fix degtoRad in "if on edge, bounce"
* Fixes from review
2016-10-17 23:17:55 -04:00
Eric Rosenbaum
6d9f889aa7
fixed sound loading
2016-10-17 17:16:55 -04:00
Eric Rosenbaum
7bd0142deb
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
...
# Conflicts:
# playground/index.html
2016-10-17 17:13:43 -04:00
Cosmic Web Services
454eb904a3
Add days since 2000 block ( #272 )
...
* Add days since 2000 block
* Empty line addition
* Add semicolin
* Empty line addition
* Tabed
* Remove extra line
* Make it exactly like scratch 2 was
* Fixed spacing
2016-10-17 13:57:25 -04:00
Ray Schamp
2904152318
Merge pull request #282 from rschamp/feature/vm.clear
...
Add VM.clear method
2016-10-17 13:56:37 -04:00
Ray Schamp
bd95c1461d
Add VM.clear method
...
Use it before loading projects so targets don't accumulate when multiple projects are loaded on the same instance.
Move check to see if the clone is the original clone onto the block implementation so all clones can be removed.
Fixes #274
2016-10-17 13:43:38 -04:00
Andrew Sliwinski
ace9a96fc2
Fix degToRad function definition. Resolves GH-229
2016-10-17 11:52:02 -04:00
Tim Mickel
3bfd755e60
Complete implementation of stop block ( #271 )
...
* "Other scripts in stage" sb2
* Complete implementation of "stop" block
2016-10-13 23:00:46 -04:00
Tim Mickel
8c654bbe60
Procedure blocks ( #264 )
2016-10-13 13:11:26 -04:00
Eric Rosenbaum
31d680a229
lint
2016-10-13 11:54:00 -04:00
Eric Rosenbaum
7b179546ed
new setup for use with scratch-gui
2016-10-12 13:17:51 -04:00
Tim Mickel
a7522c7734
Fix data_listcontents block name ( #254 )
2016-10-11 17:12:19 -04:00
Eric Rosenbaum
0024b209bd
Merge remote-tracking branch 'LLK/develop' into develop
2016-10-11 13:47:24 -04:00
Eric Rosenbaum
ed650ba487
Merge remote-tracking branch 'LLK/develop' into develop
2016-10-05 17:16:13 -04:00
Liam
30535d8e6e
Implement "distance to" block ( #239 )
...
* Implement "distance-to" block
* distance-to in stage should always be 10000
2016-10-04 21:26:59 -04:00
Liam
5871672551
Implement "go to" block ( #238 )
...
* Implement "go to" block
* Add a missing semicolon
My text editor doesn't automatically insert them and I'm not used to using
semicolons so much. :(
* Implement go-to-random
* Clean up the go-to-random code a bit
* Add rounding to _random_ picks
2016-10-04 18:19:52 -04:00
Liam
886bcbe3c1
Implement the point-towards block ( #235 )
...
* Implement the point-towards block
* Pointing towards a nonexistent sprite should do nothing, not throw an error
2016-10-04 15:20:53 -04:00
Eric Rosenbaum
0db0783fe8
working on sound font player
2016-10-04 14:19:04 -04:00
Tim Mickel
0a66c62f6a
Mutations in block representation; an unfeatured procedure call ( #212 )
...
* Add scratch3_procedures and no-op for defnoreturn
* Add mutation adapter to parse mutations in CREATE/CHANGE events
* Add mutation-to-XML
* Update spec map for Blockly procedure names
* Placeholder for procedure special cases
* Basic stepping to procedures
* Remove extra case
* Validation for changeBlock
2016-10-03 17:43:24 -04:00