public Pitch TransposeOctaves(int oct) { var probablyOctave = ((int)Octaves + oct); if (probablyOctave > Octaves.Max() || probablyOctave < Octaves.Min()) throw new ArgumentOutOfRangeException("probablyOctave", probablyOctave, "Resulting octave is out of range"); var octave = (Octaves)probablyOctave; Octaves = octave; return new Pitch(this.Step, octave, this.Accidental); }
public Pitch(Step step = null, Octaves octaves = Octaves.First, Accidentals accidental = Accidentals.Natural) { this.Step = step ?? new Step(); this.Octaves = octaves; this.Accidental = accidental; }
public Pitch(Notes note, Octaves ocatave) { _note = note; _oct = ocatave; }
public DisplayStepOctave(Step step = null, Octaves octave = Octaves.First) { DisplayOctave = octave; DisplayStep = step ?? new Step(); }
public Note(Letters l, Octaves o, int d) { Init(l, o, d); }
public static uint GetFrequencyFor(Notes n, Octaves o = Octaves.O4) { double offset = ((int)o * 12) + n.IndexOf<Notes>(); return (uint)(__rootpitch * Math.Pow(__a, offset)); }
private void Init(Letters l, Octaves o, int d) { int letter_shift = (int)l - (int)Letters.A; int octave_shift = (int)o - (int)Octaves.One; int shift = letter_shift + octave_shift * 12; double f = ETALON_FREQ * Math.Pow(2.0, (double)shift / 12); freq = f; dur = d; let = l; oct = o; }
public Note(Letters l, Octaves o) { Init(l, o, DEFAULT_DUR); }
public Octave(Octaves value) { Value = value; }
public Note(Keys key, Octaves octave) { Key = key; Octave = octave; }
public void PlayScale(uint[] scale, Notes n, uint duration, Octaves o = Octaves.O4) { var notes = EnumExtensions.GetArray<Notes>(); for (uint i = 0; i < scale.Count(); i++) { var p = new Pitch(n, o) + scale[i]; _sound.PlaySound(p, duration); } }
public void PlayKey(uint[] scale, Notes n, uint duration, Octaves o = Octaves.O4) { var key = Key.KeyOf(scale, n); foreach (var p in key) _sound.PlaySound(p, duration); }
public Unpitched(Step step = null, Octaves octave = Octaves.First) { var step1 = step ?? new Step(); DisplayStepOctave = new DisplayStepOctave(step1, octave); }