lilypond-user
[Top][All Lists]
Advanced

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

Re: Putting a \layout block in a Scheme macro


From: Timothy Lanfear
Subject: Re: Putting a \layout block in a Scheme macro
Date: Fri, 27 Jan 2017 20:03:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 27/01/17 19:20, Jérôme Plût wrote:

Thanks for the answer, but:

your code produces a failed assertion in the lilypond binary:

lilypond: 
/home/gub/NewGub/gub/target/linux-x86/src/lilypond-git.sv.gnu.org--lilypond.git-release-unstable/lily/book.cc:258:
 void Book::process_score(SCM, Paper_book*, Output_def*): Assertion `0' failed.

This assertion is unclear but, looking at the source file, it
obviously means that the top-level book content was neither a Score
nor a markup list (the execution path seems to go ly:book-process ->
Book::process -> Book::process_score). I leave it to the experts from
there!

All I can say is that it works perfectly for me. I'm using the pre-built binary for 2.19.54, Ubuntu 16.04. 64-bit.

And while we are there: your solution seems to create a new book for
the score. Is that the case? How would one adapt it to incorporate the
score at top-level?


Here is a solution that returns a score from Scheme.

\version "2.19.54"

BlankStaff =
#(define-scheme-function (count) (integer?)
  (let* ((blankstaff #{ \score { \repeat unfold #count { s1 \break } } #} )
(layout #{ \layout { \context { \Staff \remove "Bar_engraver" } } #} ))
    (ly:output-def-set-variable! layout 'indent (ly:mm 0))
    (ly:output-def-set-variable! layout 'ragged-right #f)
    (ly:score-add-output-def! blankstaff layout)
    blankstaff
))

\BlankStaff 4


--
Timothy Lanfear, Bristol, UK.




reply via email to

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