Re: Glissando between single notes in chord
Hi pabuhr. On Wed, Oct 17, 2012 at 10:48 PM, pabuhr pab...@fastmail.fm wrote: I've been working on the last version of David Nalesnik's guide-finger code. The reason is a horizontal and vertical placement problem when the guide line is long and/or at a steep angle. I have managed to fix the vertical problem, Yes--I was using the Y-extent of the number plus the line, so when the line extends below the number, both get pushed up. but the horizontal problem has me flummoxed. I'm shifting the stencil to the centered position by altering its X-extent. Looks like I made an error in calculation. I've inserted the correction in your revised function in the attached file. (Sorry, I'm too tired to alter it to fit your changed logic...) === \version 2.17.4 \language english #(set-global-staff-size 30) % left-hand finger guide before note #(define (guide-finger slope len fingering) ;; Purpose ;; add ornamentation line before fingering symbol to indicate figner movement along a ;; string without making a sound (i.e., not a glissando) ;; Parameters ;; slope : angle of rotation around right centre ;; len : length of line prefacing fingering ;; fingering : fingering designation for note (let ((music (make-music 'FingeringEvent))) (set! (ly:music-property music 'tweaks) (acons 'stencil (lambda (grob) (let* ( ;; assign to finger the digit property from parameter fingering (finger (ly:music-property fingering 'digit)) ;; DOES NEXT LINE GENERATE A STENCIL FROM THE STRING FOR A FINGER NUMBER??? ;; IS THERE A WAY TO GENERATE A FINGER STENCIL THAT IS A FINGER NUMBER RATHER THAN A MARKUP? (finger-stil (grob-interpret-markup grob (number-string finger))) Yes, it does exactly that. As far as I can tell, this function produces fingering numbers in a similar way to how they are ordinarily produced, judging by the default settings for Fingering properties 'text and 'stencil (ly:fingering::calc-text found in scm/output-lib.scm and ly:text-interface::print in lily/text-interface.cc, respectively). Hope this helps, David pabuhr-fingering-slide-revision.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
I've been working on the last version of David Nalesnik's guide-finger code. The reason is a horizontal and vertical placement problem when the guide line is long and/or at a steep angle. I have managed to fix the vertical problem, but the horizontal problem has me flummoxed. The example below shows the horizontal problem by placing a guide finger above/below a normal finger number. A stencil is created for the guide-line and finger number, which needs to be centered above/below its associated note head for fingeringOrientations up and down. However, something is wrong with the centering calculation. The width of the stencil seems to be too short so the calculation fails to center it. So there is something about the width of the stencil I do not understand. I have heavily comment the code to make it possible to understand. === \version 2.17.4 \language english #(set-global-staff-size 30) % left-hand finger guide before note #(define (guide-finger slope len fingering) ;; Purpose ;; add ornamentation line before fingering symbol to indicate figner movement along a ;; string without making a sound (i.e., not a glissando) ;; Parameters ;; slope : angle of rotation around right centre ;; len : length of line prefacing fingering ;; fingering : fingering designation for note (let ((music (make-music 'FingeringEvent))) (set! (ly:music-property music 'tweaks) (acons 'stencil (lambda (grob) (let* ( ;; assign to finger the digit property from parameter fingering (finger (ly:music-property fingering 'digit)) ;; DOES NEXT LINE GENERATE A STENCIL FROM THE STRING FOR A FINGER NUMBER??? ;; IS THERE A WAY TO GENERATE A FINGER STENCIL THAT IS A FINGER NUMBER RATHER THAN A MARKUP? (finger-stil (grob-interpret-markup grob (number-string finger))) ;; assign to finger-stil-X the width of finger-stil (finger-stil-X (ly:stencil-extent finger-stil X)) ;; assign to finger-stil-Y the height slightly below the middle of finger number (finger-stil-Y (* 0.4 (interval-length (ly:stencil-extent finger-stil Y ;; assign to guide-line a horizontal line-stencil with thickness ;; and length len up finger-stil-Y vertically on fingering number (guide-line (make-line-stencil 0.13 0 finger-stil-Y len finger-stil-Y)) ;; rotate guide-line slope degrees around right centre (guide-line (ly:stencil-rotate guide-line slope 1 0)) ;; center line vertically on fingering number (guide-line-X (ly:stencil-extent guide-line X)) ;; assign to stil the concatenation of stencil line and finger number along X-axis on right ;; add padding 0.2 to move guide slightly left from finger number (stil (ly:stencil-combine-at-edge guide-line X 1 finger-stil 0.2)) ;; assign to stil-ext-X the width of stil (stil-ext-X (ly:stencil-extent stil X)) ) ;; end declarations ;; fingering oriented on left/right side ? (if (= 0 (ly:grob-property grob 'side-axis)) ;; return finger guide as is stil ;; otherwise, create and return new finger guide with X-extents positioned with the number ;; centered over the note (ly:make-stencil ;; copy expr from stil (ly:stencil-expr stil) ;;# ;; widen the stencil by doubling its width minus one finger-number width, ;; which should have a center point under the remaining finger number ;;# (cons 0 (- (* 2 (interval-length stil-ext-X)) (interval-length finger-stil-X))) (ly:stencil-extent finger-stil Y) ) ;; end make-stencil ) ;; end if ) ;; end let ) ;; end lambda (ly:music-property music 'tweaks) ) ;; end acons ) ;; end set music ) ;; end let ) % guide-neutral % c-\gn-14 c4^\gn^2 c4-\gn-3 c4_\gn_4 gn = #(define-music-function (parser location fingering) (ly:music?) (guide-finger 0 0.7 fingering)) % line-slope line-length % guide-down % c-\gd-14 c4^\gd^2 c4-\gd-3 c4_\gd_4 gd = #(define-music-function (parser location fingering) (ly:music?) (guide-finger 20 0.7 fingering)) % guide-up % c-\gu-14 c4^\gu^2 c4-\gu-3 c4_\gu_4 gu = #(define-music-function (parser location fingering) (ly:music?) (guide-finger -20 0.7 fingering)) % guide slope length % c-\gslen #-15 #1 -14 c4^\gslen
Re: Glissando between single notes in chord
On 07/10/12 11:07, David Nalesnik wrote: Hi pabuhr, On Sat, Oct 6, 2012 at 5:21 PM, pabuhr pab...@fastmail.fm wrote: [...] Below is my attempt at a guide finger (which I'm sure you saw a few months ago). http://www.mail-archive.com/lilypond-user@gnu.org/msg73509.html [...] The problem with my version is that the combined guide/finger-number are centred above/below the note. I don't know how to get the finger number centred above the note (i.e., right justify the entire glyph); any help would be appreciated. I did try ly:stencil-aligned-to but no change in the output. I've attached a possible solution to the problem. I haven't tried it out beyond your example, but I hope it will prove useful. Thanks, that's very useful. I added three functions to your code which which take just the slope as parameter and default to using either hyphen, en dash, and em dash, to cater for different degrees of tightness of note spacing: % guide hyphen % c-\ghy #-15 -14 c4^\ghy #45 ^2 c4-\ghy #-15 -3 c4_\ghy# -14 _4 ghy = #(define-music-function (parser location slope fingering) (number? ly:music?) (gx slope #x2010 fingering)) % guide en dash % c-\gen #-15 -14 c4^\gen #45 ^2 c4-\gen #-15 -3 c4_\gen# -14 _4 gen = #(define-music-function (parser location slope fingering) (number? ly:music?) (gx slope #x2013 fingering)) % guide em dash % c-\gem #-15 -14 c4^\gem #45 ^2 c4-\gem #-15 -3 c4_\gem# -14 _4 gem = #(define-music-function (parser location slope fingering) (number? ly:music?) (gx slope #x2014 fingering)) I also tried two-em and three-em dashes (unicode values 0x2E3A and 0x2E3B, see http://www.unicode.org/charts/PDF/U2E00.pdf), but they're not in the emmentaler font; when I put them in a function the console spits out: Preprocessing graphical objects... programming error: FT_Get_Glyph_Name () error: invalid argument continuing, cross fingers programming error: Glyph has no name, but font supports glyph naming. Skipping glyph U+10002E3A, file /usr/local/lilypond/usr/share/lilypond/current/fonts/otf/emmentaler-18.otf Nick http://www.unicode.org/charts/PDF/U2E00.pdf ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
Hi Nick, On Sun, Oct 7, 2012 at 4:39 PM, Nick Payne nick.pa...@internode.on.net wrote: [...] Thanks, that's very useful. I added three functions to your code which which take just the slope as parameter and default to using either hyphen, en dash, and em dash, to cater for different degrees of tightness of note spacing: [...] I also tried two-em and three-em dashes (unicode values 0x2E3A and 0x2E3B, see http://www.unicode.org/charts/PDF/U2E00.pdf), but they're not in the emmentaler font; when I put them in a function the console spits out: Preprocessing graphical objects... programming error: FT_Get_Glyph_Name () error: invalid argument continuing, cross fingers programming error: Glyph has no name, but font supports glyph naming. Skipping glyph U+10002E3A, file /usr/local/lilypond/usr/share/lilypond/current/fonts/otf/emmentaler-18.otf Unfortunately, I'm not sure at the moment how to get the function to work with those characters. However, if you're interested simply in drawing lines, then there will be greater flexibility with a line stencil, rather than em- and en-dashes and such. I've adapted the function to do just that (see attached). It allows customization of slope and the length of the guide-line. HTH, David guide-finger2.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
Hi again, On Sun, Oct 7, 2012 at 6:00 PM, David Nalesnik david.nales...@gmail.com wrote: Hi Nick, [...] if you're interested simply in drawing lines, then there will be greater flexibility with a line stencil, rather than em- and en-dashes and such. I've adapted the function to do just that (see attached). It allows customization of slope and the length of the guide-line. Just remembered that I wrote an engraver a while back which can draw lines between fingering numbers. I can't find the file in the archives, so I'll attach it again here. With this override (which uses a property defined in the file), glissando lines get moved from between their notes to the numbers: \override Glissando #to-fingerings = ##t You can control which fingerings the line goes between by setting glissandoMap. It's meant to connect fingering numbers, but you can hide the first number to mimic the effect of the function earlier in the thread. (I'm sure something could be done to this so you wouldn't need to do that!) -David fingering-slide-engraver.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
Me again-- On Sun, Oct 7, 2012 at 6:20 PM, David Nalesnik david.nales...@gmail.com wrote: [...] It's meant to connect fingering numbers, but you can hide the first number to mimic the effect of the function earlier in the thread. (I'm sure something could be done to this so you wouldn't need to do that!) I got myself a little off-track. Just noticed the OP again. To create your example there, you'd use the engraver attached above and do something like this: \relative c'' { \override Glissando #'to-fingerings = ##t \set glissandoMap = #'((0 . 0)) fis^4 b, a dis,2\glissando g^4 b, g e | } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
programming error: Glyph has no name, but font supports glyph naming. Skipping glyph U+10002E3A, file /usr/local/lilypond/usr/share/lilypond/current/fonts/otf/emmentaler-18.otf Uh, oh, this is a nonsense error message. There *never* exists U+10002E3A, since this is outside of the valid Unicode range. Can you prepare a minimum example which delivers this error? Werner ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
On 08/10/12 15:16, Werner LEMBERG wrote: programming error: Glyph has no name, but font supports glyph naming. Skipping glyph U+10002E3A, file /usr/local/lilypond/usr/share/lilypond/current/fonts/otf/emmentaler-18.otf Uh, oh, this is a nonsense error message. There *never* exists U+10002E3A, since this is outside of the valid Unicode range. Can you prepare a minimum example which delivers this error? This gives an error message with the identical glyph number of U+10002E3A: \version 2.17.0 \relative c' { c1^\markup { \char ##x2E3A } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
2012/10/6 Nick Payne nick.pa...@internode.on.net: I'm using glissandos to indicate a guide finger in fingering, and in most cases where there are chords, I don't want it between all the notes in successive chords. Can this be done without creating a separate hidden voice with the single notes having the glissando between them. e.g. in the following, I only want the glissando between the top notes in the chords. \version 2.17.3 guide = #(define-music-function (parser location padleft padright shift missacc) (number? number? pair? boolean?) #{ \once \override Glissando #'(bound-details left padding) = #padleft \once \override Glissando #'(bound-details right padding) = #padright \once \override Glissando #'extra-offset = #shift \once \override Glissando #'(bound-details right end-on-accidental) = #missacc \once \override Glissando #'breakable = ##t \once \override Glissando #'after-line-breaking = ##t #}) \relative c'' { \guide #1 #0.5 #'(0 . 1.4) ##f fis^4 b, a dis,2\glissando g^4 b, g e | } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user Hi Nick, two month ago I created the code below (the same is attached, too). It is not exactly what you want, but it should give you some ideas. \version 2.15.39 #(define (radians-degree radians) (/ (* radians 180) PI)) #(define ((gliss-plus-text padding text) grob) (let* ((text-stencil (grob-interpret-markup grob text)) (spanner-stencil (ly:line-spanner::print grob)) (left-bound-info (ly:grob-property grob 'left-bound-info)) (y-left (cdar left-bound-info)) (right-bound-info (ly:grob-property grob 'right-bound-info)) (y-right (cdar right-bound-info)) (slant (if ( y-right y-left) 1 -1)) (spanner-stencil-x-length (interval-length (ly:stencil-extent spanner-stencil X))) (spanner-stencil-y-length (interval-length (ly:stencil-extent spanner-stencil Y))) (alpha (radians-degree (atan (/ spanner-stencil-y-length spanner-stencil-x-length (spanner-center-X (interval-center (ly:stencil-extent spanner-stencil X))) (label-center-X (interval-center (ly:stencil-extent text-stencil X (ly:stencil-combine-at-edge spanner-stencil Y UP (ly:stencil-translate (ly:stencil-rotate text-stencil (* slant alpha) 0 0) (cons (- spanner-center-X label-center-X) 0)) (+ (* -0.5 spanner-stencil-y-length) padding glissTweak = #(define-music-function (parser location lst)(pair?) #{ \once \override Glissando #'after-line-breaking = #(lambda (grob) (let ((gliss-count (ly:grob-property grob 'glissando-index))) (map (lambda (x) (let ((gliss-nmbr (car x)) (property-value-alist (cdr x))) (if (eq? gliss-nmbr gliss-count) (map (lambda (y) (ly:grob-set-property! grob (car y) (cdr y))) property-value-alist) #f))) ; $lst))) % for Version 2.14.2 lst))) $(make-music 'EventChord 'elements (list (make-music 'GlissandoEvent))) #}) tweakedGliss = { \once \override Glissando #'minimum-length = #8 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods } \relative c' { \override TextScript #'font-size = #-2 c e g bes d2\glissando^\no tweaks\ d, a' fis' c' e' \tweakedGliss \glissTweak #`((0 . ((color . ,red) (normalized-endpoints . (0 . 0.8)) (stencil . ,(gliss-plus-text -1.8 (markup #:italic #:fontsize -8 gliss.) (1 . ((style . zigzag))) (2 . ((style . trill) (color . (0.5 0.5 0.5 (3 . ((style . dashed-line))) (4 . ((stencil . ,(gliss-plus-text 0 (markup #:italic #:fontsize -8 gliss.))) (normalized-endpoints . (0 . 0.7)) (color . ,green c' e g bes d2^\some tweaks\ d, a' fis' c' e' \once \override Glissando #'(bound-details right arrow) = ##t \glissTweak #`((0 . ((style . dashed-line) (normalized-endpoints . (0 . -2.1 (1 . ((stencil . #f))) (2 . ((stencil . #f))) (3 . ((stencil . #f))) (4 . ((style . dashed-line) (normalized-endpoints . (0 . -1.5) c' e g bes d2^\some other tweaks\ d, a' fis' c' e' } HTH, Harm attachment: gliss-chf-2.png gliss-chf-2.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
I'm using glissandos to indicate a guide finger in fingering, and in ... Hey Nick, we certainly struggle with indicating a guide finger. 8-) First, an observation, which I know you are already aware of, but I'll make it anyway. It is important to differentiate between the glissando, which makes a sound, and a guide finger, which is finger movement without a sound (like a breath mark). Therefore, the notation for these two items needs differentiation or the guitar player can make an uncalled for sound. Clearly, the glissando with a finger number implies a guide finger. The notation I like for the guide finger is a short mark before the finger number so there is less chance of mistaking it for a glissando. Below is my attempt at a guide finger (which I'm sure you saw a few months ago). I redefined your guide to Guide so both are available in the example. My complain with your version is that I would play it as a glissando rather than take it as an instruction for a guide finger. The problem with my version is that the combined guide/finger-number are centred above/below the note. I don't know how to get the finger number centred above the note (i.e., right justify the entire glyph); any help would be appreciated. I did try ly:stencil-aligned-to but no change in the output. Anyway, my 2 cents on this on-going struggle. ;-) \version 2.16.0 \language english #(set-global-staff-size 30) % left-hand finger guide finger between notes #(define (gx slope character fingering) ;; Purpose ;; add ornamentation character before fingering symbol ;; Parameters ;; slope : angle of rotation around right centre ;; character : ornamentation character for fingering ;; fingering : fingering designation for note ;; Examples ;; (gx 0 #x2013 fingering) ;; unicode #x2011 - #x2015 are different length - punctuation (let ((music (make-music 'FingeringEvent)) (finger (ly:music-property fingering 'digit)) (guide-char character)) (set! (ly:music-property music 'tweaks) (acons 'stencil (lambda (grob) (ly:stencil-combine-at-edge (ly:stencil-rotate (grob-interpret-markup grob (markup #:char guide-char)) slope 1 0);; rotate slope around right centre X 1;; combine stencils along X-axis on right (grob-interpret-markup grob (number-string finger)) 0.2) ) ;; add padding to move guide slightly left from finger number (ly:music-property music 'tweaks))) music)) % guide-neutral % c-\gn-14 c4^\gn^2 c4-\gn-3 c4_\gn_4 gn = #(define-music-function (parser location fingering) (ly:music?) (gx 0 #x2013 fingering)) % guide-down % c-\gd-14 c4^\gd^2 c4-\gd-3 c4_\gd_4 gd = #(define-music-function (parser location fingering) (ly:music?) (gx 20 #x2013 fingering)) % guide-up % c-\gu-14 c4^\gu^2 c4-\gu-3 c4_\gu_4 gu = #(define-music-function (parser location fingering) (ly:music?) (gx -20 #x2013 fingering)) % guide slope % c-\gsl #-15 -14 c4^\gsl #45 ^2 c4-\gsl #-15 -3 c4_\gsl# -14 _4 gsl = #(define-music-function (parser location slope fingering) (number? ly:music?) (gx slope #x2013 fingering)) % guide slope unicode % c-\gsl #-15 ##x2011 -14 c4^\gsl #45 ##x2012 ^2 c4-\gsl #-15 ##x2013 -3 c4_\gsl #-14 ##x2014 _4 gsn = #(define-music-function (parser location slope unicode fingering) (number? number? ly:music?) (gx slope unicode fingering)) % guide slope character % c-\gsl #-15 ##\+ -14 c4^\gsl #45 ##\+ ^2 c4-\gsl #-15 ##\! -3 c4_\gsl #-14 ##\! _4 gsc = #(define-music-function (parser location slope character fingering) (number? char? ly:music?) (gx slope (char-integer character) fingering)) Guide = #(define-music-function (parser location padleft padright shift missacc) (number? number? pair? boolean?) #{ \once \override Glissando #'(bound-details left padding) = #padleft \once \override Glissando #'(bound-details right padding) = #padright \once \override Glissando #'extra-offset = #shift \once \override Glissando #'(bound-details right end-on-accidental) = #missacc \once \override Glissando #'breakable = ##t \once \override Glissando #'after-line-breaking = ##t #}) fl = \set fingeringOrientations = #'(left) \relative c'' { \Guide #1 #0.5 #'(0 . 1.4) ##f fs^4 b, a ds,2\glissando g^4 b, g e | fs^4 b, a ds,2 g-\gd^4 b, g e | fs^4 b, a ds,2 g-\gsn #10 ##x2014 ^4 b, g e | \fl fs-4 b, a-2 ds,2 g-\gd^4 b, g-\gu^2 e | } % Local Variables: % % tab-width: 4 % % compile-command: lilypond --ps test6.ly % % End: % ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
Hi pabuhr, On Sat, Oct 6, 2012 at 5:21 PM, pabuhr pab...@fastmail.fm wrote: [...] Below is my attempt at a guide finger (which I'm sure you saw a few months ago). http://www.mail-archive.com/lilypond-user@gnu.org/msg73509.html [...] The problem with my version is that the combined guide/finger-number are centred above/below the note. I don't know how to get the finger number centred above the note (i.e., right justify the entire glyph); any help would be appreciated. I did try ly:stencil-aligned-to but no change in the output. I've attached a possible solution to the problem. I haven't tried it out beyond your example, but I hope it will prove useful. Best, David guide-finger.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Glissando between single notes in chord
Hi Harm, On Sat, Oct 6, 2012 at 6:20 AM, Thomas Morley thomasmorle...@googlemail.com wrote: [...] two month ago I created the code below (the same is attached, too). It is not exactly what you want, but it should give you some ideas. Just tried this out. Very cool! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user