Re: always set beam outside of staff
Yes. Admittedly, my initial email was not as explanatory as possible. I will definitely be more thorough on my first attempt! Regardless, I am pretty happy to have the problem solved and do understand that my lack of clarity was partly to blame for any confusion. Best, Michael On 09/08/2016 04:28 PM, Thomas Morley wrote: > 2016-09-08 18:13 GMT+02:00 Michael Winter: >> Respectfully, >> >> This is like someone asking for directions but instead of getting an >> answer on how to get to their preferred destination, getting asked why >> they would want to go there at all. >> >> If this were a question about default lilypond behavior, I would >> understand that standard engraving practices should be discussed. But >> this is an exceptional case that I would like to do programmatically. >> That is, I was not asking for this to be the norm, but rather how I >> could enable the exception. After all, lilypond is so, so powerful for >> both its automatic behavior and the fact that you can pretty much do >> anything that you want. >> >> But to answer your question. I am engraving a score of someone >> posthumously. There are uninked copies done by hand, which are probably >> some of the most beautiful, albeit admittedly sometimes unconventional, >> notation practices I have ever seen. Regardless, I am doing my best to >> make the convention for engraving this particular project as close to >> possible to the composer's original hand copies. And believe me, I have >> yet to find a moment in this composer's work, where his exceptions to >> common practices were not well thought out and considered. >> >> Best, >> >> Michael > > > Respectfully as well, > > let's say I misunderstood your initial request due to some > language-issues of a none-native-speaker. > > Otherwise this thread would surely blow up for additional 30-40 mails > about how-to-ask or minimal-examples and other topics of this kind, > containing opinions which all were stated before and that more than > once. > > And you _did_ provide not only your reasoning, but also some code in follow > ups. > > > Looks like David N's replies fullfit your needs already :) > > All the best, > Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
2016-09-08 18:13 GMT+02:00 Michael Winter: > Respectfully, > > This is like someone asking for directions but instead of getting an > answer on how to get to their preferred destination, getting asked why > they would want to go there at all. > > If this were a question about default lilypond behavior, I would > understand that standard engraving practices should be discussed. But > this is an exceptional case that I would like to do programmatically. > That is, I was not asking for this to be the norm, but rather how I > could enable the exception. After all, lilypond is so, so powerful for > both its automatic behavior and the fact that you can pretty much do > anything that you want. > > But to answer your question. I am engraving a score of someone > posthumously. There are uninked copies done by hand, which are probably > some of the most beautiful, albeit admittedly sometimes unconventional, > notation practices I have ever seen. Regardless, I am doing my best to > make the convention for engraving this particular project as close to > possible to the composer's original hand copies. And believe me, I have > yet to find a moment in this composer's work, where his exceptions to > common practices were not well thought out and considered. > > Best, > > Michael Respectfully as well, let's say I misunderstood your initial request due to some language-issues of a none-native-speaker. Otherwise this thread would surely blow up for additional 30-40 mails about how-to-ask or minimal-examples and other topics of this kind, containing opinions which all were stated before and that more than once. And you _did_ provide not only your reasoning, but also some code in follow ups. Looks like David N's replies fullfit your needs already :) All the best, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
I think I found a good solution. This needs some more testing, but here goes (see below). This with the overridden auto-knee-gap and damping settings allows some dampening but will always clear one of the beam sides out of the staff. So looks like all is accomplished: generally getting the beams out of the staff, always keeping rests in the staff, and some basic dampening! Again... Many thanks... More soon if I run into snags. #(define my-positions (lambda (grob) (let* ((default-pos (beam::place-broken-parts-individually grob)) (left-pos (car default-pos)) (right-pos (cdr default-pos)) (stems (ly:grob-object grob 'stems)) (first-stem (ly:grob-array-ref stems 0)) (dir (ly:grob-property first-stem 'direction)) (max-pos (if (eq? dir UP) (max left-pos right-pos) (min left-pos right-pos))) (pos-translate (if (> (abs max-pos) 3.5) 0 (- 3.5 (abs max-pos) (if (eq? dir UP) (cons (+ left-pos pos-translate) (+ right-pos pos-translate)) (cons (- left-pos pos-translate) (- right-pos pos-translate)) \layout { \context { \Staff \override Beam.auto-knee-gap = #10 \override Beam.damping = #3 \override Beam.positions = #my-positions } } On 09/08/2016 11:13 AM, David Nalesnik wrote: > On Thu, Sep 8, 2016 at 1:08 PM, David Nalesnik> wrote: > >> So, to get the positions of the note-heads under a Beam, you could >> write something like: > Appended as a file because of awkward line-breaks when inlining > > David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 12:37 PM, David Nalesnikwrote: > On Thu, Sep 8, 2016 at 1:04 PM, tisimst > wrote: > > > > > > On Thu, Sep 8, 2016 at 11:52 AM, David Nalesnik [via Lilypond] <[hidden > > email]> wrote: > > > >> On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnik <[hidden email]> wrote: > >> > >> > > >> > \version "2.19.46" > >> > > >> > #(define my-positions > >> >(lambda (grob) > >> > (let* ((stems (ly:grob-object grob 'stems)) > >> > (first-stem (ly:grob-array-ref stems 0)) > >> > (dir (ly:grob-property first-stem 'direction))) > >> >(if (eq? dir UP) > >> >(cons 3.5 3.5) > >> >(cons -3.5 -3.5) > >> > > >> > { > >> > \override Beam.positions = #my-positions > >> > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > >> > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > >> > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > >> > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > >> > > >> > r16[d'' d'' d''] > >> > r16[d' d' d'] > >> > } > >> > >> The above sets positions to an arbitrary height outside of the staff. > >> We need to consider that setting might be too low/high: > >> \version "2.19.46" > >> > >> #(define my-positions > >>(lambda (grob) > >> (let* ((default-pos (beam::place-broken-parts-individually grob)) > >> (left-pos (car default-pos)) > >> (right-pos (cdr default-pos)) > >> (stems (ly:grob-object grob 'stems)) > >> (first-stem (ly:grob-array-ref stems 0)) > >> (dir (ly:grob-property first-stem 'direction)) > >> (new-pos > >> (if (eq? dir UP) > >> (max 3.5 left-pos right-pos) > >> (min -3.5 left-pos right-pos > >>(cons new-pos new-pos > >> > >> { > >> \override Beam.positions = #my-positions > >> d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > >> d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > >> d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > >> d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > >> > >> r16[d'' d'' d''] > >> r16[d' f' a'] > >> f'' d'' b' g' > >> \stemUp f'' d'' b' g' > >> \stemUp f''' d''' b'' g'' > >> } > > > > > > Just a thought, but I wonder if my-positions should accept at least > numeric > > input since (I'm just guessing) this value could change from system to > > system? Please ignore this if it doesn't apply. > > > > I'm not sure I follow > > Do you mean the threshold outside-staff position? (+/- 3.5 puts the > beam a little above/below the staff. It would be easy to add that as > a function parameter.) Yes. You hard-coded 3.5 into the function, but I would think that other values (say 4.5 or 6.0) might be appropriate in different systems. It's all theoretical for me, of course, but that's all I meant. Best, Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 1:04 PM, tisimstwrote: > > > On Thu, Sep 8, 2016 at 11:52 AM, David Nalesnik [via Lilypond] <[hidden > email]> wrote: > >> On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnik <[hidden email]> wrote: >> >> > >> > \version "2.19.46" >> > >> > #(define my-positions >> >(lambda (grob) >> > (let* ((stems (ly:grob-object grob 'stems)) >> > (first-stem (ly:grob-array-ref stems 0)) >> > (dir (ly:grob-property first-stem 'direction))) >> >(if (eq? dir UP) >> >(cons 3.5 3.5) >> >(cons -3.5 -3.5) >> > >> > { >> > \override Beam.positions = #my-positions >> > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] >> > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] >> > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] >> > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] >> > >> > r16[d'' d'' d''] >> > r16[d' d' d'] >> > } >> >> The above sets positions to an arbitrary height outside of the staff. >> We need to consider that setting might be too low/high: >> \version "2.19.46" >> >> #(define my-positions >>(lambda (grob) >> (let* ((default-pos (beam::place-broken-parts-individually grob)) >> (left-pos (car default-pos)) >> (right-pos (cdr default-pos)) >> (stems (ly:grob-object grob 'stems)) >> (first-stem (ly:grob-array-ref stems 0)) >> (dir (ly:grob-property first-stem 'direction)) >> (new-pos >> (if (eq? dir UP) >> (max 3.5 left-pos right-pos) >> (min -3.5 left-pos right-pos >>(cons new-pos new-pos >> >> { >> \override Beam.positions = #my-positions >> d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] >> d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] >> d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] >> d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] >> >> r16[d'' d'' d''] >> r16[d' f' a'] >> f'' d'' b' g' >> \stemUp f'' d'' b' g' >> \stemUp f''' d''' b'' g'' >> } > > > Just a thought, but I wonder if my-positions should accept at least numeric > input since (I'm just guessing) this value could change from system to > system? Please ignore this if it doesn't apply. > I'm not sure I follow Do you mean the threshold outside-staff position? (+/- 3.5 puts the beam a little above/below the staff. It would be easy to add that as a function parameter.) david ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Thank you David! This is so, so helpful. You have no idea how grateful I am. I want to play around a bit and will let you know if I have any further questions. Best, Michael On 09/08/2016 11:13 AM, David Nalesnik wrote: > On Thu, Sep 8, 2016 at 1:08 PM, David Nalesnik> wrote: > >> So, to get the positions of the note-heads under a Beam, you could >> write something like: > Appended as a file because of awkward line-breaks when inlining > > David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 11:01 AM, Michael Winterwrote: > Thank you David! > > This is a great start. And at the very least gets me to the point where > manual overrides will not be as numerous. > > I also think I can play with this to get a bit more natural dampening. > Plus this is a good opportunity to get my feet wet with scheme. > > Quick thought (to maybe deal with the dampening part) and since you > clearly know how to get values from the grobs which is where I was > unclear... > > Is there a way to get the min and max note positions. Then this could be > done by setting Stem.details.beamed-lengths and allowing the dampening > to remain. Yes, you can get this information fairly easily with the use of several Scheme functions and the Internals Reference constantly at hand. Perhaps it will be useful to go through the process I use in a general way. Reading a property that a grob directly possesses is a simple matter of using ly:grob-property (though be careful -- if the property is set to a callback, invoking ly:grob-property will actually *execute* the callback, which can have bizarre consequences, especially when you're looking for vertical dimensions. You just have to see what happens.) If a grob doesn't have a particular property you're interested in, hope that it stores a reference to another object which does. Or that it points to another object which points to another object which... How can you tell what pointers you have to work with? The Internal Reference pages for the various interfaces list such objects under "Internal Properties": as "(graphical (layout) object" or "(array of grobs)". You get the object with ly:grob-object. Another possibility of getting another grob from the grob at hand is to use ly:grob-parent. A grob has an X-parent and a Y-parent, and those parents have parents, etc. , until you arrive at One Grob to Rule Them All = System. Of course, any grob along that parentage chain has its own pointers, So, start the treasure hunt. As to your particular request -- getting note positions from a Beam grob -- here is one path: (1) the Beam grob supports the beam-interface (well, duh) which, according to http://lilypond.org/doc/v2.18/Documentation/internals/beam_002dinterface holds a 'stem property. This holds a grob-array of encompassed Stem objects; (2) a Stem grob has a 'stem-interface,and looking at http://lilypond.org/doc/v2.18/Documentation/internals/stem_002dinterface) we find a property 'note-heads storing an array of NoteHead grobs (3) Finding the staff-position of a NoteHead is a little trickier. Unexpectedly, there's no ordinary grob property and the obvious interface candidate -- 'note-head-interface' -- has nothing for us. According to the IR page for NoteHead (http://lilypond.org/doc/v2.18/Documentation/internals/notehead), 'staff-symbol-referencer-interface is supported, however That interface has a 'staff-position property.. So, to get the positions of the note-heads under a Beam, you could write something like: \version "2.19.46" #(define my-positions (lambda (grob) (let* ((stems (ly:grob-object grob 'stems)) ;; convert grob array to a list because few Scheme facilities exist for dealing with grob arrays (stem-list (ly:grob-array->list stems)) ;; list of grob arrays of NoteHead grobs for each Stem (note-heads (map (lambda (x) (ly:grob-object x 'note-heads)) stem-list)) ;; convert the above to a list of lists of NoteHead grobs -- again, for convenience (note-heads-list (map (lambda (x) ;; if no note heads (i.e. beamed rest), no array... - this seems like a design flaw to me (if (ly:grob-array? x) (ly:grob-array->list x) '())) note-heads)) ;; staff-positions of beamed notes, a list for each group (note-positions (map (lambda (x) (map (lambda (y) (ly:grob-property y 'staff-position)) x)) note-heads-list)) ;; since we just want absolute max and min, we can flatten the nested list ;; for convenience: ;; i.e., ((1 2) (3) (4 5 6)) --> (1 2 3 4 5 6) (flattened-list (append-map identity note-positions)) (highest (apply max flattened-list)) (lowest (apply min flattened-list))) (format #t "highest: ~a lowest: ~a~%" highest lowest) ; return default positions for sake of demo (since we're overriding 'positions, we need a valid return) (beam::place-broken-parts-individually grob { \override Beam.positions = #my-positions f''16 d'' b' g' 16 r16 d'' b''' g, } %% This answers the question, though I wish the Scheme would have been as straightforward as the example... Hope this helps-- David ___
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 1:08 PM, David Nalesnikwrote: > > So, to get the positions of the note-heads under a Beam, you could > write something like: Appended as a file because of awkward line-breaks when inlining David \version "2.19.46" #(define my-positions (lambda (grob) (let* ((stems (ly:grob-object grob 'stems)) ;; convert grob array to a list because few Scheme facilities for dealing with grob arrays (stem-list (ly:grob-array->list stems)) ;; list of grob arrays of NoteHead for each Stem (note-heads (map (lambda (x) (ly:grob-object x 'note-heads)) stem-list)) ;; convert the above to a list of lists of NoteHead grobs (note-heads-list (map (lambda (x) ;; if no note heads (i.e. beamed rest), no array... (if (ly:grob-array? x) (ly:grob-array->list x) '())) note-heads)) ;; staff-positions of beamed notes, a list for each group (note-positions (map (lambda (x) (map (lambda (y) (ly:grob-property y 'staff-position)) x)) note-heads-list)) ;; since we just want absolute max and min, we can flatten the nested list ;; for convenience: ;; i.e., ((1 2) (3) (4 5 6)) --> (1 2 3 4 5 6) (flattened-list (append-map identity note-positions)) (highest (apply max flattened-list)) (lowest (apply min flattened-list))) (format #t "highest: ~a lowest: ~a~%" highest lowest) ; return default positions for sake of demo (beam::place-broken-parts-individually grob { \override Beam.positions = #my-positions f''16 d'' b' g' 16 r16 d'' b''' g, }___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Thank you David! This is a great start. And at the very least gets me to the point where manual overrides will not be as numerous. I also think I can play with this to get a bit more natural dampening. Plus this is a good opportunity to get my feet wet with scheme. Quick thought (to maybe deal with the dampening part) and since you clearly know how to get values from the grobs which is where I was unclear... Is there a way to get the min and max note positions. Then this could be done by setting Stem.details.beamed-lengths and allowing the dampening to remain. Either way, what you have will definitely work! Best, Michael On 09/08/2016 06:01 AM, David Nalesnik wrote: > On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnik> wrote: > >> \version "2.19.46" >> >> #(define my-positions >>(lambda (grob) >> (let* ((stems (ly:grob-object grob 'stems)) >> (first-stem (ly:grob-array-ref stems 0)) >> (dir (ly:grob-property first-stem 'direction))) >>(if (eq? dir UP) >>(cons 3.5 3.5) >>(cons -3.5 -3.5) >> >> { >> \override Beam.positions = #my-positions >> d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] >> d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] >> d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] >> d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] >> >> r16[d'' d'' d''] >> r16[d' d' d'] >> } > > The above sets positions to an arbitrary height outside of the staff. > We need to consider that setting might be too low/high: > \version "2.19.46" > > #(define my-positions >(lambda (grob) > (let* ((default-pos (beam::place-broken-parts-individually grob)) > (left-pos (car default-pos)) > (right-pos (cdr default-pos)) > (stems (ly:grob-object grob 'stems)) > (first-stem (ly:grob-array-ref stems 0)) > (dir (ly:grob-property first-stem 'direction)) > (new-pos > (if (eq? dir UP) > (max 3.5 left-pos right-pos) > (min -3.5 left-pos right-pos >(cons new-pos new-pos > > { > \override Beam.positions = #my-positions > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > > r16[d'' d'' d''] > r16[d' f' a'] > f'' d'' b' g' > \stemUp f'' d'' b' g' > \stemUp f''' d''' b'' g'' > } > > -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 11:52 AM, David Nalesnik [via Lilypond] < ml-node+s1069038n194341...@n5.nabble.com> wrote: > On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnik <[hidden email] > <http:///user/SendEmail.jtp?type=node=194341=0>> wrote: > > > > > \version "2.19.46" > > > > #(define my-positions > >(lambda (grob) > > (let* ((stems (ly:grob-object grob 'stems)) > > (first-stem (ly:grob-array-ref stems 0)) > > (dir (ly:grob-property first-stem 'direction))) > >(if (eq? dir UP) > >(cons 3.5 3.5) > >(cons -3.5 -3.5) > > > > { > > \override Beam.positions = #my-positions > > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > > > > r16[d'' d'' d''] > > r16[d' d' d'] > > } > > > The above sets positions to an arbitrary height outside of the staff. > We need to consider that setting might be too low/high: > \version "2.19.46" > > #(define my-positions >(lambda (grob) > (let* ((default-pos (beam::place-broken-parts-individually grob)) > (left-pos (car default-pos)) > (right-pos (cdr default-pos)) > (stems (ly:grob-object grob 'stems)) > (first-stem (ly:grob-array-ref stems 0)) > (dir (ly:grob-property first-stem 'direction)) > (new-pos > (if (eq? dir UP) > (max 3.5 left-pos right-pos) > (min -3.5 left-pos right-pos >(cons new-pos new-pos > > { > \override Beam.positions = #my-positions > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > > r16[d'' d'' d''] > r16[d' f' a'] > f'' d'' b' g' > \stemUp f'' d'' b' g' > \stemUp f''' d''' b'' g'' > } > Just a thought, but I wonder if my-positions should accept at least numeric input since (I'm just guessing) this value could change from system to system? Please ignore this if it doesn't apply. -- Abraham Lee -- View this message in context: http://lilypond.1069038.n5.nabble.com/always-set-beam-outside-of-staff-tp194316p194342.html Sent from the User mailing list archive at Nabble.com.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
For example, the (pseudo-code) sequence: (treble clef, relative c'') { b4 r8.[ d16] r8.[ e16] r8.[ g16] } when I would notate it would always either shove the 8. rest outside of the bar, or collide with it, or otherwise involve ugly beaming. I found I had to re-write the rests as something like { c8.\rest[ } each time, explicitly setting the position, and then use overrides on each group to set the stem length. This seems like pretty kludgy code to me (and a pain to have to do for each beam group). Cf. Gould 165. Cheers, A On Thu, Sep 8, 2016 at 11:10 AM, Thomas Morleywrote: > 2016-09-08 8:52 GMT+02:00 Michael Winter : > > Is it possible to force a beam to always start (vertically) a minimum > > distance from the staff regardless of the stem direction? > > > > Thanks, > > > > Michael > > > > Hi Michael, > > well, it's doable. But why should I help you making LilyPond-output ugly? > Is there any usecase which makes sense? > > Convince me/us! ;) > And I will give it a try in the evening, now I have to run, job's calling. > > Cheers, > Harm > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
On Thu, Sep 8, 2016 at 7:26 AM, David Nalesnikwrote: > > \version "2.19.46" > > #(define my-positions >(lambda (grob) > (let* ((stems (ly:grob-object grob 'stems)) > (first-stem (ly:grob-array-ref stems 0)) > (dir (ly:grob-property first-stem 'direction))) >(if (eq? dir UP) >(cons 3.5 3.5) >(cons -3.5 -3.5) > > { > \override Beam.positions = #my-positions > d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] > d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] > d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] > > r16[d'' d'' d''] > r16[d' d' d'] > } The above sets positions to an arbitrary height outside of the staff. We need to consider that setting might be too low/high: \version "2.19.46" #(define my-positions (lambda (grob) (let* ((default-pos (beam::place-broken-parts-individually grob)) (left-pos (car default-pos)) (right-pos (cdr default-pos)) (stems (ly:grob-object grob 'stems)) (first-stem (ly:grob-array-ref stems 0)) (dir (ly:grob-property first-stem 'direction)) (new-pos (if (eq? dir UP) (max 3.5 left-pos right-pos) (min -3.5 left-pos right-pos (cons new-pos new-pos { \override Beam.positions = #my-positions d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] r16[d'' d'' d''] r16[d' f' a'] f'' d'' b' g' \stemUp f'' d'' b' g' \stemUp f''' d''' b'' g'' } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Greetings Harm, Ugly is a subjective matter. The work I do setting massively dense scores for my New Complexity School colleague uses his personal style where all beams are always outside the staff lines. This he does for various personal reasons, one of which is to in fact aid legibility in the dense scores where there is a lot going on on the staff area, and partly just his view of what ‘looks good’ (yet again subjective). So there is a use case for this work, I’d say. I manage it just by having a simple function for setting beam positions - but my scores seem to consist mostly of this function! :-) Andrew On 8 September 2016 at 11:33:35 PM, Thomas Morley (thomasmorle...@gmail.com) wrote: well, it's doable. But why should I help you making LilyPond-output ugly? Is there any usecase which makes sense? ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Respectfully, This is like someone asking for directions but instead of getting an answer on how to get to their preferred destination, getting asked why they would want to go there at all. If this were a question about default lilypond behavior, I would understand that standard engraving practices should be discussed. But this is an exceptional case that I would like to do programmatically. That is, I was not asking for this to be the norm, but rather how I could enable the exception. After all, lilypond is so, so powerful for both its automatic behavior and the fact that you can pretty much do anything that you want. But to answer your question. I am engraving a score of someone posthumously. There are uninked copies done by hand, which are probably some of the most beautiful, albeit admittedly sometimes unconventional, notation practices I have ever seen. Regardless, I am doing my best to make the convention for engraving this particular project as close to possible to the composer's original hand copies. And believe me, I have yet to find a moment in this composer's work, where his exceptions to common practices were not well thought out and considered. Best, Michael On 09/08/2016 02:10 AM, Thomas Morley wrote: > 2016-09-08 8:52 GMT+02:00 Michael Winter: >> Is it possible to force a beam to always start (vertically) a minimum >> distance from the staff regardless of the stem direction? >> >> Thanks, >> >> Michael > > > Hi Michael, > > well, it's doable. But why should I help you making LilyPond-output ugly? > Is there any usecase which makes sense? > > Convince me/us! ;) > And I will give it a try in the evening, now I have to run, job's calling. > > Cheers, > Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Hi Michael, On Thu, Sep 8, 2016 at 3:38 AM, Michael Winterwrote: > { d'16 [ r16 d'8 ] d'16 [ b'16\rest d'8 ] \override Beam.positions = > #'(3.5 . 3.5) d'16 [ r16 d'8 ] d''16 [ r16 d''8 ]} > > In the above example there are 4 beamed groups. > > 1) default - the rest is pushed down > > 2) explicitly set rest y position using \rest - the beam stays in the > same position and collides with the rest > > 3) explicitly set beam position - this looks close to what I want, but I > really do not want to do this manually and I would like some minimal > dampening. I have no idea how to generally / programatically get the > beam out of the staff, get the rest where it would lie naturally of not > within a beamed group (as in both this and the previous example), and > have some dampening. > > 4) This group show that even if I were to try to set the position > programatically, I would have to do it based on the stem direction. In > this particular case I would need to set the position negative. > > So to recap, there are a few things I am trying to do: generally get the > beam out of the staff, always center the rests vertically where they go > when not under a beam, and have some dampening. > This looks to do what you want. I don't know if you will encounter "kneed" beams. That would require some refinement. \version "2.19.46" #(define my-positions (lambda (grob) (let* ((stems (ly:grob-object grob 'stems)) (first-stem (ly:grob-array-ref stems 0)) (dir (ly:grob-property first-stem 'direction))) (if (eq? dir UP) (cons 3.5 3.5) (cons -3.5 -3.5) { \override Beam.positions = #my-positions d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] d'16 [ r16 d'8 ] d''16 [ r16 d''8 ] d''16 [ r16 d''8 ] d'16 [ r16 d''8 ] d''16 [ r16 d''8 ] d'''16 [ r16 d'''8 ] r16[d'' d'' d''] r16[d' d' d'] } Hope this helps, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
2016-09-08 8:52 GMT+02:00 Michael Winter: > Is it possible to force a beam to always start (vertically) a minimum > distance from the staff regardless of the stem direction? > > Thanks, > > Michael Hi Michael, well, it's doable. But why should I help you making LilyPond-output ugly? Is there any usecase which makes sense? Convince me/us! ;) And I will give it a try in the evening, now I have to run, job's calling. Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
{ d'16 [ r16 d'8 ] d'16 [ b'16\rest d'8 ] \override Beam.positions = #'(3.5 . 3.5) d'16 [ r16 d'8 ] d''16 [ r16 d''8 ]} In the above example there are 4 beamed groups. 1) default - the rest is pushed down 2) explicitly set rest y position using \rest - the beam stays in the same position and collides with the rest 3) explicitly set beam position - this looks close to what I want, but I really do not want to do this manually and I would like some minimal dampening. I have no idea how to generally / programatically get the beam out of the staff, get the rest where it would lie naturally of not within a beamed group (as in both this and the previous example), and have some dampening. 4) This group show that even if I were to try to set the position programatically, I would have to do it based on the stem direction. In this particular case I would need to set the position negative. So to recap, there are a few things I am trying to do: generally get the beam out of the staff, always center the rests vertically where they go when not under a beam, and have some dampening. Thanks! On 09/08/2016 01:21 AM, Jacques Menu Muzhic wrote: > Hello Michael, > > Can you show an example of what you’d like to get? > > JM > >> Le 8 sept. 2016 à 08:52, Michael Wintera écrit >> : >> >> Is it possible to force a beam to always start (vertically) a minimum >> distance from the staff regardless of the stem direction? >> >> Thanks, >> >> Michael >> >> ___ >> lilypond-user mailing list >> lilypond-user@gnu.org >> https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
Hello Michael, Can you show an example of what you’d like to get? JM > Le 8 sept. 2016 à 08:52, Michael Wintera écrit : > > Is it possible to force a beam to always start (vertically) a minimum > distance from the staff regardless of the stem direction? > > Thanks, > > Michael > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: always set beam outside of staff
I should add that I want to do this all programatically. I tried using /rest but that does not change the beam position and then the beam collides with the rest. Another thought I had was to try to write a function that automatically sets the beam position since that is relative to the staff, but I would need to know which direction the stems are going. Is it possible to get that value so I can set the beam position negative or positive based on the direction of the stem? On 09/07/2016 11:52 PM, Michael Winter wrote: > Is it possible to force a beam to always start (vertically) a minimum > distance from the staff regardless of the stem direction? > > Thanks, > > Michael ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
always set beam outside of staff
Is it possible to force a beam to always start (vertically) a minimum distance from the staff regardless of the stem direction? Thanks, Michael ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user