diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 55dd2f34..1ce40457 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -181,6 +181,7 @@ "music": "Generation of music tones.", "music.beat": "Returns the duration of a beat in milli-seconds", "music.beginMelody": "Starts playing a melody.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]", + "music.beginMelody|param|melodyArray": "the melody array to play, eg: ['g5:1']", "music.beginMelody|param|options": "melody options, once / forever, in the foreground / background", "music.builtInMelody": "Gets the melody array of a built-in melody.", "music.changeTempoBy": "Change the tempo by the specified amount", diff --git a/libs/core/music.ts b/libs/core/music.ts index 01b8b20a..f0a16fc8 100644 --- a/libs/core/music.ts +++ b/libs/core/music.ts @@ -307,13 +307,13 @@ namespace music { /** * Starts playing a melody. * Notes are expressed as a string of characters with this format: NOTE[octave][:duration] - * @param melody the melody array to play, eg: ['g5:1'] + * @param melodyArray the melody array to play, eg: ['g5:1'] * @param options melody options, once / forever, in the foreground / background */ //% help=music/begin-melody weight=60 blockGap=8 //% blockId=device_start_melody block="start melody %melody=device_builtin_melody| repeating %options" //% parts="headphone" - export function beginMelody(melodyArray: string[], options: MelodyOptions = MelodyOptions.Once) { + export function beginMelody(melodyArray: string[], options: MelodyOptions = 1) { init(); if (currentMelody != undefined) { if (((options & MelodyOptions.OnceInBackground) == 0)