Play no sound (rest) on the speaker or at a sound pin for the amount of time you say.

The duration of the rest is set as a number milliseconds. Instead, it’s typical to use a number of beats or a beat fraction for a rest. The ||music:beat|| block is used to convert beats to milliseconds. You can also make a custom rest by setting the rest duration to certain amount of milliseconds.


The ||music:rest|| block works on the micro:bit board. It might not work in the simulator on every browser.


  • ms is the number of milliseconds for the duration of the rest. A beat value is used instead as the block’s default rest duration. The number of beats is converted to milliseconds for you.


Middle C loop

Continuously play a Middle C tone for 1 beat and rest for 2 beats.

basic.forever(function () {
    music.playTone(262, music.beat(BeatFraction.Whole))

Custom rest time

Continuously play a Middle C note followed by a random rest time.

basic.forever(function () {
    music.playTone(262, music.beat(BeatFraction.Whole)), 2000))

See also

play tone, ring tone , tempo, set tempo, change tempo by