class InevitableCacophony::OctaveStructure::Scale
As above, but also tracks the chords that make up the scale.
Public Class Methods
new(chords, note_scalings=nil)
click to toggle source
@param chords [Array<Chord>] The chords that make up the scale, in order. @param note_scalings [Array<Fixnum>] Specific note scalings to use; for internal use.
Calls superclass method
InevitableCacophony::OctaveStructure::NoteSequence::new
# File lib/inevitable_cacophony/octave_structure.rb, line 37 def initialize(chords, note_scalings=nil) @chords = chords super(note_scalings || chords.map(&:note_scalings).flatten) end
Public Instance Methods
open()
click to toggle source
Convert this scale to an “open” one – i.e. one not including the last note of the octave.
This form is more convenient when concatenating scales together.
@return [Scale]
# File lib/inevitable_cacophony/octave_structure.rb, line 48 def open if note_scalings.last == OCTAVE_RATIO # -1 is the last note; we want to end on the one before that, so -2 Scale.new(@chords, note_scalings[0..-2]) else # This scale is already open. self end end