midiNumber property

int get midiNumber

calculateTestes the MIDI note number (C4 = 60). For microtones, returns the nearest integer value.

Implementation

int get midiNumber {
  const stepToSemitone = {
    'C': 0,
    'D': 2,
    'E': 4,
    'F': 5,
    'G': 7,
    'A': 9,
    'B': 11,
  };
  final semitone = stepToSemitone[step]!;
  return (octave + 1) * 12 + semitone + effectiveAlter.round();
}