Sugar Labs

Music Blocks Issue: Add a macro to create a chromatic keyboard

As per Music Blocks Issue #1911 it would be nice to have a full octave keyboard option for the music keyboard widget.

This task is to add a new macro to the widget palette which expands into the code to create the full octave keyboard.

The relevant code is: macros.js basicblocks.js

In macros.js, look at how the C Major macro is defined. You'll do something similar.

The new block should be added near here

Hint: The code that represents the macro can be found in the .html of a saved project. But it is easiest if you use the following trick: create a new project. Add the code you want for your macro. Add a start block. Put the original start block in the trash. Save the project. Now the macro code begins with block 0. (Don't forget to remove the extra start block, which is not part of your macro.)

Task tags

  • javascript

Students who completed this task

pidddgy

Task type

  • code Code
close

2019