Create a Lyric object to represent a unit of lyrics.

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

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 .

Value

A list of class Lyric.

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

# Create two syllables
syllable_1 <- Lyric("He-", 1)
syllable_2 <- Lyric("-llo", 3)
syllable_1
#> Lyric "He-" 
#> 
#> * to be added at position 1 
syllable_2
#> Lyric "-llo" 
#> 
#> * to be added at position 3 

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

music
#> Music 
#> 
#> $meters
#> # A tibble: 1 × 6
#>     bar number  unit actual_number actual_unit invisible
#>   <int>  <int> <int>         <int>       <int> <lgl>    
#> 1     1      4     4             4           4 FALSE    
#> 
#> $notes
#> # A tibble: 3 × 7
#>    line     i     j pitch  midi duration length
#>   <int> <int> <int> <chr> <int> <chr>     <dbl>
#> 1     1     1    NA C4       60 NA            1
#> 2     1     2    NA D4       62 NA            1
#> 3     1     3    NA E4       64 NA            1
#> 
#> $lines
#> # A tibble: 1 × 7
#>    part staff voice segment   bar offset name 
#>   <int> <int> <int>   <int> <int>  <dbl> <chr>
#> 1     1     1     1       1     1      0 NA   
#> 
#> $lyrics
#> # A tibble: 2 × 4
#>    line verse     i text 
#>   <int> <int> <int> <chr>
#> 1     1     1     1 He-  
#> 2     1     1     3 -llo 
#> 

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