Commit graph

635 commits

Author SHA1 Message Date
Evelyn Eastmond
cf98e35564 EV3 blocks progress: distance, brightness, button, motor position. Only single button for now, distance needs threshold at 0. 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
387f03b08c Add disconnect and getPeripheralIsConnected to EV3 extension 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
6f5ff31eb3 Add disconnectExtensionSession and getPeripheralIsConnected 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
613a9f96c3 Adding initial test polling for EV3 distance sensor data. 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
0280966a61 Connected Ev3 extension to device connection modals. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
d1d9b38bf9 Added all EV3 block commands/reporters/booleans to Ev3 device class as stubbed functions. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
42e0576549 All EV3 blocks stubbed out with console logs for now. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
2d8ad05a78 Adding Ev3 extension with three test blocks to latest device-connection work, auto-connecting to device for now. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
4332725d33 Adding more errors based on web socket onerror and onclose. Moved extension runtime mapping of devices back to MicroBit class. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
73cc149783 Adding promises to return on BLE write. Some refactoring. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
730b798686 Extension/runtime protocol refactoring. 2018-07-09 13:41:57 -04:00
Eric Rosenbaum
d778ddf00e wip 2018-07-09 13:41:57 -04:00
Michael "Z" Goddard
0dffc65ce9 stop drum immediately if it is still starting (#1266) 2018-06-25 15:31:35 -04:00
Ray Schamp
9afe401dca Revert "Revert #1260, #1258, #1239"
This reverts commit 28f90648b0.
2018-06-22 09:33:08 -04:00
Ray Schamp
28f90648b0 Revert #1260, #1258, #1239
This reverts commits
c268bbae47
61dacfc915
30b8cb8eb1
2018-06-22 09:30:17 -04:00
Michael "Z" Goddard
61dacfc915
Merge pull request #1258 from mzgoddard/green-music-extension
Use new scratch-audio APIs in music extension
2018-06-21 16:59:42 -04:00
Michael "Z" Goddard
7e48bed0ab
use scratch-audio EffectChain and SoundPlayer in music extension
- Use AudioEngine to decode sounds
- Store players instead of buffers
- Use SoundPlayer stop event to track concurrency
2018-06-21 16:53:45 -04:00
chrisgarrity
f0951d16fa
Merge pull request #1246 from chrisgarrity/feature/translate-labels
Localize category labels
2018-06-20 08:33:44 -04:00
Evelyn Eastmond
d09c3f0418 MicroBit extension, Scratch Link first draft. (#1230)
* First microbit gui tests

* Fixed JSONRPC inheritance.  Renamed ScratchBLE/ScratchBT files.  Removed ScratchBT test code from Microbit extension.  Renamed addLine to log.

* Fixed log comments.  Removed addLine from Microbit.

* Adding auto-connect to Microbit at extension loading.  Adding hack for displayText block to Scratch-Link.

* Resolved merge conflicts and brought in latest microbit extension example code.

* Updated microbit write tests for displayText and displaySymbol blocks.  Some linting.

* Some linting and adding of BLE Characteristic consts.

* Linting fixes.

* Moving micro:bit device connection code all to the MicroBit class, decoupling Scratch3MicroBitBlocks from connection code.

* Removing old disconenct handlers from MicroBit class.  Moved service into new BLEUUID data structure.

* Renamed _write to _send.  Moved all BLE encoding concerns to the _send method.

* Using the util log.  Some linting.

* Added _read method to MicroBit class.  Renamed _send to _write.

* Some linting and formatting comments.

* First pass at peripheral chooser pattern for ScratchBLE.

* Testing characteristicDidChange events, and some changes to ScratchBLE on ready events.

* Refactoring work on PeripheralChooser and ScratchBLE.

* Some variable renaming and method signature stubs.

* Peripheral chooser method signatures.

* Moved base64 encoding/decoding to util.  Some method signature formatting.

* Adding test stubs for new util and io classes.

* Adding test stub for MicroBit extension.

* Clean up for PR.

* Clean up for PR.

* Final cleanup for PR.

* Removed logging to console.

* Adding 'btoa' and 'atob' node modules and using them in Base64Util.
2018-06-18 14:56:51 -04:00
chrisgarrity
1e3907e922 Localize category labels
Added formatMessage to the name attribute for:
* music
* pen
* translate
* video motion

Skipped speak extension - trademarked name
Skipped extensions that are not yet localized at all.
2018-06-18 11:37:10 -04:00
Eric Rosenbaum
c2b262ba97 Add status button to microbit extension 2018-06-13 15:53:05 -04:00
Eric Rosenbaum
78074ec575
Merge pull request #1222 from picklesrus/speech-extension-icons
Speech extension icons
2018-06-11 09:50:42 -04:00
picklesrus
97b8ec83bd Ignore lint for the icons 2018-06-08 14:45:13 -07:00
picklesrus
6184c3ba12 Replace icons with version downloaded from https://material.io/tools/icons/?style=baseline 2018-06-08 14:42:46 -07:00
Ray Schamp
7de83bea07
Merge pull request #1215 from picklesrus/speech-extension-audiocontext
Add webkitAudioContext if AudioContext does not exist. This might fix…
2018-06-07 10:53:45 -04:00
picklesrus
391f47d100 Add webkitAudioContext if AudioContext does not exist. This might fix the speech extension in safari, but it is tricky to tell since I am running into problems with permissions and localhost. 2018-06-06 16:49:46 -07:00
Eric Rosenbaum
332e90e408
Merge pull request #1208 from ericrosenbaum/feature/increase-pen-size
Increase maximum pen size to 1200
2018-06-06 10:16:15 -04:00
Andrew Sliwinski
bccdef0674 Future-proof opcode and fix issues with copied comments 2018-06-05 18:32:02 -04:00
Andrew Sliwinski
55b1a794ce Add initial working version of the Amazon Polly extension 2018-06-05 17:51:55 -04:00
Eric Rosenbaum
23c7df5751 Max pen size 1200 2018-06-05 15:59:14 -04:00
Eric Rosenbaum
ca6a7f9311
Merge pull request #1199 from picklesrus/speech-extension-loginfo
Add some log info with more information about the speech match so we …
2018-06-04 16:35:58 -04:00
picklesrus
e668a210a0 Add some log info with more information about the speech match so we can debug better. 2018-06-04 13:17:34 -07:00
Kreg Hanning
9055706333 Add check for invalid symbol 2018-06-04 15:22:12 -04:00
Kreg Hanning
94464f0a52 Update microbit extension for latest firmware 2018-06-04 14:52:52 -04:00
Eric Rosenbaum
c9842ec3dc
Merge pull request #1121 from picklesrus/speech-extension-checkin
Initial version of the speech extension.  There is certainly still so…
2018-05-31 15:35:09 -04:00
Eric Rosenbaum
3e43786ef6 Default to a random language 2018-05-31 11:48:37 -04:00
picklesrus
3a5051646f Now fuzzymatchResult is unused so remove it too. 2018-05-30 13:22:07 -07:00
picklesrus
bb408b8673 Remove some code that set the utterance to the fuzzy match result 2018-05-30 13:22:07 -07:00
picklesrus
e72ea04c10 Move the add event listener code to be in the same place where we call connect so there is only one place to do it. 2018-05-30 13:22:07 -07:00
picklesrus
ef142107a6 Remove the event listener for processing audio at the same time that we disconnect the script node. At this point we are closing the web socket and do not want to process more of the microphone data even if it is already in flight. Also add it back when we resume listening instead of just at init time. 2018-05-30 13:22:07 -07:00
picklesrus
ffced16b95 Fix a copy/paste comment error and initialize current_utterance differently 2018-05-30 13:22:07 -07:00
picklesrus
a2eee6a1dd Change name of opcode to speech_ from speech.Plus, remove old comment. 2018-05-30 13:22:07 -07:00
picklesrus
250570e0ed Use arraybuffer-loader instead of buffer-loader to load the start and end sounds. The music extension switched to this a few days ago. 2018-05-30 13:20:38 -07:00
picklesrus
e7987a6a4c Initial version of the speech extension. There is certainly still some stuff to figure out but the core of it is here. 2018-05-30 13:20:38 -07:00
picklesrus
123edcb913 remove stray space 2018-05-29 15:14:38 -07:00
picklesrus
e2f6dfd29f - Update the reporter to return the human readable language.
- Remove the non-final icons and replace with a TODO.
- Add messages for the text in the blocks.
2018-05-29 15:06:38 -07:00
picklesrus
f615e9191a Add language reporter block to translate extension 2018-05-28 11:58:17 -07:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
2018-05-25 09:10:05 -04:00
Eric Rosenbaum
3cdc9765a8
Translation extension imports translated language names (#1159)
* wip

* wip

* Get viewer language code, and cleanup

* Revert "wip"

This reverts commit 6598738ed2.

# Conflicts:
#	src/extensions/scratch3_translate/index.js
2018-05-23 17:00:59 -04:00
Karishma Chadha
5e40bfb7ee No more explicit layer groups, and separate extension into video and pen. 2018-05-20 22:30:20 -04:00
Karishma Chadha
67b114b9c9 Layer group ordering. 2018-05-15 22:22:44 -04:00
Kreg Hanning
82fd6f0d2f Add micro:bit Scratch 3.0 extension (#1113)
* Add micro:bit Scratch 3.0 extension

* Fix lint errors in micro:bit extension

* Fix doc. Incorrect return type

* Check for valid pin in when pin connected block

* Drop mapping function

* Drop question mark from tilt hat block

* Generate list of symbols from object keys

* Trim display text block to max 20 characters
2018-05-14 13:52:49 -04:00
Eric Rosenbaum
846f212110
Merge pull request #1138 from picklesrus/develop-translate-changes
Update the format of the language menu to match the changes made to d…
2018-05-11 17:14:13 -04:00
Ray Schamp
1934fd427a
Revert "Dynamically load music extension manifest" 2018-05-11 11:04:43 -04:00
picklesrus
720cc820cd Update the format of the language menu to match the changes made to deal with translations. This allows the menu to pass through the maybeFormatMessage code correctly. 2018-05-10 13:20:24 -07:00
Andrew Sliwinski
3eefddcde2 Fix typo and add clarification to translation note 2018-05-10 15:25:55 -04:00
Andrew Sliwinski
d5705f6eae Fix typo 2018-05-10 13:58:09 -04:00
Andrew Sliwinski
1995753e94 Add localization support to music and video sensing extensions 2018-05-10 13:41:41 -04:00
Michael "Z" Goddard
ff7b575114
Dynamically load music extension manifest 2018-05-04 15:47:48 -04:00
Michael "Z" Goddard
8e252f2d7d
Use arraybuffer-loader in place of buffer-loader 2018-05-03 18:58:59 -04:00
Andrew Sliwinski
add879ab0a Enable video layer when loading extension. Resolves GH-1072 2018-04-23 13:03:56 -04:00
Andrew Sliwinski
ced4de8995 Flip sort order of sensing object menu in video motion extension. Resolves GH-1074 2018-04-23 13:00:20 -04:00
Andrew Sliwinski
717ac46bbd Reorder video motion blocks. Resolves GH-1073 2018-04-23 12:57:14 -04:00
Paul Kaplan
5b9dc4df77
Merge pull request #1061 from kchadha/video-transparency-save-load-fix
Fix video transparency save/load issue.
2018-04-13 13:58:19 -04:00
Karishma Chadha
bd0bcb9395 video transparency should be a number. 2018-04-13 13:47:05 -04:00
Paul Kaplan
d42135a40a
Merge pull request #1057 from thisandagain/bugfix/1056
Rename pen 'clear' to 'erase all'
2018-04-13 13:26:54 -04:00
Paul Kaplan
aff8f93999 Change displayed name to Video Motion 2018-04-13 12:52:46 -04:00
Paul Kaplan
c46d1157fa Slicing array buffers with no args throws on Safari 2018-04-13 11:08:32 -04:00
Andrew Sliwinski
6f80403e8a Rename pen 'clear' to 'erase all'. Resolves GH-1056 2018-04-13 10:53:13 -04:00
kchadha
0e0d09c235
Merge pull request #1042 from mzgoddard/target-video-state
Configure video device with stage video settings
2018-04-13 09:12:25 -04:00
Michael "Z" Goddard
8ebd659094
Use string enumerated values for videoSensing sensor block 2018-04-11 10:30:58 -04:00
Michael "Z" Goddard
cef9f58c2a
Set video device state and transparency from values in stage
Set the video device state and transparency to the values in the stage target
when the video sensing extension is loaded. Changing video state and
transparency from the extension's blocks will also store that setting to the
stage target.
2018-04-11 10:15:53 -04:00
Michael "Z" Goddard
461d523729
Add block comments to videoSensing.videoToggle and setVideoTransparency 2018-04-10 14:34:27 -04:00
Michael "Z" Goddard
d4037808a7
Add VideoState enum to Scratch3VideoSensingBlocks 2018-04-10 14:34:27 -04:00
Corey Frang
e20723994f
fix sb2 conversion to load into correct VIDEO_STATE 2018-04-10 13:59:22 -04:00
Corey Frang
f19ae793c0
enableVideo - get rid of "requests" 2018-04-10 13:59:22 -04:00
Corey Frang
46b4ef4d80
Use a global mirror state 2018-04-10 13:59:21 -04:00
Corey Frang
90166dc732
Add extra control blocks for video transparency and on/off control 2018-04-10 13:59:21 -04:00
Corey Frang
eef88f6c2d
First draft of video IO device 2018-04-10 13:57:53 -04:00
Michael "Z" Goddard
cd7e03f0f6
Merge pull request #1019 from mzgoddard/motion-detect-3
Test VideoMotion and VideoSensing blocks
2018-04-10 13:06:58 -04:00
Michael "Z" Goddard
d3ff8b5eed
Test VideoMotion and VideoSensing blocks
- Add pngjs dev dependency to read test images
2018-04-06 18:09:50 -04:00
Eric Rosenbaum
25f1c1a5e6
Merge pull request #1017 from ericrosenbaum/bugfix/clones-inherit-instrument
Clones inherit music custom state
2018-04-06 13:38:03 -04:00
Ray Schamp
efb1bdb1ea Remove video motion icon until we have one 2018-04-06 09:55:16 -04:00
Michael "Z" Goddard
91747fd229
Add back missing Scratch3VideoSensingBlocks.INTERVAL
The INTERVAL time defines how often to analyze a frame. Without the value the
test whether a frame should be analyzed will always be false.
2018-04-05 17:47:07 -04:00
Eric Rosenbaum
2a90e5868d Fix runtime scope and unit test 2018-04-05 15:01:52 -04:00
Eric Rosenbaum
88b13e218d Clones inherit music custom state 2018-04-05 11:27:54 -04:00
Michael "Z" Goddard
6d2c29530f
Document VideoMotionView 2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
9a2e937271
Document VideoMotion class
- Rename video_sensing/lib.js to video_sensing/library.js
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
a32b15a8f9
Add VideoSensing math module
- motionVector takes motion component and returns a 2d vector
- scratchAtan2 takes a y and x value and returns an angle in degrees
  referencing Scratch's coordinate system
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
b46c956203
Comment items in Scratch3VideoSensingBlocks 2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
c291a04cc7
Add file comment block to video_sensing/debug.js 2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
e65b7985cb
Add whenMotionGreaterThan hat block to video sensing ext 2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
b012d60689
Add video sensing debug C_CELL and AB_CELL views
- Rename UV to UV_CELL, UV cannot be rendered in a non-cell format

Modify C and AB views as well to better represent in color the work being done.
If you watch the debug views with XY_CELL, AB_CELL, C_CELL, and UV_CELL you can
see how AB_CELL and C_CELL affect UV_CELL in similar color patterns.
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
3c473f6ba8
Translate scratch 2 video sensing into scratch 3 extension
- Add videoSensing extension to extension-manager
2018-03-29 15:15:11 -04:00
Andrew Sliwinski
1d90c82fcf
Merge pull request #945 from picklesrus/translate-extension
Translate extension block
2018-03-15 08:36:39 -04:00
picklesrus
39d2559e37 Initial version of translate extension. 2018-03-11 12:18:21 -07:00
Corey Frang
1d414dd5a0 Ensure music extension _decodeSound is promise
Currently if there is no audio engine detected this returns undefined,
which in turn causes the line above to fail trying to call `.then` on
it.
2018-03-08 12:32:01 -05:00
Eric Rosenbaum
5d658b5ecb
Merge pull request #953 from ericrosenbaum/bugfix/load-tempo-from-sb2
Load tempo from sb2
2018-03-01 13:20:37 -05:00
Eric Rosenbaum
db795abfbc Use tempo stored in stage 2018-02-27 11:48:49 -05:00
Eric Rosenbaum
8b18ff7ae9 make inputOP, arg name and menu name the same 2018-02-26 15:56:37 -05:00
Eric Rosenbaum
e67743a4ba Require assets inside a try/catch 2018-02-16 10:05:54 -05:00
Eric Rosenbaum
063ac39019 Load music extension assets with require 2018-02-14 17:53:05 -05:00
Eric Rosenbaum
073ee84a91 Keep bufferSource refs so onended fires on safari 2018-01-22 11:57:06 -05:00
Eric Rosenbaum
9eaf67b504 Fix eslint-disable-line 2018-01-22 10:27:16 -05:00
Eric Rosenbaum
4778ab8d4f Fix music extension asset loading on safari 2018-01-22 10:15:41 -05:00
sjhuang26
f7d80459c7 Fixed pen behavior when dragging 2017-12-29 09:01:30 -05:00
Christopher Willis-Ford
ed1fc5f353 Use Scratch 2.0 block labels for legacy blocks 2017-12-22 11:08:05 -08:00
Christopher Willis-Ford
5dbffe67ac Fix legacy setPenHueToNumber and changePenHueBy
These two blocks were not doing the same shade-oriented math as
`setPenShadeToNumber`: effectively these blocks were using the new color
model instead of Scratch 2.0's hue-shade model. This change pulls the
hue-shade color update logic into a separate function, now called by all
the legacy pen blocks.
2017-12-22 10:47:11 -08:00
Eric Rosenbaum
dad620f015 Update block and menu icons for pen and music extensions 2017-12-19 14:47:37 -05:00
chrisgarrity
f51cf9877e
Preliminary localization (#777)
* localize the block and menu strings in the pen extension
* adds .tx/config to be able to push translations to transifex
* includes format-message to localize strings and extracting them.
* add setLocale function to VM to allow GUI to pass in locale data.
* refresh block definitions when the locale changes.

### Still to be decided
For now just extracting messages from the pen extension into their own file. We’ll need to decide if each category gets its own file, or group all the strings into one resource.
2017-12-11 15:41:45 -05:00
Eric Rosenbaum
d771a24b82
Merge pull request #831 from ericrosenbaum/feature/drum-update
Drum update
2017-12-07 15:41:13 -05:00
Eric Rosenbaum
8203eb2c91
Merge pull request #840 from ericrosenbaum/feature/music-block-icon
Add icon for music extension blocks
2017-12-05 15:43:10 -05:00
Eric Rosenbaum
2091ef0636 Add icon for music extension blocks 2017-12-01 11:06:46 -05:00
Eric Rosenbaum
9611401e1c Move pen and wedo into extensions folder 2017-12-01 10:31:04 -05:00
Eric Rosenbaum
68053adf7f Quieter snare 2017-11-29 15:35:16 -05:00
Eric Rosenbaum
bcdc951eb1 Update bass drum 2017-11-29 15:27:07 -05:00
Eric Rosenbaum
bf5d489cda Update crash cymbal 2017-11-29 15:25:40 -05:00
Eric Rosenbaum
799a8ab799 Update open and closed hi-hats 2017-11-29 15:25:34 -05:00
Eric Rosenbaum
773c167987 Check for instrument sample before playing 2017-11-28 13:15:48 -05:00
Eric Rosenbaum
7e87f314fb Convert menu values to string 2017-11-27 10:06:42 -05:00
Eric Rosenbaum
5fbfecb1a9
Note player (#806)
* Move drums into their own folder

* Load instrument samples

* Play notes

* Concurrency limit is shared across drums and instruments

* Increase MIDI note range

* Set instrument directly on musicState object

* JSDoc

* Clean up the play note functions and add comments

* Cleanup

* Check for audioEngine in playDrumNum

* JSDoc and comments

* Round the instrument number

* Fix unit test for set instrument

* Comment fixes

* Nit (condense onto single line)
2017-11-21 10:36:28 -05:00
Eric Rosenbaum
1e00a0c252 Comment for no-op above concurrency limit 2017-11-20 13:44:44 -05:00
Eric Rosenbaum
c3a72560f9 Clarify @TODO comment about extension status indicator 2017-11-20 13:42:35 -05:00
Eric Rosenbaum
01e9000c04 JSDoc for _playDrumNum 2017-11-14 15:00:27 -05:00
Eric Rosenbaum
75ec76cd57 Fix unit test 2017-11-14 14:58:16 -05:00
Eric Rosenbaum
9665b3ed25 Always yield on first run of a timed block 2017-11-14 14:40:27 -05:00
Eric Rosenbaum
7a65fe7d07 Limit number of concurrent drum sounds 2017-11-14 14:39:50 -05:00
Eric Rosenbaum
b64152637e Play drums! 2017-11-14 14:39:11 -05:00
Eric Rosenbaum
73dbc82411 Get number of drums from drum info array 2017-11-14 14:36:34 -05:00
Eric Rosenbaum
14e2ca8d99 Round the drum num arg 2017-11-14 14:35:26 -05:00
Eric Rosenbaum
c26198d050 Load drum sounds into an array of buffers 2017-11-14 14:33:14 -05:00
Eric Rosenbaum
91878adfe1 Build menus using drum and instrument info arrays 2017-11-14 14:32:14 -05:00
Eric Rosenbaum
9f1bcd2594 Arrays with drum and instrument name and filename 2017-11-14 14:30:44 -05:00
Eric Rosenbaum
f5b25a190e Add assets (drum sounds) for music extension 2017-11-13 16:23:10 -05:00
Eric Rosenbaum
961b3476b2 Move the music extension into a new extensions directory 2017-11-13 16:22:37 -05:00