MidiPlayerTK.HelperNoteLabel

Some useful methods to get the label of a note. More...

Static Public Member Functions

static bool IsSharp (int midiValue)
 
static string LabelC4FromMidi (int midiValue)
 
static string LabelFromEcart (int valueNote)
 
static string LabelFromMidi (int midiValue)
 
static string LabelPercussion (int midiValue)
 
static int NoteNumber (int midiValue)
 
static int OctaveNumber (int midiValue)
 Get the octave number from the MIDI value (0 to 127) based on Middle C = C4. v2.86.
http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BMA1_3 More...
 

Detailed Description

Some useful methods to get the label of a note.

Member Function Documentation

◆ IsSharp()

static bool MidiPlayerTK.HelperNoteLabel.IsSharp ( int  midiValue)
static

Is this note is a sharp ?

Parameters
midiValue
Returns
true if the note is a sharp

◆ LabelC4FromMidi()

static string MidiPlayerTK.HelperNoteLabel.LabelC4FromMidi ( int  midiValue)
static

Get the label of the note from a MIDI value. C4 standard. v2.86.
Maestro Synth follows the MIDI standard based on Middle C = C4.
http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BMA1_3

Parameters
midiValueNote value between 0 (C-1) and 127 (G9). 60 will return C4
Returns

◆ LabelFromEcart()

static string MidiPlayerTK.HelperNoteLabel.LabelFromEcart ( int  valueNote)
static

Get the label of the note (C, C#, ... E) from a value (0 to 11)

Parameters
valueNote
Returns

◆ LabelFromMidi()

static string MidiPlayerTK.HelperNoteLabel.LabelFromMidi ( int  midiValue)
static

Get the label of the note from a MIDI value. C5 standard.
Maestro Synth follows the MIDI standard based on Middle C = C4.
http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BMA1_3
But this method is based on Middle C = C5, so 60 return "C5" (for some stupid historic reason).
Use LabelC4FromMidi for label is based based on Middle C = C4.

Parameters
midiValueNote value between 0 (C0) and 127 (G10). 60 will return C5
Returns

◆ LabelPercussion()

static string MidiPlayerTK.HelperNoteLabel.LabelPercussion ( int  midiValue)
static

Get the name of the note from a MIDI value. C5 standard.
In GM standard MIDI files, channel 9 (10 if start at channem 1) is reserved for percussion instruments only.
Notes recorded on channel 10/17 always produce percussion sounds. Each distinct note number specifies a unique percussive instrument, rather than the sound's pitch.
https://en.wikipedia.org/wiki/General_MIDI

Parameters
midiValueNote value between 27 (D2#) and 87 (D7#) return the label of a percussive instrument else return an empty string.
Returns

◆ NoteNumber()

static int MidiPlayerTK.HelperNoteLabel.NoteNumber ( int  midiValue)
static

Get the note number (0=C, 11=B) from the MIDI value (0 to 127). v2.86.
http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BMA1_3

  • 0 --> 0 (DO / C)
  • 1 --> 1 (DO# / C#)
  • ...
  • 60 --> 0 (DO / C)
  • 61 --> 1 (DO# / C#)
  • 62 --> 2 (Re / D)
  • 63 --> 3 (Re# / D#)
  • 64 --> 4 (Mi / E)
  • 65 --> 5 (Fa / F)
  • 66 --> 6 (Fa# / F#)
  • 67 --> 7 (Sol / G)
  • 68 --> 8 (Sol# / G#)
  • 69 --> 9 (La / A)
  • 70 --> 10 (La# / A#)
  • 71 --> 11 (Si / B)
  • 72 --> 0 (Do / C)
  • ...
  • 126 --> 6 (FA# / F#)
  • 127 --> 7 (SOL / G)
Parameters
midiValueValue of the midi event note-on from 0 to 127
Returns
Note number from 0 (C) to 11 (B)

◆ OctaveNumber()

static int MidiPlayerTK.HelperNoteLabel.OctaveNumber ( int  midiValue)
static

Get the octave number from the MIDI value (0 to 127) based on Middle C = C4. v2.86.
http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html#BMA1_3

Parameters
midiValueValue of the midi event note-on
Returns
octave number between -1 and 9