Learn R Programming

gm (version 2.0.0)

+.Music: Add Component to Music Object

Description

Add a component to a Music object.

Usage

# S3 method for Music
+(music, object)

Value

A list of class Music.

Arguments

music

A Music object.

object

An object of class Line, Meter, Key, Tempo, Clef, Instrument, Pedal, Slur, Hairpin, Notehead, Accidental, Velocity, Dynamic, Grace, Stem, Lyric, Tie, Articulation, Fermata, Breath, Trill, Turn, Mordent, Schleifer or Tremolo.

See Also

Music() for initialization of a Music object.

Examples

Run this code
# Initialize a `Music` object
music <- Music()

# Add a `Line`
music <- music + Line("C4", 1)
music

# Add a `Meter`
music <- music + Meter(4, 4)
music

# Generate the music score
if (interactive()) {
  show(music)
}

Run the code above in your browser using DataLab