string Playable

Created a short melody of notes composed in a string.

120melodyat tempo(bpm)playuntil done
JavaScript
function music.stringPlayable(melody: string, tempo: number): music.Playable;
Python
def music.string_playable(melody: str, tempo: number): music.Playable

The melody is short series of notes composed in a string. The melody is played at a rate set by the tempo value you give. The melody string contains a sequence of notes formatted like this:

"E B C5 A B G A F "

The melody is shown in the melody block as note symbols which also appear in the Melody Editor.

120melodyat tempo(bpm)

The melodies are most often created in the Melody Editor from the block so that valid notes are chosen and the correct melody length is set.

Parameters

  • melody: a string which contains the notes of the melody.
  • tempo: a number which is the rate to play the melody at in beats per minute.

Returns

  • a playable object that contains the melody and tempo.

Example

Play the Mystery melody continuously.

120melodyat tempo(bpm)playlooping in backgroundon start

See also

tone playable, melody playable