Defining custom noteHead scaling problem
Cheating from http://old.nabble.com/defining-custom-note-heads-td17430564.html#a17626150 the older post I was able to define my own special noteHead, combining three glyphs together, calling it a tripleNote. It works perfectly in the default score size. However, when I resize the score to smaller one, the tripleNote is not scaled well - the third noteHead appears too far from the other noteHeads. I suspect this is because the offset values are hard coded into the tripleNote definition. Is there a way how to code these values proportionally to the score size instead? % Lilypond begin \version 2.12.1 tripleNote = { \once \override NoteHead #'stencil = #ly:text-interface::print \once \override NoteHead #'text = #(markup #:combine #:musicglyph noteheads.s2 #:halign 1 #:musicglyph noteheads.s2 #:halign -0.1 #:musicglyph noteheads.s2) } { \clef G_8 \override Staff.Stem #'transparent = ##t \tripleNote g } \score { { \clef G_8 \override Staff.Stem #'transparent = ##t \tripleNote g } \layout { #(layout-set-staff-size 15) \context { \Staff fontSize = #-4.7 \override VerticalAxisGroup #'minimum-Y-extent = #'(0 . 0) \override StaffSymbol #'staff-space = #(magstep -8) \override StaffSymbol #'thickness = #(magstep -4.5) } } } % Lilypond end -- View this message in context: http://old.nabble.com/Defining-custom-noteHead-scaling-problem-tp26315301p26315301.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Defining custom noteHead scaling problem
2009/11/12 Jiri Zurek (Prague) zu...@ics.cas.cz: Cheating from http://old.nabble.com/defining-custom-note-heads-td17430564.html#a17626150 the older post I was able to define my own special noteHead, combining three glyphs together, calling it a tripleNote. It works perfectly in the default score size. However, when I resize the score to smaller one, the tripleNote is not scaled well - the third noteHead appears too far from the other noteHeads. I suspect this is because the offset values are hard coded into the tripleNote definition. Is there a way how to code these values proportionally to the score size instead? If you use \concat, there's no need to mess around with \hspace: tripleNote = { \once \override NoteHead #'stencil = #(lambda (grob) (grob-interpret-markup grob (markup #:concat (#:musicglyph noteheads.s2 #:musicglyph noteheads.s2 #:musicglyph noteheads.s2 } Regards, Neil ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Defining custom noteHead scaling problem
2009/11/12 Neil Puttock n.putt...@gmail.com: If you use \concat, there's no need to mess around with \hspace: For \hspace, read \halign. :) ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: scaling problem
If you want a foolproof solution, define a markup-command, that constructs the brackets, and adjusts lengths with the magstep of font-size. I've done that already (see below). However, I wasn't able to adjust the extra-offset parameter in a scaled way. Can you help? Werner == #(define-markup-command (vbracket layout props vsize xoff yoff) (number? number? number?) A left vertical bracket. (let* ((mag (magstep (chain-assoc-get 'font-size props 0))) (vb (interpret-markup layout props (markup #:stencil (ly:stencil-translate (ly:bracket Y (cons 0 (* mag vsize)) (* mag 0.2) (* mag 1)) (cons (* mag xoff) 0)) vb)) \new Staff \with { fontSize = #-4 \override StaffSymbol #'staff-space = #(magstep -4) } { % compare this c''-\tweak #'extra-offset #'(2 . 6) -\markup \stencil #(ly:bracket Y '(0 . 5) 0.2 1) % with this c''-\markup \vbracket #5 #2 #6 } ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: scaling problem
2007/8/3, Werner LEMBERG [EMAIL PROTECTED]: If you want a foolproof solution, define a markup-command, that constructs the brackets, and adjusts lengths with the magstep of font-size. I've done that already (see below). However, I wasn't able to adjust the extra-offset parameter in a scaled way. Can you help? extra-offset is scaled by the staff-space of the StaffSymbol, so you should be able to use \tweak with extra-offset for \vbracket. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: scaling problem
However, I wasn't able to adjust the extra-offset parameter in a scaled way. Can you help? extra-offset is scaled by the staff-space of the StaffSymbol, so you should be able to use \tweak with extra-offset for \vbracket. Hmm, have a look at the attached image. Something doesn't work as expected... Is it possible that there is still some vertical space inserted somewhere? I tried to set both `padding' and `staff-padding' to zero (using \tweak), but this has no effect. In general, it would be great to have a `\scaledMarkup' command which takes the size of the staff into account to which the markup is attached. Werner == #(define-markup-command (vbracket layout props vsize xoff) (number? number?) A left vertical bracket. (let* ((mag (magstep (chain-assoc-get 'font-size props 0))) (vb (interpret-markup layout props (markup #:stencil (ly:stencil-translate (ly:bracket Y (cons 0 (* mag vsize)) (* mag 0.2) (* mag 1)) (cons (* mag xoff) 0)) vb)) \new Staff \with { fontSize = #-6 \override StaffSymbol #'staff-space = #(magstep -6) } { c''-\tweak #'extra-offset #'(0 . 6) -\markup \vbracket #5 #2 } \new Staff \with { fontSize = #-3 \override StaffSymbol #'staff-space = #(magstep -3) } { c''-\tweak #'extra-offset #'(0 . 6) -\markup \vbracket #5 #2 } { c''-\tweak #'extra-offset #'(0 . 6) -\markup \vbracket #5 #2 } inline: scaled-markup.png___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
scaling problem
[current lilypond git] Folks, look at this example: \new Staff \with { %fontSize = #-4 %\override StaffSymbol #'staff-space = #(magstep -4) } { c''-\tweak #'extra-offset #'(2 . 6) -\markup \stencil #(ly:bracket Y '(0 . 5) 0.2 1) } `stencil-big.png' shows the result with the two comment characters, `stencil-small.png' the same without them. On the other hand, if I say #(set-global-staff-size XX) (`XX' an arbitrary size) instead the `\with' block, the scaling of the bracket always works, this is, the result always looks like shown in `big.png', regardless of the size. With other words: It's not sufficient to set `fontSize' and `staff-space' in the `\with' block to have proper scaling for (at least) the `\stencil' markup command. I tried hard to find something in the docs and in the source files, but without success. What am I missing? Help, please. Werner inline: stencil-small.pnginline: stencil-big.png___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user