Learn R Programming

gm (version 1.0.2)

+.Music: Add Component to Music Object

Description

Add a component to a Music object.

Usage

# S3 method for Music
+(music, term)

Value

A list with class Music.

Arguments

music

A Music object.

term

A Line, Meter, Key, Clef or Tempo object.

See Also

Music() for initializing a Music object.

Line(), Meter(), Key(), Clef() and Tempo() for creating objects of corresponding classes.

Examples

Run this code
# initialize a Music object
m <- Music()

# add a Line object
m <- m + Line(list("C4"), list(1))
m

# add a Meter object
m <- m + Meter(4, 4)
m

# add a Key object
m <- m + Key(1)
m

# add a Clef object
m <- m + Clef("G", to = 1)
m

# add a Tempo object
m <- m + Tempo(120)
m

Run the code above in your browser using DataLab