MIDIGetGMDrum

Returns the General MIDI drum key name (ie, "Kick 1") for the specified MIDI note number, or returns the corresponding MIDI note number for a GM drum key name. When MIDIGetEvent() matches a note type of event (ie, On/Off/(Off)/Aftertouch), it sets MIDIEvent.!Data1 to the note number. MIDIGetGMDrum() can be used to retrieve the matching GM drum key name.

Synopsis

info = MIDIGetGMDrum(name, number)

Args

name is the GM drum key name for which the MIDI note number is to be returned. If omitted, then number is used instead.

number is the MIDI note number for which the GM drum key name is to be returned.

If both name and number are omitted, then the currently selected event's note number is used to fetch the corresponding GM drum key name.

Returns

The note number or GM drum key name, or an empty string if an error.

Notes

This chart shows all GM Drum Key names, and the MIDI note numbers which select those drums.

MIDI    Key Name     MIDI     Key Name
Note                 Note
 35   Kick 2          59   Ride 2 Cym.
 36   Kick 1          60   High Bongo
 37   Side Stick      61   Low Bongo
 38   Snare 1         62   Mute Hi Conga
 39   Hand Clap       63   Open Hi Conga
 40   Snare 2         64   Low Conga
 41   Low 2 Tom       65   High Timbale
 42   Closed HiHat    66   Low Timbale
 43   Low 1 Tom       67   High Agogo
 44   Pedal HiHat     68   Low Agogo
 45   Mid 2 Tom       69   Cabasa
 46   Open HiHat      70   Maracas
 47   Mid 1 Tom       71   Short Whistle
 48   High 2 Tom      72   Long Whistle
 49   Crash 1 Cym.    73   Short Guiro
 50   High 1 Tom      74   Long Guiro
 51   Ride 1 Cym.     75   Claves
 52   Chinese Cym.    76   High Wood Blk
 53   Bell Ride       77   Low Wood Blk
 54   Tambourine      78   Mute Cuica
 55   Splash Cymbal   79   Open Cuica
 56   Cowbell         80   Mute Triangle
 57   Crash 2 Cym.    81   Open Triangle
 58   Vibra-Slap
MIDI Note refers to the MIDI note number that causes this Key Name to be played.

name can be a substring of a GM name (ie, "HiHat" matches "Closed HiHat"). Leading/trailing blanks and case are ignored.

If you set the MidiErr variable to raise a condition, then that condition is raised if the name you pass is not a known GM drum note name.

Examples

/* Get the GM drum key name corresponding to a note number of 60 */
name = MIDIGetGMDrum(60)
IF name \== "" THEN SAY 'GM drum key name =' name

/* Query the current event's GM drum key name */
name = MIDIGetGMDrum()
IF name \== "" THEN SAY 'GM drum key name =' name

/* Display all GM drum key names */
DO i = 0 TO 127
  name = MIDIGetGMDrum(i)
  IF name \== "" THEN SAY name
END