Class: WTFChord::FingeringsGenerator
- Defined in:
- lib/wtf_chord/fingerings_generator.rb
Constant Summary collapse
- MAX_DIST =
5- MAX_FRET =
7
Instance Attribute Summary
Attributes inherited from Chord
Instance Method Summary collapse
Methods inherited from Chord
#initialize, #inspect, #third_tone
Constructor Details
This class inherits a constructor from WTFChord::Chord
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/wtf_chord/fingerings_generator.rb', line 13 def call fingerings.clear (0...MAX_FRET).each do |from| to = from + MAX_DIST generate(from...to) do |variant| fingerings << variant if filter_variant(variant) end end fingerings.sort_by!(&:complexity) end |
#fingerings ⇒ Object
9 10 11 |
# File 'lib/wtf_chord/fingerings_generator.rb', line 9 def fingerings @fingerings ||= [] end |