Beat

Returns the duration of a beat in milli-seconds

music.beat(BeatFraction.Whole)

Simulator: This function only works on the micro:bit and in some browsers.

Parameters

  • BeatFraction means fraction of a beat (BeatFraction.Whole, BeatFraction.Sixteenth etc)

Returns

  • a number that means the amount of milli-seconds a beat fraction represents.

Example

music.playTone(Note.C, music.beat(BeatFraction.Quarter))

See also

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