Create visualisations of a piano keyboard with ggplot2.
You can install the development version of piano from GitHub with:
# install.packages("pak")
pak::pak("stibu81/piano")Use plot_piano() to plot a full piano keyboard with 88 keys:
library(piano)
plot_piano()The range of the piano can be restricted and labels can be added:
plot_piano("C", "e2", labels = "white")Chords can be marked on the keyboard using different colours for the left and right hand:
plot_piano("F", "c3",
mark_left = c("e", "bb", "d1"),
mark_right = c("e1", "a1", "c2"))

