Sven Axelsson <[EMAIL PROTECTED]> writes:

> 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 " }

change that line to: \\notemode { " music " }

> \\layout {
> indent = 10\\mm
> raggedright = ##t
> \\context {
> \\Staff
> \\remove Time_signature_engraver
> \\remove Bar_engraver
> }
> }
> }
> ")) (make-music 'SequentialMusic))

But there must be a cleaner way. Maybe that, if you don't mind repeating
the \layout block in longer examples:

\layout {
  indent = 10\mm
  raggedright = ##t
}

musicExample = #(def-music-function (parser location music) (ly:music?)
                 #{ \new Staff \with {
                      \remove Time_signature_engraver
                      \remove Bar_engraver
                    } $music #})

%% A short Example
\musicExample { c' d' e' f' }

%% A longer example
\score {
  { c' d' e' f' c' d' e' f' }
  \layout { raggedright = ##f }
}

%% A short Example
\musicExample { c' d' e' f' }

nicolas


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to