Create a Mordent object to represent a mordent ornament.

Mordent(i, to = NULL, inverted = NULL, long = NULL, ornament = NULL)

Arguments

i

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

to

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

inverted

Optional. A single logical, which indicates whether the mordent is inverted or not. The default value is FALSE. See MusicXML specification of mordent and inverted mordent.

long

Optional. A single logical, which indicates whether the mordent is long or not. The default value is FALSE.

ornament

Optional. A single character, which can be "left up", "left down", "right up", or "right down". It indicates the direction of the mordent's left or right part.

Value

A list of class Mordent.

See also

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

Examples

# Create a mordent
mordent <- Mordent(1)
mordent
#> Mordent 
#> 
#> * to be added at position 1 

# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4")) + mordent
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 D4       62 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   
#> 
#> $mordents
#> # A tibble: 1 × 5
#>    line     i inverted long  ornament
#>   <int> <int> <lgl>    <lgl> <chr>   
#> 1     1     1 FALSE    FALSE NA      
#> 

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