melody Editor

Show the melody editor and return the composed melody string.

music.melodyEditor("");

In Blocks, the melody editor is displayed and the user can create a melody using the melody editor interface. The composed melody is returned as a melody string for use with playMelody.

When not using Blocks, the melody string parameter is returned.

Parameters

  • melody: a string which contains the notes of the current melody.

Returns

  • a string that contains the new melody created in the melody editor or the string in melody when the melody editor is not displayed.

Example

Change the melody in playMelody using the melody editor.

forever(function () {
    music.playMelody(music.melodyEditor("E F G F E G B C5 "), 120)
})

See also

play melody