Re: Pedal bracket alignment
Still, I appreciate your help Mark. Thanks, Edward > On 16 Apr 2018, at 12:48 am, Mark Stephen Mrotek <carsonm...@ca.rr.com> wrote: > > Edward, > Your requirements are more exacting than my knowledge/skill can meet. > > Mark > > From: lilypond-user > [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of > Edward Neeman > Sent: Saturday, April 14, 2018 8:04 PM > To: Lilypond-user <lilypond-user@gnu.org> > Subject: Re: Pedal bracket alignment > > Hello Mark, > > After playing around with this problem, I’ve found a few ways to get a > reasonable result. Some of the strategies I tried are in the attached file. > My dream option would be to be able to create a function that would give one > set of shorten-pair values at the Ped. marking, and another set of values for > the pedal changes. > > Thanks, > Edward ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Pedal bracket alignment
Brilliant thanks Harm! I’ll let you know if I manage to “break” it. Best, Edward > On 15 Apr 2018, at 8:36 pm, Thomas Morleywrote: > > 2018-04-15 5:04 GMT+02:00 Edward Neeman : >> My dream option would be to be able to create a function that would give one >> set of shorten-pair values at the Ped. marking, and another set of values >> for the pedal changes. > > > How about attached. > > It doesn't move the "Ped."-marking, though. > Please read comments and doc-strings. > Not tested beyond the given example! > > Cheers, > Harm > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Pedal bracket alignment
Edward, Your requirements are more exacting than my knowledge/skill can meet. Mark From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of Edward Neeman Sent: Saturday, April 14, 2018 8:04 PM To: Lilypond-user <lilypond-user@gnu.org> Subject: Re: Pedal bracket alignment Hello Mark, After playing around with this problem, I’ve found a few ways to get a reasonable result. Some of the strategies I tried are in the attached file. My dream option would be to be able to create a function that would give one set of shorten-pair values at the Ped. marking, and another set of values for the pedal changes. Thanks, Edward ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Pedal bracket alignment
2018-04-15 5:04 GMT+02:00 Edward Neeman: > My dream option would be to be able to create a function that would give one > set of shorten-pair values at the Ped. marking, and another set of values > for the pedal changes. How about attached. It doesn't move the "Ped."-marking, though. Please read comments and doc-strings. Not tested beyond the given example! Cheers, Harm \version "2.18.2" #(define (note-column::main-extent grob) "Return extent of the noteheads in the 'main column', (i.e. excluding any suspended noteheads), or extent of the rest (if there are no heads)." (let* ((note-heads (ly:grob-object grob 'note-heads)) (stem (ly:grob-object grob 'stem)) (rest (ly:grob-object grob 'rest))) (cond ((ly:grob-array? note-heads) (let (;; get the cdr from all note-heads-extents, where the car ;; is zero (n-h-right-coords (filter-map (lambda (n-h) (let ((ext (ly:grob-extent n-h grob X))) (and (= (car ext) 0) (cdr ext (ly:grob-array->list note-heads ;; better be paranoid, find the max of n-h-right-coords and ;; return a pair with (cons 0 ) (cons 0.0 (reduce max 0 n-h-right-coords ((ly:grob? rest) (ly:grob-extent rest grob X)) ;; better be paranoid (else '(0 . 0) #(define (adjust-piano-pedal-bracket val) (lambda (grob) ;; grob is supposed to be PianoPedalBracket. ;; Returns a number-pair to set shorten-pair. ;; This pair is calculated warranting no gap between consecutive ;; PianoPedalBrackets. ;; If `val' is #f the extent of left and right bounding ;; NoteColumns are calculated. Half of those lengths are taken then. ;; (Only the NoteColumn's main extent is taken, disregarding suspended ;; NoteHeads) (let* ((orig (ly:grob-original grob)) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '())) (with-text? (ly:grob? (ly:grob-object grob 'pedal-text))) (left-val #f) (right-val #f)) (if val (begin (set! left-val val) (set! right-val (- val))) (let* ((left-bound (ly:spanner-bound grob LEFT)) (left-bound-elts-array (ly:grob-object left-bound 'elements)) (left-bound-elts-list (if (ly:grob-array? left-bound-elts-array) (ly:grob-array->list left-bound-elts-array) '())) (left-bound-nc-list (filter (lambda (g) (grob::has-interface g 'note-column-interface)) left-bound-elts-list)) (left-bound-note-column (if (pair? left-bound-nc-list) (car left-bound-nc-list) #f)) (left-val-default (if left-bound-note-column (/ (interval-length (note-column::main-extent left-bound-note-column)) 2) 0)) (right-bound (ly:spanner-bound grob RIGHT)) (right-bound-elts-array (ly:grob-object right-bound 'elements)) (right-bound-elts-list (if (ly:grob-array? right-bound-elts-array) (ly:grob-array->list right-bound-elts-array) '())) (right-bound-nc-list (filter (lambda (g) (grob::has-interface g 'note-column-interface)) right-bound-elts-list)) (right-bound-note-column (if (pair? right-bound-nc-list) (car right-bound-nc-list) #f)) (right-val-default (if right-bound-note-column (/ (interval-length (note-column::main-extent right-bound-note-column)) -2) 0))) (set! left-val left-val-default) (set! right-val right-val-default))) (if (pair? siblings) (cond ((equal? grob (car siblings)) (if with-text? (cons 0 0) (cons left-val 0))) ((equal? grob (last siblings)) (cons 0 right-val)) (else (cons 0 0))) (if with-text? (cons 0 right-val) (cons left-val right-val))
Re: Pedal bracket alignment
Hello Mark,After playing around with this problem, I’ve found a few ways to get a reasonable result. Some of the strategies I tried are in the attached file. My dream option would be to be able to create a function that would give one set of shorten-pair values at the Ped. marking, and another set of values for the pedal changes.Thanks,Edward pedal-options.ly Description: Binary data On 15 Apr 2018, at 8:55 am, Edward Neemanwrote:\version "2.19.80"\relative { \set Staff.pedalSustainStyle =#'mixed \override Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) c'4\sustainOn c d\sustainOff\sustainOn d\sustainOff e\sustainOn e f\sustainOff f }___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Pedal bracket alignment
Edward, If you provide an example, I shall try to comply. Mark -Original Message- From: Edward Neeman [mailto:edward.nee...@gmail.com] Sent: Saturday, April 14, 2018 6:33 PM To: Mark Stephen Mrotek <carsonm...@ca.rr.com> Cc: Lilypond-user <lilypond-user@gnu.org> Subject: Re: Pedal bracket alignment Hello Mark and Shane, Thanks for suggestion! In fact I was doing something very similar, putting the pedal marking in its own variable (though I added it to the bottom staff of the piano part). I was hoping to be able to change how the pedal bracket is aligned with the notes in the same rhythmic column (basically, more centred). I could fudge that by putting the pedal change one sixteenth note late, but I was hoping for a neater solution. Best, Edward > On 15 Apr 2018, at 10:31 am, Mark Stephen Mrotek <carsonm...@ca.rr.com> wrote: > > Edward, > > As Shane suggests, placing the pedal marking in a \new Dynamics allows > specific placement. > Attached is an example. > > Mark > > -Original Message- > From: lilypond-user > [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf > Of Edward Neeman > Sent: Saturday, April 14, 2018 3:55 PM > To: Lilypond-user <lilypond-user@gnu.org> > Subject: Pedal bracket alignment > > Hello, > > I would like to align the pedal bracket changes closer to the middle of the > notes they’re attached to, instead of at the beginning of the note. > > What is the best way to achieve this? I have been using shorten-pair but that > leaves too much space between the Ped. mark and the start of the bracket. > > \version "2.19.80" > > \relative { > \set Staff.pedalSustainStyle =#'mixed \override > Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) c'4\sustainOn c > d\sustainOff\sustainOn d\sustainOff e\sustainOn e f\sustainOff f } > > Thanks! > Edward > ___ > 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: Pedal bracket alignment
Hello Mark and Shane, Thanks for suggestion! In fact I was doing something very similar, putting the pedal marking in its own variable (though I added it to the bottom staff of the piano part). I was hoping to be able to change how the pedal bracket is aligned with the notes in the same rhythmic column (basically, more centred). I could fudge that by putting the pedal change one sixteenth note late, but I was hoping for a neater solution. Best, Edward > On 15 Apr 2018, at 10:31 am, Mark Stephen Mrotek <carsonm...@ca.rr.com> wrote: > > Edward, > > As Shane suggests, placing the pedal marking in a \new Dynamics allows > specific placement. > Attached is an example. > > Mark > > -Original Message- > From: lilypond-user > [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of > Edward Neeman > Sent: Saturday, April 14, 2018 3:55 PM > To: Lilypond-user <lilypond-user@gnu.org> > Subject: Pedal bracket alignment > > Hello, > > I would like to align the pedal bracket changes closer to the middle of the > notes they’re attached to, instead of at the beginning of the note. > > What is the best way to achieve this? I have been using shorten-pair but that > leaves too much space between the Ped. mark and the start of the bracket. > > \version "2.19.80" > > \relative { > \set Staff.pedalSustainStyle =#'mixed > \override Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) > c'4\sustainOn c d\sustainOff\sustainOn d\sustainOff e\sustainOn e > f\sustainOff f } > > Thanks! > Edward > ___ > 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: Pedal bracket alignment
Edward, As Shane suggests, placing the pedal marking in a \new Dynamics allows specific placement. Attached is an example. Mark -Original Message- From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of Edward Neeman Sent: Saturday, April 14, 2018 3:55 PM To: Lilypond-user <lilypond-user@gnu.org> Subject: Pedal bracket alignment Hello, I would like to align the pedal bracket changes closer to the middle of the notes they’re attached to, instead of at the beginning of the note. What is the best way to achieve this? I have been using shorten-pair but that leaves too much space between the Ped. mark and the start of the bracket. \version "2.19.80" \relative { \set Staff.pedalSustainStyle =#'mixed \override Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) c'4\sustainOn c d\sustainOff\sustainOn d\sustainOff e\sustainOn e f\sustainOff f } Thanks! Edward ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user \version "2.19.49" \score { << \relative c { \clef bass \time 6/8 \key g \major g8_5 d'_3 b'_1 c_2 b_1 b, | g_5 d'_3 b'_1 c_2 b_1 b, | g d' b' d_2 e,_1 e, | a_5 e' c'_1 e_2 d_1 e,_3 | } \new Dynamics { s4.\sustainOn s\sustainOff | s\sustainOn s\sustainOff | s\sustainOn s8\sustainOff s8.\sustainOn s16\sustainOff | s4.\sustainOn s\sustainOff | } >> } %{ convert-ly.py (GNU LilyPond) 2.19.80 convert-ly.py: Processing `'... Applying conversion: 2.19.2, 2.19.7, 2.19.11, 2.19.16, 2.19.22, 2.19.24, 2.19.28, 2.19.29, 2.19.32, 2.19.40, 2.19.46, 2.19.49 %} %{ convert-ly.py (GNU LilyPond) 2.19.80 convert-ly.py: Processing `'... Applying conversion: The document has not been changed. %} ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Pedal bracket alignment
I usually use an independent voice that can be populated with s values such that you can fudge the distances. If you have a pedal duration you want displayed as different from the rhythm for example c2 c4 but you only wish the pedal mark for quarter beat then s4\sustainOn s4\sustain off. Regards, Shane Sent from my T-Mobile 4G LTE Device Original message From: Edward Neeman <edward.nee...@gmail.com> Date: 4/14/18 6:55 PM (GMT-05:00) To: Lilypond-user <lilypond-user@gnu.org> Subject: Pedal bracket alignment Hello, I would like to align the pedal bracket changes closer to the middle of the notes they’re attached to, instead of at the beginning of the note. What is the best way to achieve this? I have been using shorten-pair but that leaves too much space between the Ped. mark and the start of the bracket. \version "2.19.80" \relative { \set Staff.pedalSustainStyle =#'mixed \override Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) c'4\sustainOn c d\sustainOff\sustainOn d\sustainOff e\sustainOn e f\sustainOff f } Thanks! Edward ___ 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
Pedal bracket alignment
Hello, I would like to align the pedal bracket changes closer to the middle of the notes they’re attached to, instead of at the beginning of the note. What is the best way to achieve this? I have been using shorten-pair but that leaves too much space between the Ped. mark and the start of the bracket. \version "2.19.80" \relative { \set Staff.pedalSustainStyle =#'mixed \override Staff.PianoPedalBracket.shorten-pair = #'(0.6 . -0.6) c'4\sustainOn c d\sustainOff\sustainOn d\sustainOff e\sustainOn e f\sustainOff f } Thanks! Edward ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user