]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/lexer.ll: lex \score separately.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 31 May 2004 22:40:54 +0000 (22:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 31 May 2004 22:40:54 +0000 (22:40 +0000)
* lily/paper-book.cc: junk stencil2line.

* lily/paper-line.cc (Paper_line): construct from Stencil
directly. No futzing with the dimensions.

* lily/include/paper-line.hh (class Paper_line):

* lily/stencil.cc (interpret_stencil_expression): combine-stencil
takes arbitrary number of arguments.

* input/test/markup-score.ly (tuning): simplify example.

ChangeLog
input/test/markup-score.ly
lily/lexer.ll
scm/define-markup-commands.scm
scm/framework-tex.scm
scm/new-markup.scm
scm/page-layout.scm
scm/stencil.scm

index d2b79b84e2953e7e2454b19d80a139467d5388da..c9dc7b6529adbfdaab512008c63cd9012cb2b804 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,29 @@
-       
+2004-06-01  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/lexer.ll: lex \score separately.
+
+       * lily/paper-book.cc: junk stencil2line.
+
+       * lily/paper-line.cc (Paper_line): construct from Stencil
+       directly. No futzing with the dimensions.
+
+       * lily/include/paper-line.hh (class Paper_line): 
+
+       * lily/stencil.cc (interpret_stencil_expression): combine-stencil
+       takes arbitrary number of arguments.
+
+       * input/test/markup-score.ly (tuning): simplify example. 
+
+2004-05-31  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/score.cc (LY_DEFINE): ly:score-embedded-format, new function. 
+
+       * scm/define-markup-commands.scm (score): define score-markup
+
+       * lily/parser.yy (markup): use score-markup.
+
+       * lily/score.cc: add ly:score? 
+
 2004-05-30  Carl Sorensen <carl_sorensen@byu.edu>
 
        * scm/fret-diagrams.scm: add fret-diagram-verbose markup; modified
index 12de723acfb5bdb94681227ceeeabe169055c171..3fb864c62f9174452a24d372192f0d519893b28e 100644 (file)
-\header {
-
-    %% When vertical dimension and stacking works properly, this
-    %% should be broken up into a few regression tests.
 
-    %% Too bad that '{' is overloaded, we need something (the bit arbitrary
-    %% `\score' now, to introduce to-markup-stencil-rendered music.
-    
+\header {
     texidoc = "Use \\score block as markup command."
-    
 }
 
 \version "2.3.2"
 
-%%;; Hmm - why is stencil so tall?
-#(define (page-stack-lines page)
-  (stack-stencils Y 1 0
-   (map ly:paper-line-stencil (ly:page-paper-lines page))))
-       
-#(define (page-stack-lines page)
-  (let* ((urg-stencil (ly:stencil-align-to! (stack-stencils Y DOWN 0
-                       (map ly:paper-line-stencil (ly:page-paper-lines page)))
-                      Y DOWN))
-        (expr (ly:stencil-expr urg-stencil))
-        (xext (ly:stencil-extent urg-stencil X))
-        (yext (ly:stencil-extent urg-stencil Y)))
-   (ly:stencil-align-to!
-    ;; urgr
-    (ly:make-stencil expr xext (cons (* -0.25 (cdr yext)) 0))
-    Y CENTER)))
-
-inBed = \paper {
-    %% can't do this, this paper('s fonts) must be notified to the
-    %% main/current book, and e output in the header.
-    %% #(paper-set-staff-size (* 11.0 pt))
-    
-    raggedright = ##t
-    linewidth = 0\mm
-    indent = 0 \mm
-
-    #(define page-to-stencil page-stack-lines)
-    %%#(define (page-to-stencil page)
-    %%  (box-stencil (page-stack-lines page) 0.1 0.5))
-
-    \context {
-       \Staff
-       minimumVerticalExtent = ##f
-    }
-}
-
-noCruft = \paper {
-    \context {
-       \Staff
-       %% Hmm, no effect ?
-       %% \override StaffSymbol #'print-function = ##f
-       %% Clef = \turnOff
-       %% StaffSymbol = \turnOff
-       %% TimeSignature = \turnOff
-       \override Clef #'print-function = ##f
-       \override StaffSymbol #'line-count = #0
-       \override TimeSignature #'print-function = ##f
-    }
-}
-
-noCruftInBed = \paper {
-    \inBed
-
-    %%\noCruft
-    %%URGHSr
-    \context {
-       \Staff
-       %% Hmm, no effect ?
-       %% \override StaffSymbol #'print-function = ##f
-       %% Clef = \turnOff
-       %% StaffSymbol = \turnOff
-       %% TimeSignature = \turnOff
-       \override Clef #'print-function = ##f
-       \override StaffSymbol #'line-count = #0
-       \override TimeSignature #'print-function = ##f
-    }
-}
-
 tuning = \markup {
-    \score { { \clef bass  <c, g, d g>1 } \paper{ \inBed }}
+    \score {
+       \new Staff \with {
+           \remove Time_signature_engraver
+       } {
+           \clef bass  <c, g, d g>1
+       }
+       \paper { raggedright = ##t }
+    }
 }
 
-#(define-public (my-footer paper page-number)
-  (let ((props (page-properties paper)))
-    (interpret-markup paper props
-     (markup #:fill-line ( #:line ( "Tuning: " tuning) "")))))
-
-tempoChange = \markup {
-    %% wtf, no horizontal shift?
-    "" %%\kern #-10 
-    \translate #'(-15 . 0)
-    \score { \times 2/3 { c'8 c' c' } \paper { \noCruftInBed }}
-    " ="
-    \score { { c'8[ c'] } \paper { \noCruftInBed } }
-}
 
 \header {
     title = "Solo Cello Suites"
@@ -104,14 +23,13 @@ tempoChange = \markup {
     subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
 }
 
-\paper {
-    #(define make-footer my-footer)
-}
-
 \relative {
     \time 4/8
     \times 2/3 { c'8 d e } \times 2/3 {c d e}
     \time 4/8
-    g8^\tempoChange a8 g8 a \break
+
+                               % todo: tempo change example.
+    
+    g8 a8 g8 a \break
 }
 
index 70d6a8ba573b6378e613a4405242f18c1ea6fbca..377e9f1e9b4561f69c1fd3d21e592342c992c7f5 100644 (file)
@@ -233,6 +233,11 @@ HYPHEN             --
        {
                start_main_input ();
                main_input_b_ = true;
+/*
+This is broken - we should switch to \notes when the pitchnames are loaded.
+Then we get spanish etc. correct. --hwn.
+
+*/
                SCM nn = lookup_identifier ("pitchnames");
                push_note_state (alist_to_hashq (nn));
        }
index f5114886c8ba52a569d69b56f73cd80e6b59e8a3..15b0a71a54f72e212a2693c89fa9bb90745293dd 100644 (file)
   "Stencil as markup"
   stil)
 
+
+(def-markup-command (score paper props score) (ly:score?)
+  (let*
+      ((systems (ly:score-embedded-format score paper))
+       (1st (vector-ref systems 0))
+       (stencil (ly:paper-line-stencil 1st)) )
+
+    (ly:stencil-align-to! stencil Y CENTER)
+    (display (ly:stencil-extent stencil X))
+    (display (ly:stencil-extent stencil Y))
+;    (set! stencil (ly:stencil-translate-axis stencil -20 X))
+;    (set! stencil (ly:stencil-translate-axis stencil 20 Y))
+    stencil))
+
 (def-markup-command (simple paper props str) (string?)
   "A simple text string; @code{\\markup @{ foo @}} is equivalent with
 @code{\\markup @{ \\simple #\"foo\" @}}."
@@ -56,7 +70,7 @@
        (line-stencils (if (= word-count 1)
                           (map (lambda (x) (interpret-markup paper props x))
                                (list (make-simple-markup "")
-                                     (car markups)
+                                     (make-stencil-markup (car stencils))
                                      (make-simple-markup "")))
                                stencils)))
     (stack-stencil-line fill-space line-stencils)))
@@ -76,9 +90,11 @@ determines the space between each markup in @var{args}."
 
 (def-markup-command (combine paper props m1 m2) (markup? markup?)
   "Print two markups on top of each other."
-  (ly:stencil-add
-   (interpret-markup paper props m1)
-   (interpret-markup paper props m2)))
+  (let*
+      ((s1   (interpret-markup paper props m1))
+       (s2   (interpret-markup paper props m2)))
+            
+    (ly:stencil-add s1 s2)))
 
 (def-markup-command (finger paper props arg) (markup?)
   "Set the argument as small numbers."
index f19d0f2d8361e3cc650edc10f1d586019f6431b0..22330b5f795edbd4a6dcca494e09bd8c171efabf 100644 (file)
@@ -1,5 +1,3 @@
-
-
 (define-module (scm framework-tex))
 
 (use-modules (ice-9 regex)
        "}\\vss\n}\n\\vfill\\lilypondpagebreak\n")))
 
 
-(define (dump-line putter line last?)
-  (ly:outputter-dump-string
-   putter
-   (string-append "\\leavevmode\n\\lybox{0}{0}{0}{"
-                 (ly:number->string (ly:paper-line-extent line Y))
-                 "}{"))
-
-   (ly:outputter-dump-stencil putter (ly:paper-line-stencil line))
-   (ly:outputter-dump-string
-    putter
-    (if last?  
-       "}%\n"
-       "}\\interscoreline\n"
-       )) )
 
 (define-public (output-framework-tex outputter book scopes fields basename)
   (let*
   (ly:outputter-dump-string outputter "\\lilypondend\n")
   ))
 
+(define (dump-line putter line last?)
+  (ly:outputter-dump-string
+   putter
+   (string-append "\\leavevmode\n\\lybox{0}{0}{0}{"
+                 (ly:number->string (ly:paper-line-extent line Y))
+                 "}{"))
+
+   (ly:outputter-dump-stencil putter (ly:paper-line-stencil line))
+   (ly:outputter-dump-string
+    putter
+    (if last?  
+       "}%\n"
+       "}\\interscoreline\n"
+       )) )
+
 (define-public (output-classic-framework-tex outputter book scopes fields basename)
   (let*
       ((bookpaper  (ly:paper-book-book-paper book))
index 7dcf129684903f9b270ce89cf1a09a50d26c0bf0..44067bae691b54d631a47d045312bbcbe6fed507 100644 (file)
@@ -415,6 +415,7 @@ Also set markup-signature and markup-keyword object properties."
 
 
 (define-public (stack-stencil-line space stencils)
+  "DOCME"
   (if (and (pair? stencils)
           (ly:stencil? (car stencils)))
       
index c8168c138dcc90fa9b69d69b6408ab7a3e01c784..f3cb9ff89540ebf4a2c7bd1e3e4d1af9ca05f93c 100644 (file)
              (make-column-markup
               (list
               (markup #:fill-line
-                      (#:large #:bigger #:bigger #:bold (get 'subtitle))
-                      #:fill-line (#:bigger #:bigger #:bold (get 'subsubtitle)))
+                      (#:large #:bigger #:bigger #:bold (get 'subtitle)))
+              (markup #:fill-line (#:bigger #:bigger #:bold (get 'subsubtitle)))
               (markup #:override '(baseline-skip . 5)
                       #:column ("")))
 
index 8f60fa0bec615d9a0267895699bfe1cf37f1410e..b77a3c83443d504836887fafa2a169883f0a6263 100644 (file)
@@ -5,7 +5,7 @@
 ;;;; (c)  2003--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 (define-public (stack-stencils axis dir padding stils)
-  "Stack stencils STILS in direction AXIS,DIR, using PADDING."
+  "Stack stencils STILS in direction AXIS, DIR, using PADDING."
   (if (null? stils)
       '()
       (if (pair? stils)