class Alda::Chord

A chord event. Includes Alda::EventList.

An Alda::EventContainer containing an Alda::Chord can be created using event list sugar. See Alda::EventList#method_missing.

Alda::Score.new do
  p x{ c; e; g }.event.class # => Alda::Chord
end

The event contained by an Alda::EventContainer can become an Alda::Chord by using Alda::EventContainer#/.

Public Class Methods

new(*events, &block) → Alda::Chord click to toggle source

There is an event list sugar invoking this method. See Alda::EventList#method_missing.

In most cases, events should be empty. Note that events cannot be specified using the sugar. block is to be passed with the chord object as self.

Alda::Score.new { piano_; x { c; -e; g } }.play
# (plays chord Cm)
Calls superclass method Alda::EventList::new
# File lib/alda-rb/event.rb, line 576
def initialize *events, &block
  @events = events
  super &block
end

Public Instance Methods

to_alda_code() click to toggle source
# File lib/alda-rb/event.rb, line 581
def to_alda_code
  events_alda_codes ?/
end