verovio-humdrum-viewer
verovio-humdrum-viewer copied to clipboard
Adjust rhythms of passages filtered with `yank`
This is related to https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/779.
I'm filtering passages marked manually as cadences (!! cadence start/end
) with the yank
command.
Is it possible to fix the output by yank
so the result becomes a valid kern score? At the beginning there are beats missing when a voice begins with a null token. At the end there are beats missing when a voice has a longer note duration than the other voices (note duration is longer than the duration of the last line/slice when comparing with beat -p -d -n -u 1
).
I just posted a similar issue for the myank
filter: https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/780. Would it be a better solution not to fix the yank
command but implement this feature into the myank
filter and support not only measure range selection but also allow to pass line ranges (e.g. myank -l 181-187
)?
Examples
Source file: https://verovio.humdrum.org/?file=https://raw.githubusercontent.com/WolfgangDrescher/lassus-geistliche-psalmen/master/kern/01-beatus-vir.krn (comments with the cadences are not yet commited)
Missing durations at end of yanked passage
yank -l -r 181-187
**kern **text **kern **text **kern **text
*staff3 *staff3 *staff2 *staff2 *staff1 *staff1
*Ivox * *Ivox * *Ivox *
*I"Bassus * *I"Tenor * *I"Cantus *
*I'B * *I'T * *I'C *
*clefC3 * *clefC2 * *clefG2 *
*k[] * *k[] * *k[] *
*C:ion * *C:ion * *C:ion *
*M2/1 * *M2/1 * *M2/1 *
*met(C|) * *met(C|) * *met(C|) *
*MM180 * *MM180 * *MM180 *
* * * * * *ij
* * * * * *Xij
* * * *ij * *
1r . 2f weiß 4a .
. . . . 4b .
. . 2e zu 1cc .
1G zu 1d spot- . .
. . . . 2b zu
=27 =27 =27 =27 =27 =27
2.A spot- 2c ten/ 2.cc spot-
*- *- *- *- *- *-
Expected output
**kern **text **kern **text **kern **text
*staff3 *staff3 *staff2 *staff2 *staff1 *staff1
*Ivox * *Ivox * *Ivox *
*I"Bassus * *I"Tenor * *I"Cantus *
*I'B * *I'T * *I'C *
*clefC3 * *clefC2 * *clefG2 *
*k[] * *k[] * *k[] *
*C:ion * *C:ion * *C:ion *
*M2/1 * *M2/1 * *M2/1 *
*met(C|) * *met(C|) * *met(C|) *
*MM180 * *MM180 * *MM180 *
* * * * * *ij
* * * * * *Xij
* * * *ij * *
1r . 2f weiß 4a .
. . . . 4b .
. . 2e zu 1cc .
1G zu 1d spot- . .
. . . . 2b zu
=27 =27 =27 =27 =27 =27
2.A spot- 2c ten/ 2.cc spot-
. . 4s . . .
*- *- *- *- *- *-
Missing durations at beginning (and end) of yanked passage
yank -l -r 49-55
**kern **text **kern **text **kern **text
*staff3 *staff3 *staff2 *staff2 *staff1 *staff1
*Ivox * *Ivox * *Ivox *
*I"Bassus * *I"Tenor * *I"Cantus *
*I'B * *I'T * *I'C *
*clefC3 * *clefC2 * *clefG2 *
*k[] * *k[] * *k[] *
*C:ion * *C:ion * *C:ion *
*M2/1 * *M2/1 * *M2/1 *
*met(C|) * *met(C|) * *met(C|) *
*MM180 * *MM180 * *MM180 *
* * * * * *ij
2c . . . 4g der
. . . . 4a .
=6 =6 =6 =6 =6 =6
1G mann/ 1d der 4b .
. . . . 4cc .
. . . . 2b .
2r . 1c mann/ 2cc mann/
*- *- *- *- *- *-
Expected output
**kern **text **kern **text **kern **text
*staff3 *staff3 *staff2 *staff2 *staff1 *staff1
*Ivox * *Ivox * *Ivox *
*I"Bassus * *I"Tenor * *I"Cantus *
*I'B * *I'T * *I'C *
*clefC3 * *clefC2 * *clefG2 *
*k[] * *k[] * *k[] *
*C:ion * *C:ion * *C:ion *
*M2/1 * *M2/1 * *M2/1 *
*met(C|) * *met(C|) * *met(C|) *
*MM180 * *MM180 * *MM180 *
* * * * * *ij
2c . 2e] . 4g der
. . . . 4a .
=6 =6 =6 =6 =6 =6
1G mann/ 1d der 4b .
. . . . 4cc .
. . . . 2b .
2r . 1c mann/ 2cc mann/
2s . . . 2s .
*- *- *- *- *- *-
Interestingly, it is possible to render the invalid kern file with verovio, even when the VHV has no output:


The problems described in https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/780 also occur here.
I just posted a similar issue for the myank filter: https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/780. Would it be a better solution not to fix the yank command but implement this feature into the myank filter and support not only measure range selection but also allow to pass line ranges (e.g. myank -l 181-187)?
Yes, yank
is written in AWK which I can read but not write (so it is difficult for me to enhance awk scripts).
I startet a PR as a draft to add line range selection to myank
in https://github.com/craigsapp/humlib/pull/55. Probably not the best solution, but it's a start. Any feedback welcome.