Class: Stave::Theory::Scale

Inherits:
Core::NoteCollection show all
Defined in:
lib/stave/theory/scale.rb

Instance Attribute Summary

Attributes inherited from Core::NoteCollection

#root, #type

Instance Method Summary collapse

Methods inherited from Core::NoteCollection

inherited, #initialize, #note_at, #notes, #to_h, type_class, #uniq

Constructor Details

This class inherits a constructor from Stave::Core::NoteCollection

Instance Method Details

#key_signatureObject



4
5
6
# File 'lib/stave/theory/scale.rb', line 4

def key_signature
  KeySignature.parse(self)
end

#mode(position) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/stave/theory/scale.rb', line 20

def mode(position)
  return if type.mode_types.empty?

  Mode.new(
    type: type.mode_type_at(position),
    root: note_at(position)
  )
end

#seventhsObject



14
15
16
17
18
# File 'lib/stave/theory/scale.rb', line 14

def sevenths
  return unless type.hexatonic?

  harmonise!(type.seventh_types)
end

#triadsObject



8
9
10
11
12
# File 'lib/stave/theory/scale.rb', line 8

def triads
  return unless type.hexatonic?

  harmonise!(type.triad_types)
end