private void Clear() { this.dotted = 0; this.duration = 0; this.semitone = DomainModel.Semitone.SEMITONE.NORMAL; this.pitch = ""; }
public NoteBuilder() { this.semitone = DomainModel.Semitone.SEMITONE.NORMAL; this.dotted = 0; this.duration = 0; this.ocataveModifier = 0; this.semitone = Semitone.SEMITONE.NORMAL; }
private int calculatePitch(string pitch, int octave, Clef clef, Semitone.SEMITONE semitone) { Dictionary <string, int> pitchDictionary = new Dictionary <string, int>() { { "c", 0 }, { "d", 2 }, { "e", 4 }, { "f", 5 }, { "g", 7 }, { "a", 9 }, { "b", 11 } }; int midiKey; pitchDictionary.TryGetValue(pitch, out midiKey); if (semitone == Semitone.SEMITONE.MINOR) { midiKey++; } if (semitone == Semitone.SEMITONE.MAJOR) { midiKey--; } midiKey += (octave - 2) * 12; int test = midiKey + 60; if (test < 0) { return(0); } if (test > 127) { return(0); } return(midiKey + 60); }
public void SetSemitone(Semitone.SEMITONE semitone) { this.semitone = semitone; }