lilypond-user
[Top][All Lists]
Advanced

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

Re: flam snippet not working


From: David Kastrup
Subject: Re: flam snippet not working
Date: Fri, 16 Aug 2013 20:50:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Roel Spruit <address@hidden> writes:

> Hello,
>
> I'm getting back into lilypond after a loooong absence. I'm facing a
> problem with the flam / drag / ruff snippets and the latest version of
> lilypond. This is the snippet I use: http://lsr.dsi.unimi.it/LSR/Item?id=566
>
> When I use the \flam function I get the following error when parsing the
> .ly file:
>
> In procedure car in expression (first (ly:music-property note #)):
> Include.Rudiments.ly:17:38: Wrong type (expecting pair): ()
>
> I've traced it back to this line:
> (let ((mypitch (ly:music-property (first (ly:music-property note 'elements))
>
> Unfortunately I do not know enough about lilypond functions to fix it. Does
> anybody have any tips? Should this function work?
>
> I have attached the .ly file that contains the function.
>
> Any help is greatly appreciated!
>
> Roel
>
> startAcciaccaturaMusic =  {
>   s1*0(
>   \override Stem  #'stroke-style = #"grace"
>   \override TextScript #'font-size = #-2
> }
>
> stopAcciaccaturaMusic =  {
>   \revert Stem #'stroke-style
>   \revert TextScript #'font-size
>   s1*0)
> }
>
>
> flam =
> #(define-music-function (parser location note) (ly:music?)
>    "Return { \\grace { note8 } note }."
>    (let ((mypitch (ly:music-property (first (ly:music-property note 
> 'elements))
>                                      'drum-type)))
>      (make-sequential-music
>       (list (make-grace-music
>              (make-sequential-music
>               (list
>                (context-spec-music
>                 (make-grob-property-set 'Stem
>                                         'stroke-style "grace")
>                 'Bottom)
>                (make-event-chord
>                 (list (make-music 'NoteEvent
>                                   'duration (ly:make-duration 3 0 1 1)
>                                   'drum-type mypitch))))))
>             note))))

Try something like
flam =
#(define-music-function (parser location note) (ly:music?)
  "Return { \\slashedGrace { note8 } note }."
  #{ \slashedGrace {
     $(let ((m (ly:music-deep-copy note)))
        (set! (ly:music-property m 'duration)
              (ly:make-duration 3 0 1 1))
        m) } $m #})

-- 
David Kastrup




reply via email to

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