The music library is used to play music through the SPIKE App.
DRUM_SNARE=1DRUM_BASS=2DRUM_SIDE_STICK=3DRUM_CRASH_CYMBAL=4DRUM_OPEN_HI_HAT=5DRUM_CLOSED_HI_HAT=6DRUM_TAMBOURINE=7DRUM_HAND_CLAP=8DRUM_CLAVES=9DRUM_WOOD_BLOCK=10NoneintegerdrumWhich drum to play, out of the DRUM constants
1
2
3
use Libraries.Robots.Spike.Music
Music ms
ms:PlayDrum(ms:DRUM_SNARE)NoneintegerinstrumentWhich instrument to play, out of the INSTRUMENT constants
integernoteThe midi note to play (0-130)
integerdurationHow 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