From 14b3a5edf364291951c9f553d84e2c7e6bc63931 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 23:16:46 +0000 Subject: [PATCH 1/2] Initial plan From 03a5f0242ef95c5e9272be33b0aa9f778c291032 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Jun 2026 23:19:25 +0000 Subject: [PATCH 2/2] Support string[] and Buffer in stringPlayable block Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- libs/core/_locales/core-jsdoc-strings.json | 2 +- libs/core/playable.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 4d7055343ed..a5c5100f947 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -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)", diff --git a/libs/core/playable.ts b/libs/core/playable.ts index 095b8b04324..20a6353d787 100644 --- a/libs/core/playable.ts +++ b/libs/core/playable.ts @@ -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" @@ -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); }