Class: Ramekin::CombinedRestEvent
Constant Summary
Constants inherited
from NoteEvent
NoteEvent::NOTES
Instance Attribute Summary collapse
Attributes inherited from NoteEvent
#extensions, #note, #octave
Attributes inherited from Element
#channel, #components, #macro_stack, #start_tick
Instance Method Summary
collapse
Methods inherited from NoteEvent
#default_error_location, #default_length, #inspect, #length_amk, #note_hex, #note_name, #octave_amk, #octave_num, #octave_switching_amk, #repr, #to_amk
Methods inherited from Element
make
Constructor Details
Returns a new instance of CombinedRestEvent.
146
147
148
149
|
# File 'lib/ramekin/note_aggregator.rb', line 146
def initialize(rests)
@rests = rests
error! "empty CombinedRestEvent" if rests.empty?
end
|
Instance Attribute Details
#rests ⇒ Object
Returns the value of attribute rests.
145
146
147
|
# File 'lib/ramekin/note_aggregator.rb', line 145
def rests
@rests
end
|
Instance Method Details
#fin ⇒ Object
163
164
165
|
# File 'lib/ramekin/note_aggregator.rb', line 163
def fin
@rests.last.fin
end
|
155
156
157
|
# File 'lib/ramekin/note_aggregator.rb', line 155
def meta
@rests.first.meta
end
|
#rest? ⇒ Boolean
167
168
169
|
# File 'lib/ramekin/note_aggregator.rb', line 167
def rest?
true
end
|
#start ⇒ Object
159
160
161
|
# File 'lib/ramekin/note_aggregator.rb', line 159
def start
@rests.first.start
end
|
#ticks ⇒ Object
171
172
173
|
# File 'lib/ramekin/note_aggregator.rb', line 171
def ticks
@rests.map(&:ticks).sum
end
|
#tie? ⇒ Boolean
151
152
153
|
# File 'lib/ramekin/note_aggregator.rb', line 151
def tie?
false
end
|