gnu-music-discuss
[Top][All Lists]
Advanced

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

Re: slur in scheme


From: Jan Nieuwenhuizen
Subject: Re: slur in scheme
Date: 19 Mar 2001 10:32:50 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Laurent Martelli <address@hidden> writes:

> I'm trying to make slurs with the new ly-make-music function, but all
> my attempts failed. Here's what I tried (with 1.3.140) :

> Am I missing something ?

Just two small things:  you got stop and start reversed, LEFT == -1,
RIGHT==1.  And also, slur requests should go with the note.

Try this:

#(define (make-note-req p d)
   (let* ( (ml (ly-make-music "Note_req")) )
   (ly-set-mus-property ml 'duration d)
   (ly-set-mus-property ml 'pitch p)   
   ml 
))

#(define (make-note elts)
   (let* ( (ml (ly-make-music "Request_chord")) )
   (ly-set-mus-property ml 'elements elts)
   ml 
))

#(define (seq-music-list elts)
   (let* ( (ml (ly-make-music "Sequential_music")) )
   (ly-set-mus-property ml 'elements elts)
   ml 
))
#(define (start-slur)
   (let* ( (ml (ly-make-music "Span_req")) )
   (ly-set-mus-property ml 'span-type "slur")
   (ly-set-mus-property ml 'span-direction -1)
   ml 
))
#(define (stop-slur)
   (let* ( (ml (ly-make-music "Span_req")) )
   (ly-set-mus-property ml 'span-direction 1)
   (ly-set-mus-property ml 'span-type "slur")
   ml 
))

fooMusic  = #(seq-music-list
  (list (make-note (list (make-note-req (make-pitch 1 0 0) (make-duration 2 0))
  (start-slur)))
  (make-note (list (make-note-req (make-pitch 1 1 0) (make-duration 2 0))))
  (make-note (list (make-note-req (make-pitch 1 2 0) (make-duration 2 0))
  (stop-slur)))
  (make-note (list (make-note-req (make-pitch 1 3 0) (make-duration 2 0)))))
   )
     
\score { \fooMusic }



-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

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