Re: how to write a scheme function to override glissando properties
This slide function is great. I always have to tweak the glissando command because it is always too small. On 12/19/2010 3:26 PM, jakob lund wrote: I 2010/12/19 Marc Hohlm...@hohlart.de: Am 16.12.2010 17:04, schrieb Patrick Schmidt: [...] Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http://www.mail-archive.com/lilypond-devel@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Hm, I don't know what's wrong - I tried something like slide = #(define-music-function (parser location len thick beg end) (number? number? ly:music? ly:music?) #{ \once \override Glissando #'minimum-length = $len \once \override Glissando #'thickness = $thick \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods $beg \glissando $end #}) myMusic = \relative c' { \slide #10 #5 a4 b4\3 } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } and that doesn't work either. I don't understand why ... I think what happens is that the start note, passed to your function, is already wrapped up in an object. \glissando is meant for use with a single note, rather than with a music object. You can use scheme to add the `start glissando' property to the object though: \version 2.13.40 slide = #(define-music-function (parser location length startnote) (number? ly:music?) #{ \once\override Voice.Glissando #'minimum-length = $length \once\override Voice.Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods #(begin (set! (ly:music-property $startnote 'elements) (cons (make-music (quote GlissandoEvent)) (ly:music-property $startnote 'elements) )) (ly:export $startnote)) #}) { \slide #7 a'' e'' } this page contains a similar example http://lilypond.org/doc/v2.13/Documentation/extending/adding-articulation-to-notes-_0028example_0029 Jakob ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 19.12.2010 21:26, schrieb jakob lund: [...] I think what happens is that the start note, passed to your function, is already wrapped up in an object. \glissando is meant for use with a single note, rather than with a music object. Sounds reasonable. You can use scheme to add the `start glissando' property to the object though: \version 2.13.40 slide = #(define-music-function (parser location length startnote) (number? ly:music?) #{ \once\override Voice.Glissando #'minimum-length = $length \once\override Voice.Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods #(begin (set! (ly:music-property $startnote 'elements) (cons (make-music (quote GlissandoEvent)) (ly:music-property $startnote 'elements) )) (ly:export $startnote)) #}) { \slide #7 a'' e'' } Thanks for this example! Regards, Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 19.12.2010 21:22, schrieb Patrick Schmidt: [...] The values for minimum-length in different contexts influence each other. The highest value wins. This is reasonable but unfortunately the glissandi staves and tab staves don't have the same length in print even when they were given the same value for minimum-length... Ok, since the property is called minimum-length, of course the greater value wins - the note heads are spaced wide enough so that the greater amount of #'minimum-length fits between. The shorter glissando line will be expanded appropriately... Thinking about it, I think that the default bounds are too big for tablature. Have a look at http://lilypond.org/doc/v2.13/Documentation/internals/glissando In #'bound-details, the padding is set to 1.5 * staff-space, and because the staff-space in tablature is 1.5 times the normal space, the glissando lines are way too far away from the fret numbers. Setting these to 1 will improve the output. \once \override TabVoice.Glissando #'bound-details = #'((right (attach-dir . 0) (padding . 1)) (left (attach-dir . 0) (padding . 1))) a''2 \glissando e' Regards, Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 16.12.2010 17:04, schrieb Patrick Schmidt: [...] Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http://www.mail-archive.com/lilypond-devel@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Hm, I don't know what's wrong - I tried something like slide = #(define-music-function (parser location len thick beg end) (number? number? ly:music? ly:music?) #{ \once \override Glissando #'minimum-length = $len \once \override Glissando #'thickness = $thick \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods $beg \glissando $end #}) myMusic = \relative c' { \slide #10 #5 a4 b4\3 } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } and that doesn't work either. I don't understand why ... Sorry for being not very helpful. Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 19.12.2010 um 20:13 schrieb Marc Hohl: Am 16.12.2010 17:04, schrieb Patrick Schmidt: [...] Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http:// www.mail-archive.com/lilypond-devel@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Hm, I don't know what's wrong - I tried something like slide = #(define-music-function (parser location len thick beg end) (number? number? ly:music? ly:music?) #{ \once \override Glissando #'minimum-length = $len \once \override Glissando #'thickness = $thick \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods $beg \glissando $end #}) myMusic = \relative c' { \slide #10 #5 a4 b4\3 } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } and that doesn't work either. I don't understand why ... Needless to say, that I don't understand it either... Apparently it's not even possible to override the length of a glissando in one context without changing the look of the other context. Look at this: \version 2.13.44 slides = { a2\glissando b2\3 } \score { \new Staff { \clef treble_8 \slides } \new TabStaff { \slides } \layout { \context { \Voice \override Glissando #'minimum-length = #10 \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods \override Glissando #'thickness = #3 } \context { \TabVoice \override Glissando #'minimum-length = #1 \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods \override Glissando #'thickness = #10 } } } The values for minimum-length in different contexts influence each other. The highest value wins. This is reasonable but unfortunately the glissandi staves and tab staves don't have the same length in print even when they were given the same value for minimum-length... Sorry for being not very helpful. No, no, I appreciate your input very much. Thanks, patrick Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
I 2010/12/19 Marc Hohl m...@hohlart.de: Am 16.12.2010 17:04, schrieb Patrick Schmidt: [...] Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http://www.mail-archive.com/lilypond-devel@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Hm, I don't know what's wrong - I tried something like slide = #(define-music-function (parser location len thick beg end) (number? number? ly:music? ly:music?) #{ \once \override Glissando #'minimum-length = $len \once \override Glissando #'thickness = $thick \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods $beg \glissando $end #}) myMusic = \relative c' { \slide #10 #5 a4 b4\3 } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } and that doesn't work either. I don't understand why ... I think what happens is that the start note, passed to your function, is already wrapped up in an object. \glissando is meant for use with a single note, rather than with a music object. You can use scheme to add the `start glissando' property to the object though: \version 2.13.40 slide = #(define-music-function (parser location length startnote) (number? ly:music?) #{ \once\override Voice.Glissando #'minimum-length = $length \once\override Voice.Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods #(begin (set! (ly:music-property $startnote 'elements) (cons (make-music (quote GlissandoEvent)) (ly:music-property $startnote 'elements) )) (ly:export $startnote)) #}) { \slide #7 a'' e'' } this page contains a similar example http://lilypond.org/doc/v2.13/Documentation/extending/adding-articulation-to-notes-_0028example_0029 Jakob ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 19.12.2010 um 21:26 schrieb jakob lund: I 2010/12/19 Marc Hohl m...@hohlart.de: Am 16.12.2010 17:04, schrieb Patrick Schmidt: [...] Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http://www.mail-archive.com/lilypond-devel@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Hm, I don't know what's wrong - I tried something like slide = #(define-music-function (parser location len thick beg end) (number? number? ly:music? ly:music?) #{ \once \override Glissando #'minimum-length = $len \once \override Glissando #'thickness = $thick \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods $beg \glissando $end #}) myMusic = \relative c' { \slide #10 #5 a4 b4\3 } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } and that doesn't work either. I don't understand why ... I think what happens is that the start note, passed to your function, is already wrapped up in an object. \glissando is meant for use with a single note, rather than with a music object. You can use scheme to add the `start glissando' property to the object though: \version 2.13.40 slide = #(define-music-function (parser location length startnote) (number? ly:music?) #{ \once\override Voice.Glissando #'minimum-length = $length \once\override Voice.Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods #(begin (set! (ly:music-property $startnote 'elements) (cons (make-music (quote GlissandoEvent)) (ly:music-property $startnote 'elements) )) (ly:export $startnote)) #}) { \slide #7 a'' e'' } this page contains a similar example http://lilypond.org/doc/v2.13/Documentation/extending/adding- articulation-to-notes-_0028example_0029 Jakob Hi Jakob, thank you, too for your solution. I did have a look at the section on adding articulation to notes in Extending but I think I have a different problem. I actually wanted to write a function that calls \glissando and overrides its properties more or less for the whole score. I'd even prefer to tweak the command \glissando in order to get the same output in a Staff and a TabStaff. But I probably didn't look in the right place. I just found the definition of \glissando in property-init.ly: glissando = #(make-music 'GlissandoEvent) But I didn't manage to override its properties. Maybe you know how to do it? Thanks, patrick ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 14.12.2010 um 20:16 schrieb Marc Hohl: Am 14.12.2010 14:25, schrieb Patrick Schmidt: Hi all, Hi Patrick, I noticed that glissandi are quite often hardly visible in a Staff- context. There is also a huge difference in the look of glissandi in Staff- and TabStaff-contexts. I'd like to write a function to adjust these differences for Staffs and TabStaffs separately but I don't even manage to manipulate the look in general. I'd be very grateful if someone showed me what's missing in the following code alternatives: [...] Don't you think that you could introduce global values within a layout block which fit for the whole document? Something like \layout { \context { \Voice \override Glissando #'minimum-length =#best value for staves \override Glissando #'springs-and-rods = #ly:spanner::set- spacing-rods } \context { \TabVoice \override Glissando #'minimum-length = #best value for tab staves \override Glissando #'springs-and-rods = #ly:spanner::set- spacing-rods } } Hi Marc, thanks for your solution but I'm still trying to find out what's wrong with the scheme function I posted. I discussed the need for this function with Carl and he gave me some advice: http://www.mail- archive.com/lilypond-de...@gnu.org/msg32745.html. It might be impossible to find a general set of values for staves and tab staves. If I don't succeed I learned something about writing scheme functions, at least. Maybe you can spot the mistake in the function? Thanks for your help! patrick Regards, Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
how to write a scheme function to override glissando properties
Hi all, I noticed that glissandi are quite often hardly visible in a Staff- context. There is also a huge difference in the look of glissandi in Staff- and TabStaff-contexts. I'd like to write a function to adjust these differences for Staffs and TabStaffs separately but I don't even manage to manipulate the look in general. I'd be very grateful if someone showed me what's missing in the following code alternatives: 1) slide = #(make-music (sequential-music (list (make-grob-property-set 'Glissando 'thickness 5) (make-grob-property-set 'Glissando 'minimum-length 10) (make-grob-property-set 'Glissando 'springs-and-rods ly:spanner::set-spacing-rods) (quote GlissandoEvent 2) slide = #(define-music-function (parser location) () #{ \once \override Glissando #'minimum-length = #10 \once \override Glissando #'thickness = #5 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods \glissando #}) myMusic = \relative c' { a4\slide b4\3 % \override Voice.Glissando #'minimum-length = #10 %this works % \override Voice.Glissando #'springs-and-rods = #ly:spanner::set- spacing-rods % this works % \displayMusic { a4\glissando b4\3 } } \score { \new Staff { \new Voice { \clef treble_8 \myMusic } } \new TabStaff { \new TabVoice { \myMusic } } } Thanks for your help! patrick ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to write a scheme function to override glissando properties
Am 14.12.2010 14:25, schrieb Patrick Schmidt: Hi all, Hi Patrick, I noticed that glissandi are quite often hardly visible in a Staff-context. There is also a huge difference in the look of glissandi in Staff- and TabStaff-contexts. I'd like to write a function to adjust these differences for Staffs and TabStaffs separately but I don't even manage to manipulate the look in general. I'd be very grateful if someone showed me what's missing in the following code alternatives: [...] Don't you think that you could introduce global values within a layout block which fit for the whole document? Something like \layout { \context { \Voice \override Glissando #'minimum-length =#best value for staves \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods } \context { \TabVoice \override Glissando #'minimum-length = #best value for tab staves \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods } } Regards, Marc ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user