humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

Tacet full-measure rests #678

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

In the score: https://verovio.humdrum.org/?file=https%3A%2F%2Fdata.nifc.humdrum.org%2F18xx%3A997.krn

There are tacet parts with no time signature encoded but full-measure rests are. These are converted into <mRest> in MEI. Verovio has problems with the no-time-signature mrests and assumes that they are 4 quarter notes long (which is a problem for MIDI playback and some spacing problems at the ends of measure in 2/4 for example).

Several solutions could be done, such as automatically add a time signature for these tacet parts.

Also, it would be useful to add a *tacet interpretation which would allow the tacet parts to not be shown by default in the score.

Test example:

https://verovio.humdrum.org/?file=https%3A%2F%2Fdata.nifc.humdrum.org%2F18xx%3A997.krn

Screen Shot 2022-04-12 at 10 17 36 AM
craigsapp commented 2 years ago

One solution is implemented with commit https://github.com/rism-digital/verovio/commit/d74f3aac04071f0b539f4ae3e40109fd44b0acc0

Adding a *tacet interpretation before the first data line in the file will cause that staff to not be printed (regardless of whether or not there are notes in the spine). This is an easy way to fix the MIDI playback since the staff with the unknown time signatures are no longer converted to MEI, so no mRests with an unknown time signature are present.

Screen Shot 2022-04-12 at 9 33 20 PM

If you want to see the tacet staves in the full score, then apply the filter:

shed -e s/^tacet$/Xtacet/I
Screen Shot 2022-04-12 at 9 36 09 PM
craigsapp commented 2 years ago

To make <meterSig> invisible, use @form="invis".

craigsapp commented 2 years ago

If all staves in score contain *tacet, then do not suppress them (otherwise there is nothing to print). This is fixed with commit https://github.com/rism-digital/verovio/commit/13297e4d3edd486167bf6a2fac866938be14087a

Screen Shot 2022-04-12 at 10 16 24 PM

If you need to see individual empty measures in the extracted tacet part, then use kernview -v 10:

Screen Shot 2022-04-12 at 10 16 52 PM

There is also a complication if you use extract -k 11 since this system does not ignore the tacet staves below the extracted staff.

craigsapp commented 2 years ago

Commit https://github.com/rism-digital/verovio/commit/c94157811cd5b6a8a17f0412950da0e458f02790 should fix the problem: The time signature will be monitored when adding an mRest in the MEI conversion. When the mRest does not have the same duration as the time signature, then it will be converted to a regular rest. For this particular test case there is no time signature, therefore 4/4 is presumed (matching the assumption of verovio for mRests). Since the real time signature is 2/4, the 2ryy does match the (incorrect) assumed duration of 1ryy, so the rest is prevented from becoming an mRest.

This solution avoids the need to encode time signatures in a tacet part. A current limitation is that the full-measure rest has to be printable as a single rest (so cannot handle 5/8, 7/8 and similar time signatures for now).

After the fix, the MIDI playback does not pause at the end of each measure due to mRests trying to overfill the 2/4 measures. Also there is no extra space added to the ends of the music due to the same problem.

Screen Shot 2022-04-13 at 6 46 00 AM
Click to view MEI conversion ```xml Et incarnatus Verovio

Transcoded from Humdrum

Encoded by: Andrzej Borzym

Et incarnatus Et incarnatus Raszek, Wacław Raszek, Wacław ureference SEGMENT pl-cz--iii-553--001-004_raszek-waclaw--missa-in-f-et-incarnatus.krn reference cenid 18xx:997 reference COM Raszek, Wacław reference COM-rismid pe30020314 reference CDT <1848->1848 reference CNT reference OPR Missa in F reference OTL Et incarnatus reference OMV 004 reference PDT 1829 reference AGN Sacred; Mass reference SMS-siglum PL-CZ reference SMS-shelfmark III-553 reference SMS-shelfwork 001-004 M reference SMS-variant reference SMS-altvar reference NIFC-rismid 300001048 reference URL-scan http://repozytorium.nifc.pl/skany/pl-cz-nut--iii-553 reference ONB-nifc UWAGA: części Mszy: Kyrie, Gloria, Credo, Et incarnatus, Et resurrexit, Sanctus, Pleni sunt, Benedictus, Agnus Dei, Dona nobis reference key d reference system-decoration [(g1)][(g2)][(g3)][(g4)]<s12> reference RDF**kern > = above reference RDF**kern < = below reference RDF**kern | = vertical stroke reference RDF**dynam fp = "fp." reference RDF**dynam rf = "rf." reference RDF**dynam p = "p." reference RDF**dynam pp = "pp." reference RDF**dynam f = "f." reference ENC Andrzej Borzym reference END 2020-09-15 reference AIN 1 alto 1 bass 2 clars 2 cor 1 organ 1 soprn 1 tenor 1 viola 2 violn reference ENC Andrzej Kubiczek reference END 2022-01-30 ureference SEGMENT pl-cz--iii-553--001-004_raszek-waclaw--missa-in-f-et-incarnatus.krn reference cenid 18xx:997 reference COM Raszek, Wacław reference COM-rismid pe30020314 reference CDT <1848->1848 reference CNT reference OPR Missa in F reference OTL Et incarnatus reference OMV 004 reference PDT 1829 reference AGN Sacred; Mass reference SMS-siglum PL-CZ reference SMS-shelfmark III-553 reference SMS-shelfwork 001-004 M reference SMS-variant reference SMS-altvar reference NIFC-rismid 300001048 reference URL-scan http://repozytorium.nifc.pl/skany/pl-cz-nut--iii-553 reference ONB-nifc UWAGA: części Mszy: Kyrie, Gloria, Credo, Et incarnatus, Et resurrexit, Sanctus, Pleni sunt, Benedictus, Agnus Dei, Dona nobis reference key d
Et incarnatus     Wacław Raszek 1848–48 cl 1 in B cl 2 in B cor 1 in F cor 2 in F S A T B vl 1 vl 2 a-vla org
Et in car Et in car Et in Car Et in car p Andante Largo. p Largo. Et in Carnatus Tacet. Et in Carnatus Tacet. Largo. p Largo. p p Tutti Andante. Largo. Tu: Largo. pia. p fp p Largo. p Adagio. na tus est de na tus est de na tus est de na tus est de rf spi ri tu Spi ri tu Spi ri tu spi ri tu san cto San cto San cto san cto P S Ex Ma ex Ma ex Ma ex Ma ri  a ri  a ri  a ri  a Vir gi Vir gi Vir gi Vir gi ne et ne et ne et ne et e ho mo ho mo ho mo ho mo rf P S fa ctus fa ctus fa ctus fa ctus est est est est P Cru ci Cru ci Cru ci Cru ci fp for. f f fp fp pf. P P fi xus fi xus fi xus fi xus fp fp fp S S S S S pf.  E ti am pro  e ti am pro  e ti am pro  E ti am pro fp fp fp pf. S P S S no bis sub no bis sub no bis sub no bis sub fp fp fp pf. Pon ti Pon ti Pon ti Pon ti fp fp fp pf. P  o Pi  o Pi  o Pi  o Pi fp fp fp pf. P P la la la la fp fp fp pf. P to to to to fp S fp fp pf. P P paſ sus pa sus paſ sus paſ sus fp S fp fp P pf. et se et se Et se et se fp fp P fp P pf. pul tus pul tus pul tus pul tus fp P fp P se pul tus se pul tus se pul tus se pul tus P fp fp est est est est p fp P pedal. se se se se S pp p pp pp pul tus pul tus pul tus pul tus P P est. est. est. est. pp P cres. P Verte 1. S
```