Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better support for repeating notes #1365

Open
codefisher opened this issue Jun 15, 2017 · 12 comments
Open

better support for repeating notes #1365

codefisher opened this issue Jun 15, 2017 · 12 comments

Comments

@codefisher
Copy link

I am trying to do up some collects from a devotion specific to the Order of St. Paul the First hermit. The music uses "white notes" or cavum to indicate notes that repeat, I would like to do the same. The problems come in with how lines wrap. The music puts a new cavum at the beginning of every line, when the repeating notes spans more then one line. So I am looking for a way to input the notes so they are hidden unless they are this first note on the line. I realise that this might be a bit specific to be made into a GABC code, but maybe something could be done so a macro could be easily written for it.

The attached shows what I want, and it almost works except only when I manually break the lines in the gabc with 'z'. I would like it to work, and still display the same result with out the need to do so, so it easier to put the music in booklets of different sizes.

If you look at the macro what specially I need is something similar to \gre@lastoflinecount that gives the same values but for when a line has been automatically wrapped, and not manually with 'z'.

orationes-i.zip

This would also work better if \gresetnotes could be used, but changing the value multiple times does not seem to work.

Sorry if this is not clear. I had hoped to discuss this first on the mailing list, but that has been down for weeks...

@henryso
Copy link
Contributor

henryso commented Jun 18, 2017

@eroux, @rpspringuel Do you have any ideas how to support this on the TeX side? My TeX is not savvy enough to figure this one out, but if someone can push me along, I can add the appropriate support in the C code if necessary.

@codefisher We apologize for the disappearance of the mailing lists. We didn't know gna.org was disappearing and are in the process of setting up new lists. Letting subscribers of the old list know about the new list is the challenge here.

@antoniopessotti

This comment has been minimized.

@eroux
Copy link
Contributor

eroux commented Jun 19, 2017

I think it would be easier to understand with an image example, @codefisher can you please provide one?

@codefisher
Copy link
Author

@eroux Here is a pdf of what the code given in the first post should come out looking like. I can only get this working right now as said before if I manually put the line breaks in with 'z' which then limits how I use the file.

orationes-i.pdf

@rpspringuel
Copy link
Contributor

If \gresetnotes isn't working, it might be due to a scope problem, as the flag it manipulates is checked on every syllable. Adding a \global somewhere might fix that problem.

As far as I recall, there is nothing currently in the code that works like \gre@lastoflinecount except for automatic line breaks. However, it's probably possible to devise some sort of hook that could be inserted into \gre@localleftbox (where the line drawing commands reside) that could do something similar.

I'm going to have to think about this some more before coming up with a solution.

@eroux
Copy link
Contributor

eroux commented Jun 19, 2017

Well, there's nothing easy to make that work, I guess the easiest solution would be a post_linebreak_filtrer making some notes invisible, but that's not really straightforward to write if you're not familiar with that kind of things....

@henryso
Copy link
Contributor

henryso commented Jun 20, 2017

Riffing off of this discussion, what if there is something in gabc that means "show this glyph only if it's the first on a line?" This would generate a macro which calls into the Lua glyph numbering logic to determine if the glyph is the first on the line and show it only if that's the case. Otherwise it would render something invisible to which the glyph number may attach. The problem I see is the possibility of an unstable document if the score is too complex. Do you think that might work?

@eroux
Copy link
Contributor

eroux commented Jun 21, 2017

Well, I think this would be quite cumbersome to add something for this very specific use case in gabc... maybe some TeX/Lua code could be documented in the Tips and Tricks section of the website?

@codefisher
Copy link
Author

codefisher commented Jun 21, 2017 via email

@SrMariaRuth
Copy link

@codefisher I had the same problem while working at the new Antiphonale Monasticum project, I solved it this way (a poor trick, I admit, but...): after the first cavum in gabc score, I wrote remaining text without notes and, at the end of the line, I put {last-syllable}( z). So first gabc code in your score would be something like:
... De(g)fen(hr)de, quaesumus, Domine, Bea{ta}( z)

I know this is not a solution, but maybe it might help?

@codefisher
Copy link
Author

@SrMariaRuth that was my first solution. It works but again you have to put the 'z' in manually. I am looking for away to get away from it.

@rpspringuel
Copy link
Contributor

I've just done some testing and hooking into the drawing of the lines (\localleftbox) does not appear to work. The first syllable of the new line appears to be "drawn" (and thus the decision on the notes visibility) before the line breaking decision which triggers the drawing of the lines is made. This is probably going to take a post_linebreak_filter as suggested by @eroux above.

I'm adding the Lua tag to the issue, but will leave the TeX tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants