Class: Coltrane::Representation::Guitar::NoteSet
- Inherits:
-
Object
- Object
- Coltrane::Representation::Guitar::NoteSet
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/coltrane/representation/guitar/note_set.rb
Instance Attribute Summary collapse
-
#guitar ⇒ Object
readonly
Returns the value of attribute guitar.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
Instance Method Summary collapse
-
#initialize(note_set, guitar:) ⇒ NoteSet
constructor
A new instance of NoteSet.
- #results ⇒ Object (also: #strings)
Constructor Details
#initialize(note_set, guitar:) ⇒ NoteSet
Returns a new instance of NoteSet.
13 14 15 16 |
# File 'lib/coltrane/representation/guitar/note_set.rb', line 13 def initialize(note_set, guitar:) @notes = note_set @guitar = guitar end |
Instance Attribute Details
#guitar ⇒ Object (readonly)
Returns the value of attribute guitar.
10 11 12 |
# File 'lib/coltrane/representation/guitar/note_set.rb', line 10 def guitar @guitar end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
10 11 12 |
# File 'lib/coltrane/representation/guitar/note_set.rb', line 10 def notes @notes end |
Instance Method Details
#results ⇒ Object Also known as: strings
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/coltrane/representation/guitar/note_set.rb', line 20 def results @strings ||= begin guitar.strings.map do |string| { pitch: string.pitch, notes: notes.map { |note| string.find(note) } } end end end |