diff --git a/docs/reference/music.md b/docs/reference/music.md index d595b112a63..8f5e3aaca6d 100644 --- a/docs/reference/music.md +++ b/docs/reference/music.md @@ -1,24 +1,36 @@ # Music -Make music. Play melodies and tones. +Make music! Play songs, melodies, sounds, and tones. -## Songs +## Play music + +Use the ``||music:play||`` block to play a song you compose, a short melody, or a built-in sound. ```cards -music.createSong(hex`00780004080200`) +music.play(music.createSong(hex`00780004080200`), music.PlaybackMode.UntilDone) ``` -## Melodies +### Play a song -```cards -music.stringPlayable("", 120) +```block +music.play(music.createSong(hex`0078000408020200001c00010a006400f40164000004000000000000000000000000000500000430000400080001220c001000012514001800011e1c00200001222400280001252c003000012934003800012c3c004000011e03001c0001dc00690000045e010004000000000000000000000564000104000330000400080001290c001000011e1400180001251c002000012924002800011b2c003000012234003800011e3c0040000129`), music.PlaybackMode.UntilDone) +``` + +### Play a melody + +```block +music.play(music.stringPlayable("D F E A E A C B ", 120), music.PlaybackMode.UntilDone) +``` + +### Play a built-in sound + +```block +music.play(music.melodyPlayable(music.wawawawaa), music.PlaybackMode.UntilDone) ``` ## Sound ```cards -music.play(null, music.PlaybackMode.UntilDone) -music.tonePlayable(262, music.beat(BeatFraction.Whole)) music.ringTone(0) music.rest(0) music.noteFrequency(Note.C) @@ -30,16 +42,17 @@ music.setVolume(0) music.stopAllSounds() ``` -## See Also +## See also [play](/reference/music/play), -[tone playable](/reference/music/tone-playable), -[string playable](/reference/music/string-playable), [create song](/reference/music/create-song), +[string playable](/reference/music/string-playable), +[tone playable](/reference/music/tone-playable), [ring tone](/reference/music/ring-tone), [rest](/reference/music/rest), [beat](/reference/music/beat), [tempo](/reference/music/tempo), [change tempo by](/reference/music/change-tempo-by), [set tempo](/reference/music/set-tempo), -[set voluime](/reference/music/set-volume) +[set voluime](/reference/music/set-volume), +[stop All Sounds](reference/music/stop-all-sounds)