prevent aligned 6ths.
2004-03-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/accidental.cc (accurate_boxes): enlarge Y-extent of flat to
+ prevent aligned 6ths.
+
* lily/custos.cc (print): remove neutral position.
(print): remove adjust-if-on-staffline.
@tab lyric hyphen
@tab
@lilypond[fragment,relative=1]
- \notes { g'4 g }
- \lyricsto "" \new Lyrics \lyrics { twin -- kle }
+ << \notes { g'4 g }
+ \lyricsto "" \new Lyrics \lyrics { twin -- kle }
+ >>
@end lilypond
@item @code{\chords @{ c:dim f:maj7 @}}
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=1
-PATCH_LEVEL=29
-MY_PATCH_LEVEL=hwn1
+PATCH_LEVEL=30
+MY_PATCH_LEVEL=
}
-\score { \notes \context Voice \relative c' {
- cis4
- c4
- \transpose c c' {
- <bis es gis>4
- <es! as!>
- <gis! cis!>
- <g! des'>
- <ges! es'!>
-}
- <cis d es fis gis ases bes ces d e! >4
- <bes'! fis!>
- <bes! cis!>
- <c! es ges beses>
- <bes! c d f >
- <bes,! c d f >
+\score {
+ \notes \context Voice \relative c'
+ {
+ cis4
+ c4
+ \transpose c c' {
+ <ges es'>
+ <bis es gis>4
+ <es! as!>
+ <gis! cis!>
+ <g! des'>
+ <ges! es'!>
+ }
+ <cis d es fis gis ases bes ces d e! >4
+ <bes'! fis!>
+ <bes! cis!>
+ <c! es ges beses>
+ <bes! c d f >
+ <bes,! c d f >
+ }
+ \paper {
+ raggedright = ##t
+ }
+
}
-\paper { raggedright = ##t}
- }
really close.
*/
stem[X_AXIS][RIGHT] *= .5;
+
+ /*
+ To prevent vertical alignment for 6ths
+ */
+ stem[Y_AXIS] *= 1.1;
bulb[Y_AXIS][UP] *= .35;
boxes.push (bulb);
#include "paper-def.hh"
#include "lookup.hh"
+/*
+ UGH UGH UGH
+
+ This does 3 things at one:
+
+ - acc positioning
+ - drawing accidentals
+ - drawing note heads
+
+ It confuses interpretation & formatting.
+
+ UGH.
+ --hwn.
+ */
+
/*
* TODO: note-head collision handling
*
{
accidentals_style = String ("");
}
+
int num_acc;
num_acc = number_accidentals (key_signature, pitch_min, true, false);
add_accidentals (me, &head_min, num_acc, pitch_min,
ADD_INTERFACE (Ambitus, "ambitus-interface",
"An object that represents the pitch range of a voice.",
- "c0-position pitch-min pitch-max accidentals note-head-style join-heads");
+ "c0-position pitch-min pitch-max accidentals note-head-style accidentals-style join-heads");
Paper_def *paper_;
int number_;
- SCM lines_;
- SCM protect_;
- Stencil *header_;
- Stencil *footer_;
+ Protected_scm lines_;
+ Protected_scm header_;
+ Protected_scm footer_;
+
+ Stencil *get_header () { return unsmob_stencil (header_); }
+ Stencil *get_footer () { return unsmob_stencil (footer_); }
/* actual height filled with text. */
Real height_;
- //HMMM all this size stuff to paper/paper-outputter?
+ // HMMM all this size stuff to paper/paper-outputter?
Real hsize_;
Real vsize_;
Real top_margin_;
SCM make_header = scm_primitive_eval (ly_symbol2scm ("make-header"));
SCM make_footer = scm_primitive_eval (ly_symbol2scm ("make-footer"));
- header_ = unsmob_stencil (scm_call_2 (make_header, paper_->smobbed_copy (),
- scm_int2num (number_)));
- protect_ = SCM_EOL;
- // ugh, how to protect a Stencil from the outside?
- protect_ = scm_cons (header_->get_expr (), protect_);
- if (header_)
- header_->align_to (Y_AXIS, UP);
+ header_ = scm_call_2 (make_header, paper_->smobbed_copy (),
+ scm_int2num (number_));
+ if (get_header ())
+ get_header ()->align_to (Y_AXIS, UP);
// FIXME: tagline/copyright
- footer_ = unsmob_stencil (scm_call_2 (make_footer, paper_->smobbed_copy (),
- scm_int2num (number_)));
- // ugh, how to protect a Stencil from the outside?
- protect_ = scm_cons (footer_->get_expr (), protect_);
- if (footer_)
- footer_->align_to (Y_AXIS, UP);
+ footer_ = scm_call_2 (make_footer, paper_->smobbed_copy (),
+ scm_int2num (number_));
+
+ if (get_footer ())
+ get_footer ()->align_to (Y_AXIS, UP);
}
void
Page::output (Paper_outputter *out, bool is_last)
{
- if (header_)
+ if (get_header ())
{
- out->output_line (stencil2line (header_), false);
+ out->output_line (stencil2line (get_header ()), false);
out->output_line (height2line (head_sep_), false);
}
out->output_scheme (scm_list_1 (ly_symbol2scm ("start-page")));
for (SCM s = lines_; gh_pair_p (s); s = ly_cdr (s))
out->output_line (ly_car (s), is_last && gh_pair_p (ly_cdr (s)));
out->output_scheme (scm_list_2 (ly_symbol2scm ("stop-page"),
- gh_bool2scm (is_last && !footer_)));
- if (footer_)
+ gh_bool2scm (is_last && !get_footer ())));
+ if (get_footer ())
{
out->output_line (height2line (foot_sep_), false);
- out->output_line (stencil2line (footer_), is_last);
+ out->output_line (stencil2line (get_footer ()), is_last);
}
}
Page::text_height ()
{
Real h = vsize_ - top_margin_ - bottom_margin_;
- if (header_)
- h -= header_->extent (Y_AXIS).length () + head_sep_;
- if (footer_)
- h -= footer_->extent (Y_AXIS).length () + foot_sep_;
+ if (get_header ())
+ h -= get_header ()->extent (Y_AXIS).length () + head_sep_;
+ if (get_footer ())
+ h -= get_footer ()->extent (Y_AXIS).length () + foot_sep_;
return h;
}
return Stencil ();
}
- bool adjust = to_boolean (me->get_property ("adjust-if-on-staffline"));
+ bool adjust = true;
String staffline_offs;
if (String::compare (flag_style, "mensural") == 0)
,
"tremolo-flag french-beaming "
- "avoid-note-head adjust-if-on-staffline thickness "
+ "avoid-note-head thickness "
"stem-info beamed-lengths beamed-minimum-free-lengths "
"beamed-extreme-minimum-free-lengths lengths beam stem-shorten "
"duration-log beaming neutral-direction stem-end-position "
-\version "2.1.28"
+\version "2.1.30"
% a3-init.ly
hsize = 296.9 \mm
-\version "2.1.28"
+\version "2.1.30"
% a4.ly
hsize = 210.0 \mm
-\version "2.1.28"
+\version "2.1.30"
% Symbols needed to print accordion music
%
% 2' = T
% Toplevel initialisation file.
-\version "2.1.28"
+\version "2.1.30"
\include "declarations-init.ly"
pitchnames = \pitchnamesCatalan
-\version "2.1.28"
+\version "2.1.30"
% Toplevel initialisation file.
-\version "2.1.28"
+\version "2.1.30"
\include "declarations-init.ly"
-\version "2.1.28"
+\version "2.1.30"
chordmodifiers = #default-chord-modifier-list
#(ly:set-option 'old-relative)
-\version "2.1.29"
+\version "2.1.30"
breve = #(ly:make-duration -1 0)
longa = #(ly:make-duration -2 0 )
maxima = #(ly:make-duration -3 0)
pitchnames = \pitchnamesDeutsch
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.28"
+\version "2.1.30"
drumPitchNames =
#'((acousticbassdrum . acousticbassdrum)
-\version "2.1.28"
+\version "2.1.30"
%
% declare the standard dynamic identifiers.
pitchnames = \pitchnamesEnglish
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.29"
+\version "2.1.30"
\context {
\name Global
clefGlyph = #"clefs-G"
clefPosition = #-2
- centralCPosition = #-6
+ middleCPosition = #-6
defaultBarType = #"|"
barNumberVisibility = #default-bar-number-visibility
% Choose vaticana do clef on 3rd line as default.
clefGlyph = #"clefs-vaticana_do"
- centralCPosition = #1
+ middleCPosition = #1
clefPosition = #1
clefOctavation = #0
pitchnames = \pitchnamesEspanol
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.28"
+\version "2.1.30"
%
% Running LilyPond on this file generates the documentation
-\version "2.1.28"
+\version "2.1.30"
%
% Running LilyPond on this file generates the short interface doc
-\version "2.1.28"
+\version "2.1.30"
startGraceMusic = \notes {
-\version "2.1.28"
+\version "2.1.30"
%%%%%%%%
%%%%%%%% shortcuts common for all styles of gregorian chant notation
#(define-public midi-debug #f)
-\version "2.1.28"
+\version "2.1.30"
\include "declarations-init.ly"
pitchnames = \pitchnamesItaliano
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.28"
+\version "2.1.30"
% legal-init.ly
hsize = 8.5 \in
-\version "2.1.28"
+\version "2.1.30"
% letter-init.ly
hsize = 8.5 \in
-\version "2.1.28"
+\version "2.1.30"
\midi {
\tempo 4=60
\include "performer-init.ly"
-\version "2.1.28"
+\version "2.1.30"
%{
common dutch names for notes. es means flat, is means sharp
%}
pitchnames =\pitchnamesNorsk
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.29"
+\version "2.1.30"
% JUNKME
%part-paper-init.ly
-\version "2.1.29"
+\version "2.1.30"
%
% setup for Request->Element conversion. Guru-only
% property-init.ly
-\version "2.1.28"
+\version "2.1.30"
stemUp = \override Stem #'direction = #1
stemDown = \override Stem #'direction = #-1
-\version "2.1.28"
+\version "2.1.30"
major = #`(
-\version "2.1.28"
+\version "2.1.30"
dashHat= "marcato"
-\version "2.1.28"
+\version "2.1.30"
startGroup = #(make-span-event 'NoteGroupingEvent START)
stopGroup = #(make-span-event 'NoteGroupingEvent STOP)
pitchnames = \pitchnamesSuomi
-\version "2.1.28"
+\version "2.1.30"
)
pitchnames = \pitchnamesSvenska
-\version "2.1.28"
+\version "2.1.30"
-\version "2.1.28"
+\version "2.1.30"
% tabloid-init.ly
(if (pair? e)
(let* ((musics (map make-prop-set
`(((symbol . clefGlyph) (value . ,(cadr e)))
- ((symbol . centralCPosition)
+ ((symbol . middleCPosition)
(value . ,(+ oct
(caddr e)
(cdr (assoc (cadr e) c0-pitch-alist)))))
(pedalSostenutoStyle ,symbol? "see @code{pedalSustainStyle}.")
(printOctaveNames ,boolean? "Print octave marks for the NoteNames context.")
(rehearsalMark ,integer? "The last rehearsal mark printed.")
- (repeatCommands ,list? "This property is read to find any command of the form @{code(volta . @var{x})}, where @var{x} is a string or @code{#f}")
+ (repeatCommands ,list? "This property is read to find any command of the form @code{(volta . @var{x})}, where @var{x} is a string or @code{#f}")
(restNumberThreshold ,number?
"If a multimeasure rest takes less
to 10 (5+5) staffspaces high.
@example
-\set Staff.verticalExtent = #'(-5.0 . 5.0)
+\\set Staff.verticalExtent = #'(-5.0 . 5.0)
@end example
")
(quotes ,hash-table? "Hash table, mapping names to music-event vectors.")
(stavesFound ,grob-list? "list of all staff-symbols found.")
- (instrumentSupport ,ly:grob-list? "list of grobs to attach instrument name
+ (instrumentSupport ,grob-list? "list of grobs to attach instrument name
to.")
(tieMelismaBusy ,boolean? "Signal whether a tie is present.")
)
center of the staff.")
;; todo: why is this tunable?
- (neutral-position ,number? "Position (in half staff spaces) where
-to flip the direction of stems: by default, custodes above this
-position get their stems downwards; custodes below this position get
-their stems upwards. A value of 0 designates the center of the staff.
-Use property neutral-direction to control the behaviour of stems on
-the neutral position itself. (Note: currently, neutral-position is
-supported only for custodes; for stems of note heads, neutral-position
-is currently fixed to 0, i.e. the middle of the staff.)")
(dir-function ,procedure? "The function to determine the
direction of a beam. Choices include:
means force linebreak. Other values influence linebreaking decisions
as a real penalty.")
- (pitch-max ,ly:pitch? "FIXME, JUNKME")
- (pitch-min ,ly:pitch? "FIXME, JUNKME")
+ (pitch-max ,ly:pitch? "Top pitch for ambitus.")
+ (pitch-min ,ly:pitch? "Bottom pitch for ambitus.")
(positions ,pair?
"Pair of staff coordinates @code{(@var{left}
zigzags.")
(zigzag-width ,ly:dimension? "The width of one
zigzag-squiggle. This number will be adjusted slightly so that the
-line can be constructed from a whole number of squiggles.")
+glissando line can be constructed from a whole number of squiggles.")
(avoid-note-head ,boolean? "If set, the stem of a chord does not
pass through all note heads, but starts at the last note head. ")
;; end ancient notation
+ ; ugh.
+ (accidentals-style ,symbol? "style for ambitus.")
)))
(meta . ((interfaces . (spacing-interface note-spacing-interface item-interface ))))
))
- (StaffSymbol
- . (
- (print-function . ,Staff_symbol::print)
- (line-count . 5)
- (ledger-line-thickness . (1.0 . 0.1))
- (layer . 0)
- (meta . ((interfaces . (staff-symbol-interface spanner-interface))))
- ))
-
(SostenutoPedal
. (
(print-function . ,Text_item::print)
(direction . -1)
(meta . ((interfaces . (piano-pedal-interface axis-group-interface side-position-interface spanner-interface))))
))
+
+ (StaffSymbol
+ . (
+ (print-function . ,Staff_symbol::print)
+ (line-count . 5)
+ (ledger-line-thickness . (1.0 . 0.1))
+ (layer . 0)
+ (meta . ((interfaces . (staff-symbol-interface spanner-interface))))
+ ))
(Stem
. (
(X-extent-callback . ,Stem::dim_callback)
(Y-extent-callback . ,Stem::height)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
- (adjust-if-on-staffline . #t)
(font-family . music)
(meta . ((interfaces . (stem-interface font-interface item-interface ))))
))
markups))
(text-width (apply + (map interval-length
(map (lambda (x)
- (ly:stencil-get-extent x X))
+ (ly:stencil-extent x X))
stencils))))
(word-count (length markups))
(word-space (cdr (chain-assoc 'word-space props)))
(m2 (interpret-markup paper props arg2)))
(ly:stencil-align-to! m1 X CENTER)
(ly:stencil-align-to! m2 X CENTER)
- (let* ((x1 (ly:stencil-get-extent m1 X))
- (x2 (ly:stencil-get-extent m2 X))
+ (let* ((x1 (ly:stencil-extent m1 X))
+ (x2 (ly:stencil-extent m2 X))
(line (ly:round-filled-box (interval-union x1 x2) '(-0.05 . 0.05) 0.0))
;; should stack mols separately, to maintain LINE on baseline
(stack (stack-lines -1 0.2 0.6 (list m1 line m2))))
(stemth 0.13)
(stemy (* dir stemlen))
(attachx (if (> dir 0)
- (- (cdr (ly:stencil-get-extent headgl X)) stemth)
+ (- (cdr (ly:stencil-extent headgl X)) stemth)
0))
(attachy (* dir 0.28))
(stemgl (and (> log 0)
(max stemy attachy))
(/ stemth 3))))
(dot (ly:find-glyph-by-name font "dots-dot"))
- (dotwid (interval-length (ly:stencil-get-extent dot X)))
+ (dotwid (interval-length (ly:stencil-extent dot X)))
(dots (and (> dot-count 0)
(apply ly:stencil-add
(map (lambda (x)
(* 1.5 dotwid)
0)
;; huh ? why not necessary?
- ;;(cdr (ly:stencil-get-extent headgl X))
+ ;;(cdr (ly:stencil-extent headgl X))
dotwid)
X)
stemgl)))
(display ": { ")
(let ((es (ly:music-property music 'elements))
(e (ly:music-property music 'element)))
- (display (ly:get-mutable-properties music))
+ (display (ly:mutable-music-properties music))
(if (pair? es)
(begin (display "\nElements: {\n")
(map display-music es)
(define-public (make-ottava-set octavation)
(let ((m (make-music 'ApplyContext)))
(define (ottava-modify context)
- "Either reset centralCPosition to the stored original, or remember
-old centralCPosition, add OCTAVATION to centralCPosition, and set
+ "Either reset middleCPosition to the stored original, or remember
+old middleCPosition, add OCTAVATION to middleCPosition, and set
OTTAVATION to `8va', or whatever appropriate."
- (if (number? (ly:context-property context 'centralCPosition))
+ (if (number? (ly:context-property context 'middleCPosition))
(if (= octavation 0)
- (let ((where (ly:context-property-where-defined context 'centralCPosition))
+ (let ((where (ly:context-property-where-defined context 'middleCPosition))
(oc0 (ly:context-property context 'originalCentralCPosition)))
- (ly:context-set-property! context 'centralCPosition oc0)
+ (ly:context-set-property! context 'middleCPosition oc0)
(ly:unset-context-property where 'originalCentralCPosition)
(ly:unset-context-property where 'ottavation))
- (let* ((where (ly:context-property-where-defined context 'centralCPosition))
- (c0 (ly:context-property context 'centralCPosition))
+ (let* ((where (ly:context-property-where-defined context 'middleCPosition))
+ (c0 (ly:context-property context 'middleCPosition))
(new-c0 (+ c0 (* -7 octavation)))
(string (cdr (assoc octavation '((2 . "15ma")
(1 . "8va")
(0 . #f)
(-1 . "8va bassa")
(-2 . "15ma bassa"))))))
- (ly:context-set-property! context 'centralCPosition new-c0)
+ (ly:context-set-property! context 'middleCPosition new-c0)
(ly:context-set-property! context 'originalCentralCPosition c0)
(ly:context-set-property! context 'ottavation string)))))
(set! (ly:music-property m 'procedure) ottava-modify)
(define-public (set-start-grace-properties context)
(define (execute-1 x)
- (let ((tr (ly:translator-find context (car x))))
+ (let ((tr (ly:context-find context (car x))))
(if (ly:context? tr)
(ly:context-pushpop-property tr (cadr x) (caddr x) (cadddr x)))))
(define-public (set-stop-grace-properties context)
(define (execute-1 x)
- (let ((tr (ly:translator-find context (car x))))
+ (let ((tr (ly:context-find context (car x))))
(if (ly:context? tr)
(ly:context-pushpop-property tr (cadr x) (caddr x)))))
(ly:stencil? (cadr stencils)))
(let* ((tail (stack-stencil-line space (cdr stencils)))
(head (car stencils))
- (xoff (+ space (cdr (ly:stencil-get-extent head X)))))
+ (xoff (+ space (cdr (ly:stencil-extent head X)))))
(ly:stencil-add head
(ly:stencil-translate-axis tail xoff X)))
(car stencils))
(let ((slur (Slur::print grob))
(text (fontify-text (ly:get-default-font grob) letter)))
- (let ((x (/ (- (cdr (ly:stencil-get-extent slur 0))
- (/ (cdr (ly:stencil-get-extent text 0)) 2.0)
+ (let ((x (/ (- (cdr (ly:stencil-extent slur 0))
+ (/ (cdr (ly:stencil-extent text 0)) 2.0)
)
-2.0)))
(let*
(
(mol (callback grob))
- (x-ext (interval-widen (ly:stencil-get-extent mol 0) x-padding))
- (y-ext (interval-widen (ly:stencil-get-extent mol 1) y-padding))
+ (x-ext (interval-widen (ly:stencil-extent mol 0) x-padding))
+ (y-ext (interval-widen (ly:stencil-extent mol 1) y-padding))
(x-rule (make-filled-box-stencil (interval-widen x-ext line-thick)
(cons 0 line-thick)))
(y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext))
(define-public (bracketify-stencil stil axis thick protusion padding)
"Add brackets around STIL, producing a new stencil."
- (let* ((ext (ly:stencil-get-extent stil axis))
+ (let* ((ext (ly:stencil-extent stil axis))
(lb (ly:bracket axis ext thick (- protusion)))
(rb (ly:bracket axis ext thick protusion)))
(set! stil
;; TODO merge this and prev function.
(define-public (box-stencil stil thick padding)
"Add a box around STIL, producing a new stencil."
- (let* ((x-ext (interval-widen (ly:stencil-get-extent stil 0) padding))
- (y-ext (interval-widen (ly:stencil-get-extent stil 1) padding))
+ (let* ((x-ext (interval-widen (ly:stencil-extent stil 0) padding))
+ (y-ext (interval-widen (ly:stencil-extent stil 1) padding))
(y-rule (make-filled-box-stencil (cons 0 thick) y-ext))
(x-rule (make-filled-box-stencil (interval-widen x-ext thick)
(cons 0 thick))))
(let* ((name (ly:music-property music 'name))
(e (ly:music-property music 'element))
(es (ly:music-property music 'elements))
- (mprops (ly:get-mutable-properties music))
+ (mprops (ly:mutable-music-properties music))
(d (ly:music-property music 'duration))
(p (ly:music-property music 'pitch))
(ignore-props '(origin elements duration pitch element)))