Open craigsapp opened 2 years ago
Yes, for now we basically ignore the duration of the grace notes. Fixing this shouldn't be too difficult. The most general case that must be handled is to rescale beams (with grace notes of different durations) to 1/2 of the principal note, if the beam is trying to steal more than 1/2 of the duration: Wikipedia says that if the principal note is dotted, then 1/2 should be replaced by 2/3. Is that a rule that we should use as well?
For dotted notes the rule is not as rigid as Wikipedia suggests. But if we all agree on it, I think it's fine to do so.
Grace notes are not conducive to computational performance since there is leeway by the performer on how to perform them (and may be played differently at different tempos), and also a lot of convention for various repertories that is not encoded into the graphical score. So good luck solving the general case of grace-note (and ornament) MIDI playback 😉
This example:
Is not grace notes in the musical sense even if it is grace notes in a notational sense (where grace notes mean no time is allotted to them in the score). These grace notes are a form of cadenza, evidenced in particular by the use of variable rhythms within the grace note group. To perform such music, the tempo would be suspended for the quarter note that precedes them:
Since this is a single-staff example the music could be encoded either as grace notes without score duration or as smaller sized notes with score duration (the latter method would be better for MIDI playback). For a performer, these grace notes would indicate that the music is not to be played in time, and there is a fair amount of improvization in the timing that would be allowed.
Full example from https://github.com/rism-digital/verovio/pull/2577
Here is a related example from real music (Hummel prelude in B major (H dur) op. 67, no. 11):
In this case the last three grace notes beamed groups will be given extra time for performance that is not present in the score. There is another grace note group above the espress. which is a written-out turn ornament, and this grace note group will not modify the onset times of the notes around it (but will have an expected starting time that matches to a turn).
Here is an example where the primary note is dotted (half and quarter):
I would expect that the grace note takes one eighth note of time from the main note (so 1/3 of the main notes duration goes to the grace note when it is a dotted quarter, and 1/6 of the main note's duration when the grace note is an eighth note and the main note is a dotted half note). In other words, for accented grace notes without slashes, the duration that should be taken away is the visual duration of the grace note (so take away an eighth-note duration for this this example for both dotted quarter notes and dotted half notes.
Transcoded from Humdrum
The Appoggiatura is normally played on the beat. Its value depends on context but in the baroque era, usually takes half or even two-thirds of the value of the written note:
One special form of the appoggiatura is known as the Coulé, namely one that fills in between descending thirds, either before the beat or on the beat (Ex.9b):
The problem with implementing grace notes in the MIDI conversion will be that people will want to hear them played correctly 😉
One special form of the appoggiatura is known as the Coulé, namely one that fills in between descending thirds, either before the beat or on the beat (Ex.9b):
Is this the same as Nachschlag grace notes? (Example given on the page https://github.com/rism-digital/verovio/pull/2577). Based on the "nach" part of the name, I am suspecting that it can only be the unaccented interpretation in measure 2.
A problem is that the Coulé can be both accented or unaccented, and there is currently no way of representing such a grace note in MEI (grace ntoes have to be either one or the other). Perhaps using something like form="coule"
would be a way of clarifying grace note gestural renderings?
For the unaccented version, based on the Nachschlag example referenced above:
<note dur="4" oct="5" pname="e" accid.ges="n" />
<graceGrp grace="unacc" attach="pre">
<note dur="8" oct="5" pname="d" accid.ges="n" />
</graceGrp>
<note dur="4" oct="5" pname="c" accid.ges="n" />
<graceGrp grace="unacc" attach="pre">
<note dur="8" oct="4" pname="b" accid.ges="n" />
</graceGrp>
<note dur="2" oct="4" pname="a" accid.ges="n" />
Perhaps @dur.ges
can be used to specify the performance duration of grace notes (or some other duration parameter, particularly if the duration is not a proportional duration)? By default @dur
will be taken from the adjacent regular note, and @dur.ges
can be used when it is another value. For the above example where 16th note duration should be stolen:
<note dur="4" oct="5" pname="e" accid.ges="n" />
<graceGrp grace="unacc" attach="pre">
<note dur="8" dur.ges="16" oct="5" pname="d" accid.ges="n" />
</graceGrp>
<note dur="4" oct="5" pname="c" accid.ges="n" />
<graceGrp grace="unacc" attach="pre">
<note dur="8" dur.ges="16" oct="4" pname="b" accid.ges="n" />
</graceGrp>
<note dur="2" oct="4" pname="a" accid.ges="n" />
This will minimize the need for interpretation that verovio or other performance rendering software would need in order to play MEI encodings.
Also note that verovio uses @dur.ges
for time alignment between notes in different layers/staves, Using grace notes to use @dur.ges
for performance rendering should be OK if verovio ignores that parameter for cross-layer/staff alignments.
The definition of unacc
on this page is interesting:
https://music-encoding.org/guidelines/v4/data-types/data.grace.html
Acciaccaturas are currently encoded as @grace="unacc"
, but this state would also fit the definition of Nachschläge? The main difference is that a Nachschlag is played in time (such as as a 16th note in the above example), while an acciaccatura is typically "as short as possible" (and would not change duration much if the tempo changes).
The new MIDI grace-note feature is great!
Here is an enhancement I think of while testing it:
The current implementation performs all of these like the last beat in the measure, with the accented grace note stealing the duration of an eighth note from the following quarter note. Preferably the stolen duration is equal to the visual duration of the grace note (so 32nd note on the the first beat, and 16th note on the second beat). Probably check that the stolen duration is no more than 1/2 of the duration of the following note (and use 1/2 duration if trying to take more than 1/2 duration).