Create a Tie
to tie some notes together.
Tie(i, j = NULL, to = NULL, above = NULL)
A single positive integer, which represents the start position of the tie in a musical line.
Optional. A single positive integer, which represents the start position of the tie in a chord. If not provided, all notes in the chords that have equivalent pitches are tied.
Optional. A single character or a single positive integer, which indicates the musical line where to add the tie.
Optional. A single logical, which indicates if the tie is placed above the notes. By default, the position is decided by MuseScore.
A list of class Tie
.
+.Music()
for adding a tie to a Music
object.
# Create a tie
tie <- Tie(1)
tie
#> Tie
#>
#> * to be added at position 1
# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "C4")) + tie
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: 2 × 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 C4 60 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
#>
#> $ties
#> # A tibble: 1 × 4
#> line i j above
#> <int> <int> <int> <lgl>
#> 1 1 1 NA NA
#>
# Generate the music score
if (interactive()) {
show(music)
}