rest

Give the speaker a period of time to not play any sound.

music.rest(400);

Simulator: ||music:rest|| works on the LEGO® MINDSTORMS® Education EV3. It might not work in the simulator on every browser.

Parameters

  • ms is a number saying how many milliseconds the LEGO® MINDSTORMS® Education EV3 should rest. One second is 1000 milliseconds.

Example

Play a ‘C’ note for one second and then rest for one second. Do it again, and again…

let frequency = music.noteFrequency(Note.C)
while (true) {
  music.playTone(frequency, 1000)
  music.rest(1000)
}

See also

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

music