Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/core/_locales/core-jsdoc-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"music.stopMelody|param|options": "which melody to stop",
"music.stringPlayable": "Play a melody from the melody editor",
"music.stringPlayable|param|bpm": "number in beats per minute dictating how long each note will play",
"music.stringPlayable|param|melody": "string of up to eight notes [C D E F G A B C5] or rests [-] separated by spaces, which will be played one at a time, ex: \"E D G F B A C5 B \"",
"music.stringPlayable|param|melody": "string, string array, or Buffer of notes [C D E F G A B C5] or rests [-], ex: \"E D G F B A C5 B \"",
"music.tempo": "Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play.",
"music.tonePlayable": "Plays a tone through pin ``P0`` for the given duration.",
"music.tonePlayable|param|duration": "tone duration in milliseconds (ms)",
Expand Down
4 changes: 2 additions & 2 deletions libs/core/playable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace music {

/**
* Play a melody from the melody editor
* @param melody string of up to eight notes [C D E F G A B C5] or rests [-] separated by spaces, which will be played one at a time, ex: "E D G F B A C5 B "
* @param melody string, string array, or Buffer of notes [C D E F G A B C5] or rests [-], ex: "E D G F B A C5 B "
* @param bpm number in beats per minute dictating how long each note will play
*/
//% blockId="music_string_playable"
Expand All @@ -130,7 +130,7 @@ namespace music {
//% melody.shadow=melody_editor
//% bpm.min=40 bpm.max=500
//% bpm.defl=120
export function stringPlayable(melody: string, bpm: number): Playable {
export function stringPlayable(melody: string | string[] | Buffer, bpm: number): Playable {
return new StringArrayPlayable(melody, bpm);
}

Expand Down
Loading