Music

The music library is used to play music through the SPIKE App.

Constants

  1. DRUM_SNARE=1
  2. DRUM_BASS=2
  3. DRUM_SIDE_STICK=3
  4. DRUM_CRASH_CYMBAL=4
  5. DRUM_OPEN_HI_HAT=5
  6. DRUM_CLOSED_HI_HAT=6
  7. DRUM_TAMBOURINE=7
  8. DRUM_HAND_CLAP=8
  9. DRUM_CLAVES=9
  10. DRUM_WOOD_BLOCK=10

PlayDrum(integer drum)

Returns

None

Parameters

  1. 1.integerdrum

    Which drum to play, out of the DRUM constants

Example

1 2 3 use Libraries.Robots.Spike.Music Music ms ms:PlayDrum(ms:DRUM_SNARE)

PlayInstrument(integer instrument, integer note, integer duration)

Returns

None

Parameters

  1. 1.integerinstrument

    Which instrument to play, out of the INSTRUMENT constants

  2. 2.integernote

    The midi note to play (0-130)

  3. 3.integerduration

    How long to play the instrument/note for, in milliseconds

Example

1 2 3 use Libraries.Robots.Spike.Music Music ms ms:PlayInstrument(ms:INSTRUMENT_PIANO, 50, 3000) // Play for 3 seconds