Create a Trill object to represent a trill ornament.

Trill(i, j = NULL, to = NULL)

Arguments

i

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

j

Optional. A single positive integer, which indicates the end position of the trill line in a musical line. If not provided, the trill will appear as a tr symbol above only the trilled note. Otherwise, it will appear as a tr~~~ symbol above the notes between the start and end positions.

to

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

Value

A list of class Trill.

See also

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

Examples

# Create a trill
trill <- Trill(1, 3)
trill
#> Trill Line 
#> 
#> * from position 1 to 3 

# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4", "E4", "F4")) + trill
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: 4 × 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
#> 4     1     4    NA F4       65 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   
#> 
#> $trills
#> # A tibble: 1 × 3
#>    line     i     j
#>   <int> <int> <int>
#> 1     1     1     3
#> 

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