The music library is used to play music through the SPIKE App.
DRUM_SNARE=1
DRUM_BASS=2
DRUM_SIDE_STICK=3
DRUM_CRASH_CYMBAL=4
DRUM_OPEN_HI_HAT=5
DRUM_CLOSED_HI_HAT=6
DRUM_TAMBOURINE=7
DRUM_HAND_CLAP=8
DRUM_CLAVES=9
DRUM_WOOD_BLOCK=10
None
integerdrum
Which drum to play, out of the DRUM constants
1
2
3
use Libraries.Robots.Spike.Music
Music ms
ms:PlayDrum(ms:DRUM_SNARE)
None
integerinstrument
Which instrument to play, out of the INSTRUMENT constants
integernote
The midi note to play (0-130)
integerduration
How long to play the instrument/note for, in milliseconds
1
2
3
use Libraries.Robots.Spike.Music
Music ms
ms:PlayInstrument(ms:INSTRUMENT_PIANO, 50, 3000) // Play for 3 seconds