public Note(Pitch pitch, Octave octave, MoleOrCross moleOrCross, Duration duration, int points, bool hasTilde) { this.pitch = pitch; this.octave = octave; this.moleOrCross = moleOrCross; this.duration = duration; this.hasTilde = hasTilde; this.points = points; }
public void SetMole(MoleOrCross mole) { note.moleOrCross = mole; }
public void GetPitch(int previousMidiKey, int midiKey, out Pitch pitch, out Octave octave, out MoleOrCross moc) { int key = midiKey % 12; //int octave = (midiKey / 12) - 1; pitch = pitches[key]; moc = moles[key]; // Check if note has distance more than 6 == Octave higher or lower int distance = (previousMidiKey != 0) ? midiKey - previousMidiKey : 0; int baseOctave = 0; while (distance < -6) { baseOctave--; distance += 8; } while (distance > 6) { baseOctave++; distance -= 8; } octave = (Octave)baseOctave; }