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 docs/beta-ref.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appref": "v8"
"appref": "v8.1.9"
}
24 changes: 0 additions & 24 deletions libs/core-mini-codal/music.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
/**
* Generation of music tones.
*/
//% color=#DF4600 weight=98 icon="\uf025"
//% groups='["Melody", "Tone", "Volume", "Silence", "Tempo", "State", "Melody Advanced"]'
namespace music {

let stopSoundHandlers: (() => void)[];
const MICROBIT_MELODY_ID = 2000;

/**
* Gets the melody array of a built-in melody.
* @param melody the melody name
*/
//% weight=60 help=music/built-in-playable-melody
//% blockId=device_builtin_melody_playable block="melody $melody"
//% toolboxParent=music_playable_play_default_bkg
//% toolboxParentArgument=toPlay
//% duplicateShadowOnDrag
//% group="Melody Advanced"
export function builtInPlayableMelody(melody: Melodies): StringArrayPlayable {
return new StringArrayPlayable(getMelody(melody), undefined);
}

/**
* Registers code to run on various melody events
*/
//% blockId=melody_on_event block="music on %value"
//% help=music/on-event weight=59 blockGap=32
//% group="Melody Advanced"
export function onEvent(value: MusicEvent, handler: () => void) {
control.onEvent(MICROBIT_MELODY_ID, value, handler);
}


export function _onStopSound(handler: () => void) {
Expand Down
1 change: 0 additions & 1 deletion libs/core-mini-codal/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"music.ts",
"motors.ts",
"soundexpressions.ts",
"playable.ts",
"rgbled.ts",
"logo.cpp",
"touchmode.cpp"
Expand Down
7 changes: 3 additions & 4 deletions libs/core-mini-codal/soundexpressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ namespace music {
//% duplicateWithToolboxParent=music_playable_play
//% duplicateWithToolboxParentArgument=toPlay
//% duplicateShadowOnDrag
//% group="Melody"
//% group="Sound Effects"
export function createSoundExpression(waveShape: WaveShape, startFrequency: number, endFrequency: number, startVolume: number, endVolume: number, duration: number, effect: SoundExpressionEffect, interpolation: InterpolationCurve): SoundExpression {
return new SoundExpression(createSoundEffect(waveShape, startFrequency, endFrequency, startVolume, endVolume, duration, effect, interpolation));
}
Expand All @@ -487,7 +487,7 @@ namespace music {
//% blockId=soundExpression_builtinSoundEffect
//% block="$soundExpression"
//% blockGap=8
//% group="Melody"
//% group="Sound Effects"
//% toolboxParent=soundExpression_playSoundEffect
//% toolboxParentArgument=sound
//% weight=98 help=music/builtin-sound-effect
Expand All @@ -503,8 +503,7 @@ namespace music {
//% blockId=soundExpression_builtinPlayableSoundEffect
//% block="$soundExpression"
//% blockGap=8
//% group="Melody Advanced"
//% advanced=true
//% group="Sound Effects"
//% toolboxParent=music_playable_play
//% toolboxParentArgument=toPlay
//% duplicateShadowOnDrag
Expand Down
Loading
Loading