Returns the corresponding note number for a note name (ie, "A#1").
Synopsis
number = MIDINoteNum(name)
Args
name is the note name for which the corresponding number is to be returned.
Returns
The note number, or an empty string if an error.
Notes
If you omit name, or pass an empty string, a SYNTAX condition is raised. CONDITION('E') returns error number 40.5 and CONDITION('D') returns the message Missing argument in invocation of "MIDINoteNum"; argument 1 is required.
If you set the MidiErr variable to raise a condition, then that condition is raised if the name you pass is not a legitimate note name.
Leading/trailing spaces are not ignored. Use STRIP() to remove any leading/trailing spaces from the name before calling MIDINoteNum(). But case is ignored on the letter (ie, 'Cb3' is the same as 'cb3').
Examples
/* Get the number corresponding to a note name of 'C 3' */ num = MIDINoteNum('C 3') IF num \== "" THEN SAY 'C 3 is note #'|| num