Clef {gm}R Documentation

Create Clef Object

Description

Create a Clef object to represent a clef.

Usage

Clef(sign, line = NULL, octave = NULL, to = NULL, bar = NULL, offset = NULL)

Arguments

sign

A single character, which can be "G", "F" or "C". Case insensitive.

line

Optional. A single integer, which depends on sign:

  • 1 or 2, if sign is "G";

  • an integer between 3 and 5, if sign is "F";

  • an integer between 1 and 5, if sign is "C".

octave

Optional. A single integer, which can be -1 or 1. octave can be specified only when

  • sign is "G" and line is 2, or

  • sign is "F" and line is 4.

to

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

bar

Optional. A positive integer, which indicates the number of the measure where to add the clef. By default, the clef will be added at the first measure.

offset

Optional. A non-negative number, which indicates the clef's position in a measure. The default value is 0.

Details

See Wikipedia for more details.

Value

A list of class Clef.

See Also

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

Examples

# Create a bass clef
clef <- Clef("F")
clef

# Add the clef to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C3", "D3")) + clef
music

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

[Package gm version 2.0.0 Index]