Example #1
0
 public static MusicalNote CreateNote(NoteName note, int octave, IntonationMethod intonation = IntonationMethod.EqualTempered)
 {
     return(new MusicalNote
     {
         _NoteName = note,
         _Octave = octave,
         _BaseIntonation = intonation,
         _Pitch = NoteConverter.GetPitchFromNote(note, octave, intonation)
     });
 }
        public static PreciseDouble GetAdjustedFretRatio(PitchValue tuning, int fret, Temperament temperament)
        {
            if (fret == 0)
            {
                return(0d);
            }

            var           pitchAtFret = GetPitchAtFret(tuning, fret, temperament);
            PreciseDouble fretRatio   = NoteConverter.CentsToIntonationRatio(pitchAtFret.Cents - tuning.Cents);

            return(fretRatio);
        }
Example #3
0
 public static PitchValue FromRatio(double ratio)
 {
     return(new PitchValue(NoteConverter.IntonationRatioToCents(ratio), ratio));
 }
Example #4
0
 public static PitchValue FromCents(double cents)
 {
     return(new PitchValue(cents, NoteConverter.CentsToIntonationRatio(cents)));
 }