abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

%%printtempo 0 doesn't consistently suppress tempo drawing

Open seisiuneer opened this issue 7 months ago • 2 comments

User reported that on both my tool and drawthedots that when setting

%%printtempo 0

there are cases where the tempo still gets drawn

The expectation is that once you set

%%printtempo 0

that no tempo marks would be drawn until a

%%printtempo 1

is encountered, and this should allow selective showing or hiding of tempo marks.

For example this ABC does hide the single Q: tag in the header:

X: 1 T: Cooley's C: Traditional R: Reel M: 4/4 L: 1/8 %%printtempo 0 Q: 1/4=90 K: Edor |:"Em"EBBA B2 EB|B2 AB dBAG|"D"F/E/D AD BDAD|F/E/D AD BAGF| "Em"EBBA B2 EB|B2 AB defg|"D"afge dBAF|1 DEFD "Em"E3D:|2 DEFD "Em"E2gf||

This one hides the header Q: but shows the one in the body:

X: 1 T: Cooley's C: Traditional R: Reel M: 4/4 L: 1/8 %%printtempo 0 Q: 1/4=90 K: Edor |:"Em"EBBA B2 EB|B2 AB dBAG|"D"F/E/D AD BDAD|F/E/D AD BAGF| Q: 1/2=90 "Em"EBBA B2 EB|B2 AB defg|"D"afge dBAF|1 DEFD "Em"E3D:|2 DEFD "Em"E2gf||

This one doesn't suppress them properly in the header:

X: 1 T: Cooley's C: Traditional R: Reel M: 4/4 L: 1/8 %%printtempo 0 Q: "FOO" Q: 1/4=90 K: Edor |:"Em"EBBA B2 EB|B2 AB dBAG|"D"F/E/D AD BDAD|F/E/D AD BAGF| "Em"EBBA B2 EB|B2 AB defg|"D"afge dBAF|1 DEFD "Em"E3D:|2 DEFD "Em"E2gf||

This one hides the numeric Q: but draws the text one:

X: 1 T: Cooley's C: Traditional R: Reel M: 4/4 L: 1/8 %%printtempo 0 Q: 1/4=90 Q: "FOO" K: Edor |:"Em"EBBA B2 EB|B2 AB dBAG|"D"F/E/D AD BDAD|F/E/D AD BAGF| "Em"EBBA B2 EB|B2 AB defg|"D"afge dBAF|1 DEFD "Em"E3D:|2 DEFD "Em"E2gf||

And this one draws all of them:

X: 1 T: Cooley's C: Traditional R: Reel M: 4/4 L: 1/8 %%printtempo 0 Q: "FOO" Q: 1/4=90 K: Edor |:"Em"EBBA B2 EB|B2 AB dBAG|"D"F/E/D AD BDAD|F/E/D AD BAGF| Q: 1/2=90 "Em"EBBA B2 EB|B2 AB defg|"D"afge dBAF|1 DEFD "Em"E3D:|2 DEFD "Em"E2gf||

Walking the code, I can see that there is some handling for the header with the tempo and tempo.suppress based on the multilinevars, but that Q: tags later encountered are drawn no matter what directly as a result of encountering a tempo element with no filtering.

In the header handling, not sure why having a text Q: tag before the numeric one causes both to get drawn, but reversing the order causes the numeric one to be hidden, but the text one to be drawn.

I couldn't see a clean way to get the parser tempo.suppress info down to the music engraver for the body cases.

seisiuneer avatar Jun 27 '24 16:06 seisiuneer