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 729
def initialize duration, &block
  @duration = duration
  super &block
end

Public Instance Methods

to_alda_code() click to toggle source
# File lib/alda-rb/event.rb, line 734
def to_alda_code
  "{#{events_alda_codes}}#@duration"
end