class Alda::Cram
A CRAM event. Includes Alda::EventList
.
An Alda::EventContainer
containing an Alda::Cram
can be created using event list sugar. See Alda::EventList#method_missing
.
The duration of a cram event can be specified just like that of an Alda::Note
.
Alda::Score.new do piano_ c3 t4 { c2 d4 e f }; g2 end
Attributes
duration[RW]
The string representing the duration of the CRAM.
Public Class Methods
new(duration, &block)
click to toggle source
There is an event list sugar invoking this method, see Alda::EventList#method_missing
.
block
is to be passed with the CRAM object as self
.
Alda::Score.new { piano_; t8 { a; b }}
Calls superclass method
Alda::EventList::new
# File lib/alda-rb/event.rb, line 974 def initialize duration, &block @duration = duration super &block end
Public Instance Methods
cram == other → true or false
click to toggle source
Overrides Alda::EventList#==
. Returns true if the super method returns true and other
has the same duration
as cram
(using ==
).
Calls superclass method
Alda::EventList#==
# File lib/alda-rb/event.rb, line 995 def == other super && @duration == other.duration end
to_alda_code() → String
click to toggle source
Overrides Alda::Event#to_alda_code
.
# File lib/alda-rb/event.rb, line 984 def to_alda_code "{#{events_alda_codes}}#@duration" end