Create a Clef object.

Clef objects represent clefs.

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

Arguments

sign

"G", "F" or "C", case insensitive.

line

Optional, 1 or 2 if sign is "G", an integer between 3 and 5 if sign is "F", or an integer between 1 and 5 if sign is "C".

octave

Optional, -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

an index or a Line name, which indicates to which Line object to add the Clef object.

bar

Optional. A positive integer which indicates the number of the measure to which to add the Clef object. By default, a Clef object will be added to the first measure.

offset

Optional. A duration value, sum of duration values or 0, which indicates the position in a measure, at which to add the Clef object. The default value is 0.

Value

A list with class Clef.

See also

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

vignette("gm", package = "gm") for details about duration values.

Examples

# create a Clef object
Clef("G", line = 2, octave = 1)
#> octave up treble Clef 

# add a Clef object to a Music object
Music() +
  Line(list("C4"), list(1)) +
  Clef("F", to = 1, bar = 10, offset = 1)
#> Music
#> 
#> Line 1
#> 
#> * as part 1 staff 1 voice 1
#> * of length 1
#> * of pitch C4
#> * of duration 1
#> 
#> bass Clef at bar 10 with offset 1 for part 1 staff 1