PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=11
-PATCH_LEVEL=7
+PATCH_LEVEL=8
MY_PATCH_LEVEL=
texidoc = "Accidentals are reset for clef changes."
}
+\layout {
+ ragged-right = ##t
+}
+
+
\version "2.10.0"
\new Staff \relative c' {
\clef treble
<cis dis fis gis>
}
-\layout {ragged-right = ##t}
--- /dev/null
+\header
+{
+ texidoc = "Even very flat but slanted patterns should give slanted beams. "
+}
+
+\version "2.10.7"
+\layout{
+ line-width = 15\cm
+ debug-beam-scoring = ##t
+}
+
+\relative c'''{
+ \time 2/4
+ \assertBeamQuant #'(0 . 1) #'(0 . 0)
+ fis16[ dis b ais] cis4
+}
texidoc = "Bends avoid dots, but only if necessary."
}
+\paper {
+ ragged-right = ##t
+}
+
\score {
<<
\new Staff \relative c' {
}
>>
}
-
-\paper {
- ragged-right = ##t
-}
@code{\\noBreak}."
}
+\layout {
+ indent = 0.0
+ line-width = 4.0\cm
+}
\relative c'' \context Voice {
\emptyText
c1 \noBreak c1 \noBreak \mark "nobreak" c1 \noBreak
c1 \break \mark "break" c1 \break \mark "break" c1
}
-\layout {
- indent = 0.0
- line-width = 4.0\cm
-}
}
-\context Staff \relative c'' <<
- { c2. c bes2 } \\
- { c2. a8 g4 f4. g4 f }
->>
-
\layout {
\context{
\Voice
\consists "Completion_heads_engraver"
}
}
+
+\context Staff \relative c'' <<
+ { c2. c bes2 } \\
+ { c2. a8 g4 f4. g4 f }
+>>
texidoc = "Broken crescendi should be open on one side."
}
-\relative c'' {
- c1 \< \break c1\! \> \break c1\!
-}
\layout {
line-width = 4.\cm
}
+\relative c'' {
+ c1 \< \break c1\! \> \break c1\!
+}
+
}
+\layout{
+ line-width = 50.\mm
+ indent = 0
+}
+
\new Staff \relative c''{
% gliss non gliss and
c4 \glissando d e \glissando f \glissando \break
c4 \glissando c,, \glissando c' \glissando d
}
-\layout{
- line-width = 50.\mm
- indent = 0
-}
-
pedal line spanners."
}
+\paper {
+ line-width = 3\cm
+ indent = 0\cm
+}
+
\relative {
\set Staff.shortInstrumentName = "foo"
f1 | f1 | f1 |
f1\< | f1 | f1\! |
}
-\paper {
- line-width = 3\cm
- indent = 0\cm
-}
-
% EOF
}
+\layout {
+ ragged-right = ##t
+}
<<
\new Voice =A {
}
\lyricsto A \context Lyrics \lyricmode { a __ a __ ha }
>>
- \layout {
- ragged-right = ##t
- }
}
+\layout {
+ indent = 0.0 \cm
+ line-width = 3.4 \cm
+
+ \context {
+ \Staff \remove "Time_signature_engraver"
+ }
+}
+
+
+
<<
\new Staff \relative c'' {
\time 1/4 c16[ c c c]
bla16 -- bla -- bla
}
>>
- \layout {
- indent = 0.0 \cm
- line-width = 3.4 \cm
-
- \context {
- \Staff \remove "Time_signature_engraver"
- }
- }
-
-
The boolean property @code{no-spacing-rods} in @code{TextScript} is used
to control the horizontal size of text. " }
+\layout {
+ line-width = 3.0\cm
+}
\relative c''{
%% \emptyText
\fatText
c_"very wide and long text" c
}
-\layout {
- line-width = 3.0\cm
-}
sd = { \change Staff = down}
+\layout {
+ line-width = 8.0 \cm
+}
+
+
\context PianoStaff
<<
\new Staff = "up" {
\clef F s1*4
}
>>
- \layout {
- line-width = 8.0 \cm
- }
-
-
"
}
+\layout{
+ line-width = 120.\mm
+}
\relative c''{
\time 3/4
\stemNeutral c ( \stemUp c \stemNeutral c) c ( a c) c( d, c') c( f, c')
\stemDown c( f, c')
}
-\layout{
- line-width = 120.\mm
-}
-
-
}
+\paper {
+ indent = 0.0\mm
+ line-width = 40.0\mm
+}
+
\relative {
\override Tie #'minimum-length = #5
f2. f16 f f f ~ | \break
f1
}
-
-\paper {
- indent = 0.0\mm
- line-width = 40.0\mm
-}
{
SCM details = him->get_property ("details");
+ /*
+ TODO: put in define-grobs.scm
+ */
INTER_QUANT_PENALTY = get_detail (details, ly_symbol2scm ("inter-quant-penalty"), 1000.0);
SECONDARY_BEAM_DEMERIT = get_detail (details, ly_symbol2scm ("secondary-beam-demerit"), 10.0);
STEM_LENGTH_DEMERIT_FACTOR = get_detail (details, ly_symbol2scm ("stem-length-demerit-factor"), 5);
REGION_SIZE = get_detail (details, ly_symbol2scm ("region-size"), 2);
BEAM_EPS = get_detail (details, ly_symbol2scm ("beam-eps"), 1e-3);
-
- // possibly ridiculous, but too short stems just won't do
STEM_LENGTH_LIMIT_PENALTY = get_detail (details, ly_symbol2scm ("stem-length-limit-penalty"), 5000);
DAMPING_DIRECTION_PENALTY = get_detail (details, ly_symbol2scm ("damping-direction-penalty"), 800);
+ HINT_DIRECTION_PENALTY = get_detail (details, ly_symbol2scm ("hint-direction-penalty"), 20);
MUSICAL_DIRECTION_FACTOR = get_detail (details, ly_symbol2scm ("musical-direction-factor"), 400);
IDEAL_SLOPE_FACTOR = get_detail (details, ly_symbol2scm ("ideal-slope-factor"), 10);
ROUND_TO_ZERO_SLOPE = get_detail (details, ly_symbol2scm ("round-to-zero-slope"), 0.02);
TODO: find a way to incorporate the complexity of the beam in this
penalty.
*/
- if (fabs (dy / dx) > parameters->ROUND_TO_ZERO_SLOPE
- && sign (dy_damp) != sign (dy))
- dem += parameters->DAMPING_DIRECTION_PENALTY;
-
+ if (sign (dy_damp) != sign (dy))
+ {
+ if (!dy)
+ {
+ if (fabs (dy_damp / dx) > parameters->ROUND_TO_ZERO_SLOPE)
+ dem += parameters->DAMPING_DIRECTION_PENALTY;
+ else
+ dem += parameters->HINT_DIRECTION_PENALTY;
+ }
+ else
+ dem += parameters->DAMPING_DIRECTION_PENALTY;
+ }
+
dem += parameters->MUSICAL_DIRECTION_FACTOR
* max (0.0, (fabs (dy) - fabs (dy_mus)));
return SCM_UNSPECIFIED;
}
+
+LY_DEFINE (ly_parser_print_book_to_systems, "ly:book-process-to-systems",
+ 4, 0, 0, (SCM book_smob,
+ SCM default_paper,
+ SCM default_layout,
+ SCM output),
+ "Print book. @var{output} is passed to the backend unchanged. "
+ "Eg. it may be "
+ "a string (for file based outputs) or a socket (for network based "
+ "output).")
+{
+ Book *book = unsmob_book (book_smob);
+
+ SCM_ASSERT_TYPE (book, book_smob, SCM_ARG1, __FUNCTION__, "Book");
+ SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
+ default_layout, SCM_ARG2, __FUNCTION__, "\\paper block");
+ SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
+ default_layout, SCM_ARG3, __FUNCTION__, "\\layout block");
+
+ Paper_book *pb = book->process (unsmob_output_def (default_paper),
+ unsmob_output_def (default_layout));
+ if (pb)
+ {
+ pb->classic_output (output);
+ pb->unprotect ();
+ }
+
+ return SCM_UNSPECIFIED;
+}
+
"The property @code{style} controls the shape of cluster segments. Valid values "
"include @code{leftsided-stairs}, @code{rightsided-stairs}, @code{centered-stairs}, "
"and @code{ramp}.\n",
+
+ /* props */
"style "
"padding "
- "columns ");
+ "columns "
+ );
struct Cluster_beacon
{
Real STEM_LENGTH_LIMIT_PENALTY;
Real DAMPING_DIRECTION_PENALTY;
Real MUSICAL_DIRECTION_FACTOR;
+ Real HINT_DIRECTION_PENALTY;
Real IDEAL_SLOPE_FACTOR;
Real ROUND_TO_ZERO_SLOPE;
scm_remember_upto_here_1 (prot);
return output;
}
-
-LY_DEFINE (ly_score_process, "ly:render-music-as-systems",
- 5, 0, 0, (SCM music,
- SCM outdef,
- SCM book_outputdef,
- SCM header,
- SCM outname),
- "Create output using a default \\book block. ")
-{
- SCM_ASSERT_TYPE(unsmob_music(music), music,
- SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE(unsmob_output_def (outdef), outdef,
- SCM_ARG2, __FUNCTION__, "output def");
- SCM_ASSERT_TYPE(unsmob_output_def (book_outputdef), book_outputdef,
- SCM_ARG3, __FUNCTION__, "output def");
- SCM_ASSERT_TYPE(scm_is_string (outname), outname,
- SCM_ARG5, __FUNCTION__, "string");
-
-
- SCM scaled_def = outdef;
- SCM scaled_bookdef = book_outputdef;
-
- Output_def *bpd = unsmob_output_def (book_outputdef);
-
- /* ugh . */
- assert (bpd->c_variable ("is-paper") == SCM_BOOL_T);
-
- Real scale = scm_to_double (bpd->c_variable ("output-scale"));
-
- Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
- Output_def *bdef = scale_output_def (bpd, scale);
- def->parent_ = bdef;
-
- scaled_def = def->self_scm ();
- scaled_bookdef = bdef->self_scm ();
-
- def->unprotect ();
- bdef->unprotect ();
-
- SCM context = ly_run_translator (music, scaled_def, SCM_BOOL_F);
- SCM output_as_scm = ly_format_output (context);
- Music_output *output = unsmob_music_output (output_as_scm);
-
- Paper_score *pscore = dynamic_cast<Paper_score *> (output);
- assert (pscore);
-
- /* ugh, this is strange, Paper_book without a Book object. */
- Paper_book *paper_book = new Paper_book ();
- paper_book->header_ = header;
- paper_book->paper_ = unsmob_output_def (scaled_bookdef);
-
- if (ly_is_module (header))
- paper_book->add_score (header);
-
- paper_book->add_score (pscore->self_scm ());
- paper_book->classic_output (outname);
- paper_book->unprotect ();
-
- scm_remember_upto_here_1 (scaled_def);
- scm_remember_upto_here_1 (scaled_bookdef);
-
- return SCM_UNSPECIFIED;
-}
-
(version-not-seen-message input-file-name))
#(if (pair? toplevel-scores)
- (toplevel-book-handler
+ ((if (defined? 'default-toplevel-book-handler)
+ default-toplevel-book-handler
+ toplevel-book-handler)
parser
(apply ly:make-book $defaultpaper $defaultheader toplevel-scores)))
\version "2.10.0"
-#(set! toplevel-score-handler print-score-with-defaults)
-#(set! toplevel-music-handler
- (lambda (p m)
- (if (not (eq? (ly:music-property m 'void) #t))
- (print-score-with-defaults
- p (scorify-music m p)))))
+%% toplevel \book gets output per page,
+%% everything else gets output per system/title
+#(define default-toplevel-book-handler
+ print-book-with-defaults-as-systems )
#(ly:set-option (quote no-point-and-click))
#(define inside-lilypond-book #t)
(beaming . ,ly:beam::calc-beaming)
(stencil . ,ly:beam::print)
(clip-edges . #t)
-
+
+ (details . ((hint-direction-penalty . 20)))
;; TODO: should be in SLT.
(thickness . 0.48) ; in staff-space
(neutral-direction . ,DOWN)
ly:beam::quanting
(check-beam-quant l r)
))
-
+
(define-public (check-slope-callbacks comparison)
(list ly:beam::calc-least-squares-positions
(cons score (ly:parser-lookup parser 'toplevel-scores))))
(define-public (scorify-music music parser)
-
(for-each (lambda (func)
(set! music (func music parser)))
toplevel-music-functions)
(collect-scores-for-book parser (scorify-music music parser)))))
-(define-public (print-book-with-defaults parser book)
+(define (print-book-with parser book process-procedure)
(let*
((paper (ly:parser-lookup parser '$defaultpaper))
(layout (ly:parser-lookup parser '$defaultlayout))
(set! base (format #f "~a-~a" base count)))
(ly:parser-define! parser 'output-count (1+ count))
- (ly:book-process book paper layout base)
+ (process-procedure book paper layout base)
))
-(define-public (print-score-with-defaults parser score)
- (let*
- ((paper (ly:parser-lookup parser '$defaultpaper))
- (count (ly:parser-lookup parser 'output-count))
- (base (ly:parser-output-name parser)))
-
- (if (not (integer? count))
- (set! count 0))
-
- (if (> count 0)
- (set! base (format #f "~a-~a" base count)))
-
- (ly:parser-define! parser 'output-count (1+ count))
-
- (if (not (ly:score-error? score))
- (let*
- ((header (ly:score-header score))
- (output-defs (ly:score-output-defs score))
- (layout-defs (filter (lambda (d) (eq? #t (ly:output-def-lookup d 'is-layout)))
- output-defs))
- (midi-defs (filter (lambda (d) (eq? #t (ly:output-def-lookup d 'is-midi)))
- output-defs))
- (music (ly:score-music score))
- (layout-def (if (null? layout-defs)
- (ly:parser-lookup parser '$defaultlayout)
- (car layout-defs))))
-
- (if (not (module? header))
- (set! header (ly:parser-lookup parser '$defaultheader)))
-
- (ly:render-music-as-systems
- music layout-def paper header base)
-
- (if (pair? midi-defs)
- (ly:performance-write (ly:format-output (ly:run-translator music (car midi-defs)))
- (format #f "~a.midi" base)
- ))
-
- ))))
-
-
-
+(define-public (print-book-with-defaults parser book)
+ (print-book-with parser book ly:book-process))
+(define-public (print-book-with-defaults-as-systems parser book)
+ (print-book-with parser book ly:book-process-to-systems))
;;;;;;;;;;;;;;;;
;; alist
(define (profile-measurements)
(let* ((t (times))
(stats (gc-stats)))
-
+
(list
(- (tms:utime t)
(ly:assoc-get 'gc-time-taken stats))
+ (ly:assoc-get 'total-cells-allocated stats 0)
;; difficult to put memory amount stats into here.
)))
(ly:progress "\nWriting timing to ~a..." outname)
(format (open-file outname "w")
- "time: ~a"
- (car diff))))
+ "time: ~a\ncells: ~a\n"
+ (car diff)
+ (cadr diff)
+ )))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
))
(let* ((failed '())
- (start-measurements #f)
+ (start-measurements (ly:get-option 'dump-profile))
(handler (lambda (key failed-file)
(set! failed (append (list failed-file) failed)))))
(lambda (x)
(gc)
- (set! start-measurements (profile-measurements))
+ (if start-measurements
+ (set! start-measurements (profile-measurements)))
(lilypond-file handler x)
- (if (ly:get-option 'dump-profile)
+ (if start-measurements
(dump-profile x start-measurements (profile-measurements)))