lilypond-devel
[Top][All Lists]
Advanced

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

Scheme error - what am I doing wrong?


From: Sven Axelsson
Subject: Scheme error - what am I doing wrong?
Date: Sat, 8 Oct 2005 22:24:34 +0200

I am working on a piece where I need many short example extracts. I thoght I could simplify this with a music-function. This is what I've got:

musicExtract = #(def-music-function (parser location music) (string?)
  (ly:parser-parse-string (ly:clone-parser parser) (string-append "
\\score {
  { " music " }
  \\layout {
    indent = 10\\mm
    raggedright = ##t
    \\context {
      \\Staff
      \\remove Time_signature_engraver
      \\remove Bar_engraver
    }
  }
}
")) (make-music 'SequentialMusic))

Running this with
\musicExtract #"a4 b c d"

gives me
<string>:3:4: error: syntax error, unexpected STRING
  {
    a4 b c d }

Now, my Scheme programming is very rusty, so I'm probably doing something silly.

Also, I'm using a string because that appeared simpler. I would really want to use ly:music as the parameter type, but then I need some code to expand the music list, and I don't have a clue as to what that would be.

--
Sven Axelsson
reply via email to

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