Learn R Programming

gm (version 2.0.0)

Lyric: Create Lyric Object

Description

Create a Lyric object to represent a unit of lyrics.

Usage

Lyric(text, i, to = NULL, verse = NULL)

Value

A list of class Lyric.

Arguments

text

A single character, which usually represents a word or syllable of the lyrics. See the Details section for more complex usage.

i

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

to

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

verse

Optional. A positive integer which indicates the verse where to add the Lyric. The default value is 1. See the MuseScore handbook .

Details

You can use "-" and "_" in argument text to create the following structures:

  • Syllable: for example, with Lyric("mo-", 1) and Lyric("-ther", 3), the two syllables of mother are added to the first and third notes, with a hyphen placed on the second note.

  • Melisma: for example, with Lyric("love_", 1) and Lyric("_", 3), the word love is added to the first note, followed by an underscore line which extends over the second and third notes.

  • Elision: for example, with Lyric("my_love", 1), words my and love are both added to the first note, connected by an elision slur.

Use "\\-" and "\\_" if you want to add hyphens and underscores literally.

See Also

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

Examples

Run this code
# Create two syllables
syllable_1 <- Lyric("He-", 1)
syllable_2 <- Lyric("-llo", 3)
syllable_1
syllable_2

# Add them to a `Music`
music <-
  Music() +
  Meter(4, 4) +
  Line(c("C4", "D4", "E4")) +
  syllable_1 +
  syllable_2

music

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

Run the code above in your browser using DataLab