Returns the note name (ie, "C#3") for the specified note number. A note name consists of the pitch followed by the octave number, such as the C sharp in the third octave. When MIDIGetEvent() matches a note type of event (On/Off/(Off)/Aftertouch), it sets MIDIEvent.!Data1 to the note number. MIDINoteName() can be used to retrieve the matching name.
Synopsis
name = MIDINoteName(key, number)
Args
number is the note number for which the name is to be returned. If omitted, then the currently selected event's note number is used.
key determines whether an accidental is named with a sharp (#) or flat (b -- a small B). If negative, a flat is used, If positive or 0, a sharp is used. This pertains to the MIDIEvent.!Data1 of a "Key Sig" event.
Returns
The note name, or an empty string if an error.
Notes
RxMIDI regards the lowest note (ie, number 0) as C-2 and the highest note is G8.
If you set the MidiErr variable to raise a condition, and you omit number, then that condition is raised if there is no currently selected event.
Examples
/* Get the name corresponding to a note number of 60 */ name = MIDINoteName(60) IF name \== "" THEN SAY 'note =' name /* Query the current event's note name */ name = MIDINoteName() IF name \== "" THEN SAY 'note =' name