leonawicz / tabr

R package: tabr. Notation-based and tidy music data analysis and transcription.
https://leonawicz.github.io/tabr/
Other
128 stars 10 forks source link

Transpose music staff with respect to corresponding tab staff #8

Closed leonawicz closed 6 years ago

leonawicz commented 6 years ago

Most of the time that a standard music staff (e.g., 8va treble clef) is included above a tab staff, the two match, but sometimes this is not desired.

When using a capo, it is standard to transcribe the tab staff with respect to the capo'd fret as the new end of the guitar neck. This means that notes and chords are annotated on the tab staff the same as they would be if the capo was not used to transpose the music. The chord names and shapes are the same. For example, a song in Em will be written out on the tab staff as though it is still in Em, while it actually being in Fm is merely inferred from stating that the capo is on the first fret. It is not actually written out in Fm.

Normally, a standard music staff included above the tab staff will follow suit, also being written in Em though it may actually be in Fm due to capo 1 for instance. This is often of no consequence. However, sometimes you need to share the sheet music with other musicians playing other instruments and it is not helpful to tell them it's transposed from what they literally would play. In this case, it is best to have only the tab staff use an implied transposition while the other staff should be explicit.

The feature to add is (likely) an argument to track that allows for specifying transposition by a number of semitones to be applied to only the standard music staff relative to the tab staff. There should be a new data frame column in track table objects to store this, defaulting to 0. This information will be passed along through functions like trackbind and score and eventually passed to lilypond (or the tab wrapper) where the actual transposition of the specific staff will be applied in the generated LilyPond markup.

leonawicz commented 6 years ago

Done. Set ms_transpose and ms_key arguments in track. These settings are passed through track, trackbind and score as new data frame columns. This information is used to transpose the music staff relative to the tab staff when finally processed by lilypond.

The optional MIDI output will also be transposed, but only if the score does not have multiple music staves that are transposed to multiple different keys. In that case music staff transposition is ignored and the MIDI will default to the usual tab staff assigned key signature.

See updated example that is written as D minor with Capo 1, with the music staff placed above the tab staff now shown as in E flat minor.