Class: WTFChord::Collectors::Guitar
- Inherits:
-
Generic
- Object
- WTFChord::Chord
- Generic
- WTFChord::Collectors::Guitar
- Defined in:
- lib/wtf_chord/collectors/guitar.rb
Constant Summary collapse
- MAX_FRET =
7
Constants inherited from WTFChord::Chord
Instance Attribute Summary
Attributes inherited from Generic
Attributes inherited from WTFChord::Chord
#bass, #name, #notes, #pitch, #steps
Instance Method Summary collapse
Methods inherited from Generic
Methods inherited from WTFChord::Chord
#===, #bass?, #fingerings, #initialize, #inspect, #original_bass, #size, #third_tone, #tone
Constructor Details
This class inherits a constructor from WTFChord::Chord
Instance Method Details
#collect! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/wtf_chord/collectors/guitar.rb', line 10 def collect! (0...MAX_FRET).each do |from| to = from + max_dist generate(from...to) do |variant| fingerings << set_bass(variant) if filter_variant(variant) end end fingerings.uniq! fingerings.sort_by!(&:complexity) end |