Grace {gm}R Documentation

Create Grace Object

Description

Create a Grace object. The Grace object can be added to an existing note or chord. It will turn the note or chord to a grace note or chord.

Usage

Grace(i, to = NULL, slash = NULL)

Arguments

i

A single positive integer, which represents the position of the Grace object in a musical line.

to

Optional. A single character or a single positive integer, which indicates the musical line where to add the Grace object.

slash

Optional. A single logical, which indicates if there is a slash symbol on the grace note or chord. The default value is TRUE.

Details

A Grace object can not be added to a rest, tuplet, or note or chord that has a dotted duration. There must be a note or chord after the note or chord where the Grace object is added.

Value

A list of class Grace.

See Also

+.Music() for adding a Grace object to a Music object.

Examples

# Create a `Grace`
grace <- Grace(1)
grace

# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4"), c(0.5, 1)) + grace
music

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

[Package gm version 2.0.0 Index]