class Alda::Marker
A marker event. An Alda::EventContainer
containing an Alda::Marker
can be created using event list sugar. See Alda::EventList#method_missing
.
It should be used together with Alda::AtMarker
.
Alda::Score.new do piano_ v1 c d _here e2 v2 __here c4 d e2 end
Attributes
name[RW]
The marker’s name
Public Class Methods
new(name) → Alda::Marker
click to toggle source
Creates an Alda::Marker
.
Underlines in name
is converted to hyphens.
Calls superclass method
# File lib/alda-rb/event.rb, line 1023 def initialize name super() @name = Alda::Utils.snake_to_slug name end
Public Instance Methods
marker == other → true or false
click to toggle source
Overrides Alda::Event#==
. Returns true if other
is an Alda::Marker
and has the same name
as marker
(using ==
).
Calls superclass method
Alda::Event#==
# File lib/alda-rb/event.rb, line 1044 def == other super || other.is_a?(Alda::Marker) && @name == other.name end
to_alda_code() → String
click to toggle source
Overrides Alda::Event#to_alda_code
.
# File lib/alda-rb/event.rb, line 1033 def to_alda_code ?% + @name end