scale step, scale and chords as classes

(A way to look at music theory for people who are familiar with object-oriented programming or pattern language.)

A scale step, a scale and a chord can each be seen as an instance of a class.

the class ScaleStep

  • the class ScaleStep has one attribute: frequency

the class Scale

  • the class Scale takes one argument: a frequency
  • the class has seven attributes: one for each step in the scale
    • each attribute is an instance of class ScaleStep
    • each attribute is defined in relation to the base frequency

the class ChordScale

  • the class ChordScale takes one argument: a frequency
  • the class' first attribute ('this_scale') is an instance of class Scale, which is instantiated with this frequency
  • the class has six more attributes: one for each chord in the scale
    • each attribute is defined as a set of three particular attributes of 'this_scale'
    • for example: the attribute 'three_chord' is composed of
      • this_scale.step_three
      • this_scale.step_five
      • this_step.step_seven