lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme problem?


From: takumi ikeda
Subject: Re: Scheme problem?
Date: Fri, 13 Feb 2015 01:00:43 +0900

Hi Kevin,
Thank you for your reply. But the part of "(if (= UP dir) -0.5 0.5)"
seems to not working...

BTW, How can I learn the syntax like "(ly:duration-log
(ly:music-property music 'duration))"? I found the documentation
lilypond.org/doc/v2.19/Documentation/internals/scheme-functions but it
says only "Function: ly:duration-log dur". Is "dur" an data type?
Where is the reference of "dur"?

2015-02-12 22:13 GMT+09:00 Kevin Barry <address@hidden>:
> Hi Takumi,
>
> Is this what you want?
>
> \version "2.18.2"
>
> tremps = #"
> 2 setlinewidth
> 0.07 0.07 scale
> -10 7 moveto
> -5 3 5 3 10 7 curveto
> -10 -7 lineto
> -5 -3 5 -3 10 -7 curveto
> stroke
> "
>
> z-trem =
> #(define-music-function (parser location music) (ly:music?)
>    #{
>      \override StemTremolo.stencil =
>      #(lambda (grob)
>         (let* (
>                 (dur-log (ly:duration-log (ly:music-property music
> 'duration)))
>                 (dir (ly:grob-property grob 'direction))
>                 )
>           (grob-interpret-markup grob
>             (markup
>              (
>                #:translate (cons 0 (if (= 0 dur-log)
>                                        0
>                                        (if (= UP dir) -0.5 0.5)))
>                #:postscript tremps
>                )
>              )
>             )
>           )
>         )
>      $music
>    #}
>    )
>
>
> \new Staff {
>   \z-trem
>   c'1:32 c''8: f'16: g':  c''8: c'4: c''16:
> }
>
> On Thu, Feb 12, 2015 at 12:44 PM, takumi ikeda <address@hidden> wrote:
>>
>> Hello all,
>>
>> I am trying the following code but I got "Wrong type: ()" error.
>> I would like to avoid translating tremolos when the note is whole note.
>> Writing Scheme is quite difficult for me. Any help would be appreciated.
>>
>> Takumi
>>
>> >>
>>
>> \version "2.18.2"
>>
>> tremps = #"
>> 2 setlinewidth
>> 0.07 0.07 scale
>> -10 7 moveto
>> -5 3 5 3 10 7 curveto
>> -10 -7 lineto
>> -5 -3 5 -3 10 -7 curveto
>> stroke
>> "
>>
>> z-trem =
>> #(define-music-function (parser location music) (ly:music?)
>>    #{
>>      \override StemTremolo.stencil =
>>      #(lambda (grob)
>>         (let* (
>>                 (dur-log (ly:grob-property grob 'duration-log))
>>                 (dir (ly:grob-property grob 'direction))
>>                 )
>>           (grob-interpret-markup grob
>>             (markup
>>              (
>>                #:translate (cons 0 (if (= 0 dur-log) 0
>>                                        (if (= UP dir) -0.5 0.5)))
>>                #:postscript tremps
>>                )
>>              )
>>             )
>>           )
>>         )
>>      $music
>>    #}
>>    )
>>
>>
>> \new Staff {
>>   \z-trem
>>   c'1:32 c''8: f'16: g':  c''8: c'4: c''16:
>> }
>>
>> _______________________________________________
>> lilypond-user mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]