2016-10-21 17:48:43 +02:00
|
|
|
# Beat
|
|
|
|
|
|
|
|
Returns the duration of a beat in milli-seconds
|
|
|
|
|
|
|
|
```sig
|
|
|
|
music.beat(BeatFraction.Whole)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~ hint
|
|
|
|
|
|
|
|
**Simulator**: This function only works on the @boardname@ and in some browsers.
|
|
|
|
|
|
|
|
## ~
|
|
|
|
|
|
|
|
## Parameters
|
2016-10-21 17:48:43 +02:00
|
|
|
|
|
|
|
* ``BeatFraction`` means fraction of a beat (BeatFraction.Whole, BeatFraction.Sixteenth etc)
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Returns
|
2016-10-21 17:48:43 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
* a [number](/types/number) that means the amount of milli-seconds a beat fraction represents.
|
2016-10-21 17:48:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```blocks
|
|
|
|
music.playTone(Note.C, music.beat(BeatFraction.Quarter))
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-10-21 17:48:43 +02:00
|
|
|
|
|
|
|
[play tone](/reference/music/play-tone), [ring tone](/reference/music/ring-tone), [rest](/reference/music/rest), [set tempo](/reference/music/set-tempo), [change tempo by](/reference/music/change-tempo-by)
|