paulrosen / abcjs

javascript for rendering abc music notation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Hiding non musical elements (non width)

kasravi opened this issue · comments

I want to show only the notes (where the width of the space they occupy is proportional to their length, which is what is happening right now, if I'm not mistaken)
I've already figured out how to hide non musical elements (key, clef, ...) with CSS. but the space they occupy on the staff is still there. Is there any way I can remove the left over space as well?
My end goal is to have equal length bars, whether or not there are clef or key changes (cannot think of any other elements right now)

I think they won't be equal length bars anyway. That is, 4 eighth notes don't take up the same amount of space as one half note. It is somewhat logarithmic.

For your original question, I can't think of a way to have those elements in the music but not have them take up space. If you had an ABC string without those elements (that is, strip them out of the string) then it would meet that criteria, right? And you could do clef=none to remove the first clef. If you want the audio, then you could have a parallel ABC string that is complete that you use for that.

There is an option in the ABC spec for having equal width measures, but it isn't yet implemented in abcjs, unfortunately. I'd love to have it!

thanks @paulrosen, you're always helpful.

yes I'm already rendering it twice (I want to sow them greyed out in behind), I'll try to remove them from the string itself.

Thanks again!