humdrum-tools / verovio-humdrum-viewer

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

semitone filter #881

Open derkveen opened 9 months ago

derkveen commented 9 months ago

The semitone filter often results in a red screen. Is there a way to use this filter more flexibly? For example, I couldn't find any errors in the following file, but the semitone filter doesn't work for this file.

**kern  **kern  **kern  **kern
*part1  *part1  *part1  *part1
*staff4 *staff3 *staff2 *staff1
*clefG2 *clefF4 *clefG2 *clefG2
*k[b-]  *k[b-]  *k[b-]  *k[b-]
*F: *F: *F: *F:
*M4/4   *M4/4   *M4/4   *M4/4
*met(c) *met(c) *met(c) *met(c)
=1  =1  =1  =1
16r 1r  2r  2r
16gLL   .   .   .
16f .   .   .
16e-XJJ .   .   .
16dLL   .   .   .
16c .   .   .
16B-    .   .   .
16AJJ   .   .   .
4G  .   16r 2g
.   .   16fLL   .
.   .   16e-X   .
.   .   16dJJ   .
*clefF4 *   *   *
16r .   4e- .
16cLL   .   .   .
16B-    .   .   .
16AJJ   .   .   .
=2  =2  =2  =2
[4G 1r  16r 2b-
.   .   16dLL   .
.   .   16e .
.   .   16f#XJJ .
16GLL]  .   [4g .
16F .   .   .
16E-X   .   .   .
16DJJ   .   .   .
8.CL    .   16gLL]  2a
.   .   16g .
.   .   16f#    .
16CJk   .   16eJJ   .
16DLL   .   [4f#    .
16A .   .   .
16d .   .   .
16cJJ   .   .   .
=3  =3  =3  =3
4Bn 4r  16f#LL] 2g
.   .   16f .
.   .   16e-X   .
.   .   16dJJ   .
16r 8cL [4e-    .
16GLL   .   .   .
16c 8cJ .   .
16E-XJJ .   .   .
4c  [4c 16e-LL] 2rb
.   .   16e-    .
.   .   16d .
.   .   16cJJ   .
4r  16cLL]  4d  .
.   16c .   .
.   16B-X   .   .
.   16AJJ   .   .
=4  =4  =4  =4
16r 4B- 2r  2rb
16GLL   .   .   .
16F .   .   .
16E-XJJ .   .   .
16DLL   4r  .   .
16C .   .   .
16BB-   .   .   .
16AAJJ  .   .   .
4GG 4G  16r 2g
.   .   16fLL   .
.   .   16e-X   .
.   .   16dJJ   .
4r  16r 4e- .
.   16cLL   .   .
.   16B-    .   .
.   16AJJ   .   .
!!pagebreak:original
=5  =5  =5  =5
16rD    1r  4B- 2rb
16GLL   .   .   .
16F .   .   .
16E-XJJ .   .   .
16DLL   .   4r  .
16E-    .   .   .
16D .   .   .
16CJJ   .   .   .
4r  .   16r 2dd
.   .   16fLL   .
.   .   16g .
.   .   16aJJ   .
16rD    .   [4b-    .
16B-LL  .   .   .
16A .   .   .
16GJJ   .   .   .
=6  =6  =6  =6
[4F#X   1r  16b-LL] 2cc
.   .   16b-    .
.   .   16a .
.   .   16gJJ   .
16F#LL] .   4a  .
16F#    .   .   .
16E .   .   .
16DJJ   .   .   .
[4G .   16aLL   2b-
.   .   16a .
.   .   16g .
.   .   16f#XJJ .
16GLL]  .   [4g .
16F#    .   .   .
16E .   .   .
16DJJ   .   .   .
=7  =7  =7  =7
4C#X    16r 4g] 2a
.   16ELL   .   .
.   16F .   .
.   16GJJ   .   .
8rBB    4A  16r .
.   .   16eLL   .
8C# .   16f .
.   .   16gJJ   .
[4D 16r 4f  2rb
.   16ALL   .   .
.   16B-    .   .
.   16cJJ   .   .
16DLL]  8d  8r  .
16E .   .   .
16F 8r  8f  .
16GJJ   .   .   .
=8  =8  =8  =8
4A  16dLL   4e  2rb
.   16d .   .
.   16c .   .
.   16B-JJ  .   .
16ALL   4c  8r  .
16B-    .   .   .
16A .   8e-X    .
16GJJ   .   .   .
4F#X    2r  16r 2a
.   .   16gLL   .
.   .   16f#X   .
.   .   16e-JJ  .
16r .   4d  .
16cLL   .   .   .
16B-    .   .   .
16AJJ   .   .   .
!!pagebreak:original
=9  =9  =9  =9
*^  *   *   *
[4G 2ryy    1r  16r 2b-
.   .   .   16dLL   .
.   .   .   16e .
.   .   .   16f#XJJ .
16GLL]  .   .   [4g .
16A .   .   .   .
16G .   .   .   .
16FJJ   .   .   .   .
[4E-X   2ryy    .   16gLL]  2b-
.   .   .   16a .
.   .   .   16g .
.   .   .   16f#XJJ .
16E-LL] .   .   [4g .
16F .   .   .   .
16E-    .   .   .   .
16DJJ   .   .   .   .
=10 =10 =10 =10 =10
4C  2ryy    1r  16gLL]  2cc
.   .   .   16d .
.   .   .   16e .
.   .   .   16fJJ   .
16r .   .   4e  .
16B-LL  .   .   .   .
16A .   .   .   .
16GJJ   .   .   .   .
4F  2ryy    .   16r 2cc
.   .   .   16gLL   .
.   .   .   16a .
.   .   .   16b-JJ  .
16rD    .   .   4a  .
16E-XLL .   .   .   .
16D .   .   .   .
16CJJ   .   .   .   .
=11 =11 =11 =11 =11
4BB-    2ryy    1r  16r 2dd
.   .   .   16f#XLL .
.   .   .   16g .
.   .   .   16aJJ   .
16rD    .   .   4g  .
16ALL   .   .   .   .
16G .   .   .   .
16FJJ   .   .   .   .
4E  2ryy    .   16r 4dd
.   .   .   16b-LL  .
.   .   .   16a .
.   .   .   16gJJ   .
16rD    .   .   4a  [4cc
16GLL   .   .   .   .
16F#X   .   .   .   .
16EJJ   .   .   .   .
*v  *v  *   *   *
=12 =12 =12 =12
8.FL    16r 4a  4cc]
.   16A#XKL .   .
.   8dJ .   .
16FJk   .   .   .
8.GL    16dLL   8g  4b-
.   16dJ    .   .
.   8gJ 8r  .
16GGJk  .   .   .
4C  16r 8.gL    2a
.   16EKL   .   .
.   8A#J    .   .
.   .   16gJk   .
4D  16A#LL  8.fL    .
.   16A#    .   .
.   16Bn    .   .
.   16cJJ   16e-XJk .
!!pagebreak:original
=13 =13 =13 =13
2G  4Bn 16dLL   2g
.   .   16f .
.   .   16e-X   .
.   .   16dJJ   .
.   16BLL   8.e-L   .
.   16BJ    .   .
.   8cJ .   .
.   .   16fJk   .
4GG 16cLL   2d  2rb
.   16c .   .
.   16B-X   .   .
.   16AJJ   .   .
16rD    4B- .   .
16ALL   .   .   .
16G .   .   .
16F#XJJ .   .   .
=14 =14 =14 =14
16GLL   4G  2r  2r
16E-X   .   .   .
16D .   .   .
16CJJ   .   .   .
16r 4D  .   .
16CLL   .   .   .
16BB-   .   .   .
16AAJJ  .   .   .
4GG 2r  4r  4r
12GL    .   [4b-    4dd
12g .   .   .
12fJ    .   .   .
=15 =15 =15 =15
12eL    1r  4b-]    2cc
12D .   .   .
12EJ    .   .   .
12F#XL  .   4a  .
12EE    .   .   .
12FF#XJ .   .   .
12GGL   .   4a  2b-
12G .   .   .
12F#J   .   .   .
12EL    .   4g  .
12e .   .   .
12dJ    .   .   .
=16 =16 =16 =16
12cL    1r  4g  2a
12B-    .   .   .
12cJ    .   .   .
12dL    .   4f  .
12F .   .   .
12DJ    .   .   .
12B-L   .   12cL    12eL
12A .   12d 12f
12GJ    .   [12eJ   [12gJ
6A  .   12eL]   12gL]
.   .   12d 12f
12AA    .   12cJ    12eJ
!!pagebreak:original
=17 =17 =17 =17
12DL    1r  4d  4f
12F .   .   .
12EJ    .   .   .
12DL    .   4r  4rb
12F .   .   .
12AJ    .   .   .
12dL    .   4r  4r
12F .   .   .
12AJ    .   .   .
12B-L   .   4b- 4dd
12g .   .   .
12fJ    .   .   .
=18 =18 =18 =18
*   *^  *   *
12c#XL  4rc 2r  4g  2a
12A .   .   .   .
12c#J   .   .   .   .
12r 4d  .   2f  .
12FL    .   .   .   .
12DJ    .   .   .   .
12r 4d  4F  .   2r
12DL    .   .   .   .
12BB-J  .   .   .   .
8GG 12d 12B-L   4e  .
.   6c  12A .   .
8r  .   .   .   .
.   .   12GJ    .   .
*   *v  *v  *   *
=19 =19 =19 =19
*M4/4   *M4/4   *M4/4   *M4/4
*met(c) *met(c) *met(c) *met(c)
4DD 1r  1r  4r
2.r .   .   8.aL
.   .   .   16aJk
.   .   .   8.b-L
.   .   .   16b-Jk
.   .   .   8.ccL
.   .   .   16ccJk
=20 =20 =20 =20
1r  1r  4r  4dd
.   .   8.dL    8rdd
.   .   .   8dd
.   .   16dJk   .
.   .   8.e-XL  8.ccL
.   .   16e-Jk  16ccJk
.   .   8.fL    8.aL
.   .   16fJk   16aJk
=21 =21 =21 =21
1r  1r  4g  8.b-L
.   .   .   16ccJk
.   .   8.gL    [4dd
.   .   16dJk   .
.   .   [4e-X   8ddL]
.   .   .   16ccL
.   .   .   16b-JJ
.   .   8e-L]   [4cc
.   .   16dL    .
.   .   16cJJ   .
!!pagebreak:original
=22 =22 =22 =22
1r  4r  4d  8ccL]
.   .   .   16b-L
.   .   .   16aJJ
.   8.GL    8.gL    8.b-L
.   16GJk   16gJk   16b-Jk
.   8.AL    8.fL    8.ccL
.   16AJk   16fJk   16ccJk
.   8.BnL   8.e-XL  8.ddL
.   16BJk   16dJk   16ddJk
=23 =23 =23 =23
4r  8.cL    8.eL    8.gL
.   16cJk   16eJk   16gJk
8.AAL   8.cL    8.fL    8.aL
16AAJk  16cJk   16fJk   16aJk
8.BB-L  8.dL    4f  8.gL
16BB-Jk 16dJk   .   16aJk
8.CL    4c  4e  8.b-L
16CJk   .   .   16ccJk
=24 =24 =24 =24
8.FFL   4f  1r  4a
16CJk   .   .   .
4F  8.fL    .   2.r
.   16fJk   .   .
8.GL    8.e-XL  .   .
16GJk   16e-Jk  .   .
8.AL    8.dL    .   .
16AJk   16cJk   .   .
=25 =25 =25 =25
8rD 4B- 1r  4d
8D  .   .   .
8.DDL   8r  .   8rb
.   8B- .   8d
16DDJk  .   .   .
8.EEL   8.B-L   .   4c
16EEJk  16B-Jk  .   .
8.FF#XL 8.AL    .   8r
.   .   .   8c
16FF#Jk 16AJk   .   .
=26 =26 =26 =26
2GG 8.GL    1r  8.B-L
.   16FJk   .   16dJk
.   8.E-XL  .   8.gL
.   16DJk   .   16fJk
4C  8.r .   8.eL
.   16B-    .   16gJk
8.r 8.AL    .   8.ccL
16C 16GJk   .   16b-Jk
!!pagebreak:original
=27 =27 =27 =27
8.DL    4F#X    2r  8.aL
16CJk   .   .   16aJk
8.BB-L  8.GL    .   8.ddL
16AAJk  16F#Jk  .   16ccJk
4GG 4G  8.r 4b-
.   .   16d .
4r  8.r [4g 4r
.   16G .   .
=28 =28 =28 =28
2rD 4e-X    8.gL]   2.r
.   .   16aJk   .
.   8.dL    4b- .
.   16e-Jk  .   .
8rD 4f#X    4a  .
16rD    .   .   .
16D .   .   .
8rD 4d  4f  4a
16rD    .   .   .
16DD    .   .   .
=29 =29 =29 =29
8.GGL   4d  4g  4b-
16DJk   .   .   .
8.GL    4r  8.r 4b-
16FJk   .   16d .
8.E-XL  4r  8.gL    [4cc
16CJk   .   16b-Jk  .
8.r 4F  4a  8.ccL]
16FF    .   .   16ee-XJk
=30 =30 =30 =30
4BB-    8.r 4b- 4dd
.   16F .   .
8.r 4B- 8.fL    4dd
16BB-   .   16gJk   .
4F  8.r 4a  4cc
.   16e-X   .   .
(8.GL   4d  4g  4b-
48FLL   .   .   .
48E .   .   .
48DJJJ) .   .   .
!!pagebreak:original
=31 =31 =31 =31
*   *   *^  *
4C  8r  8rb 2rG 2a
.   8G  8e-XL   .   .
4D  4F#X    8d  .   .
.   .   8cJ .   .
4BBn    2G  8gL 4d  8r
.   .   8fJ .   4dd
4C  .   4e- 4rF .
.   .   .   .   8cc
*   *   *v  *v  *
=32 =32 =32 =32
1GG 1G  1d  1bn
==  ==  ==  ==
*-  *-  *-  *-
!!!system-decoration: {(s1,s2,s3,s4)}
craigsapp commented 9 months ago

I suspect it is spine splits, and also more likely spine merges which are causing the problem. With music without splits/merges the semitones filter is working;

https://verovio.humdrum.org/?file=chorales/chor001.krn&filter=semitones%20%7C%20shed%20-e%20s%2Ftti%2Ftext-tti%2FX

Screenshot 2024-02-12 at 12 18 02

So I will check out what the problem is (I created that filter a while ago and haven't used it since, so I have never noticed that problem).

On the command-line terminal, the output of semitones is visible (VHV suppresses displaying it since it had invalid syntax):

humcat h://chorales/chor001.krn | semitones | rid -G

Output:

**kern  **tti   **kern  **tti   **kern  **tti   **kern  **tti
*ICvox  *ICvox  *ICvox  *ICvox  *ICvox  *ICvox  *ICvox  *ICvox
*Ibass  *Ibass  *Itenor *Itenor *Ialto  *Ialto  *Isoprn *Isoprn
*I"Bass *I"Bass *I"Tenor    *I"Tenor    *I"Alto *I"Alto *I"Soprano  *I"Soprano
*>[A,A,B]   *>[A,A,B]   *>[A,A,B]   *>[A,A,B]   *>[A,A,B]   *>[A,A,B]   *>[A,A,B]   *>[A,A,B]
*>norep[A,B]    *>norep[A,B]    *>norep[A,B]    *>norep[A,B]    *>norep[A,B]    *>norep[A,B]    *>norep[A,B]    *>norep[A,B]
*>A *>A *>A *>A *>A *>A *>A *>A
*clefF4 *clefF4 *clefGv2    *clefGv2    *clefG2 *clefG2 *clefG2 *clefG2
*k[f#]  *k[f#]  *k[f#]  *k[f#]  *k[f#]  *k[f#]  *k[f#]  *k[f#]
*G: *G: *G: *G: *G: *G: *G: *G:
*M3/4   *M3/4   *M3/4   *M3/4   *M3/4   *M3/4   *M3/4   *M3/4
*MM100  *MM100  *MM100  *MM100  *MM100  *MM100  *MM100  *MM100
4GG 12  4B  0   4d  0   4g  0
=1  =1  =1  =1  =1  =1  =1  =1
4G  -3  4B  1   4d  2   2g  7
4E  2   8cL -1  4e  -2  .   .
.   .   8BJ -2  .   .   .   .
4F# 1   4A  -2  4d  0   4dd -3
=2  =2  =2  =2  =2  =2  =2  =2
4G  -5  4G  -1  2d  -3  4.b -2
4D  2   4F# 1   .   .   .   .
.   .   .   .   .   .   8a  -2
4E  -4  4G  5   4B  5   4g  0
=3  =3  =3  =3  =3  =3  =3  =3
4C  -1  8cL -1  8eL -2  4.g 2
.   .   8BJ 1   8d  2   .   .
8BBL    -2  4c  2   8e  2   .   .
8AAJ    -2  .   .   8f#J    1   8a  2
4GG 7   4d  0   4g  -1  4b  -2
=4  =4  =4  =4  =4  =4  =4  =4
2D; -7  2d; 0   2f#;    1   2a; 2
4GG -1  4d  -5  4g  -5  4b  3
=5  =5  =5  =5  =5  =5  =5  =5
4FF#    1   4A  2   4d  2   2dd -2
4GG 2   4B  1   4e  2   .   .
4AA 2   4c  2   4f# 1   4cc -1
=6  =6  =6  =6  =6  =6  =6  =6
4BB 1   4d  2   2g  -1  4b  -2
4C  2   4e  -2  .   .   2a  -2
4D  -7  8dL -2  4f# -4  .   .
.   .   8cJ -1  .   .   .   .
=7  =7  =7  =7  =7  =7  =7  =7
2GG;    0   2B; 3   2d; 5   2g; 4
=:|!    =:|!    =:|!    =:|!    =:|!    =:|!    =:|!    =:|!
*>B *>B *>B *>B *>B *>B *>B *>B
4GG 0   4d  0   [4g -1  4b  0
=8  =8  =8  =8  =8  =8  =8  =8
4GG 2   4d  -2  8gL]    .   4b  1
.   .   .   .   8f#J    -2  .   .
4AA 2   4c  -1  8eL 2   4cc 2
.   .   .   .   8f#J    1   .   .
4BB 0   8BL -2  [4g 2   4dd 0
.   .   8AJ 2   .   .   .   .
=9  =9  =9  =9  =9  =9  =9  =9
4.BB    -2  8BL 1   8gL]    .   4.dd    -2
.   .   8cJ 2   8aJ -2  .   .
.   .   4d  0   8gL -1  .   .
8AA -2  .   .   8f#J    1   8cc -1
4GG 7   4d  0   4g  -1  4b  -2
=10 =10 =10 =10 =10 =10 =10 =10
2D; 2   2d; -3  2f#;    -2  2a; -2
[4E -2  4B  -4  4e  0   4g  4
=11 =11 =11 =11 =11 =11 =11 =11
4E] .   4G  4   4e  2   2b  1
4D  -2  4B  5   8f#L    1   .   .
.   .   .   .   8gJ 2   .   .
4C  -1  4e  -2  4a  0   4cc 2
=12 =12 =12 =12 =12 =12 =12 =12
4.BB    1   2d  0   4a  -2  2dd -2
.   .   .   .   4.g -1  .   .
8C  2   .   .   .   .   .   .
4D  -7  4d  0   .   .   4cc -1
.   .   .   .   8f# 1   .   .
=13 =13 =13 =13 =13 =13 =13 =13
8GGL    2   2.d -2  2g  -2  2.b -4
8AAJ    2   .   .   .   .   .   .
4BB -4  .   .   .   .   .   .
4GG 5   .   .   4f  -1  .   .
=14 =14 =14 =14 =14 =14 =14 =14
2C; -5  2c; 2   2e; 3   2g; 4
4GG -1  4d  0   4g  2   4b  3
=15 =15 =15 =15 =15 =15 =15 =15
4FF#    1   8dL -2  4.a -2  2dd -2
.   .   8cJ -1  .   .   .   .
4GG 2   4B  1   .   .   .   .
.   .   .   .   8g  -1  .   .
4AA 2   4c  2   4f# 1   4cc -1
=16 =16 =16 =16 =16 =16 =16 =16
4BB -4  2d  0   2g  -1  2b  -2
4GG 7   .   .   .   .   .   .
4D  2   8dL -2  [4f#    -2  4a  -2
.   .   8cJ -1  .   .   .   .
=17 =17 =17 =17 =17 =17 =17 =17
8EL -2  4B  1   8f#L]   .   4.g 2
8D  -2  .   .   8eJ 0   .   .
8C  -1  4c  2   8eL 2   .   .
8BB -2  .   .   8f#J    1   8a  2
8AA -2  4d  0   4g  -1  4b  -2
8GGJ    7   .   .   .   .   .   .
=18 =18 =18 =18 =18 =18 =18 =18
2D; 5   2d; 0   2f#;    1   2a; 2
[4G -1  4d  0   4g  2   4b  3
=19 =19 =19 =19 =19 =19 =19 =19
4G] .   2d  2   2a  -2  2dd -2
4F# -2  .   .   .   .   .   .
[4E -2  4e  0   8gL -1  4cc -1
.   .   .   .   8f#J    1   .   .
=20 =20 =20 =20 =20 =20 =20 =20
8EL]    .   2e  -2  2g  -1  4b  -2
8DJ -2  .   .   .   .   .   .
4C  2   .   .   .   .   2a  -2
4D  -7  8dL -2  4f# -4  .   .
.   .   8cJ -1  .   .   .   .
=21 =21 =21 =21 =21 =21 =21 =21
2GG;    .   2B; .   2d; .   2g; .
==  ==  ==  ==  ==  ==  ==  ==
*-  *-  *-  *-  *-  *-  *-  *-

Checking this output on the command line:

cat input.krn | semitones | rid -G | humdrum  | head

The first error is:

humdrum: ERROR 22: Exclusive interpretations do not match for designated
                   join spines in line 198, file STDIN.

Checking that line in the output:

Screenshot 2024-02-12 at 12 24 53

The problem is as I expect: There are four *v in a row, and the loose interpretation of these lines are to merge all four of the first spines into a single spine. But this merges **kern and **tti, which is bad. This line should be split into two lines with two separate merges for the the two spines. Not backwards compatible with the original Humdrum Toolkit, I could have VHV filters and conversion to notation not allow merging spines of two different data types. One related output option I could generate is creating **tti analysis data where as a single spine for all notes on the "staff" (all subspines of a given **kern spine, which would avoid spine splits and merges in the **tti data).