Class: OutroRails::Theory::Key::CirclePosition

Inherits:
Struct
  • Object
show all
Defined in:
lib/outro_rails/theory/key.rb

Overview

One wedge of the circle-of-fifths wheel: the major key(s) at a position (two spellings at the enharmonic seam, F#/Gb) and their relative minors, kept in matching order (F# => D#m, Gb => Ebm).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#majorsObject

Returns the value of attribute majors

Returns:

  • (Object)

    the current value of majors



23
24
25
# File 'lib/outro_rails/theory/key.rb', line 23

def majors
  @majors
end

#minorsObject

Returns the value of attribute minors

Returns:

  • (Object)

    the current value of minors



23
24
25
# File 'lib/outro_rails/theory/key.rb', line 23

def minors
  @minors
end

Instance Method Details

#major_labelObject



28
29
30
# File 'lib/outro_rails/theory/key.rb', line 28

def major_label
  majors.map(&:to_s).join("/")
end

#minor_labelObject



32
33
34
# File 'lib/outro_rails/theory/key.rb', line 32

def minor_label
  minors.map(&:to_s).join("/")
end

#pitch_classObject



24
25
26
# File 'lib/outro_rails/theory/key.rb', line 24

def pitch_class
  majors.first.tonic.pitch_class
end