[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make-span-event
From: |
Nicolas Sceaux |
Subject: |
Re: make-span-event |
Date: |
Mon, 01 Nov 2004 16:42:08 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Juergen Reuter <address@hidden> writes:
> Hi!
>
> Maybe this is a silly question, but there is something that I do not quite
> understand. I am trying to create span events in a music function:
>
> \version "2.4.0"
> crescendo = #(def-music-function
> (location music) (ly:music?)
> (make-music 'SequentialMusic
> 'elements (list
> (make-span-event 'CrescendoEvent START)
> music
> (make-span-event 'CrescendoEvent STOP))))
>
> crescendoStart = #(make-span-event 'CrescendoEvent START)
> crescendoStop = #(make-span-event 'CrescendoEvent STOP)
>
> \score {
> <<
> { c d\crescendoStart e\crescendoStop f }
> { c \crescendo { d e } f }
> { c d\cr e\endcr f }
> >>
> }
>
> In this example, the predefined \cr and \endcr work well; also do the
> locally defined \crescendoStart and \crescendoStop. However, although the
> \crescendo music function uses exactly the same scheme expressions for
> creating span events, applying the \crescendo function does not show any
> effect. What I am doing wrong?
You can find out by comparing the two music expressions:
guile> (mus:display #{ \notemode { d\cr e\endcr } #})
(make-music 'SequentialMusic
'elements (list
(make-music 'SequentialMusic
'elements (list
(make-music 'EventChord
'elements (list
(make-music 'NoteEvent
'duration (ly:make-duration 2 0 1 1)
'pitch (ly:make-pitch -1 1 0))
(make-music 'CrescendoEvent
'span-direction -1)))
(make-music 'EventChord
'elements (list
(make-music 'NoteEvent
'duration (ly:make-duration 2 0 1 1)
'pitch (ly:make-pitch -1 2 0))
(make-music 'CrescendoEvent
'span-direction 1)))))))
guile> (mus:display #{ \crescendo \notemode { d e } #})
(make-music 'SequentialMusic
'elements (list
(make-music 'SequentialMusic
'elements (list
(make-music 'CrescendoEvent
'span-direction -1)
(make-music 'SequentialMusic
'elements (list
(make-music 'EventChord
'elements (list
(make-music 'NoteEvent
'duration
(ly:make-duration 2 0 1 1)
'pitch (ly:make-pitch -1
1 0))))
(make-music 'EventChord
'elements (list
(make-music 'NoteEvent
'duration
(ly:make-duration 2 0 1 1)
'pitch (ly:make-pitch -1
2 0))))))
(make-music 'CrescendoEvent
'span-direction 1)))))
Note where the CrescendoEvents are placed in both cases.
nicolas
- Re: make-span-event,
Nicolas Sceaux <=