on unquoted strings before \notenames.
* lily/parser.yy (lyric_element): allow markup as lyric text. This
increases the number of s/r reductions to 4.
* scm/new-markup.scm (fraction-markup): \fraction command.
* lily/lexer.ll: allow any string without \ { } # and " in \markup
mode
* lily/lookup.cc (round_filled_box): rename function.
(LY_DEFINE): round-filled-box: change signature.
* Documentation/user/refman.itely: revise section explaining grace
notes.
* lily/my-lily-lexer.cc: add \accacciatura and \appoggiatura
* ly/grace-init.ly (stopGraceMusic): add slurs on grace note by
default
* ly/engraver-init.ly (ScoreContext): new property graceSettings.
2003-08-28 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/my-lily-lexer.cc (My_lily_lexer): don't crash
+ on unquoted strings before \notenames.
+
+ * lily/parser.yy (lyric_element): allow markup as lyric text. This
+ increases the number of s/r reductions to 4.
+
+ * scm/new-markup.scm (fraction-markup): \fraction command.
+
+ * lily/lexer.ll: allow any string without \ { } # and " in \markup
+ mode
+
+ * lily/lookup.cc (round_filled_box): rename function.
+ (LY_DEFINE): round-filled-box: change signature.
+
+ * Documentation/user/refman.itely: revise section explaining grace
+ notes.
+
* lily/translator-scheme.cc (LY_DEFINE): add !
* input/*/*.ly (vmus): use \new everywhere.
@cindex ornaments
@cindex grace notes
-Grace notes are ornaments that are written out, like accaciatura and
-appogiatura notes.
+Grace notes are ornaments that are written out. The most common ones
+are accacciatura, which should be played as very short. It is denoted
+by a slurred small note with a slashed stem. The appoggiatura is a
+grace note that takes a fixed fraction of the main note, is and
+denoted as a slurred note in small print without a slash.
+They are entered with the commands @code{\accacciatura} and
+@code{\appoggiatura}, as demonstrated in the following example:
+
+
+@cindex appoggiatura
+@cindex accacciatura
+
+@lilypond[relative=2,verbatim,fragment]
+b4 \accacciatura d8 c4 \appoggiatura e8 d4
+\accacciatura { g16 f } e4
+@end lilypond
+
+Both are special forms of the @code{\grace} command. By prefixing this
+keyword to a music expression, a new one is formed, which will be
+printed in a smaller font and takes up no logical time in a measure.
@lilypond[relative=2,verbatim,fragment]
-c4 \grace c16 c4 \grace {
-c16[ d16] } c4
+ c4 \grace c16 c4 \grace {
+ c16[ d16] } c2 c4
@end lilypond
+Unlike @code{\accacciatura} and @code{\appoggiatura}, the
+@code{\grace} command does not start a slur.
-From the point of view of typesetting, their characteristic is that
-grace notes take up take up no logical time in a measure. Internally,
-timing for grace notes is done using a second time. Every point in
-musical time consists of two rational numbers: one denotes the logical
-time, one denotes the grace timing. The above example is shown here
-with timing tuples:
+Internally, timing for grace notes is done using a second, `grace'
+time. Every point in time consists of two rational numbers: one
+denotes the logical time, one denotes the grace timing. The above
+example is shown here with timing tuples:
-@lilypond[]
-\score { \notes \relative c''{
- c4^"(0,0)" \grace c16_" "_"(1/4,-1/16)" c4^"(1/4,0)" \grace {
- c16_"(2/4,-1/8)"[ d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
+@lilypond[singleline]
+<
+ \relative c''{
+ c4 \grace c16 c4 \grace {
+ c16[ d16] } c4
}
-\paper { linewidth = 12.\cm }
-}
+ \new Lyrics \lyrics {
+ \markup { (0,0) } 4
+ \grace { \markup {
+ ( \fraction 1 4 , \fraction -1 16 ) } 16 }
+ \markup { (\fraction 1 4 , 0 ) } 4
+ \grace {
+ \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
+ \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
+ }
+ \markup { ( \fraction 2 4 , 0 ) }
+ } >
@end lilypond
@end lilypond
-Unbeamed eighth notes and shorter by default have a slash through the
-stem. These notes are called accaciaturas, and should generally be
-played as short as possible. An appogiatura takes a fixed fraction of
-the main note, is and denoted without a slash.
-
-Such slashless notes are obtained by setting the object property
-@code{stroke-style} of the @internalsref{Stem} object:
-@cindex slash
-@cindex grace slash
-
-@lilypond[fragment,verbatim]
-\relative c'' \context Voice {
- \grace c8 c4 \grace { c16[ c16] } c4
- \grace {
- \property Voice.Stem \override #'stroke-style = #'()
- c16
- \property Voice.Stem \revert #'stroke-style
- } c4
-}
-@end lilypond
-The @code{\override} is carefully matched with a @code{\revert}:
-
If you want to end a note with a grace note, then the standard trick
is to put the grace notes before a phantom ``space note'', e.g.
By adjusting the duration of the skip note (here it is a half-note),
the space between the main-note and the grace is adjusted.
-A @code{\grace} section has some default values, and LilyPond will
-use those default values unless you specify otherwise inside the
-@code{\grace} section. For example, if you specify \slurUp
-@emph{before} your @code{\grace} section, a slur which starts inside
-the @code{\grace} will not be forced up, even if the slur ends outside
-of the @code{\grace}. Note the difference between the first and
-second bars in this example:
-@lilypond[fragment,verbatim]
-\relative c'' \context Voice {
- \slurUp
- \grace {
- a4( }
- a4) a4( a2)
- \slurBoth
-
- \grace {
- \slurUp
- a4( }
- a4) a4( a2)
- \slurBoth
+A @code{\grace} section will introduce special typesetting settings,
+for example, to produce smaller type, and set directions. Hence, when
+introducing layout tweaks, they should be inside the grace section,
+for example,
+@lilypond[fragment,verbatim,relative 2]
+\new Voice {
+ \accacciatura {
+ \property Voice.Stem \override #'direction = #-1
+ f16->
+ \property Voice.Stem \revert #'direction
+ }
+ g4
}
@end lilypond
+The overrides should also be reverted inside the grace section.
+
+If the layout of grace sections must be changed throughout the music,
+then this can be accomplished through the function
+@code{add-grace-property}. The following example
+undefines the Stem direction grace section, so stems do not always
+point up.
+
+@example
+ \new Staff @{
+ #(add-grace-property "Voice" Stem direction '())
+ @dots{}
+ @}
+@end example
+
+@noindent
+Another option is to change the variables @code{startGraceMusic},
+@code{stopGraceMusic}, @code{startAccacciaturaMusic},
+@code{stopAccacciaturaMusic}, @code{startAppoggiaturaMusic},
+@code{stopAppoggiaturaMstuic}. More information is in the file
+@file{ly/grace-init.ly}
@seealso
expressions. Nesting or juxtaposing grace sections is not supported,
and might produce crashes or other errors.
-Overriding settings for grace music globally cannot be done in a
-modular way. A kludge (@code{add-to-grace-init}) is defined in
-@file{ly/grace-init.ly}.
+Overriding settings cannot be done in separate styles for appoggiatura
+and accacciatura.
@node Glissando
a note:
@lilypond[fragment,relative,verbatim]
- c'-\glissando c'
+ c'\glissando c'
@end lilypond
@seealso
Absolute dynamic marks are specified using an variable after a
-note: @code{c4-\ff}. The available dynamic marks are @code{\ppp},
+note: @code{c4\ff}. The available dynamic marks are @code{\ppp},
@code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
@code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
@code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}:
@lilypond[verbatim,singleline,fragment,relative]
- c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
- c2-\sf c-\rfz
+ c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
+ c2\sf c\rfz
@end lilypond
@cindex @code{\cr}
use spacer notes if multiple marks during one note are needed:
@lilypond[fragment,verbatim,center,quote]
- c''-\< c''-\! d''-\decr e''-\rced
- < f''1 { s4 s4-\< s4-\! \> s4-\! } >
+ c''\< c''\! d''\decr e''\rced
+ < f''1 { s4 s4\< s4\! \> s4\! } >
@end lilypond
This may give rise to very short hairpins. Use @code{minimum-length}
in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
\context Voice {
\property Voice.crescendoText = \markup { \italic "cresc. poco" }
\property Voice.crescendoSpanner = #'dashed-line
- a'2-\mf-\< a a a-\!
+ a'2\mf\< a a a\!
}
@end lilypond
note or chord:
@lilypond[fragment,verbatim]
- c'4-\sustainDown c'4-\sustainUp
+ c'4\sustainDown c'4\sustainUp
@end lilypond
What is printed can be modified by setting @code{pedal@var{X}Strings},
@lilypond[fragment,verbatim]
\property Staff.pedalSustainStyle = #'bracket
- c''4-\sustainDown d''4 e''4
- a'4-\sustainUp-\sustainDown
- f'4 g'4 a'4-\sustainUp
+ c''4\sustainDown d''4 e''4
+ a'4\sustainUp\sustainDown
+ f'4 g'4 a'4\sustainUp
@end lilypond
A third style of pedal notation is a mixture of text and brackets,
@lilypond[fragment,verbatim]
\property Staff.pedalSustainStyle = #'mixed
-c''4-\sustainDown d''4 e''4
-c'4-\sustainUp-\sustainDown
- f'4 g'4 a'4-\sustainUp
+c''4\sustainDown d''4 e''4
+c'4\sustainUp\sustainDown
+ f'4 g'4 a'4\sustainUp
@end lilypond
The default `*Ped' style for sustain and damper pedals corresponds to
for a sostenuto pedal:
@lilypond[fragment,verbatim]
-c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
+c''4\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4\sostenutoUp
@end lilypond
For fine-tuning of the appearance of a pedal bracket, the properties
@lilypond[fragment,verbatim]
\property Staff.PianoPedalBracket \override
#'shorten-pair = #'(0 . -1.0)
-c''4-\sostenutoDown d''4 e''4 c'4
-f'4 g'4 a'4-\sostenutoUp
+c''4\sostenutoDown d''4 e''4 c'4
+f'4 g'4 a'4\sostenutoUp
@end lilypond
@node Arpeggio
@lilypond[fragment,relative,verbatim]
- <<c e g c>>-\arpeggio
+ <<c e g c>>\arpeggio
@end lilypond
When an arpeggio crosses staves, you attach an arpeggio to the chords
@lilypond[fragment,relative,verbatim]
\context PianoStaff <
\property PianoStaff.connectArpeggios = ##t
- \new Staff { <<c' e g c>>-\arpeggio }
- \new Staff { \clef bass <<c,, e g>>-\arpeggio }
+ \new Staff { <<c' e g c>>\arpeggio }
+ \new Staff { \clef bass <<c,, e g>>\arpeggio }
>
@end lilypond
@lilypond[fragment,relative,verbatim]
\context Voice {
\property Voice.Arpeggio \set #'arpeggio-direction = #1
- <<c e g c>>-\arpeggio
+ <<c e g c>>\arpeggio
\property Voice.Arpeggio \set #'arpeggio-direction = #-1
- <<c e g c>>-\arpeggio
+ <<c e g c>>\arpeggio
}
@end lilypond
@lilypond[fragment,relative,verbatim]
\property PianoStaff.Arpeggio \override
#'molecule-callback = \arpeggioBracket
- <<c' e g c>>-\arpeggio
+ <<c' e g c>>\arpeggio
@end lilypond
@refcommands
Interval x_extent = 0.5 * Interval (-linethickness, +linethickness);
Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35);
Box line_box (x_extent, y_extent);
- Molecule line = Lookup::roundfilledbox (line_box, blotdiameter);
+ Molecule line = Lookup::round_filled_box (line_box, blotdiameter);
line.translate_axis (0.5 * head_min.extent (X_AXIS).length (), X_AXIS);
molecule.add_molecule (line);
}
Interval xdim (0, thickness);
Interval ydim (-0.5 * staff_space, +0.5 * staff_space);
Box b (xdim, ydim);
- Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+ Molecule out = Lookup::round_filled_box (b, blotdiameter);
return out.smobbed_copy ();
}
Interval xdim (0, thickness);
Interval ydim (-0.5 * height, +0.5 * height);
Box b (xdim, ydim);
- Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+ Molecule out = Lookup::round_filled_box (b, blotdiameter);
return out.smobbed_copy ();
}
Interval xdim (0, thickness);
Interval ydim (-0.5 * staff_size, +0.5 * staff_size);
Box b (xdim, ydim);
- Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+ Molecule out = Lookup::round_filled_box (b, blotdiameter);
return out.smobbed_copy ();
}
Interval xdim (0, thickness);
Interval ydim (-0.5 * staff_size, +0.5 * staff_size);
Box b (xdim, ydim);
- Molecule line1 = Lookup::roundfilledbox (b, blotdiameter);
+ Molecule line1 = Lookup::round_filled_box (b, blotdiameter);
Molecule line2 (line1);
line2.translate_axis (0.5 * staff_space, X_AXIS);
line1.add_molecule (line2);
box.add_point (bottom_points[i] - hvpadding);
box.add_point (Offset(top_points[i + 1][X_AXIS],
top_points[i][Y_AXIS]) + hvpadding);
- out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+ out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
}
}
else if (String::compare (shape, "rightsided-stairs") == 0)
box.add_point (Offset(bottom_points[i][X_AXIS],
bottom_points[i + 1][Y_AXIS]) - hvpadding);
box.add_point (top_points[i + 1] + hvpadding);
- out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+ out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
}
}
else if (String::compare (shape, "centered-stairs") == 0)
hvpadding);
box.add_point (Offset (right_xmid, top_points[i][Y_AXIS]) +
hvpadding);
- out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+ out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
left_xmid = right_xmid;
}
Real right_xmid = bottom_points[size - 1][X_AXIS];
hvpadding);
box.add_point (Offset (right_xmid, top_points[size - 1][Y_AXIS]) +
hvpadding);
- out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+ out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
}
else if (String::compare (shape, "ramp") == 0)
{
static Molecule dashed_slur (Bezier, Real thick, Real dash);
static Molecule blank (Box b);
static Molecule filledbox (Box b);
- static Molecule roundfilledbox (Box b, Real blotdiameter);
+ static Molecule round_filled_box (Box b, Real blotdiameter);
static Molecule repeat_slash (Real w, Real slope, Real th);
static Molecule line (Real th, Offset from, Offset to);
static Molecule horizontal_line (Interval w, Real th);
} else
return scan_escaped_word (str);
}
- {LYRICS} {
+ [{}] {
+ return YYText()[0];
+ }
+ [^#{}"\\ \t\n\f]+ {
String s (YYText ());
char c = s[s.length () - 1];
if (c == '{' || c == '}') // brace open is for not confusing dumb tools.
here_input ().warning (
- _ ("Brace found at end of lyric. Did you forget a space?"));
+ _ ("Brace found at end of markup. Did you forget a space?"));
yylval.scm = scm_makfrom0str (s.to_str0 ());
return STRING;
}
- {WHITE} {
-
- }
- . {
- return YYText ()[0];
+ . {
+ return YYText()[0];
}
}
* Box extent(X_AXIS)
*/
Molecule
-Lookup::roundfilledbox (Box b, Real blotdiameter)
+Lookup::round_filled_box (Box b, Real blotdiameter)
{
if (b.x ().length () < blotdiameter)
{
blotdiameter = b.y ().length ();
}
- SCM at = (scm_list_n (ly_symbol2scm ("roundfilledbox"),
+ SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"),
gh_double2scm (-b[X_AXIS][LEFT]),
gh_double2scm (b[X_AXIS][RIGHT]),
gh_double2scm (-b[Y_AXIS][DOWN]),
return Molecule (b,at);
}
-LY_DEFINE(ly_round_filled_box, "ly:round-filled-box",
- 2, 0,0,
- (SCM b, SCM blot),
- "Make a box with rounded corners. B is a pair of number-pairs, and BLOT a number")
-{
- SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG2, __FUNCTION__, "number") ;
- SCM_ASSERT_TYPE(gh_pair_p (b), b, SCM_ARG4, __FUNCTION__, "pair") ;
-
- SCM_ASSERT_TYPE(ly_number_pair_p (gh_car (b)), gh_car (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
- SCM_ASSERT_TYPE(ly_number_pair_p (gh_cdr (b)), gh_cdr (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
-
- Interval x (ly_scm2interval (gh_car (b)));
- Interval y (ly_scm2interval (gh_cdr (b)));
-
- return Lookup::roundfilledbox (Box (x,y),
- gh_scm2double (blot)).smobbed_copy();
-
-}
/*
gh_scm2double (t),
gh_scm2double (p)).smobbed_copy ();
}
-
+
+
+
+LY_DEFINE(ly_filled_box ,"ly:round-filled-box",
+ 3, 0, 0,
+ (SCM xext, SCM yext, SCM blot),
+ "Make a filled-box of dimensions @var{xext}, @var{yext} and roundness @var{blot}.")
+{
+ SCM_ASSERT_TYPE(ly_number_pair_p (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE(ly_number_pair_p (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
+ SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+
+ return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
+ gh_scm2double (blot)).smobbed_copy ();
+}
+
Interval (0, -join_left * 0.5 * staff_space);
Box stem_box (x_extent, y_extent);
- Molecule stem = Lookup::roundfilledbox (stem_box, blotdiameter);
+ Molecule stem = Lookup::round_filled_box (stem_box, blotdiameter);
out.add_molecule (stem);
}
My_lily_lexer::My_lily_lexer ()
{
+ // yy_flex_debug = 1;
+
keytable_ = new Keyword_table (the_key_tab);
+
+ chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+ pitchname_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+
scopes_ = SCM_EOL;
add_scope(ly_make_anonymous_module());
Box ledger_line (x_extent, y_extent);
Molecule proto_ledger_line =
- Lookup::roundfilledbox (ledger_line, blotdiameter);
+ Lookup::round_filled_box (ledger_line, blotdiameter);
if (!take_space)
proto_ledger_line.set_empty (true);
*/
/*
- Two shift/reduce problems:
+ Four shift/reduce problems:
1. foo = bar.
"bar" -> String -> string-assignment
+Similar problem for
+
+ * \markup identifier.
+ * \markup { }
+
+
2. \repeat
\repeat .. \alternative
%type <i> exclamations questions dots optional_rest
%type <i> bass_mod
-%type <scm> grace_head
+%type <scm> grace_head
+%type <scm> lyric_element
%type <scm> bass_number br_bass_figure bass_figure figure_list figure_spec
%token <i> DIGIT
%token <scm> NOTENAME_PITCH
scm_gc_protect_object (mus);
$$ = unsmob_music (mus);
}
- | STRING optional_notemode_duration {
+
+ | lyric_element optional_notemode_duration {
Input i = THIS->pop_spot ();
+ if (!THIS->lexer_->lyric_state_b ())
+ THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
Music * lreq = MY_MAKE_MUSIC("LyricEvent");
lreq->set_mus_property ("text", $1);
}
;
+lyric_element:
+ full_markup { $$ = $1 }
+ | STRING { $$ = $1 ; }
+ ;
+
new_chord:
steno_tonic_pitch optional_notemode_duration {
$$ = make_chord ($1, $2, SCM_EOL);
Interval (0, -delta_pitch * 0.5 * staff_space); // descending join
Box stem_box (x_extent, y_extent);
- Molecule stem = Lookup::roundfilledbox (stem_box, blotdiameter);
+ Molecule stem = Lookup::round_filled_box (stem_box, blotdiameter);
out.add_molecule (stem);
}
else
% Toplevel initialisation file.
+
+
#(define-public point-and-click #f)
#(define-public midi-debug #f)
\include "declarations-init.ly"
+
#(ly:set-option 'new-relative)
#(ly:set-point-and-click #f)
+
+foo= \notes {
+ <<c e g b>>-\markup { \normal-size-super
+ % \override #'(font-family . math) "N" }
+ \override #'(font-family . math) "M" }
+}
+
(remainder (+ a 1) 2))
-(define-public (widen-interval iv amount)
+(define-public (interval-widen iv amount)
(cons (- (car iv) amount)
- (+ (cdr iv) amount))
-)
+ (+ (cdr iv) amount)))
+
+
+(define-public (interval-union i1 i2)
+ (cons (min (car i1) (car i2))
+ (max (cdr i1) (cdr i2))))
+
(define-public (write-me message x)
"Return X. Display MESSAGE and write X. Handy for debugging, possibly turned off."
(stack-lines dir padding baseline (cdr mols))
padding baseline
)
- )
- ))
+ )))
(define-public (fontify-text font-metric text)
"Set TEXT with font FONT-METRIC, returning a molecule."
(define-public (bracketify-molecule mol axis thick protusion padding)
"Add brackets around MOL, producing a new molecule."
- (let* (
- (ext (ly:molecule-get-extent mol axis))
+ (let* ((ext (ly:molecule-get-extent mol axis))
(lb (ly:bracket axis ext thick (- protusion)))
- (rb (ly:bracket axis ext thick protusion))
- )
+ (rb (ly:bracket axis ext thick protusion)))
(set! mol (ly:molecule-combine-at-edge mol (other-axis axis) 1 lb padding))
(set! mol (ly:molecule-combine-at-edge mol (other-axis axis) -1 rb padding))
mol
(define-public (box-molecule mol thick padding)
"Add a box around MOL, producing a new molecule."
(let* (
- (x-ext (widen-interval (ly:molecule-get-extent mol 0) padding))
- (y-ext (widen-interval (ly:molecule-get-extent mol 1) padding))
- (x-rule (make-filled-box-molecule (widen-interval x-ext thick)
+ (x-ext (interval-widen (ly:molecule-get-extent mol 0) padding))
+ (y-ext (interval-widen (ly:molecule-get-extent mol 1) padding))
+ (x-rule (make-filled-box-molecule (interval-widen x-ext thick)
(cons 0 thick)))
(y-rule (make-filled-box-molecule (cons 0 thick) y-ext)))
)
(define-public (line-markup grob props . rest)
+ "A horizontal line of markups. Syntax:
+\\line << MARKUPS >>
+"
+
(stack-molecule-line
(cdr (chain-assoc 'word-space props))
(map (lambda (x) (interpret-markup grob props x)) (car rest)))
grob
props
(cadr rest))
- (car rest) Y)
- )
+ (car rest) Y))
+
+(define-public (fraction-markup grob props . rest)
+ "Syntax: \\fraction MARKUP1 MARKUP2."
+
+ (let*
+ ((m1 (interpret-markup grob props (car rest)))
+ (m2 (interpret-markup grob props (cadr rest))))
+
+ (ly:molecule-align-to! m1 X CENTER)
+ (ly:molecule-align-to! m2 X CENTER)
+
+ (let*
+ ((x1 (ly:molecule-get-extent m1 X))
+ (x2 (ly:molecule-get-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))))
+
+ (ly:molecule-align-to! stack Y CENTER)
+ (ly:molecule-align-to! stack X LEFT)
+ ;; should have EX dimension
+ ;; empirical anyway
+ (ly:molecule-translate-axis stack 0.75 Y)
+ )))
(define-public (note-markup grob props . rest)
0))
(attachy (* dir 0.28))
(stemgl (if (> log 0)
- (ly:round-filled-box (cons
+ (ly:round-filled-box
(cons attachx (+ attachx stemth))
(cons (min stemy attachy)
- (max stemy attachy)))
+ (max stemy attachy))
(/ stemth 3)
) #f))
(dot (ly:find-glyph-by-name font "dots-dot"))
(cons hbracket-markup (list markup?))
(cons bracket-markup (list markup?))
(cons note-markup (list integer? integer? ly:dir?))
+ (cons fraction-markup (list markup? markup?))
(cons column-markup (list markup-list?))
(cons dir-column-markup (list markup-list?))
(if (<= dy 1) "-" "="))
(func "h-line" dx))))))
-(define (roundfilledbox breapth width depth height blot)
+(define (round-filled-box breapth width depth height blot)
(filledbox breapth width depth height))
(define (draw-line thick x1 y1 x2 y2)
(let*
(
(mol (callback grob))
- (x-ext (widen-interval (ly:molecule-get-extent mol 0) x-padding))
- (y-ext (widen-interval (ly:molecule-get-extent mol 1) y-padding))
- (x-rule (make-filled-box-molecule (widen-interval x-ext line-thick)
+ (x-ext (interval-widen (ly:molecule-get-extent mol 0) x-padding))
+ (y-ext (interval-widen (ly:molecule-get-extent mol 1) y-padding))
+ (x-rule (make-filled-box-molecule (interval-widen x-ext line-thick)
(cons 0 line-thick)))
(y-rule (make-filled-box-molecule (cons 0 line-thick) y-ext))
)
(ly:number->string (+ depth height))
" re f "))
-(define (roundfilledbox breadth width depth height blotdiam)
+(define (round-filled-box breadth width depth height blotdiam)
(let* ((rad (/ blotdiam 2))
(h (- height rad))
(d (- depth rad))
"f "))
-(define (roundfilledbox breadth width depth height blot)
+(define (round-filled-box breadth width depth height blot)
(filledbox breadth width depth height))
(define (font-def i s) "")
(ly:number->string depth) "}{"
(ly:number->string height) "}"))
-(define (roundfilledbox x y width height blotdiam)
- (embedded-pdf (list 'roundfilledbox x y width height blotdiam)))
+(define (round-filled-box x y width height blotdiam)
+ (embedded-pdf (list 'round-filled-box x y width height blotdiam)))
(define (text s)
(string-append "\\hbox{" (output-tex-string s) "}"))
(numbers->string (list wid slope thick))
" draw_repeat_slash"))
-(define (roundfilledbox x y width height blotdiam)
+(define (round-filled-box x y width height blotdiam)
(string-append
" "
(numbers->string
; ((eq? keyword 'placebox)
; (dispatch (+ x (cadr expr)) (+ y (caddr expr) (cadddr expr))))
; ((eq? keyword 'repeat-slash wid slope thick)
-; ((eq? keyword 'roundfilledbox x y dx dy w h b)
+; ((eq? keyword 'round-filled-box x y dx dy w h b)
; ((eq? keyword 'select-font name-mag-pair)
; ((eq? keyword 'start-system width height)
; ((eq? keyword 'stem x y z w) (filledbox x y z w))
"")
-(define (roundfilledbox x y dx dy w h b)
+(define (round-filled-box x y dx dy w h b)
(sketch-filled-rectangle w 0 0 h x y))
(define (polygon points blotdiameter) "") ;; TODO
; (draw-line th x1 0 x2 0))
(define (filledbox breapth width depth height)
- (roundfilledbox breapth width depth height line-thickness))
+ (round-filled-box breapth width depth height line-thickness))
(define font-cruft
"fill:black;stroke:none;text-anchor:start;writing-mode:lr;font-weight:normal;")
(number->string (- 0 (* output-scale y)))
")"))))
-(define (roundfilledbox breapth width depth height blot-diameter)
+(define (round-filled-box breapth width depth height blot-diameter)
(tagify "rect" ""
;;'(style . "fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;")
`(style . ,(format "fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-opacity:1;stroke-width:~f;stroke-linejoin:miter;stroke-linecap:butt;" line-thickness))
(ly:number->string depth) "}{"
(ly:number->string height) "}")))
-(define (roundfilledbox x y width height blotdiam)
- (embedded-ps (list 'roundfilledbox x y width height blotdiam)))
+(define (round-filled-box x y width height blotdiam)
+ (embedded-ps (list 'round-filled-box x y width height blotdiam)))
(define (text s)
(string-append "\\hbox{" (output-tex-string s) "}"))