]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.9
authorfred <fred>
Tue, 26 Mar 2002 21:44:39 +0000 (21:44 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:44:39 +0000 (21:44 +0000)
18 files changed:
Documentation/tex/tutorial.yo
init/lily.scm
lily/atom.cc
lily/dynamic-engraver.cc
lily/include/lily-guile.hh
lily/include/paper-outputter.hh
lily/include/protected-scm.hh
lily/lily-guile.cc
lily/p-score.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/protected-scm.cc
lily/stem.cc
mutopia/Coriolan/coriolan-part-paper.ly
mutopia/Coriolan/corni-part.ly
mutopia/Coriolan/corno-1.ly
ps/lily.ps
tex/lily-ps-defs.tex

index a6186f2444d0666ea95304f0d488d58ba4be473f..297a1fb3a5868196d920949f0db515db54459025 100644 (file)
@@ -8,27 +8,24 @@ Yodl-1.30.18 to convert this to tex or html.
 
 TODO
 
-need to rethink paper size stuff?
-
 pipethrough(date) sucks.
 
 paragraphs have too much space.
 
-instead <-> instead
 )
 
 COMMENT(
-       Mainly written by Han-Wen Nienhuys, 
+        Mainly written by Han-Wen Nienhuys, 
 
-       with help of (among others)
+        with help of (among others)
 
-       * Jan Nieuwenhuizen
+        * Jan Nieuwenhuizen
 
-       * Lambert Meertens,
+        * Lambert Meertens,
 
-       * Adrian Mariano
+        * Adrian Mariano
 
-       * Mats Bengtsson
+        * Mats Bengtsson
 
 )
 
@@ -74,9 +71,10 @@ music.  LilyPond is a program that can print music from a
 specification that you, the user, supply.  Using LilyPond may be a bit
 quaint in the beginning, because you have to give that specification
 using a em(language).  This document is a gentle introduction to that
-language, which is called Mudela.
+language, which is called Mudela, an abbreviation for Music Definition
+Language.
 
-We will demonstrate the working of Mudela by presenting a examples of
+We will demonstrate the working of Mudela by presenting  examples of
 input alongside with the resulting output.  We will comment on these
 examples using English terms for notation, so if you are not familiar
 with these terms, you should consult the glossary that is distributed
@@ -87,37 +85,36 @@ sect(The first tune)
 label(sec:firsttune)
 
 To demonstrate what LilyPond input looks like, we start off with a
-full fledged (yet simple) example. It is somewhat convoluted version
+full fledged, yet simple, example. It is somewhat convoluted version
 of one of the menuets in bind(J.)bind(S.)Bach's em(Clavierbuchlein).
 
 mudela(verbatim)(
 % lines preceded by a percent are comments.
 \include "paper16.ly"
 \score {
-    \notes                     % let's start music
-    \relative c'' {            % octave quotes are relative now
-       \key G;
-       \time 3/4;              % set the time signature.
-
-       d4 [g,8 a b c] d4 g, g |
-       e'4 [c8 d e fis] g4 g, g |
-       c4 [d8( )c b a( ] )b4 [c8 b a g] |
-       a4 [b8 a g fis] g2.  |
-
-       \bar ":|";              % a repeat sign
-
-
-       b'4 [g8 a b g]
-       a4 [d,8 e fis d] |
-       g4 [e8 fis g d] cis4 [b8 cis] a4 |
-       [a8-. b-. cis-. d-. e-. fis-. ] % try some super and subscripts.
-       g4 fis e |
-       fis a,  r8 cis8
-       d2.-\fermata
-       \bar "|.";
+    \notes                     
+    \relative c'' {            
+        \key g;
+        \time 3/4;             
+
+        d4 [g,8 a b c] d4 g, g |
+        e'4 [c8 d e fis] g4 g, g |
+        c4 [d8( )c b a( ] )b4 [c8 b a g] |
+        a4 [b8 a g fis] g2.  |
+
+        \bar ":|";             
+
+        b'4 [g8 a b g]
+        a4 [d,8 e fis d] |
+        g4 [e8 fis g d] cis4 [b8 cis] a4 |
+        [a8-. b-. cis-. d-. e-. fis-. ] 
+        g4 fis e |
+        fis a,  r8 cis8
+        d2.-\fermata
+        \bar "|.";
     }
     \paper {
-       linewidth = 10.0 \cm; % standard settings are too wide for a book
+       linewidth = 14.0 \cm; % standard settings are too wide for a book
    }
 })
 
@@ -126,26 +123,17 @@ you would try to enter and save this text with a text editor, compile
 it with LilyPond and view the output.  Details of this procedure may
 vary from system to system.  On a Unix system, you should enter the
 input in a file ending in file(.ly), such as file(menuet.ly).  To
-create the output, one would issue
-verb(
-       ly2dvi menuet
-)
-file(ly2dvi) is a little program that does the job of calling the LilyPond
-and  
-TeX() and adjusting page margins.
-
-If all goes well, this will create the output file file(menuet.dvi).
-To view this output, isssue the command
-verb(
-       xdvi menuet
-)
+create the output, one would issue code(ly2dvi menuet).
 
-[running on W32?]
+file(ly2dvi) is a little program that does the job of calling the
+LilyPond and TeX() and adjusting page margins.
 
-Now for some explanation of the input itself, we will dissect the
-input line by line
+If all goes well, this will create the output file file(menuet.dvi).
+To view this output, issue the command code(xdvi menuet).  Now that we
+are familiar with the procedure to view the output, we will analyse
+the input itself, line by line.
 
-verb(% lines preceded by a percent are comments.)COMMENT
+verb(% lines preceded by a percent are comments.)COMMENT(
 
 )The percent sign (code(%)) introduces a line comment.  If you want
 make larger comments, you can use block comments. These are delimited
@@ -167,19 +155,20 @@ verb(\score {
 music.  The music is combined with the output directions by putting
 them into a code(\score) block.
 verb(
-   \notes                      % get ready for notes
+   \notes              
 ) COMMENT( 
 
 )This makes LilyPond ready for accepting notes.
 verb(
-    \relative c''              % octave quotes are relative now
-)
-As we will see, pitches are combinations of octave, note name and
-chromatic alteration.  In this scheme, the octave is indicated by using raised
-quotes (') and lowered" quotes (commas: code(,)).  The central C is denoted
-by code(c').  The C one octave higher is code(c'').  One and two
-octaves below central C is denoted by code(c) and code(c,)
-respectively.
+    \relative c''
+)COMMENT(
+
+) As we will see, pitches are combinations of octave, note name and
+chromatic alteration.  In this scheme, the octave is indicated by
+using raised quotes (`code (')') and ``lowered'' quotes (commas:
+`code(,)').  The central C is denoted by code(c').  The C one octave
+higher is code(c'').  One and two octaves below central C is denoted
+by code(c) and code(c,) respectively.
 
 If you have to indicate the pitches in a long piece that is written in
 either a high or very low octave, you would have to type very many
@@ -189,10 +178,11 @@ octave that they are the closest to the preceding note.  If you add a
 high-quote an extra octave is added.  The lowered quote will substract
 an octave.  Because the first note obviously has no predecessor, you
 have to give the (absolute) pitch of the note to start with.
+COMMENT(
 
-verb(
+)verb(
        {                         % sequential music follows
-) COMMENT(
+)COMMENT(
 
 ) The brace indicates that what follows is sequential music, i.e.,
 notes that are to be played and printed after each other.  This is in
@@ -202,14 +192,14 @@ coming after code(\score).
 
 
 verb(
-       \time 3/4;              % set the time signature.
+        \time 3/4;             % set the time signature.
 ) COMMENT(
 
 ) This command changes the time signature of the current piece: this
 prints a 3/4 sign.  The 3/4 value is also used to generate bar lines
 in the right spots.
 verb(
-       \key G;
+        \key g;
 ) COMMENT(
 
 ) This command changes the current key to G-major.  Although
@@ -217,42 +207,51 @@ this command comes after the code(\time) command, in the
 output, the key comes before the time signature: LilyPond knows about
 music typesetting conventions.
 verb(
-       d4
+        d4
 ) COMMENT(
 
 ) This is a code(d) note.  The relative music was started with a
-code(c''), the real pitch of this note is code(d'').  The 4 is
-designates the duration of the note (it is a quarter note).
-verb(
-       [g,8
-)
-The open bracket starts a beam.  This bracket is connected to the
-following note, which is an eighth pitch code(g') (remember relative mode)
-verb(
-       a b
-)
-These are notes with pitch code(a') and code(b').  Because their
+code(c''), the real pitch of this note is code(d'').  The 4 
+designates the duration of the note (it is a quarter note). COMMENT(
+
+)verb(
+        [g,8
+)COMMENT(
+
+)The open bracket starts a beam.  This bracket is connected to the
+following note, which is an eighth with pitch code(g') (remember
+relative mode for pitches!)
+COMMENT(
+
+)verb(
+        a b
+)COMMENT(
+
+)These are notes with pitch code(a') and code(b').  Because their
 duration is the same as the code(g), there is no need to enter the
 duration (It is not illegal to enter it anyway.  Then you would have
 to enter code(a8 b8))
-verb(
-         c]
+COMMENT(
+
+)verb(
+          c]
 ) COMMENT(
 
-) This ends the beam started four notes earlier, at the code(g).  In the output,
-you will notice a measure bar following this note.  You do not have to
-enter anything to make LilyPond create a bar.  Instead Lily deduce
-where bars have to be by comparing durations of notes with the current
-time signature.
-verb(
-         d4 g, g |
+) This ends the beam started four notes earlier, at the code(g).  In
+the output, you will notice a measure bar following this note.  You do
+not have to enter anything to make LilyPond create a bar.  Instead
+Lily will deduce where bars have to be by comparing durations of notes with
+the current time signature.  COMMENT(
+
+)verb(
+          d4 g, g |
 ) COMMENT(
 
 ) Three more notes:  The code(|) is a "barcheck".  When processing the
 music, LilyPond will check  that barchecks are found at the start of
 a bar precisely.  This makes it easy to spot where notes are forgotten. 
 verb(
-       e'4 [c8 d e fis]
+        e'4 [c8 d e fis]
 ) COMMENT(
 
 ) So far, no notes were chromatically altered.  Here is the first one
@@ -261,7 +260,7 @@ that is: code(fis). Mudela by default uses Dutch note names, and
 sharp sign in the output. The program keeps track of key signatures,
 and will only print accidentals if they are needed.
 verb(
-       c4 [d8( )c b a( ] )b4 [c8 b a g] |
+        c4 [d8( )c b a( ] )b4 [c8 b a g] |
 ) COMMENT(
 
 ) The next line shows something new: a slur is a symbol that is
@@ -273,14 +272,15 @@ notes, and the brackets (beam markers) around the notes. As you can
 see, the brackets and parentheses do not have to nest.
 
 verb(
-       a4 [b8 a g fis] g2.  |
+        a4 [b8 a g fis] g2.  |
 ) COMMENT(
 
 ) A duration that is to be augmented with a duration dot, is notated
-with a number followed by periods, as many as you want augmentation
-dots.
-verb(
-       \bar ":|";              % a repeat sign
+with a duration number followed by periods, as many as you want
+augmentation dots.COMMENT(
+
+)verb(
+        \bar ":|";             % a repeat sign
 ) COMMENT(
 
 )
@@ -297,26 +297,28 @@ verb(
 This line shows that Lily will print an accidental if that is needed:
 the first C sharp will be printed with an accidental, the second without.
 verb(
-       [a8-. b-. cis-. d-. e-. fis-. ] % try some super and subscripts.
+        [a8-. b-. cis-. d-. e-. fis-. ] % try some super and subscripts.
 ) COMMENT(
 
 )
 There is more to music than just pitches and rhythms.  An important
 aspect is articulation.  You can enter articulation signs either in an
-abbreviated form, e.g., by using code(-.) for staccato as shown above.
+abbreviated form, by a dash and the the character for the
+articulation to use,  e.g. code(-.) for staccato as shown above.
+COMMENT(
 
-verb(
-       fis a,  r8 cis8
+)verb(
+        fis a,  r8 cis8
 ) COMMENT(
 
 )
 Rests are denoted by the special notename code(r).  You can also make
 an invisible rest by using the special notename code(s).
 verb(
-       d2.-\fermata
+        d2.-\fermata
 ) COMMENT(
 
-) Finally, all articulations has a verbose form, like code(\fermata).
+) Finally, all articulations have a verbose form, like code(\fermata).
 The ``command'' COMMENT(Hi Adrian :-) code(\fermata) is not part of
 the core of the language (most of the other discussed elements are),
 but it is an abbreviation of a more complicated description of a
@@ -324,14 +326,14 @@ fermata.  code(\fermata) refers to that abbreviation and is therefore
 called an em(identifier).
 
 verb(
-       }
+        }
 ) COMMENT(
 
 )
 This ends the sequential music.
 
 verb(\paper {
-           linewidth = 10.0\cm;
+            linewidth = 10.0\cm;
 })
 This specifies a conversion from music to notation output.  Most of
 the details of this conversions (font sizes, dimensions, etc.) have
@@ -340,7 +342,7 @@ to be smaller.  We do this by setting the line width to 10 centimeter
 (approximately 4 inches).
 
 verb(
-       }
+        }
 )
 Finally, the last brace ends the code(\score) block.
 
@@ -350,10 +352,8 @@ There are a couple of things to note here.  The input format tries to
 capture the meaning of em(music), and not notation.  Therefore the
 format contains musical concepts like pitches and durations, instead
 of symbols and positions.  Second, the format tries to be
-em(context-free): a note will remain to sound the  same regardless of
-the current time signature, the key nop(etc.)COMMENT(footnote The
-code(\relative) mode is a concession to this, but a )
-
+em(context-free): a note will sound the same regardless of the current
+time signature, the key nop(etc.)
 
 The purpose of LilyPond informally is explained by the term `music
 typesetter'. As you may have figured out by now, this is not a really
@@ -373,15 +373,15 @@ made between processing speed and the beauty of the output: you get
 prettier output by using LilyPond.
 
 
-As you can see, the most interesting parts of the input is music
+As you can see, the most interesting part of the input is music
 itself, in this case the sequence of notes.  We will therefore focus
 on entering music for now.  Consequently, when we mean
 verb(\score {
-       \notes { XXXX } 
+        \notes { XXXX } 
        \paper {  }
 })COMMENT(
 
-) we will leave out the the repetitive details and just print
+) we will leave out the the repetitive details for now and just print
 code(XXXX).
 
 
@@ -415,16 +415,16 @@ mudela()(
        \notes {
          c'\longa c'\breve  
          c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 c'2. c'8. c'16
-        }
-        \paper {
-               linewidth = -1.0;
-               \translator { \type "Score_engraver";
-                           \name "Score";
-                           \consists "Note_heads_engraver";
-                           \consists "Stem_engraver";
-                           \consists "Rhythmic_column_engraver";
-        }}}
-        
+         }
+         \paper {
+               linewidth = -1.0;
+               \translator { \type "Score_engraver";
+                           \name "Score";
+                           \consists "Note_heads_engraver";
+                           \consists "Stem_engraver";
+                           \consists "Rhythmic_column_engraver";
+         }}}
+         
 )
 
 subsect(Basic pitches)
@@ -461,8 +461,10 @@ for C sharp or C flat.  For this reason, mudela uses a different,
 non-English convention for entering altered pitches: a note is made
 sharp by adding the suffix `--is' to its name, and flat by adding the
 suffix `--es'.  For a double sharp another `--is' suffix is added, for
-flats another `--es' suffix. The names for the alterations of C are
-given in bind(Table)ref(notename-tab).
+flats another `--es' nop(suffix.)  footnote(Variations on this
+convention are used in a number of germanic languages, notably Dutch,
+German, Swedish, and Norwegian.) The names for the alterations of C
+are given in bind(Table)ref(notename-tab).
 
 latexcommand(\begin{table}[h])
   center(
@@ -480,16 +482,13 @@ latexcommand(\begin{table}[h])
   label(notename-tab)
 latexcommand(\end{table})
 
-Variations on this convention are used in a number of germanic
-languages, notably Dutch, German, Swedish, and Norwegian.
-
 Throughout this document we will continue to use these names.footnote(
   Mudela defaults to Dutch notenames.  To make (Dutch) pronunciation
   easier, the a-flat and e-flat are contracted to code(as) and
   code(es).  Similarly, the a double flat and e double flat are
   contracted to code(ases) and code(eses).  For consistency, the dutch
   names also include code(aes), code(aeses), code(ees) and
-  code(eeses)) consistency
+  code(eeses)) 
 
 If you are not comfortable with these names, you can make your own.
 Note names for different languages are included with the example
@@ -534,11 +533,18 @@ mudela(verbatim, fragment)(
   }
 )
 
+There is one thing to note, in sequences of chords, the (relative)
+pitch of a is taken with reference to the first note of the previous
+chord.
+
 You can nest simultaneous and sequential music in any way you want,
-e.g.,
-mudela(verbatim,fragment)(
-       < { g''4 g''4 }
-         { c'8 <c' e'> c' <c' e'> } >
+e.g., COMMENT(
+
+)mudela(verbatim,fragment,center)(
+        < { g''4 g''4 }
+          { c'8 <c' e'> c' <c' e'> } >
+)COMMENT(
+
 )
 As you can see, LilyPond has some difficulty typesetting this
 elegantly.  To adequately solve this, you have to persuade LilyPond to
@@ -568,26 +574,26 @@ following example:
 
 mudela()(
 \score{ <
-       \property Score.textstyle = typewriter
-       \type Staff \notes {
-               c''4-.
-               c''4--
-               c''4-+
-               c''4-|
-               c''4->
-               c''4-^
-               }
-       \type Lyrics\lyrics {
-             "."4 "-" "+" "|" ">" "\^{ }" }
-       >
-       \paper { linewidth = 12.\cm; }
+        \property Score.textstyle = typewriter
+        \type Staff \notes {
+               c''4-.
+               c''4--
+               c''4-+
+               c''4-|
+               c''4->
+               c''4-^
+               }
+        \type Lyrics\lyrics {
+              "."4 "-" "+" "|" ">" "\^{ }" }
+        >
+        \paper { linewidth = 12.\cm; }
 })
 
 Text and digits for fingering can be entered in the same manner: add a
 dash and the text or digit to be printed:
 mudela(fragment,verbatim)(
   c''4-1 g''4-5 c''-"Sul tasto" )
-Currently, the meaning of the
+COMMENT(Currently, the meaning of the
 syntax `note-dash-digit/articulation/text' is just ``add a superscript to this
 note.''  This is not in line with our goal to em(define) music with
 Mudela.  We hope that this will be fixed in a future version of the
@@ -596,7 +602,7 @@ subscripts can be forced into up or down position respectively by entering an
 a caret (code(^)) or an underscore, code(_) instead of the dash:
 mudela(fragment,verbatim,center)(
   c'4-^ c'4^^ c'''4-^ c'''4_^
-)
+))
 
 Dynamic markings are another way to add a nuance to a note.  They are
 entered by adding the name for the dynamic sign after the note.  You
@@ -615,14 +621,9 @@ Music typesetting does not use fixed symbols only.  A lot of symbols
 are variable: they run from one note to another. In LilyPond
 terminology, such a symbol is called a em(spanner).  To print a
 spanner, you have to attach a marker to the note that begins it and to
-the one that ends it.
-
-It is your job to make sure that each spanner that you start, also ends.
-If it doesn't, then Bad Things are likely to happen. If you end
-spanners that are not started,  LilyPond will
-warn you about illegal ending markers.
+the one that ends it.  These are the spanners that are entered like
+this:
 
-LilyPond has a few spanners
 description(
 dit(The slur)
  The slur has the opening parenthesis as 
@@ -646,7 +647,7 @@ bracket, then ending marker is the closing bracket.  The brackets have
 to be em(around) the beamed notes.  footnote(Strictly speaking, a
 beam is not a musical concept: beaming doesn't change the meaning of
 music, it only clarifies the rhythmic structure.  One might argue that
-beams should not be present in a "music" language.  Unfortunately,
+beams should not be present in a ``music'' language.  Unfortunately,
 LilyPond is not smart enough to insert beams into music on its own.
 
 LilyPond does have code that guesses what the pattern should look
@@ -691,6 +692,11 @@ within a note.
 
 )
 
+It is your job to make sure that each spanner that you start, also
+ends.  If it doesn't, then Bad Things are likely to happen. If you end
+spanners that are not started, LilyPond will warn you about illegal
+ending markers.
+
 sect(Commands)
 label(sec:commands)
 
@@ -1026,7 +1032,7 @@ sound the same if it were written as a single chord on a single staff,
 i.e., COMMENT(
 
 )mudela(fragment)(
-       <g4 e'4>
+        <g4 e'4>
 )COMMENT(
 
 ) The Mudela construct for multiple staffs reflects the similarity
@@ -1087,8 +1093,8 @@ command.  The bass clef is made with a clef command:  COMMENT(
 
 ) mudela(verbatim,fragment)(
   \type GrandStaff <
-       \type Staff = treblestaff e'4
-       \type Staff = bassstaff { \clef "bass"; g4 }
+        \type Staff = treblestaff e'4
+        \type Staff = bassstaff { \clef "bass"; g4 }
   >)COMMENT(
 
 )
@@ -1414,7 +1420,7 @@ This explains the following definition, which is a simplified Staff context:
 verb(
 \translator
 {
-       \type "Line_group_engraver_group";
+        \type "Line_group_engraver_group";
         \name Staff ;
 
         \consists "Bar_engraver";
@@ -1424,7 +1430,7 @@ verb(
         \consists "Time_signature_engraver";
         \consists "Staff_symbol_engraver";
 
-       defaultClef = treble;
+        defaultClef = treble;
           
         \accepts "Voice";
 }) COMMENT(
index 94a6810b2d91e9a147ca8c0234e2ba28d8f029d1..a0bc2888e7300d2a23187f0d5894a8f9da17cc24 100644 (file)
     (string-append (number->string (car c)) " ")
     (string-append (number->string (cadr c)) " ")))
 
+
+
+(define
+  (font i)
+  (string-append
+   "font"
+   (make-string 1 (integer->char (+ (char->integer #\A) i)))
+   ))
+
+
+
+(define (scm-scm action-name)
+  1)
+
+;;;;;;;;
+
+  (define (empty) 
+    "")
+
+  (define (empty1 a)
+    "")
+
+  (define (empty2 a b )
+    "")
+  
+
+(define emptybar empty1)
+(define setdynamic empty1)
+(define settext empty1)
+(define setnumber empty1)
+
+
 ;;;;;;;; TeX
-;(define (tex action)
 
-(define (beam-tex width slope thick)
-  (embedded-ps-tex ((ps-scm 'beam) width slope thick)))
+(define (tex-scm action-name)
 
-(define (bracket-tex h)
-  (embedded-ps-tex ((ps-scm 'bracket) h)))
+  (define (unknown) 
+    "%\n\\unknown%\n")
 
-(define (dashed-slur-tex thick dash l)
-  (embedded-ps-tex ((ps-scm 'dashed-slur)  thick dash l)))
+  (define (beam width slope thick)
+    (embedded-ps ((ps-scm 'beam) width slope thick)))
 
-(define (crescendo-tex w h cont)
-  (embedded-ps-tex ((ps-scm 'crescendo) w h cont)))
+  (define (bracket h)
+    (embedded-ps ((ps-scm 'bracket) h)))
 
-(define (decrescendo-tex w h cont)
-  (embedded-ps-tex ((ps-scm 'decrescendo) w h cont)))
+  (define (dashed-slur thick dash l)
+    (embedded-ps ((ps-scm 'dashed-slur)  thick dash l)))
 
-(define (embedded-ps-tex s)
-  (string-append "\\embeddedps{" s "}"))
+  (define (crescendo w h cont)
+    (embedded-ps ((ps-scm 'crescendo) w h cont)))
 
+  (define (decrescendo w h cont)
+    (embedded-ps ((ps-scm 'decrescendo) w h cont)))
 
-(define (end-output-tex) 
-  "\n\\EndLilyPondOutput")
+  (define (embedded-ps s)
+    (string-append "\\embeddedps{" s "}"))
 
-(define (empty-tex) 
-  "%\n\\empty%\n")
 
-(define (experimental-on-tex) "\\turnOnExperimentalFeatures")
+  (define (end-output) 
+    "\n\\EndLilyPondOutput")
+  
+  (define (experimental-on) "\\turnOnExperimentalFeatures")
 
-(define (extender o h)
-  ((invoke-output o "invoke-dim1") "extender" h))
+  (define (extender o h)
+    ((invoke-output o "invoke-dim1") "extender" h))
 
-(define (font-switch-tex i)
-  (string-append
-   "\\" (font i) "\n"))
+  (define (font-switch i)
+    (string-append
+     "\\" (font i) "\n"))
 
-(define (font-def-tex i s)
-  (string-append
-   "\\font" (font-switch-tex i) "=" s "\n"))
+  (define (font-def i s)
+    (string-append
+     "\\font" (font-switch i) "=" s "\n"))
 
-(define (generalmeter-tex num den)
-  (string-append 
-   "\\generalmeter{" (number->string (inexact->exact num)) "}{" (number->string (inexact->exact den)) "}"))
+  (define (generalmeter num den)
+    (string-append 
+     "\\generalmeter{" (number->string (inexact->exact num)) "}{" (number->string (inexact->exact den)) "}"))
 
-(define (header-end-tex) "\\turnOnPostScript")
+  (define (header-end) "\\turnOnPostScript")
 
-(define (header-tex creator generate) 
-  (string-append
-   "%created by: " creator generate "\n"))
+  (define (header creator generate) 
+    (string-append
+     "%created by: " creator generate "\n"))
 
-(define (invoke-char-tex s i)
-  (string-append 
-   "\n\\" s "{" (inexact->string i 10) "}" ))
+  (define (invoke-char s i)
+    (string-append 
+     "\n\\" s "{" (inexact->string i 10) "}" ))
+  (define (char i)
+    (string-append "\\show{" (inexact->string i 10) "}"))
+    
+  (define (invoke-dim1 s d)
+    (string-append
+     "\n\\" s "{" (number->dim d) "}"))
 
-(define (invoke-dim1-tex s d)
-  (string-append
-   "\n\\" s "{" (number->dim-tex d) "}"))
+  (define (lily-def key val)
+    (string-append
+     "\\def\\" key "{" val "}\n"))
 
-(define (lily-def-tex key val)
-  (string-append
-   "\\def\\" key "{" val "}\n"))
+  (define (number->dim x)
+    (string-append 
+     (number->string (chop-decimal x)) "pt "))
 
-(define (number->dim-tex x)
-  (string-append 
-   (number->string (chop-decimal x)) "pt "))
+  (define (placebox x y s) 
+    (string-append 
+     "\\placebox{"
+     (number->dim y) "}{" (number->dim x) "}{" s "}"))
 
-(define (placebox-tex x y s) 
-  (string-append 
-   "\\placebox{"
-   (number->dim-tex y) "}{" (number->dim-tex x) "}{" s "}"))
+  (define (pianobrace y)
+    (define step 1.0)
+    (define minht mudelapaperstaffheight)
+    (define maxht (* 6 minht))
+    (string-append
+     "{\\bracefont " (char  (/  (- (max y (- maxht step)) minht)   step)) "}"))
+  
+  (define (rulesym h w) 
+    (string-append 
+     "\\vrule height " (number->dim (/ h 2))
+     " depth " (number->dim (/ h 2))
+     " width " (number->dim w)
+     )
+    )
 
-(define (rulesym-tex h w) 
-  (string-append 
-   "\\vrule height " (number->dim-tex (/ h 2))
-   " depth " (number->dim-tex (/ h 2))
-   " width " (number->dim-tex w)
-   )
-  )
+  (define (slur l)
+    (embedded-ps ((ps-scm 'slur) l)))
+
+  (define (start-line) 
+    (string-append 
+     "\\hbox{%\n")
+    )
 
-(define (slur-tex l)
-  (embedded-ps-tex ((ps-scm 'slur) l)))
+  (define (stem kern width height depth) 
+    (string-append 
+     "\\kern" (number->dim kern)
+     "\\vrule width " (number->dim width)
+     "depth " (number->dim depth)
+     "height " (number->dim height) " "))
 
-(define (start-line-tex) 
-  (string-append 
-   "\\hbox{%\n")
-  )
+  (define (stop-line) 
+    "}\\interscoreline")
 
-(define (stem-tex kern width height depth) 
-  (string-append 
-   "\\kern" (number->dim-tex kern)
-   "\\vrule width " (number->dim-tex width)
-   "depth " (number->dim-tex depth)
-   "height " (number->dim-tex height) " "))
+  (define (text f s)
+    (string-append "\\set" f "{" s "}"))
 
-(define (stop-line-tex) 
-  "}\\interscoreline")
+  (define (tuplet dx dy dir)
+    (embedded-ps ((ps-scm 'tuplet) dx dy dir)))
 
-(define (text-tex f s)
-  (string-append "\\set" f "{" s "}"))
+  (define (volta w last)
+    (embedded-ps ((ps-scm 'volta)  w last)))
 
-(define (tuplet-tex dx dy dir)
-  (embedded-ps-tex ((ps-scm 'tuplet) dx dy dir)))
+  (define (maatstreep h)
+    (string-append "\\maatstreep{" (number->dim h) "}"))
+  
+  (cond ((eq? action-name 'all-definitions)
+        `(begin
+          (define beam ,beam)
+          (define tuplet ,tuplet)
+          (define bracket ,bracket)
+          (define crescendo ,crescendo)
+          (define volta ,volta)
+          (define slur ,slur)
+          (define dashed-slur ,dashed-slur) 
+          (define decrescendo ,decrescendo) 
+          (define empty ,empty)
+          (define end-output ,end-output)
+          (define font-def ,font-def)
+          (define font-switch ,font-switch)
+          (define generalmeter ,generalmeter)
+          (define header-end ,header-end)
+          (define lily-def ,lily-def)
+          (define header ,header) 
+          (define invoke-char ,invoke-char) 
+          (define invoke-dim1 ,invoke-dim1)
+          (define placebox ,placebox)
+          (define rulesym ,rulesym)
+          (define start-line ,start-line)
+          (define stem ,stem)
+          (define stop-line ,stop-line)
+          (define text ,text)
+          (define experimental-on  ,experimental-on)
+          (define char  ,char)
+          (define maatstreep ,maatstreep)
+          (define pianobrace ,pianobrace)
+          ))
+
+       ((eq? action-name 'experimental-on) experimental-on)
+       ((eq? action-name 'beam) beam)
+       ((eq? action-name 'tuplet) tuplet)
+       ((eq? action-name 'bracket) bracket)
+       ((eq? action-name 'crescendo) crescendo)
+       ((eq? action-name 'volta) volta)
+       ((eq? action-name 'slur) slur)
+       ((eq? action-name 'dashed-slur) dashed-slur) 
+       ((eq? action-name 'decrescendo) decrescendo) 
+       ((eq? action-name 'empty) empty)
+       ((eq? action-name 'end-output) end-output)
+       ((eq? action-name 'font-def) font-def)
+       ((eq? action-name 'font-switch) font-switch)
+       ((eq? action-name 'generalmeter) generalmeter)
+       ((eq? action-name 'header-end) header-end)
+       ((eq? action-name 'lily-def) lily-def)
+       ((eq? action-name 'header) header) 
+       ((eq? action-name 'invoke-char) invoke-char) 
+       ((eq? action-name 'invoke-dim1) invoke-dim1)
+       ((eq? action-name 'placebox) placebox)
+       ((eq? action-name 'rulesym) rulesym)
+       ((eq? action-name 'start-line) start-line)
+       ((eq? action-name 'stem) stem)
+       ((eq? action-name 'stop-line) stop-line)
+       (else (error "unknown tag -- PS-TEX " action-name))
+       )
 
-(define (volta-tex w last)
-  (embedded-ps-tex ((ps-scm 'volta)  w last)))
+  )
 
 ;;;;;;;;;;;; PS
 (define (ps-scm action-name)
   (define (text f s)
     (string-append "(" s ") set" f " "))
 
-(define 
-  (unknown-tex) 
-  "%\n\\unknown%\n")
 
   (define (volta w last)
     (string-append 
      "draw_tuplet"))
 
 
+  (define (unknown) 
+    "\n unknown\n")
+
 
   ; dispatch on action-name
   (cond ((eq? action-name 'all-definitions)
-       `(eval
+       `(begin
          (define beam ,beam)
          (define tuplet ,tuplet)
          (define bracket ,bracket)
 )
 
 
-(define 
-  (unknown-ps) 
-  "\n unknown\n")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; output definitions
-
-(define 
-  (beam o width slope thick) 
-  ((invoke-output o "beam") width slope thick))
-
-(define 
-  (bracket o h)
-  ((invoke-output o "bracket") h))
-
-(define 
-  (char o n) 
-  ((invoke-output o "invoke-char") "show" n))
-
-(define 
-  (crescendo o w h cont)
-  ((invoke-output o "crescendo") w h cont))
-
-(define 
-  (dashed-slur o thick dash l) 
-  ((invoke-output o "dashed-slur") thick dash l))
-
-(define 
-  (decrescendo o w h cont)
-  ((invoke-output o "decrescendo") w h cont))
-
-(define 
-  (doublebar o h)
-  ((invoke-output o "invoke-dim1") "doublebar" h))
-
-(define 
-  (empty o) 
-  ((invoke-output o "empty")))
-
-(define 
-  (emptybar o h) (empty o))
-
-(define 
-  (end-output o) 
-  ((invoke-output o "end-output")))
-
-(define 
-  (experimental-on o) 
-  ((invoke-output o "experimental-on")))
-
-(define
-  (fatdoublebar o h)
-  ((invoke-output o "invoke-dim1") "fatdoublebar" h))
-
-(define
-  (finishbar o h)
-  ((invoke-output o "invoke-dim1") "finishbar" h))
-
-(define
-  (font i)
-  (string-append
-   "font"
-   (make-string 1 (integer->char (+ (char->integer #\A) i)))
-   ))
-
-(define 
-  (font-def o i s) 
-  ((invoke-output o "font-def") i s))
-
-(define 
-  (font-switch o i) 
-  ((invoke-output o "font-switch") i))
-
-(define 
-  (generalmeter o num den)
-   ((invoke-output o "generalmeter") num den))
-
-(define 
-  (header o creator generate) 
-  ((invoke-output o "header") creator generate))
-
-(define 
-  (header-end o) 
-  ((invoke-output o "header-end")))
-
-(define
-  (invoke-output o s)
-   (eval-string (string-append s "-" o)))
-
-(define
-  (lily-def o key val)
-  ((invoke-output o "lily-def") key val))
-
-(define 
-  (maatstreep o h) 
-  ((invoke-output o "invoke-dim1") "maatstreep" h))
-
-(define 
-  (pianobrace o i)
-  ((invoke-output o "invoke-char") "pianobrace" i))
-
-(define 
-  (placebox o x y b) 
-  ((invoke-output o "placebox") x y (b o)))
-
-(define
-  (repeatbar o h)
-  ((invoke-output o "invoke-dim1") "repeatbar" h))
-
-(define
-  (repeatbarstartrepeat o h)
-  ((invoke-output o "invoke-dim1") "repeatbarstartrepeat" h))
-
-(define 
-  (rulesym o x y) 
-  ((invoke-output o "rulesym") x y))
-
-(define 
-  (setbold o s) 
-  ((invoke-output o "text") "bold" s))
-
-(define
-  (setdynamic o s) (empty o))
-
-(define 
-  (setfinger o s) 
-  ((invoke-output o "text") "finger" s))
-
-(define 
-  (sethuge o s) 
-  ((invoke-output o "text") "huge" s))
-
-(define 
-  (setitalic o s) 
-  ((invoke-output o "text") "italic" s))
-
-(define 
-  (setlarge o s) 
-  ((invoke-output o "text") "large" s))
-
-(define 
-  (setLarge o s) 
-  ((invoke-output o "text") "Large" s))
-
-(define 
-  (setnumber o s) 
-  ((invoke-output o "text") "number" s))
-
-; urg, howto do all these sizes;
-; what about: fontjj fontj font fonti fontii
-(define 
-  (setnumber-1 o s) 
-  ((invoke-output o "text") "numberj" s))
-
-(define 
-  (settext o s) 
-  ((invoke-output o "text") "text" s))
-
-(define 
-  (settypewriter o s) 
-  ((invoke-output o "text") "typewriter" s))
-
-(define 
-  (slur o l) 
-  ((invoke-output o "slur") l))
-
-(define 
-  (tuplet o dx dy dir)
-  ((invoke-output o "tuplet") dx dy dir))
-
-(define 
-  (stem o kern width height depth) 
-  ((invoke-output o "stem") kern width height depth))
-
-
-
-(define 
-  (start-line o) 
-  ((invoke-output o "start-line")))
-
-(define
-  (startbar o h)
-  ((invoke-output o "invoke-dim1") "startbar" h))
-
-(define
-  (startrepeat o h)
-  ((invoke-output o "invoke-dim1") "startrepeat" h))
-
-(define 
-  (stem o kern width height depth) 
-  ((invoke-output o "stem") kern width height depth))
-
-(define 
-  (stop-line o) 
-  ((invoke-output o "stop-line")))
-
-(define
-  (stoprepeat o h)
-  ((invoke-output o "invoke-dim1") "stoprepeat" h))
-
-(define 
-  (tuplet-ps dx dy dir)
-  (string-append 
-   (numbers->string (list dx dy (inexact->exact dir)))
-   "draw_tuplet"))
-
-(define 
-  (unknown o) 
-  ((invoke-output o "unknown")))
-
-(define 
-  (volta o w last)
-  ((invoke-output o "volta") w last))
 
index ae6092c165e628f28185ed7bc7c5944cf73dc5fd..be150860370baa775723b30cb384db9c8b800b71 100644 (file)
@@ -69,13 +69,6 @@ Atom::extent () const
 Atom::Atom ()
   : dim_ (Interval (0,0),Interval (0,0))
 {
-  /*
-    urg
-    We should probably make Atom an abstract base class to
-    derive Ps_atom and Tex_atom from.
-    But Atom is used as a simple type *everywhere*,
-    and we don't have virtual contructors.
-   */
   str_ = "unknown\n";
   origin_l_ = 0;
 }
index becdf9b76ba29b34e3742d808141ef4688917e02..fbfd95459d5ee0a3f6e137e910f73c41e168c6a2 100644 (file)
@@ -64,7 +64,7 @@ Dynamic_engraver::do_process_requests()
          Text_def * td_p = new Text_def;
          td_p->align_dir_ = CENTER;
          String loud = absd->loudness_str ();
-         td_p->text_str_ = paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
+         td_p->text_str_ =  paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
          td_p->style_str_ = "dynamic";
 
          
index 5afbb1e6cefbe705e3f6d74baaae879796d762d8..e2f945b1c08a568129976bd174a586e5835ff5a2 100644 (file)
 #define LILY_GUILE_HH
 
 #include "config.hh"
+#include  "string.hh"
 
 #include <guile/gh.h>
 #include <libguile.h>
 
+SCM ly_symbol (String name);
+
 SCM ly_append (SCM a, SCM b);
 SCM ly_eval (SCM a);
 SCM ly_func_o (char const* name);
-SCM ly_lambda_o ();
-SCM ly_list1 (SCM a);
-SCM ly_quote ();
 SCM ly_quote_scm (SCM s);
 
 
 #include "array.hh"
 #include "scalar.hh"
 
-SCM lambda_scm (String str, Array<int> args_arr);
-SCM lambda_scm (String str, Array<Real> args_arr);
-SCM lambda_scm (String str, Array<Scalar> args_arr);
-
 
 void read_lily_scm_file (String);
 
index e88e6fa5c6556c89f36a6b42efa3196b4c2e9830..42c580768e9a5d24a8c2c22c998fd9667702844a 100644 (file)
@@ -24,13 +24,17 @@ public:
   Paper_outputter (Paper_stream *);
   ~Paper_outputter ();
 
+  void output_int_def (String k, int v);
+  void output_Real_def (String k, Real v);
+  void output_String_def (String k, String v);
+  void output_scope (Scope*, String prefix);
+  void output_version ();
   void output_font_def (int i, String str);
   void output_font_switch (int i);
   void output_header ();
   void output_molecule (Molecule const *, Offset, char const *);
   void output_comment (String s);
   void output_scheme (SCM scm);
-  void output_string (String s);
   void start_line ();
   void stop_line ();
   void switch_to_font (String fontname);
index 5fa1f568ce07dd3ca4c58ccf636c1f72977e897d..f02ced787bda655c9d33d51238e0315f10e8c20f 100644 (file)
@@ -25,6 +25,7 @@ public:
   ~Protected_scm ();
   Protected_scm &operator = (Protected_scm const &);
   operator SCM ();
+  SCM to_SCM () const;
 };
 
 #endif /* PROTECTED_SCM_HH */
index 8599b9ba9569e55dfe2718fcf778a98a3b8ea0ac..b729e905906664a27c480dc0caf9c5a01c94b5da 100644 (file)
 #include "simple-file-storage.hh"
 #include "file-path.hh"
 
-SCM
-ly_list1 (SCM a)
-{
-  return gh_list (a, SCM_UNDEFINED);
-}
-
-SCM
-ly_quote ()
-{
-  return gh_eval_str ("'quote");
-}
 
 /*
   scm_m_quote doesn't use any env, but needs one for a good signature in GUILE.
@@ -36,83 +25,20 @@ ly_quote ()
 SCM
 ly_quote_scm (SCM s)
 {
-  //  return scm_m_quote (s, SCM_UNDEFINED);
   return scm_cons2 (scm_i_quote, s, SCM_EOL);
-  
-}
-
-SCM
-ly_eval (SCM a)
-{
-  return gh_call1 (gh_eval_str ("eval"), a);
-}
-
-SCM
-ly_lambda_o ()
-{
-  return gh_eval_str ("'(lambda (o))");
 }
 
-SCM
-ly_func_o (char const* name)
-{
-  char buf[200];               // ugh.
-  snprintf (buf, 200, "'(%s o)", name);
-  return gh_eval_str (buf);
-}
-
-
-SCM
-lambda_scm (String str, Array<int> args_arr)
-{
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size () - 1; i >= 0; i--)
-    args_scm = gh_cons (gh_int2scm (args_arr[i]), args_scm);
-  SCM scm =
-    gh_append2 (ly_lambda_o (), 
-               ly_list1 (gh_append2 (ly_func_o (str.ch_l ()), args_scm)));
-  return scm;
-}
-
-// scm_top_level_env(SCM_CDR(scm_top_level_lookup_closure_var)))
-SCM
-lambda_scm (String str, Array<Scalar> args_arr)
-{
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size (); i--; )
-    args_scm = gh_cons (gh_str02scm (args_arr[i].ch_l ()), args_scm);
-  SCM scm =
-    gh_append2 (ly_lambda_o (), 
-    ly_list1 (gh_append2 (ly_func_o (str.ch_l ()), args_scm)));
-  return scm;
-}
+/*
+  See: libguile/symbols.c
 
+  SCM
+  scm_string_to_symbol(s)
+  
+*/
 SCM
-lambda_scm (String str, Array<Real> args_arr)
+ly_symbol (String name)
 {
-  if (str.empty_b ())
-    {
-      str = "empty";
-      args_arr.clear ();
-    }
-  SCM args_scm = SCM_EOL;
-  for (int i = args_arr.size (); i--; )
-    args_scm = gh_cons (gh_double2scm (args_arr[i]), args_scm);
-  
-  SCM scm =
-    gh_append2 (ly_lambda_o (), 
-    ly_list1 (gh_append2 (ly_func_o (str.ch_l ()), args_scm)));
-  return scm;
+  return gh_car (scm_intern (name.ch_C(), name.length_i()));
 }
 
 /**
index 94982bb10066f288b367e2710ea4211429532d07..2afdbc129c206728fe5a470b23f9ece2a75ef769 100644 (file)
@@ -45,18 +45,6 @@ Paper_score::Paper_score ()
 
 Paper_score::~Paper_score ()
 {
-#if 0
-  for (int i=0; i< line_l_arr_.size (); i++)
-    line_l_arr_[i]->unlink_all ();
-
-  for (PCursor<Score_element*> i(elem_p_list_.top()); i.ok(); i++)
-    {
-
-      if (i->linked_b())
-       i->unlink ();
-      assert (! i->linked_b ());
-    }
-#endif
 }
 
 void
index e3fe90b19dd5887d7d4fa41274d89cbb3ad78211..a98af9d3896d1fcacd3a69fc4618db32b528ece9 100644 (file)
@@ -224,77 +224,34 @@ Paper_def::reset_default_count()
   default_count_i_ = 0;
 }
 
-//urg
 extern char const* lily_version_number_sz ();
 
-void
-output_def (Paper_outputter* p, String key, String val)
-{
-  SCM args_scm =
-    gh_cons (gh_str02scm (key.ch_l ()), gh_cons (gh_str02scm (val.ch_l ()), SCM_EOL));
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("lily-def"), args_scm)));
-  p->output_scheme (scm);
-}
-
-void
-output_header (Paper_outputter* p, Scope *head)
-{
-  if (!head)
-    return;
-
-  String id_str = "Lily was here";
-  if (no_timestamps_global_b)
-    id_str += ".";
-  else
-    id_str += String (", ") + lily_version_number_sz ();
-  output_def (p, "LilyIdString", id_str);
-  
-  for (Dictionary_iter<Identifier*> i (*head); i.ok (); i++)
-    {
-      if (!i.val ()->access_content_String (false))
-       continue;
-      
-      String val = *i.val()->access_content_String (false);
-      output_def (p, "mudela" + i.key (), val);
-    }
-}
-
-void
-Paper_def::output_settings (Paper_outputter* p) const
-{
-  for (Dictionary_iter<Identifier*> i (*scope_p_); i.ok (); i++)
-    output_def (p, String ("mudelapaper") + i.key (), i.val ()->str ());
-  p->output_string (*scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false));
-}
-
 Paper_outputter*
 Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origin_str) const
 {
   Paper_outputter* p = new Paper_outputter (os_p);
 
-  output_header (p, header_global_p);
-#if 0
   // for now; breaks -fscm output
   p->output_comment (_ ("outputting Score, defined at: "));
   p->output_comment (origin_str);
-#endif
-
-  output_header (p, header_l);
-
-  output_settings (p);
 
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("experimental-on"), SCM_EOL)));
+  p->output_version();
+  if (header_global_p)
+    p->output_scope (header_global_p, "mudela");
+  if (header_l)
+    p->output_scope (header_l, "mudela");
+  if (scope_p_)
+    p->output_scope (scope_p_, "mudelapaper");
+  
+  if (output_global_ch == String("tex"))
+    {
+      *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false);
+    }
+  
 
+  SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
   p->output_scheme (scm);
-
-  scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("header-end"), SCM_EOL)));
-
+  scm = gh_list (ly_symbol ("header-end"), SCM_UNDEFINED);
   p->output_scheme (scm);
 
   return p;
@@ -308,7 +265,8 @@ Paper_def::paper_stream_p () const
   if (outname != "-")
     outname += String (".") + output_global_ch;
   *mlog << _f ("Paper output to %s...", 
-              outname == "-" ? String ("<stdout>") : outname ) << endl;
+              outname == "-" ? String ("<stdout>") : outname) << endl;
+
   target_str_global_array.push (outname);
   return new Paper_stream (outname);
 }
index 3f31fb306f8012a217af9b9d1af953324ce0c084..bfab233f072e0d716a5acc8619855a9d9bab23a8 100644 (file)
@@ -9,6 +9,9 @@
 
 #include <time.h>
 #include <fstream.h>
+
+#include "dictionary-iter.hh"
+#include "virtual-methods.hh"
 #include "paper-outputter.hh"
 #include "paper-stream.hh"
 #include "molecule.hh"
@@ -18,6 +21,8 @@
 #include "debug.hh"
 #include "lookup.hh"
 #include "main.hh"
+#include "scope.hh"
+#include "identifier.hh"
 
 Paper_outputter::Paper_outputter (Paper_stream *s)
 {
@@ -27,16 +32,16 @@ Paper_outputter::Paper_outputter (Paper_stream *s)
 
 Paper_outputter::~Paper_outputter ()
 {
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("end-output"), SCM_EOL)));
-
+  SCM scm = gh_list (ly_symbol ("end-output"), SCM_UNDEFINED);
   output_scheme (scm);
 }
 
 void
 Paper_outputter::output_header ()
 {
+  String s = String ("(eval (") + output_global_ch + "-scm 'all-definitions))";
+  gh_eval_str (s.ch_C());
+  
   String creator;
   if (no_timestamps_global_b)
     creator = "GNU LilyPond\n";
@@ -54,8 +59,8 @@ Paper_outputter::output_header ()
     }
 
   SCM args_scm = 
-    gh_cons (gh_str02scm (creator.ch_l ()),
-    gh_cons (gh_str02scm (generate.ch_l ()), SCM_EOL));
+    gh_list (gh_str02scm (creator.ch_l ()),
+            gh_str02scm (generate.ch_l ()), SCM_UNDEFINED);
 
 #ifndef NPRINT
   DOUT << "output_header\n";
@@ -65,10 +70,7 @@ Paper_outputter::output_header ()
     }
 #endif
 
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("header"), args_scm)));
-
+  SCM scm = gh_cons (ly_symbol ("header"), args_scm);
   output_scheme (scm);
 }
 
@@ -84,37 +86,23 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
       a_off += o;
 
       if (!i->lambda_)
-        {
-         // urg
-         i->lambda_ = gh_append2 (ly_lambda_o (), 
-           ly_list1 (ly_func_o ("empty")));
-       }
-
-      switch_to_font (i->font_);
+       continue; 
 
-#ifndef NPRINT
-      if (check_debug && !monitor->silent_b ("Guile"))
+      if (check_debug)
        {
-         DOUT << i->str_ << "\n";
-         gh_display (i->lambda_); gh_newline ();
+         output_comment (classname (i.ptr ()->origin_l_));
+
        }
-#endif
+      
+      switch_to_font (i->font_);
 
-      SCM args_scm = 
-       gh_cons (gh_double2scm (a_off.x ()), 
-       gh_cons (gh_double2scm (a_off.y ()), 
-       gh_cons (i->lambda_, SCM_EOL)));
+      SCM args_scm = gh_list (gh_double2scm (a_off.x ()),
+                gh_double2scm (a_off.y ()), 
+                i->lambda_.to_SCM (),
+                SCM_UNDEFINED);
 
-#ifndef NPRINT
-      if (check_debug && !monitor->silent_b ("Guile"))
-       {
-         gh_display (args_scm); gh_newline ();
-       }
-#endif
 
-      SCM box_scm =
-       gh_append2 (ly_lambda_o (),
-       ly_list1 (gh_append2 (ly_func_o ("placebox"), args_scm)));
+      SCM box_scm = gh_cons (ly_symbol ("placebox"), args_scm);
 
       output_scheme (box_scm);
     }
@@ -123,8 +111,14 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm)
 void
 Paper_outputter::output_comment (String str)
 {
-  // urg
-  *outstream_l_ << "% " << str << "\n";
+  if (String (output_global_ch) == "scm")
+    {
+      *outstream_l_ << "; " << str << '\n';
+    }
+  else
+    {
+      *outstream_l_ << "% " << str << "\n";
+    }
 }
 
 
@@ -136,41 +130,69 @@ Paper_outputter::output_scheme (SCM scm)
   if (String (output_global_ch) == "scm")
     {
       static SCM port = 0;
+
       // urg
       if (!port)
         {
          int fd = 1;
-         ofstream * of = dynamic_cast <ofstream*> (outstream_l_->os);
+         ofstream * of = dynamic_cast<ofstream*> (outstream_l_->os);
          if (of)
            fd = of->rdbuf()->fd();
          FILE *file = fdopen (fd, "a");
          port = scm_standard_stream_to_port (file, "a", "");
          scm_display (gh_str02scm ("(load 'lily.scm)\n"), port);
-         scm_display (gh_str02scm ("(define (of) 'ps)\n"), port);
-         scm_display (gh_str02scm ("(define (of) 'tex)\n"), port);
        }
 
-      scm_display (gh_str02scm ("(display ((eval "), port);
+      scm_display (gh_str02scm ("("), port);
       scm_write (scm, port);
-      scm_display (gh_str02scm (") (of)))\n"), port);
-      scm_newline (port);
+      scm_display (gh_str02scm (")\n"),port);
       scm_fflush (port);
-
-      return;
     }
   else
     {
-      SCM str_scm = gh_call1 (ly_eval (scm), gh_eval_str (o.ch_l ()));
-      char* c = gh_scm2newstr (str_scm, NULL);
+      SCM result = scm_eval (scm);
+      char *c=gh_scm2newstr (result, NULL);
+
       *outstream_l_ << c;
       free (c);
     }
 }
+
 void
-Paper_outputter::output_string (String str)
+Paper_outputter::output_scope (Scope *scope, String prefix)
 {
-  // urg
-  *outstream_l_ << str;
+  for (Dictionary_iter<Identifier*> i (*scope); i.ok (); i++)
+    {
+      if (dynamic_cast<String_identifier*> (i.val ()))
+       {
+         String val = *i.val()->access_content_String (false);
+
+         output_String_def (prefix + i.key (), val);
+       }
+      else if(dynamic_cast<Real_identifier*> (i.val ()))
+       {
+         Real val  = *i.val ()->access_content_Real (false);
+
+         output_Real_def (prefix + i.key (), val);       
+       }
+      else if (dynamic_cast<int_identifier*> (i.val ()))
+       {
+         int val  = *i.val ()->access_content_int (false);       
+         
+         output_int_def (prefix + i.key (), val);        
+       }
+    }
+}
+
+void
+Paper_outputter::output_version ()
+{
+  String id_str = "Lily was here";
+  if (no_timestamps_global_b)
+    id_str += ".";
+  else
+    id_str += String (", ") + get_version_str ();
+  output_String_def ( "LilyIdString", id_str);
 }
 
 void
@@ -198,38 +220,65 @@ Paper_outputter::switch_to_font (String fontname)
 void
 Paper_outputter::start_line ()
 {
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-               gh_list (ly_func_o ("start-line"), SCM_UNDEFINED));;
-
+  SCM scm = gh_list (ly_symbol ("start-line"), SCM_UNDEFINED);
   output_scheme (scm);
 }
 
-/*
-   26 fonts ought to be enough for anyone.
-*/
 void
 Paper_outputter::output_font_def (int i, String str)
 {
-  //urg, broken with guile-1.3
-  //return;
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("font-def"), 
-    gh_cons (gh_int2scm (i), gh_cons (gh_str02scm (str.ch_l ()), SCM_EOL)))));
+  SCM scm = gh_list (ly_symbol ("font-def"),
+                    gh_int2scm (i),
+                    gh_str02scm (str.ch_l ()),
+                    SCM_UNDEFINED);
 
   output_scheme (scm);
 }
 
+void
+Paper_outputter::output_Real_def (String k, Real v)
+{
+  
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (to_str(v).ch_l ()),
+                    SCM_UNDEFINED);
+  output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_double2scm (v));
+}
+
+void
+Paper_outputter::output_String_def (String k, String v)
+{
+  
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (v.ch_l ()),
+                    SCM_UNDEFINED);
+  output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_str02scm (v.ch_l ()));
+}
+
+void
+Paper_outputter::output_int_def (String k, int v)
+{
+  SCM scm = gh_list (ly_symbol ("lily-def"),
+                    gh_str02scm (k.ch_l ()),
+                    gh_str02scm (to_str (v).ch_l ()),
+                    SCM_UNDEFINED);
+  output_scheme (scm);
+
+  gh_define (k.ch_l (), gh_int2scm (v));
+}
+
 void
 Paper_outputter::output_font_switch (int i)
 {
-  //urg, broken with guile-1.2, 1.3
-  //return;
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("font-switch"), 
-    gh_cons (gh_int2scm (i), SCM_EOL))));
+  SCM scm = gh_list (ly_symbol ("font-switch"),
+                    gh_int2scm (i),
+                    SCM_UNDEFINED);
 
   output_scheme (scm);
 }
@@ -237,10 +286,7 @@ Paper_outputter::output_font_switch (int i)
 void
 Paper_outputter::stop_line ()
 {
-  SCM scm =
-    gh_append2 (ly_lambda_o (),
-    ly_list1 (gh_append2 (ly_func_o ("stop-line"), SCM_EOL)));
-
+  SCM scm =    gh_list (ly_symbol ("stop-line"), SCM_UNDEFINED);
   output_scheme (scm);
 
   current_font_ = "";
index 0304d91f9133033f5b8e1881e6ad59a30afea76f..0cc85e14d5d7959f34f59cfaaf489c12d67129d9 100644 (file)
@@ -50,3 +50,9 @@ Protected_scm::operator SCM ()
 {
   return object_;
 }
+
+SCM 
+Protected_scm::to_SCM () const
+{
+  return object_;
+}
index 91277cf1b3009229965c04e2e5f22e3a9b00f4ea..f23ca3b67ab339bdfe2f82c7351f5689ac575fe3 100644 (file)
@@ -285,7 +285,6 @@ Stem::brew_molecule_p () const
   Molecule *mol_p =new Molecule;
   Drul_array<Real> stem_y = yextent_drul_;
   Real dy = paper ()->internote_f ();
-  
 
   Real head_wid = 0;
   if (head_l_arr_.size ())
index 3499e9627c68a7aa568630efb72d8cebc7708fdc..9d24ed2e6127b81e9a4c63ab5026ca7469b292b1 100644 (file)
@@ -1,4 +1,8 @@
-\paper { 
+\paper {
        \translator { \OrchestralPartStaffContext }
-       \translator { \ScoreContext skipBars = 1; }
+       \translator { \ScoreContext
+               SkipBars = 1;
+       }
+       castingalgorithm = \Wordwrap;
+       
 }
index f0d3b0ab5068e1c13071a1862c9e2e26bcd38881..305c4ac1dac89d4480b78b6e520e54b4e242c004 100644 (file)
@@ -17,3 +17,4 @@ copyright =    "public domain";
        \midi{ \tempo 4 = 160; }
 }
 
+
index 903812a0e7c678c1b2dfee34080a0bec0321e6d7..e05d0c0ac3db5cf3fe0bed47e86133934083e759 100644 (file)
@@ -16,7 +16,92 @@ corno1 = \notes \relative c {
        r2 r4 g4-.\f | R1*6 | r4 g-.\f r2 | R1*2 | 
        % `a 2
        r8 f\p_"\ \ \ cresc." f2 e4 | r8 f f2 e4 |
-       f4. e8 f4. e8 | f4. e8 f4. e8 | d,1\ff % ~ |
-       %35
+       f4. e8 f4. e8 | f4. e8 f4. e8 | f1\ff % ~ |
+       f4 ( e f )e
+       e4. r8  e4. r8 |
+       e4. r8  e4. r8 |
+       e4. r8  d4. r8 |
+       g4. r8 f4. r8
+       c2 \sf r2
+       c2 \sf r2
+       R1*2
+       e1 \sf c1\sf  g2. g4 \sf g2. g4 \sf g2. g4\sf g2. g4\sf g r4 r2 |
+       r1 g1 ~ g ~ g~ g~ g~ g~ g~ g~ g
+       g2\ff d'2 e1
+       R1*14
+       c2. \ff e4
+       r4 e r e c2. e4 r4 e r e
+       f2. e4 e e e e f2. e4 e e e e |
+       r4 r8 c8 c2\sf
+       r4 r8 c8 c2\sf
+       r4 r8 c8 c2\sf
+       r4 r8 c8 c2\sf                  
+       c4 r4 c r |
+       e4 r e r
+       r2 e4 r
+       r2 e4 r |
+       R1*4    
+       e4\f r4 r2 r1
+       e4\f r4 r2
+       R1*3
+       e4\f r8 e e4 r8 e |
+       e4   r8 e e4 r8 e |
+       e4   r8 e g4 r8 g |
+       g4   r8 g8 r2
+       g1 ~ g |
+       g4. g8 g4 r8 g |
+       g4  r8 g8 g4 r8 g8
+       g4\p r4 r2
+       R1*16
+       d4\f r4 r2
+       g4 r r2
+       g4 r8 g g4 r8 g |
+       g4 r8 g g4 r8 g |
+       f4\p r4 r2 |
+       R1*3
+       f4 r e r
+       d r c r
+       g' r f r
+       e r e r
+       d r r2 |
+       r1
+       d4-.\ff r4 r2
+       R1*3
+       f2\sf r2 f2 \sf r2
+       R1*3
+       e2\ff r2 e \sf r2
+       R1*3
+       d2.\ff r4       d2. r4 |
+       d2. r4          d2. r4
+       e2. r4          e2. r4
+       e2. r4          e2. r4
+       e4 r4 r2 r1
+       R1*11
+       e2 d2
+       R1*17
+       r4 r8 e,8 e4. e8|
+       r4 r8 e8 e4. e8|
+       r4 r8 e8 e4. e8|
+       r4 r8 e8 e4. e8|
+       r4 r8 e8 e4. e8|
+       r4 r8 e8 e4. e8|
+       f2. e4 d e d e
+       f2. e4 d e d e
+       g2. f4 g f g f          
+       g2. f4 g f g f          
+       r4 r8 f f2
+       r4 r8 f f2
+       r4 r8 f f2
+       r4 r8 f f2                              
+       f2 e~ | e d~ | d1 ~ d1
+       d4 r4 f r d r e r
+       r1
+       r2 r4 r8 e\f e4 r4 r2
+       r2 r4 r8 e8 e4 r r2
+       R1*3
+       
+       
+
+       
 }
 
index 6ea6920d23c9d4b469145cac2b4e3e704401f4cf..d8cf6e5e42281c624bde9043fb4edac70c34e594 100644 (file)
@@ -1,5 +1,6 @@
 %!PS-Adobe-1.0: lily.ps
 
+% 2 setlanguagelevel %  hmm. auto_resize_dicts doesn't help either. 
 % round cappings
 1 setlinecap
 
index 92cf4e73b7be6a719b4c92538caa17ffbcae3c23..9f60b99b262e4a30b6065f434f7100a343e70dae 100644 (file)
@@ -16,6 +16,7 @@
 
 % transplant a TeX dimension into the PS output.
 \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}}
+
 {%
    \def\par{ }%         %Ugh.  Don't try this at home, kids!
    % neat file-include trick by Piet van Oostrum <piet@cs.uu.nl>
@@ -39,7 +40,7 @@
    % stuff too early
    %
    \filedef\includelilyps{lily.ps}%
-   \expandafter\special{! \includelilyps}
+   \expandafter\special{! \includelilyps }
 }