Create a Notehead object to customize the appearance of a note's head.

Notehead(
  i,
  j = NULL,
  to = NULL,
  shape = NULL,
  color = NULL,
  filled = NULL,
  bracket = NULL
)

Arguments

i

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

j

Optional. A single positive integer, which represents the position of the note in a chord.

to

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

shape

Optional. A single character which represents the shape of the note's head. See the MusicXML specification for all shapes. Unfortunately, not all shapes are supported in MuseScore.

color

Optional. A single character which represents the color of the note's head. It must be in the hexadecimal RGB or ARGB format.

filled

Optional. A single logical, which indicates whether the note's head is filled or hollow.

bracket

Optional. A single logical, which indicates whether the note's head is enclosed in brackets.

Value

A list of class Notehead.

See also

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

Examples

# Create a `Notehead`
notehead <- Notehead(1, shape = "diamond", color = "#800080")
notehead
#> Notehead 
#> 
#> * of shape "diamond" 
#> * of color "#800080" 
#> * to be added at position 1 

# Add it to a `Music`
music <- Music() + Meter(4, 4) + Line(c("C4", "D4")) + notehead
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   
#> 
#> $noteheads
#> # A tibble: 1 × 7
#>    line     i     j shape   color   filled bracket
#>   <int> <int> <int> <chr>   <chr>   <lgl>  <lgl>  
#> 1     1     1    NA diamond #800080 NA     NA     
#> 

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