class Alda::Sequence
A sequence event. Includes Alda::EventList
.
An Alda::EventContainer
containing an Alda::Sequence
can be created using event list sugar. See Alda::EventList#method_missing
.
Alda::Score.new do p s{ c; d; e; f }.event.class # => Alda::Sequence end
There is also a special sequence sugar.
Alda::Score.new do p((c d e f).event.class) # => Alda::Sequence end
The effects of the two examples above are technically the same although actually the generated list of events are slightly different.
Public Class Methods
join(*events) → Alda::Sequence
click to toggle source
Creates an Alda::Sequence
object by joining events
.
The Alda::EventContainer
objects are extracted, and the Alda::Sequence
objects are flattened.
# File lib/alda-rb/event.rb, line 1160 def self.join *events new do @events = events.map do |event| while event.is_a?(Alda::EventContainer) && event.count == 1 && event.labels.empty? event = event.event end event.is_a?(Alda::Sequence) ? event.events : event end.flatten end end
Public Instance Methods
to_alda_code() → String
click to toggle source
Overrides Alda::Event#to_alda_code
.
# File lib/alda-rb/event.rb, line 1148 def to_alda_code "[#{events_alda_codes}]" end