2016-04-05 22:23:42 +02:00
|
|
|
# Music
|
|
|
|
|
2016-05-05 20:16:14 +02:00
|
|
|
Generation of music tones through pin ``P0``.
|
2016-04-05 22:23:42 +02:00
|
|
|
|
|
|
|
```cards
|
2020-09-08 11:04:25 +02:00
|
|
|
music.playTone(0, 0)
|
|
|
|
music.ringTone(0)
|
|
|
|
music.rest(0)
|
|
|
|
music.startMelody(music.builtInMelody(Melodies.Entertainer), MelodyOptions.Once)
|
|
|
|
music.stopMelody(MelodyStopOptions.All)
|
|
|
|
music.onEvent(MusicEvent.MelodyNotePlayed, () => {})
|
|
|
|
music.beat(BeatFraction.Whole)
|
|
|
|
music.tempo()
|
|
|
|
music.changeTempoBy(20)
|
|
|
|
music.setTempo(120)
|
|
|
|
music.setVolume(0)
|
|
|
|
music.volume()
|
2016-04-05 22:23:42 +02:00
|
|
|
```
|
2016-08-08 22:08:15 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See Also
|
2016-08-08 22:08:15 +02:00
|
|
|
|
2020-09-08 11:04:25 +02:00
|
|
|
[playTone](/reference/music/play-tone), [ringTone](/reference/music/ring-tone),
|
|
|
|
[rest](/reference/music/rest), [startMelody](/reference/music/start-melody),
|
|
|
|
[stopMelody](/reference/music/stop-melody), [onEvent](/reference/music/on-event),
|
|
|
|
[beat](/reference/music/beat), [tempo](/reference/music/tempo),
|
|
|
|
[changeTempoBy](/reference/music/change-tempo-by), [setTempo](/reference/music/set-tempo),
|
|
|
|
[setVolume](/reference/music/set-volume), [volume](/reference/music/volume)
|