Music Block-List
Block | Description |
![]() |
Play a short melody of notes composed in a string.
|
![]() |
Play a musical tone through pin P0 of the micro:bit for as long as you say.
|
![]() |
Play a musical tone through pin P0 with the pitch as high or low as you say. The tone will keep playing until you tell it not to.
|
![]() |
Rest (play no sound) through pin PO for the amount of time you say.
|
![]() |
Set the volume for the sound synthesizer.
|
![]() |
Get the current volume level of the sound synthesizer.
|
![]() |
Stop all the sounds that are playing right now and any others waiting to play.
|
![]() |
Makes the tempo (speed of a piece of music) faster or slower by the amount you say.
|
![]() |
Makes the tempo (speed of a piece of music) as fast or slow as you say.
|
![]() |
Returns the duration of a beat in milli-seconds.
|
![]() |
Finds the tempo (speed of a piece of music).
|
![]() |
Begin playing a musical melody through pin P0 of the micro:bit.
melody: A built-in melody or an array representation of a melody you wish to play. options: the play option for the melody.
|
![]() |
Stop playing a musical melody.
options: specify which melodies (foreground, background or both) to stop:
|
![]() |
Raises events for melodies or music events.
|
![]() |
Play a sound that is generated from a sound expression.
sound: a string that is the sound expression for the sound you want to play. mode: the play mode for the sound, either until done or background. |
![]() |
Get a sound expression string for a built-in sound effect.
sound Expression: A sound expression name. The available effects are: giggle, happy hello, mysterious, sad, slide, soaring, spring, twinkle, yawn.
|
![]() |
Create a sound expression string for a sound effect.
A sound expression is set of parameters that describe a Sound that will last for some amount of time. These parameters specify a base waveform, frequency range, sound volume, and effects. Sound data is created as a Sound object and can then be played to the speaker, headphones, or at an output pin. wave Shape: the primary shape of the waveform: sine: sine wave shape saw tooth: saw tooth wave shape triangle: triangle wave shape square: square wave shape noise: random noise generated wave shape start Frequency: A number that is the frequency of the waveform when the sound expression starts. end Frequency: A number that is the frequency of the waveform when the sound expression stops. start Volume: A number the initial volume of the sound expression. end Volume: A number the ending volume of the sound expression. duration: A number the duration in milliseconds of the sound expression. effect: An effect to add to the waveform. These are: tremolo: add slight changes in volume of the sound expression. vibrato: add slight changes in frequency to the sound expression. warble: similar to vibrato but with faster variations in the frequency changes. interpolation: controls the rate of frequency change in the sound expression. linear: the change in frequency is constant for the duration of the sound. curve: the change in frequency is faster at the beginning of the sound and slows toward the end. logarithmic: the change in frequency is rapid during the very first part of the sound. |
![]()
|
Enable the speaker on the micro:bit to play music and sounds.
enabled: A boolean value that is true to enable the built-in speaker, or false to send sounds to the pitch pin. |