moodymudskipper / tidygm

Music as Tidy Data Frames
3 stars 0 forks source link

Issue with having bars as units #1

Open moodymudskipper opened 3 years ago

moodymudskipper commented 3 years ago

Some pitches continue on next bar.

Technically we can print this with {tidygm}, because we just concatenate bars into lines, but it's clunky.

library(gm)
m <- Music() +
  # add a 4/4 time signature
  Meter(4, 4) +
  # add a musical line of a C5 whole note
  Line(pitches = list("C5", "C5", "C5"), durations = list("h","w", "h"))

show(m, to = c("score", "audio"))

I think we need our own special note to signify the pitch is to be held, it might already have a name in music theory.

For instance durations for both bars here would be list("h", "h"), but notes would be list("C5", "C5") and list("~", "C5"). It would then be changed into the right {gm} syntax by summing the appropriate durations and removing the "~".

We need also to control that a bar contains no more than what makes sense, by summing the durations.