Exemple #1
0
        public static string GetSimpleName(this RelativePitch relativePitch)
        {
            switch (relativePitch)
            {
            case RelativePitch.C:  return("C");

            case RelativePitch.Cs: return("C#");

            case RelativePitch.D:  return("D");

            case RelativePitch.Ds: return("D#");

            case RelativePitch.E:  return("E");

            case RelativePitch.F:  return("F");

            case RelativePitch.Fs: return("F#");

            case RelativePitch.G:  return("G");

            case RelativePitch.Gs: return("G#");

            case RelativePitch.A:  return("A");

            case RelativePitch.As: return("A#");

            case RelativePitch.B:  return("B");

            default: return("?");
            }
        }
Exemple #2
0
 public bool HasPitch(RelativePitch relativePitch)
 {
     return
         (Util.ScaleData.HasRelativePitch(
              this.scale,
              Util.RelativePitchData.DisplaceBy(relativePitch, this.tonicPitch)));
 }
Exemple #3
0
 public RelativePitchCommand(RelativePitch orient)
     : base(orient.StartTime, orient.Duration)
 {
     _targetRelativePitch = orient.TargetOrientation * MathHelper.DegreesToRadians;
 }
Exemple #4
0
 public static bool HasRelativePitch(this Scale scale, RelativePitch relativePitch)
 {
     return(relativePitchesToDegree[(int)scale][(int)relativePitch] >= 0);
 }
Exemple #5
0
 public static RelativePitch DisplaceBy(this RelativePitch relativePitch, RelativePitch otherPitch)
 {
     return((RelativePitch)(((int)relativePitch + 12 - (int)otherPitch) % 12));
 }
Exemple #6
0
 public static Util.Pitch GetPitch(this RelativePitch relativePitch, int octave)
 {
     return(Util.Pitch.FromMidiPitch((int)relativePitch + 12 * octave));
 }
Exemple #7
0
 public Key(RelativePitch tonicPitch, Scale scale)
 {
     this.tonicPitch = tonicPitch;
     this.scale      = scale;
 }