* Documentation/topdocs/NEWS.texi: Update.
* lily/parser.yy (new_lyrics): Return SCM list of lyric musics.
(Music_list): Allow embedded scm.
* lily/score.cc (ly:score-bookify): New function.
* lily/music.cc (ly:music-scorify): Idem.
* lily/my-lily-parser.cc (ly:parser-print-book): Idem.
(ly:parser-print-score): Idem.
* scm/lily.scm (default-toplevel-book-handler): Idem.
(default-toplevel-music-handler): Idem.
(default-toplevel-score-handler): Idem.
* ly/declarations-init.ly: Set default toplevel handlers.
* lily/parser.yy (book_block, score_block, toplevel_music): Use them.
* scripts/lilypond-book.py (PREAMBLE_LY): Select classic score
printer for score at toplevel.
+2004-04-19 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * input/regression/newaddlyrics.ly: New file.
+
+ * Documentation/topdocs/NEWS.texi: Update.
+
+ * lily/parser.yy (new_lyrics): Return SCM list of lyric musics.
+ (Music_list): Allow embedded scm.
+
+ * lily/score.cc (ly:score-bookify): New function.
+
+ * lily/music.cc (ly:music-scorify): Idem.
+
+ * lily/my-lily-parser.cc (ly:parser-print-book): Idem.
+ (ly:parser-print-score): Idem.
+
+ * scm/lily.scm (default-toplevel-book-handler): Idem.
+ (default-toplevel-music-handler): Idem.
+ (default-toplevel-score-handler): Idem.
+
+ * ly/declarations-init.ly: Set default toplevel handlers.
+
+ * lily/parser.yy (book_block, score_block, toplevel_music): Use them.
+
+ * scripts/lilypond-book.py (PREAMBLE_LY): Select classic score
+ printer for score at toplevel.
+
2004-04-18 Jan Nieuwenhuizen <janneke@gnu.org>
* lily/parser.yy (NEWLYRICS): Switch to LYRICS mode for lyrics.
@itemize @bullet
+@c FIXME: un-geekify
+@item Music lists are allowed at toplevel, and are handled by
+@code{default-toplevel-music-handler}. Similarly, a @code{score} block
+at toplevel is handled by @code{default-toplevel-score-handler} an a
+@code{book} at toplevel is handled by @code{default-toplevel-book-handler}.
+
+These default handlers have the following effect. A Music list at
+toplevel is encapsulated in a @code{score} block, and a @code{score}
+block at toplevel is encapsulated in a @code{book} block. A
+@code{book} block at toplevel generates printed output.
+
+@example
+\header @{ title = "The Title" @}
+\notes @{ a b c @}
+@end example
+
+is the same as
+
+@example
+\header @{ title = "The Title" @}
+\book @{
+ \score @{
+ \notes @{ a b c @}
+ @}
+@}
+@end example
+
+@item Start pitch for @code{relative} music is optional for music lists.
+The default value is one octave below middle C.
+
+@c update-me? formal definition of newaddlyrics, once it works
+@item Combining lyrics with music can be @code{newaddlyrics}
+
+@example
+<<
+ \relative @{
+ \clef bass
+ d2 d c4 bes a2 \break
+ c2 c d4 f g2
+ @}
+ \newlyrics @{
+ My first Li -- ly song,
+ Not much can go wrong!
+ @}
+>>
+@end example
+
@item The parser is encapsulated in a Scheme function
@code{ly:parse-file}, so the following fragment processes two files
<<
\context Voice = duet {
\time 3/4 g2 e4 a2 f4 g2. }
- \lyrics \lyricsto "duet" \new Lyrics {
+ \lyricsto "duet" \new Lyrics \lyrics {
\set stanza = "1. "
Hi, my name is Bert. }
>>
\time 2/4
f4 f c' c
}
- \new Lyrics \lyrics \lyricsto "bla" { Twin -- kle twin -- kle }
+ \new Lyrics \lyricsto "bla" \lyrics { Twin -- kle twin -- kle }
>>
}
@end lilypond
--- /dev/null
+\header {
+ texidoc = "newlyrics -- multiple stanzas broken as yet."
+}
+
+%% Testing newlyrics
+%%\new PianoStaff <<
+<<
+ \new Staff \relative {
+ d'2 d c4 bes a2 \break
+ c2 c d4 f g2
+ }
+ \newlyrics <<
+ {
+ My first Li -- ly song,
+ Not much can go wrong!
+ }
+ {
+ My se -- cond ly verse
+ Not much can go wrong!
+ }
+ >>
+ \new Staff \relative {
+ \clef bass
+ d2 d c4 bes a2 \break
+ c2 c d4 f g2
+ }
+ \newlyrics <<
+ {
+ MY FIRST LI -- LY SONG,
+ NOT MUCH CAN GO WRONG!
+ }
+ {
+ MY SE -- COND LY VERSE
+ NOT MUCH CAN GO WRONG!
+ }
+ >>
+>>
+
+\version "2.3.0"
SCM ly_parse_file (SCM);
SCM ly_parse_string (SCM);
-SCM ly_parser_add_book_and_score (SCM, SCM);
+// SCM ly_parser_add_book_and_score (SCM, SCM);
+SCM ly_parser_print_book (SCM, SCM);
+SCM ly_parser_print_score (SCM, SCM);
+SCM ly_parser_bookify (SCM, SCM);
+SCM ly_parser_scorify (SCM, SCM);
#endif /* MY_LILY_PARSER_HH */
}
<INITIAL,notes,lyrics>{
\<\< {
- return LESSLESS;
+ return DOUBLE_ANGLE_OPEN;
}
\>\> {
- return MOREMORE;
+ return DOUBLE_ANGLE_CLOSE;
}
}
<figures>{
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "main.hh"
#include "input-smob.hh"
-#include "music.hh"
-#include "music-list.hh"
-#include "warn.hh"
-#include "pitch.hh"
#include "ly-smobs.icc"
#include "main.hh"
+#include "music-list.hh"
+#include "music.hh"
+#include "pitch.hh"
+#include "score.hh"
+#include "warn.hh"
bool
return ip ? ip : & dummy_input_global;
}
+
+Music*
+make_music_by_name (SCM sym)
+{
+ SCM make_music_proc = ly_scheme_function ("make-music");
+ SCM rv = scm_call_1 (make_music_proc, sym);
+
+ /* UGH. */
+ scm_gc_protect_object (rv);
+ return unsmob_music (rv);
+}
+
LY_DEFINE (ly_music_length, "ly:music-length",
1, 0, 0, (SCM mus),
"Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
return sc->self_scm ();
}
-Music*
-make_music_by_name (SCM sym)
-{
- SCM make_music_proc = ly_scheme_function ("make-music");
- SCM rv = scm_call_1 (make_music_proc, sym);
- /* UGH. */
- scm_gc_protect_object (rv);
- return unsmob_music (rv);
+LY_DEFINE (ly_music_scorify, "ly:music-scorify",
+ 1, 0, 0,
+ (SCM music),
+ "Return MUSIC encapsulated in SCORE.")
+{
+#if 0
+ SCM_ASSERT_TYPE (ly_c_music_p (music), music, SCM_ARG1, __FUNCTION__, "music");
+#endif
+ Score *score = new Score;
+
+ /* URG? */
+ SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
+ for (; ly_c_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
+ music = scm_call_1 (ly_car (check_funcs), music);
+
+ score->music_ = music;
+ scm_gc_unprotect_object (score->self_scm ());
+ return score->self_scm ();
}
lexer_ = new My_lily_lexer (sources_);
lexer_->main_input_name_ = "<string>";
lexer_->main_input_b_ = true;
- SCM nn = lexer_->lookup_identifier ("pitchnames");
- lexer_->push_note_state (alist_to_hashq (nn));
set_yydebug (0);
lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
return SCM_UNSPECIFIED;
}
+static Music_output_def*
+get_paper (My_lily_parser *parser)
+{
+ SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
+ Music_output_def *paper = unsmob_music_output_def (id);
+ return paper ? paper->clone () : new Paper_def;
+}
-LY_DEFINE (ly_parser_add_book_and_score, "ly:parser-add-book-and-score",
+LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
2, 0, 0,
- (SCM purple, SCM music),
- "Handle the toplevel-music MUSIC by adding BOOK and SCORE.")
+ (SCM parser_smob, SCM score_smob),
+ "Print score, i.e., the classic way.")
{
#if 0
SCM_ASSERT_TYPE (ly_c_parser_p (parser), music, SCM_ARG1, __FUNCTION__, "parser");
SCM_ASSERT_TYPE (ly_c_music_p (music), music, SCM_ARG1, __FUNCTION__, "music");
#endif
- My_lily_parser *parser = unsmob_my_lily_parser (purple);
- Score *score = new Score;
+ My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
+ Score *score = unsmob_score (score_smob);
+
+ SCM header = is_module (score->header_) ? score->header_
+ : parser->header_.to_SCM ();
- /* URG? */
- SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
- for (; ly_c_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
- music = scm_call_1 (ly_car (check_funcs), music);
- score->music_ = music;
- Book *book = new Book;
- book->scores_.push (score);
- scm_gc_unprotect_object (score->self_scm ());
+ Path outname = split_path (parser->output_basename_);
+ int *c = &parser->book_count_;
+ if (*c)
+ outname.base += "-" + to_string (*c);
+ (*c)++;
+
+ SCM os = scm_makfrom0str (outname.to_string ().to_str0 ());
+ for (int i = 0; i < score->defs_.size (); i++)
+ default_rendering (score->music_, score->defs_[i]->self_scm (), header,
+ os);
+
+ if (score->defs_.is_empty ())
+ {
+ Music_output_def *paper = get_paper (parser);
+ default_rendering (score->music_, paper->self_scm (), header, os);
+ scm_gc_unprotect_object (paper->self_scm ());
+ }
+ return SCM_UNDEFINED;
+}
+
+LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
+ 2, 0, 0,
+ (SCM parser_smob, SCM book_smob),
+ "Print book.")
+{
+#if 0
+ SCM_ASSERT_TYPE (ly_c_parser_p (parser_smob), parser_smob, SCM_ARG1, __FUNCTION__, "parser_smob");
+ SCM_ASSERT_TYPE (ly_c_music_p (book_smob), book_smob, SCM_ARG1, __FUNCTION__, "book_smob");
+#endif
+ My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
+ Book *book = unsmob_book (book_smob);
SCM header = parser->header_;
Path outname = split_path (parser->output_basename_);
if (*c)
outname.base += "-" + to_string (*c);
(*c)++;
- My_lily_lexer *lexer = parser->lexer_;
- Music_output_def *dp
- = unsmob_music_output_def (lexer->lookup_identifier ("$defaultpaper"));
- book->process (outname.to_string (),
- dp ? dp->clone () : new Paper_def, header);
- scm_gc_unprotect_object (book->self_scm ());
+ Music_output_def *paper = get_paper (parser);
+ book->process (outname.to_string (), paper, header);
+ scm_gc_unprotect_object (paper->self_scm ());
return SCM_UNDEFINED;
}
m->set_property ("tags", tags);
}
-Music_output_def*
-get_paper (My_lily_parser *parser)
-{
- SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
- Music_output_def *paper = unsmob_music_output_def (id);
- return paper ? paper->clone () : new Paper_def;
-}
-
bool
is_regular_identifier (SCM id)
{
%token CHANGE
%token CHORDMODIFIERS
%token CHORDS
-%token LESSLESS
-%token MOREMORE
+%token DOUBLE_ANGLE_OPEN
+%token DOUBLE_ANGLE_CLOSE
%token CLEF
%token COMMANDSPANREQUEST
%token CONSISTS
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
%token FIGURE_SPACE
-%type <book> book_block book_body
-%type <i> exclamations questions dots optional_rest
-%type <i> bass_mod
-%type <scm> grace_head
-%type <scm> oct_check
-%type <scm> context_mod_list
-%type <scm> lyric_element
-%type <scm> bass_number br_bass_figure bass_figure figure_list figure_spec
-%type <music> new_lyrics
%token <i> DIGIT
%token <scm> NOTENAME_PITCH
%token <scm> TONICNAME_PITCH
%token <scm> MARKUP_IDENTIFIER MARKUP_HEAD_LIST0
%type <scm> markup markup_line markup_list markup_list_body full_markup
+%type <book> book_block book_body
+%type <i> exclamations questions dots optional_rest
+%type <i> bass_mod
+%type <scm> grace_head
+%type <scm> oct_check
+%type <scm> context_mod_list
+%type <scm> lyric_element
+%type <scm> bass_number br_bass_figure bass_figure figure_list figure_spec
+%type <scm> new_lyrics
%type <outputdef> output_def
%type <scm> lilypond_header lilypond_header_body
%type <music> open_event close_event
lilypond_header {
THIS->header_ = $1;
}
- | toplevel_music {
- Music_output_def *paper = get_paper (THIS);
- SCM proc = THIS->lexer_->lookup_identifier ("toplevel-music-handler");
- if (proc == SCM_UNDEFINED)
- proc = ly_scheme_function ("ly:parser-add-book-and-score");
- scm_call_2 (proc, THIS->self_scm (), $1->self_scm ());
- scm_gc_unprotect_object (paper->self_scm ());
- }
| add_quote {
}
| book_block {
Book *book = $1;
- SCM header = THIS->header_;
- Path outname = split_path (THIS->output_basename_);
- int *c = &THIS->book_count_;
- if (*c)
- outname.base += "-" + to_string (*c);
- (*c)++;
- Music_output_def *paper = get_paper (THIS);
- book->process (outname.to_string (), paper, header);
+ SCM proc = THIS->lexer_->lookup_identifier ("toplevel-book-handler");
+ scm_call_2 (proc, THIS->self_scm (), book->self_scm ());
scm_gc_unprotect_object (book->self_scm ());
- scm_gc_unprotect_object (paper->self_scm ());
}
| score_block {
- /* TODO: implicit book, depending on --no-book/--no-page-layout
- option? */
Score *score = $1;
- SCM head = is_module (score->header_) ? score->header_
- : THIS->header_.to_SCM ();
-
- Path p = split_path (THIS->output_basename_);
- int *c = &THIS->score_count_;
- if (*c)
- p.base += "-" + to_string (*c);
-
- (*c)++;
- SCM outname = scm_makfrom0str (p.to_string ().to_str0());
-
- for (int i = 0; i < score->defs_.size (); i++)
- default_rendering (score->music_,
- score->defs_[i]->self_scm (), head,
- outname);
-
- if (score->defs_.is_empty ())
- {
- Music_output_def *paper = get_paper (THIS);
- default_rendering (score->music_, paper->self_scm (), head,
- outname);
- scm_gc_unprotect_object (paper->self_scm ());
- }
+
+ SCM proc = THIS->lexer_->lookup_identifier ("toplevel-score-handler");
+ scm_call_2 (proc, THIS->self_scm (), score->self_scm ());
scm_gc_unprotect_object (score->self_scm ());
}
+ | toplevel_music {
+ Music *music = $1;
+ SCM proc = THIS->lexer_->lookup_identifier ("toplevel-music-handler");
+ scm_call_2 (proc, THIS->self_scm (), music->self_scm ());
+ scm_gc_unprotect_object (music->self_scm ());
+ }
| output_def {
SCM id = SCM_EOL;
if (dynamic_cast<Paper_def*> ($1))
scm_set_car_x (s, c); /* set first cons */
scm_set_cdr_x (s, c); /* remember last cell */
}
+ | Music_list embedded_scm {
+ }
| Music_list error {
}
;
$$ = context_spec_music ($2, SCM_UNDEFINED, $4, $3);
}
| NEWCONTEXT string optional_context_mod Music {
- $$ = context_spec_music ($2, get_next_unique_context (),
- $4, $3);
+ $$ = context_spec_music ($2, get_next_unique_context (), $4,
+ $3);
}
| TIMES {
\repeat \alternative */
THIS->lexer_->pop_state ();
#if 0
- $$ = $3;
-#else
Music *music = MY_MAKE_MUSIC ("SimultaneousMusic");
music->set_property ("elements", scm_list_1 ($3->self_scm ()));
$$ = music;
+#else
+ $$ = scm_cons ($3->self_scm (), SCM_EOL);
#endif
}
| new_lyrics NEWLYRICS { THIS->lexer_->push_lyric_state (); }
Grouped_music_list {
THIS->lexer_->pop_state ();
- Music *music = MY_MAKE_MUSIC ("SimultaneousMusic");
- music->set_property ("elements", scm_cons ($4->self_scm (),
- $1->get_property ("elements")));
- $$ = music;
+ $$ = scm_cons ($4->self_scm (), $1);
}
;
}
| Grouped_music_list new_lyrics {
- /* TODO: loop over simultaneous lyric musics? */
+ /* FIXME: should find out uniqueXXX name from music */
+ SCM name = $1->get_property ("context-id");
+ //if (name == SCM_EOL)
+ if (!ly_c_string_p (name))
+ name = scm_makfrom0str ("");
- Music *music = $2;
- SCM name = scm_makfrom0str ("");
SCM context = scm_makfrom0str ("Lyrics");
Music *all = MY_MAKE_MUSIC ("SimultaneousMusic");
-#if 0 // simple only
- Music *combined = make_lyric_combine_music (name, music);
- Music *csm = context_spec_music (context, SCM_UNDEFINED,
- combined, SCM_EOL);
- all->set_property ("elements", scm_listify ($1->self_scm (),
- csm->self_scm (), SCM_UNDEFINED));
-#else
+
SCM lst = SCM_EOL;
- for (SCM s = music->get_property ("elements"); ly_c_pair_p (s);
- s = ly_cdr (s))
+ for (SCM s = $2; ly_c_pair_p (s); s = ly_cdr (s))
{
+ Music *music = unsmob_music (ly_car (s));
Music *com = make_lyric_combine_music (name, music);
Music *csm = context_spec_music (context,
- SCM_UNDEFINED, com, SCM_EOL);
- //lst = ly_snoc (csm->self_scm (), lst);
+ get_next_unique_context (), com, SCM_EOL);
lst = scm_cons (csm->self_scm (), lst);
}
-#endif
+ /* FIXME: only first lyric music is accepted,
+ the rest is junked */
all->set_property ("elements", scm_cons ($1->self_scm (),
lst));
$$ = all;
scm_gc_unprotect_object ($1->self_scm ());
- scm_gc_unprotect_object ($2->self_scm ());
}
| LYRICSTO string Music {
Music *music = $3;
chord_close: '>'
;
-simul_open: LESSLESS
+simul_open: DOUBLE_ANGLE_OPEN
;
-simul_close: MOREMORE
+simul_close: DOUBLE_ANGLE_CLOSE
;
chord_body:
return csm;
}
-
SCM
get_next_unique_context ()
{
static int new_context_count;
-
char s[1024];
- snprintf (s, 1024, "uniqueContext%d", new_context_count ++);
-
+ snprintf (s, 1024, "uniqueContext%d", new_context_count++);
return scm_makfrom0str (s);
}
#include <stdio.h>
+#include "book.hh"
+#include "cpu-timer.hh"
+#include "global-context.hh"
+#include "ly-module.hh"
#include "ly-smobs.icc"
-
-#include "score.hh"
-#include "warn.hh"
+#include "main.hh"
+#include "music-iterator.hh"
#include "music-output-def.hh"
#include "music-output.hh"
-#include "music-iterator.hh"
#include "music.hh"
-#include "global-context.hh"
-#include "scm-hash.hh"
-#include "cpu-timer.hh"
-#include "main.hh"
-#include "paper-def.hh"
-#include "ly-module.hh"
#include "paper-book.hh"
+#include "paper-def.hh"
#include "paper-score.hh"
-
+#include "scm-hash.hh"
+#include "score.hh"
+#include "warn.hh"
/*
TODO: junkme.
}
return systems;
}
+
+LY_DEFINE (ly_score_bookify, "ly:score-bookify",
+ 1, 0, 0,
+ (SCM score_smob),
+ "Return SCORE encapsulated in a BOOK.")
+{
+#if 0
+ SCM_ASSERT_TYPE (ly_c_parser_p (parser_smob), parser_smobd, SCM_ARG1, __FUNCTION__, "parser_smob");
+ SCM_ASSERT_TYPE (ly_c_score_p (score_smob), score_smob, SCM_ARG1, __FUNCTION__, "score_smob");
+#endif
+
+ Score *score = unsmob_score (score_smob);
+ Book *book = new Book;
+ book->scores_.push (score);
+ scm_gc_unprotect_object (book->self_scm ());
+ return book->self_scm ();
+}
return str;
}
-/*
- Unused.
- */
Source_file::Source_file (String filename, String data)
{
name_ = filename;
void
Source_file::init_port ()
{
- SCM str =scm_makfrom0str (contents_str0_);
-
- str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG,
- __FUNCTION__);
- scm_set_port_filename_x (str_port_,
- scm_makfrom0str (name_.get_str0()));
+ SCM str = scm_makfrom0str (contents_str0_);
+ str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
+ scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.get_str0 ()));
}
int
#(define musicQuotes (make-hash-table 29))
%%#(define-public toplevel-music-handler ly:parser-add-book-and-score)
+#(define toplevel-book-handler default-toplevel-book-handler)
#(define toplevel-music-handler default-toplevel-music-handler)
+#(define toplevel-score-handler default-toplevel-score-handler)
%%
#(if (and (ly:get-option 'old-relative)
+ (defined? 'input-file-name)
(not (ly:get-option 'old-relative-used)))
(ly:warn (string-append
"\n"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; lily specific variables.
-(define-public default-toplevel-music-handler ly:parser-add-book-and-score)
(define-public default-script-alist '())
(define-public safe-mode? #f)
+;; parser stuff.
+(define-public (print-music-as-book parser music)
+ (let* ((score (ly:music-scorify music))
+ (book (ly:score-bookify score)))
+ (ly:parser-print-book parser book)))
+
+(define-public (print-score-as-book parser score)
+ (let ((book (ly:score-bookify score)))
+ (ly:parser-print-book parser book)))
+
+(define-public (print-score parser score)
+ (let ((book (ly:score-bookify score)))
+ (ly:parser-print-score parser book)))
+
+(define-public default-toplevel-music-handler print-music-as-book)
+(define-public default-toplevel-book-handler ly:parser-print-book)
+(define-public default-toplevel-score-handler print-score-as-book)
+;;(define-public toplevel-music-handler print-music-as-book)
+;;(define-public toplevel-music-handler toplevel-music-functions)
+;;(define-public toplevel-music-handler
+;; (lambda (x y) (print-music-as-book x y)))
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Unassorted utility functions.
-;;;; music-functions.scm -- implement Scheme output routines for PostScript
+;;;; music-functions.scm --
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
;;;; (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-(use-modules (ice-9 optargs))
+;; (use-modules (ice-9 optargs))
;;; ly:music-property with setter
;;; (ly:music-property my-music 'elements)
(else
(ly:warn (string-append "Unknown accidental style: " (symbol->string style)))
(make-sequential-music '()))))))
-
-
PREAMBLE_LY = r'''%%%% Generated by %(program_name)s
%%%% Options: [%(option_string)s]
+#(define toplevel-score-handler ly:parser-print-score)
%(preamble_string)s
\paper {%(paper_string)s
}