lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating music with Scheme - can this be done in a simpler way?


From: Alard de Boer
Subject: Re: Creating music with Scheme - can this be done in a simpler way?
Date: Wed, 11 Jul 2007 18:19:52 +0200

On 09/07/07, Neil Puttock <address@hidden> wrote:
Oops! What I really meant is this:

pedalMotif = \transpose c c' { \times 2/3 { c8 c c } c4 c c8[ c] c4 }

{
    \clef bass \time 5/4
    \applyMusic #transform {
        \pedalMotif { g, }
        \pedalMotif { c }
    }
}

;)

Hi Neil,

Thanks for your solution! It works fine on its own, but I'm having
trouble using it for something like

   \applyMusic #transform {
       << \pedalMotif { c } { s4-\< s2. s4-\! } >>
   }

which fails to compile:

GNU LilyPond 2.10.25
Processing `test.ly'
Parsing...ERROR: Wrong type (expecting pair): ()

It seems the "transform" function from music-box.ly cannot
handle such a situation. However, your solution inspired me to
try a different approach, using \transpose in the music function,
but I cannot get it to work either. I tried something like this:

 \version "2.10.25"
 rh = #(define-music-function (parser location note) (ly:music?)
      #{
      \transpose c $note { \times 2/3 { c8 c c } c4 c c8[ c] c4 }
      #})
 {
     \clef bass \time 5/4
     \rh g
 }

But, this fails to compile as well (error: syntax error, unexpected
MUSIC_IDENTIFIER, expecting NOTENAME_PITCH or TONICNAME_PITCH).
Apparently the \transpose function takes a pitch instead of a note.
Changing the (ly:music?) to (ly:pitch?) brings me back to my original
problem: how do I specify a pitch? :)

(error: syntax error, unexpected NOTENAME_PITCH)

Does anyone have a hint how to solve this?

--
Groeten,
Alard.

Ceterum censeo MS Word esse delendam.




reply via email to

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