Class: InevitableCacophony::OctaveStructure::NoteSequence

Inherits:
Object
  • Object
show all
Defined in:
lib/inevitable_cacophony/octave_structure.rb

Overview

Represent a sequence of notes from an octave – either a chord, or the notes of a scale. TODO: call this something more useful

Direct Known Subclasses

Chord, Scale

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note_scalings) ⇒ NoteSequence

Returns a new instance of NoteSequence.

Parameters:

  • note_scalings (Array<Float>)

    The frequencies of each note in the scale, as multiples of the tonic.



18
19
20
# File 'lib/inevitable_cacophony/octave_structure.rb', line 18

def initialize(note_scalings)
        @note_scalings = note_scalings
end

Instance Attribute Details

#note_scalingsObject

Returns the value of attribute note_scalings.



22
23
24
# File 'lib/inevitable_cacophony/octave_structure.rb', line 22

def note_scalings
  @note_scalings
end

Instance Method Details

#lengthObject



24
25
26
# File 'lib/inevitable_cacophony/octave_structure.rb', line 24

def length
        note_scalings.length
end