Re: invisible rest that takes no horizontal space
On 6/18/10 4:08 PM, Arle Lommel wrote: Dmytro, how well defined are the contexts where these occur? If the patterns are well enough defined, you could probably automate all the replacements with \partial by using a regular expression across all the files that is centered on looking for the s2 sorts of things. Whether it would work would really depend on how predictable these things would be. It would be much simpler if you were using bar checks as then there would be something in the pattern to anchor the search on, but your example d2 s2 \bar ":|:" could be accounted for with something like Search string: ([a-g](?:is|es)?2) s2 \\bar ":\|:" Replacement string: \\partial 2\r\1 \\bar ":|:" [...] Where it would break down is if these partial measures are variable in length or if you have variable numbers of notes before the spacer, in which case it might not work. [...] Which is the case. I'm dealing with quite messy 18th century manuscripts. Thanks for thinking along with me, but it seems not possible to escape from some computing with note and rest durations in order to insert the \partial command at the right place and with the right duration. best, Peter ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
> On 6/18/10 12:32 PM, Dmytro O. Redchuk wrote: >> Why not: >> % [...] >> d4. e8 fis4 e | >> \partial 2 >> d2 \bar ":|:" >> fis2 g | >> % [...] >> > > Yes. That would be the solution if I could start from scratch. The > problem is that I have more than 1000 melodies in which the > invisible rest is used instead of \partial. We do not have the > resources to change them all. Dmytro, how well defined are the contexts where these occur? If the patterns are well enough defined, you could probably automate all the replacements with \partial by using a regular expression across all the files that is centered on looking for the s2 sorts of things. Whether it would work would really depend on how predictable these things would be. It would be much simpler if you were using bar checks as then there would be something in the pattern to anchor the search on, but your example d2 s2 \bar ":|:" could be accounted for with something like Search string: ([a-g](?:is|es)?2) s2 \\bar ":\|:" Replacement string: \\partial 2\r\1 \\bar ":|:" Depending on your environment, you might have to modify the strings to match your flavor of regex. I've tested this pattern and it accounts for your test case. Where it would break down is if these partial measures are variable in length or if you have variable numbers of notes before the spacer, in which case it might not work. If there is anything that indicates the measure bar line location that starts the partial measure, it should be possible (even if that something is just a new line). If you aren't comfortable with regex and would like me to look at some examples to see if you could automate the replacements, let me know off list and I may be able to help if you want to see if it's possible to fix these that way. -Arle ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Fri 18 Jun 2010, 15:44 Peter Van Kranenburg wrote: > It does. > > I got the bar number printed using a little hack: > > stopThisMeasure = \applyContext > #(lambda (x) > (ly:context-set-property! > (ly:context-property-where-defined x 'measurePosition) > 'measurePosition > (ly:moment-sub (ly:context-property x 'measureLength) > (ly:make-moment 1 128) ))) > > then "\stopThisMeasure s128" has the desired effect. Probably > because the measure is ended in the normal way. Still some > horizontal space is inserted by this, but it is minimal because of > the 128th rest. I can live with that. I do believe displaying bar number can be achieved in a better way, but don't believe i can help with this .) Well, i even didnt manage to get automatic accidentals appear correctly :O( (So, this means, everything is ahead so far!-) Lilypond is great. -- Dmytro O. Redchuk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 6/18/10 3:19 PM, Dmytro O. Redchuk wrote: I've found http://lsr.dsi.unimi.it/LSR/Snippet?id=333 and tried this: %-8<- stopThisMeasure = \applyContext #(lambda (x) (ly:context-set-property! (ly:context-property-where-defined x 'measurePosition) 'measurePosition (ly:context-property x 'measureLength))) \relative c'' { \override Score.BarNumber #'break-visibility = #all-visible \time 3/4 d4. e8 fis4 | d4 \stopThisMeasure \bar ":|:" fis2 g4 | } %-8<- I actually don't understand how it works .) And whether it does at all .) It seems it does what's you are looking for, but i am not sure. Well, bar numbers increase but not shown, i would like to know how to workaround this, but can not look for that any further now. It does. I got the bar number printed using a little hack: stopThisMeasure = \applyContext #(lambda (x) (ly:context-set-property! (ly:context-property-where-defined x 'measurePosition) 'measurePosition (ly:moment-sub (ly:context-property x 'measureLength) (ly:make-moment 1 128) ))) then "\stopThisMeasure s128" has the desired effect. Probably because the measure is ended in the normal way. Still some horizontal space is inserted by this, but it is minimal because of the 128th rest. I can live with that. Thanks a lot! Peter Hope, it will be useful for you, and/or someone more knowledgeable will help you :-) Sorry for the noise. best, Peter Not tested at all, sorry .) ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Fri 18 Jun 2010, 14:57 Peter Van Kranenburg wrote: > On 6/18/10 2:10 PM, Dmytro O. Redchuk wrote: > >Looks like " " would do. > > > > Only for meters like 4/4 or 2/2. Not for meters like 3/4 or 6/8. > > So the question remains, how to set Timing.measurePosition to the > value of Timing.measurelength. I've found http://lsr.dsi.unimi.it/LSR/Snippet?id=333 and tried this: %-8<- stopThisMeasure = \applyContext #(lambda (x) (ly:context-set-property! (ly:context-property-where-defined x 'measurePosition) 'measurePosition (ly:context-property x 'measureLength))) \relative c'' { \override Score.BarNumber #'break-visibility = #all-visible \time 3/4 d4. e8 fis4 | d4 \stopThisMeasure \bar ":|:" fis2 g4 | } %-8<- I actually don't understand how it works .) And whether it does at all .) It seems it does what's you are looking for, but i am not sure. Well, bar numbers increase but not shown, i would like to know how to workaround this, but can not look for that any further now. Hope, it will be useful for you, and/or someone more knowledgeable will help you :-) Sorry for the noise. > > best, > Peter > > >Not tested at all, sorry .) -- Dmytro O. Redchuk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 6/18/10 2:10 PM, Dmytro O. Redchuk wrote: Is it possible to set the measurePosition to the measureLength manually? I am lacking lisp skills. How to access Timing.measurelength? This does not work: \set Timing.measurePosition = Timing.measureLength Looks like " " would do. Only for meters like 4/4 or 2/2. Not for meters like 3/4 or 6/8. So the question remains, how to set Timing.measurePosition to the value of Timing.measurelength. best, Peter Not tested at all, sorry .) P. So, what I am looking for is a simple solution to prevent the invisible rest (s) from taking horizontal space. Then we have at least output that is visually more acceptable. best, Peter -- http://www.meertens.knaw.nl/cms/en http://www.musical-style-recognition.net/ http://www.lodebar.nl/pvk Visiting Address: Meertens Instituut, Room 0.54 Joan Muyskenweg 25; 1096 CJ Amsterdam; Netherlands Postal Address: Postbus 94264; 1090 GG Amsterdam; Netherlands Tel: +31 (0)20 4628507 ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Fri 18 Jun 2010, 13:43 Peter Van Kranenburg wrote: > From the reference: > > - > measurePosition > The point within the measure where we currently are. This quantity > is reset by subtracting measureLength whenever measureLength is > reached or exceeded. When that happens, currentBarNumber is > incremented. > - > > Setting measurePosition to zero goes 'back' to the beginning of bar. Yes, setting to smth like this: \set Timing.measurePosition = #(ly:make-moment 4 4) is better. It seems "4 4" is the same as "13 13" or " ". Only there is no bar number at the start of a measure next to this "\set". > Is it possible to set the measurePosition to the measureLength > manually? I am lacking lisp skills. How to access > Timing.measurelength? This does not work: > > \set Timing.measurePosition = Timing.measureLength Looks like " " would do. Not tested at all, sorry .) > > P. > > > > >>So, what I am looking for is a simple solution to prevent the > >>invisible rest (s) from taking horizontal space. Then we have at > >>least output that is visually more acceptable. > >> > >>best, > >>Peter > > > > > -- > http://www.meertens.knaw.nl/cms/en > http://www.musical-style-recognition.net/ > http://www.lodebar.nl/pvk > > Visiting Address: > Meertens Instituut, Room 0.54 > Joan Muyskenweg 25; 1096 CJ Amsterdam; Netherlands > > Postal Address: Postbus 94264; 1090 GG Amsterdam; Netherlands > Tel: +31 (0)20 4628507 -- Dmytro O. Redchuk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Fri 18 Jun 2010, 12:40 Peter Van Kranenburg wrote: > On 6/18/10 12:32 PM, Dmytro O. Redchuk wrote: > >Why not: > > % [...] > > d4. e8 fis4 e | > > \partial 2 > > d2 \bar ":|:" > > fis2 g | > > % [...] > > > > Yes. That would be the solution if I could start from scratch. The > problem is that I have more than 1000 melodies in which the > invisible rest is used instead of \partial. We do not have the > resources to change them all. Well... yes. Understood .) So, spacers may be of different length, but all of them should have no space? Probably you may want to replace all of them with \set Timing.measurePosition = #(ly:make-moment -0 8) % 8 or whatever So, i guess, in such a way you will replace all spacers with an "indicator of measure end". Not tested, just tried a bit. Well... too bad :-) Barnumbers do not increase, you'll need additional tricks. > So, what I am looking for is a simple solution to prevent the > invisible rest (s) from taking horizontal space. Then we have at > least output that is visually more acceptable. > > best, > Peter -- Dmytro O. Redchuk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Fri 18 Jun 2010, 12:23 Peter Van Kranenburg wrote: > These partial measures can occur anywhere. Not only at te beginning > (see attached example). And, no, there are no barline checks > encoded. > > The example has been encoded as (starting at second system): > > [...] d4. e8 fis4 e d2 s2 \bar ":|:" fis2 g [...] Why not: % [...] d4. e8 fis4 e | \partial 2 d2 \bar ":|:" fis2 g | % [...] ?.. > > So, my question is how to prevent the s2 from occupying horizontal space. > > best, > Peter -- Dmytro O. Redchuk ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 2010-06-18 12:23, Peter Van Kranenburg wrote: The example has been encoded as (starting at second system): [...] d4. e8 fis4 e d2 s2 \bar ":|:" fis2 g [...] So, my question is how to prevent the s2 from occupying horizontal space. You might try d2*2 instead of d2 s2. Which looks not quite perfect, but fair enough considering that you're trying to cheat without too much effort... ;-) For a "real" solution, I can't think of a way without locally redefining the lengths of the measures, which will involve far more work in your script. HTH, Alexander ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
Hi Peter, > adding *0 to s[0-9]+ is easy. To add the \partial command, it is necessary to > figure out the current time signature from the context, to find the start of > the measure and to figure out the length of the partial bar, which is not > easy. One has to write a lilypond parser for that. No... if you have s4 s4 s4. c8 | you could easily have your script figure out the length of the measure, without a "Lilypond parser". Of course, I'm assuming you use barline checks, like the docs recommend -- otherwise, you may definitely be unable to use this solution. Cheers, Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
Hi Peter, > Thank you. That triggered the right solution. r4*0 does not work. The rest > collides with the following note. You can make it transparent. > I have around 1000 melodies in which partial measures were solved by > inserting invisible rests (s) instead of using \partial. With this solution > it is relatively easy to write a script to add *0 to all those invisible > rests in order to get visually satisfying scores. If it's that easy to write a script, why not write one that "does the right thing"? i.e., turns them into \partial measures? Cheers, Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
Hi Peter, > On closer look, I see it does not work... The bar lines after the invisible > rest are shifted. This takes no score time and no space. > In the Notation Reference I found how to set Score.measurePosition. Is it > also possible to increase Score.measurePosition? I think so… but to solve your problem, maybe you should adjust the BarLine properties instead. Good luck! Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 6/15/10 11:34 PM, Peter Van Kranenburg wrote: Thank you. That triggered the right solution. r4*0 does not work. The rest collides with the following note. But, s4*0 works for me. And that is exactly what I need. I have around 1000 melodies in which partial measures were solved by inserting invisible rests (s) instead of using \partial. With this solution it is relatively easy to write a script to add *0 to all those invisible rests in order to get visually satisfying scores. On closer look, I see it does not work... The bar lines after the invisible rest are shifted. This takes no score time and no space. In the Notation Reference I found how to set Score.measurePosition. Is it also possible to increase Score.measurePosition? Peter ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
Graham Percival writes: > On Tue, Jun 15, 2010 at 08:59:45PM +0200, Peter Van Kranenburg wrote: >> >> \skip and s consume score time, but both print some horizontal space. >> How can I insert an invisible rest that does not take horizontal space? >> I searched the manuals and snippet repository, but no clue... > > My first instinct is that s4*0 should do what you want, but I > haven't tested it. That takes no time, but uses space. Pretty much the opposite of what was wanted. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 6/15/10 10:05 PM, Kieren MacMillan wrote: Hi Richie, \skip and s consume score time, but both print some horizontal space. How can I insert an invisible rest that does not take horizontal space? I searched the manuals and snippet repository, but no clue... Use r4*0 You may have to put \once \override Rest #'X-extent = #'(0 . 0) or \once \override Rest #'extra-spacing-width = #'(+inf.0 . -inf.0) to eliminate any space. Thank you. That triggered the right solution. r4*0 does not work. The rest collides with the following note. But, s4*0 works for me. And that is exactly what I need. I have around 1000 melodies in which partial measures were solved by inserting invisible rests (s) instead of using \partial. With this solution it is relatively easy to write a script to add *0 to all those invisible rests in order to get visually satisfying scores. Thanks again! Peter ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
Hi Richie, > > \skip and s consume score time, but both print some horizontal space. > > How can I insert an invisible rest that does not take horizontal space? > > I searched the manuals and snippet repository, but no clue... Use r4*0 You may have to put \once \override Rest #'X-extent = #'(0 . 0) or \once \override Rest #'extra-spacing-width = #'(+inf.0 . -inf.0) to eliminate any space. Hope this helps! Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
RE: invisible rest that takes no horizontal space
> Hi all, > > \skip and s consume score time, but both print some horizontal space. > How can I insert an invisible rest that does not take horizontal space? > I searched the manuals and snippet repository, but no clue... > > Thanks! > > Peter van Kranenburg You can't, because I think Lilypond aligns and spaces all music objects (rests, text, crescendos, etc.) according to musical time. Tell us what you are trying to do, I'm sure one of us geeks will be able to figure something out :) - search _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On Tue, Jun 15, 2010 at 08:59:45PM +0200, Peter Van Kranenburg wrote: > > \skip and s consume score time, but both print some horizontal space. > How can I insert an invisible rest that does not take horizontal space? > I searched the manuals and snippet repository, but no clue... My first instinct is that s4*0 should do what you want, but I haven't tested it. Cheers, - Graham ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: invisible rest that takes no horizontal space
On 15.06.2010, at 20:59, Peter Van Kranenburg wrote: Hi all, \skip and s consume score time, but both print some horizontal space. How can I insert an invisible rest that does not take horizontal space? I searched the manuals and snippet repository, but no clue... Thanks! Peter van Kranenburg Perhaps there's another way of achieving what you want. Can you describe in a bit more detail what you want to do? ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
invisible rest that takes no horizontal space
Hi all, \skip and s consume score time, but both print some horizontal space. How can I insert an invisible rest that does not take horizontal space? I searched the manuals and snippet repository, but no clue... Thanks! Peter van Kranenburg ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user