Example #1
0
 static public int GetTone(this Pitch item)
 {
     return((int)(item.GetSemitones() - item.GetOctave() * Pitch.Octave));
 }
Example #2
0
 static public Pitch GetShiftedSemitones(this Pitch item, double amount)
 {
     return(new Pitch(item.GetSemitones() + amount));
 }
Example #3
0
 static public byte GetMidiNote(this Pitch item)
 {
     return((byte)item.GetSemitones());
 }
Example #4
0
 static public int GetCents(this Pitch item)
 {
     return((int)(item.GetSemitones().GetFractionalComponent() * 100.0));
 }
Example #5
0
 static public double GetFrequency(this Pitch item)
 {
     return(440.0 * Math.Pow(2.0, (item.GetSemitones() - 69.0) / 12.0));
 }