I used the first snippet posted by Simon for an Arrastres function. Then I
noticed Davids post for afterGrace so I tried my hand at that.
Both work but I have a few questions.
In the first posted by simon I did it my typical way. And it works like all
my other functions. Typically I use modified lily functions like bendAfter
(one of my favorite to use). In all cases I can't figure out how to add the
command in the function. So although it works it could be better.
Here is the code
%%%%%%%%%%%%%%%
\version "2.18.2"
Arrastres =
#(define-music-function
(parser location len
mus note)
(number?
ly:music? ly:music?)
#{
\afterGrace
$mus
{
\once \override Flag.stroke-style = #"grace"
\once \override NoteHead.extra-spacing-width = #`(,len . 1)
s1*0 \stemUp $note
}
#})
mus = \relative c' {
\time 2/4
\key g \major
\stemDown dis16 fis dis b c a g \Arrastres #-3 fis \glissando c'8|
<a c>2
}
\score {
\mus
}
%%%%%%%%%%%%%%%%%%
My question is where do I add \glissando in the function so I don't have to
write it everytime.
The second modified from the snippet posted by David afterGrace works great
and I even got it so i don't need \glissando. But again I have questions.
Here is the code
%%%%%%%%%%%%%
\version "2.18.2"
Fraction = #(cons 6 8)
Arrastres =
#(define-music-function (parser location len main grace) (number? ly:music?
ly:music?)
(_i "Create @var{grace} note(s) after a @var{main} music _expression_.")
(let ((main-length (ly:music-length main))
(fraction (ly:parser-lookup parser 'Fraction)))
(make-simultaneous-music
(list
main
(make-sequential-music
(list
(make-music 'SkipMusic
'duration (ly:make-duration
0 len
(* (ly:moment-main-numerator main-length)
(car fraction))
(* (ly:moment-main-denominator main-length)
(cdr fraction))))
#{
\once \override Flag.stroke-style = #"grace"
#}
(make-music
'GraceMusic
'element grace)))
#{
\glissando
#}))))
\relative c' {c \Arrastres #6 c e8 e}
%%%%%%%%%%%%%%%%%%%%%%%
well where to begin...
first why is Fraction = #(cons 6 8) and not Fraction = #(cons 1 1) or 2 2
etc. 6 8 seams rather small. Is it so in some cases there is not to much
space?
second
'duration (ly:make-duration
0 len
was set 0 0 ... again why. I assume the first number is notes occupied? and
the second distance. Why 0 on the second. and isn't this just a recap of
Fraction = #(cons 6 8)? or is one gliss length and the other note distance
(both having the same effect -- so make one 0 )-- i assume.
Thanks
Stephen
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user