lilypond-user
[Top][All Lists]
Advanced

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

scheme question


From: Matthieu Jacquot
Subject: scheme question
Date: Thu, 24 Jul 2008 03:06:58 -0700 (PDT)

Hello everybody,
As the title says, I'm trying to add something I need in Lily via scheme but
I got a few problems.
I'd like to try to add a spanner for the string number indication, it's the
very beginning and I'm already stuck.
I start here :
 
\displayMusic c4
=>
(make-music
  'EventChord
  'elements
  (list (make-music
          'NoteEvent
          'duration
          (ly:make-duration 2 0 1 1)
          'pitch
          (ly:make-pitch -1 0 0))))

and I want to go there :
\displayMusic <c\3>4
=>
(make-music
  'EventChord
  'elements
  (list (make-music
          'NoteEvent
          'duration
          (ly:make-duration 2 0 1 1)
          'articulations
          (list (make-music
                  'StringNumberEvent
                  'string-number
                  3))
          'pitch
          (ly:make-pitch -1 0 0))))

My problem is that I have to add 'articulations list to 'elements and I
didn't find any exemple to do so.
Here's where I am :
string = #(define-music-function (parser location event-chord )
                                     ( ly:music? )

  (let ((result-event-chord (ly:music-deep-copy event-chord)))
    (set! (ly:music-property result-event-chord 'elements )
          (cons
         (make-music
                  'StringNumberEvent
                  'string-number
                  3)
                  (ly:music-property result-event-chord 'elements )))
      result-event-chord)
      )
But no string number. I think I don't understand the set! command, but maybe
it's not at all the good approach... Can anyone help me? Do you know how I
can find exemples from the source code?
with best regards
Matthieu 
PS : sorry to have post this thread in the dev mailing list yesterday.
-- 
View this message in context: 
http://www.nabble.com/scheme-question-tp18628816p18628816.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.





reply via email to

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