+2002-04-09 Chris Jackson <chris@fluffhouse.org.uk>
+
+ * lily/arpeggio.cc: New function brew_chord_bracket to draw chord
+ brackets using arpeggio requests.
+
+ * ly/property-init.ly: Shorthand \arpeggioBracket defined as the
+ molecule-callback to use for drawing the brackets.
+
+ * Documentation/user/refman.itely:
+ * input/test/chord-bracket.ly: Chord brackets documented
+
2002-04-10 Han-Wen <hanwen@cs.uu.nl>
* mf/feta-din-code.mf: tweaks for p, s. New dynamic r sign.
separate "Command"-menu and "LilyPond"-menu. Added "Miscellanous"-
submenu to "LilyPond"-menu.
+ * lilypond-mode.el: Added "Midi all" to "Command"-menu, i.e.,
+ an interface to play midi.
+
2002-04-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* input/regression/script-stack-order.ly: new file.
@end lilypond
This command creates @internalsref{Arpeggio} grobs. Cross staff arpeggios
-are @code{PianoStaff.Arpeggio}. @internalsref{Arpeggio}
+are @code{PianoStaff.Arpeggio}.
To add an arrow head to explicitly specify the direction of the
arpeggio, you should set the arpeggio grob property
}
@end lilypond
-@ignore
A square bracket on the left indicates that the player should not
-arpeggiate the chord.
+arpeggiate the chord. To draw these brackets, set the
+@code{molecule-callback} property of @code{Arpeggio} or
+@code{PianoStaff.Arpeggio} grobs to @code{\arpeggioBracket}, and use
+@code{\arpeggio} statements within the chords as before.
-@lil ypond[fragment,relative,verbatim]
+@lilypond[fragment,relative,verbatim]
\context PianoStaff <
\property PianoStaff.connectArpeggios = ##t
- \property PianoStaff.Arpeggio \override #'arpeggio-direction = #'bracket
+ \property PianoStaff.Arpeggio \override #'molecule-callback = \arpeggioBracket
\context Voice = one { <c'\arpeggio e g c> }
\context Voice = other { \clef bass <c,,\arpeggio e g>}
>
-@ e nd lilypond
-@end ignore
+@end lilypond
@refbugs
MAJOR_VERSION=1
MINOR_VERSION=5
PATCH_LEVEL=51
-MY_PATCH_LEVEL=hjj1
+MY_PATCH_LEVEL=uu1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
[c8( e g )bes] [a( c f ) d]
c-. r e-. r f4 r4
g,1\pp
- c,2~c4. c8
+ c,2 c4. c8
[c8( e g )bes] [a( c f ) d]
c r e r f4 r4 % -. ?
\notes\relative c'' { c4-\ff
c \f
+ c \rfz
c \mf
c \mp \> \!
c \pp \< \!
/*
- arpegggio.cc -- implement Arpeggio
+ arpeggio.cc -- implement Arpeggio
source file of the GNU LilyPond music typesetter
#include "staff-symbol.hh"
#include "warn.hh"
#include "font-interface.hh"
+#include "lookup.hh"
bool
Arpeggio::has_interface (Grob* me)
return mol.smobbed_copy () ;
}
+/* Draws a vertical bracket to the left of a chord
+ Chris Jackson <chris@fluffhouse.org.uk> */
+
+MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_bracket, 1);
+SCM
+Arpeggio::brew_chord_bracket (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+
+ Grob * common = me;
+ for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob * stem = unsmob_grob (ly_car (s));
+ common = common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
+ Y_AXIS);
+ }
+
+ Interval heads;
+ Real my_y = me->relative_coordinate (common, Y_AXIS);
+
+ for (SCM s = me->get_grob_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
+ {
+ Grob * stem = unsmob_grob (ly_car (s));
+ Grob * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+ Interval iv = Stem::head_positions (stem);
+ iv *= Staff_symbol::staff_space (ss)/2.0;
+ heads.unite (iv + ss->relative_coordinate (common, Y_AXIS) - my_y);
+ }
+
+ Real lt = me->paper_l ()->get_var ("linethickness");
+ Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
+ Real dy = heads.length() + sp;
+ Real x = 0.7;
+
+ Molecule l1 = Lookup::line (lt, Offset(0, 0), Offset (0, dy));
+ Molecule bottom = Lookup::line (lt, Offset(0, 0), Offset (x, 0));
+ Molecule top = Lookup::line (lt, Offset(0, dy), Offset (x, dy));
+ Molecule mol;
+ mol.add_molecule (l1);
+ mol.add_molecule (bottom);
+ mol.add_molecule (top);
+ mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS);
+ return mol.smobbed_copy();
+}
+
+
/*
We have to do a callback, because brew_molecule () triggers a
vertical alignment if it is cross-staff.
{
public:
DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+ DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
DECLARE_SCHEME_CALLBACK (width_callback, (SCM,SCM));
static bool has_interface (Grob*);
};
:group 'LilyPond
:type 'string)
-(defcustom LilyPond-gv-command "gv -watch"
- "Command used to display PS files."
+(defcustom LilyPond-midi-command "timidity"
+ "Command used to play MIDI files."
:group 'LilyPond
:type 'string)
-(defcustom LilyPond-midi-command "timidity"
+(defcustom LilyPond-midi-all-command "timidity -ig"
"Command used to play MIDI files."
:group 'LilyPond
".midi"))
"Midi")))
+(defun LilyPond-command-all-midi ()
+ "Play next midi score of the current document."
+ (interactive)
+ (if (Midi-running)
+ (quit-process (get-process "midi") t)
+ (LilyPond-compile-file
+ (let ((fname (LilyPond-master-file))
+ (allcount (string-to-number (substring (count-midi-words) 0 -12))))
+ (concat LilyPond-midi-all-command " "
+ (if (> allcount 0) ; at least one midi-score
+ (concat (substring fname 0 -3) ".midi "))
+ (if (> allcount 1) ; more than one midi-score
+ (concat (substring fname 0 -3) "-?.midi "))
+ (if (> allcount 9) ; etc.
+ (concat (substring fname 0 -3) "-??.midi"))
+ (if (> allcount 99) ; not first score
+ (concat (substring fname 0 -3) "-???.midi"))))
+ "Midi")))
+
(defun LilyPond-un-comment-region (start end level)
"Remove up to LEVEL comment characters from each line in the region."
(interactive "*r\np")
'([ "View" (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file) :keys "C-c C-v"])
'([ "ViewPS" (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file) :keys "C-c C-p"])
'([ "Midi (off)" (LilyPond-command-next-midi) :keys "C-c C-m"])
+ '([ "Midi all" (LilyPond-command-all-midi)])
))
(easy-menu-define LilyPond-mode-menu
% set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff
turnOff = #'()
+
+% For drawing vertical chord brackets with \arpeggio
+% This is a shorthand for the value of the molecule-callback property
+% of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
+% cross-staff brackets are desired.
+
+arpeggioBracket = #(lambda (grob) (Arpeggio::brew_chord_bracket grob))
serif_thick# = 1.1 stafflinethickness#;
define_blacker_pixels (serif_thick);
med_thick = round (1.5 stafflinethickness);
+bottom_blot = 1.3 serif_thick;
code := 114;
fet_beginchar("dynamic s", "s", "dyns");
- set_char_box (0, 2/3 ex#, 0, 1 ex#);
+ set_char_box (0, 17/24 ex#, 0, 1 ex#);
save left_angle, right_angle;
save s_thick, s_thin;
bulb_diam = 11/70 ex;
bulb_len = 1.0 bulb_diam;
- left_angle = slant_angle - 0;
- right_angle = slant_angle -9;
- s_thick = 7.5/36 ex;
- s_thin = 5/70 ex;
+ left_angle = slant_angle - 2;
+ right_angle = slant_angle -11;
+
+ s_thick = 16/70 ex;
+ s_thin = serif_thick;
+
base_point = (0,0);
penpos1 (bulb_diam, -45);
save updir, fill_up;
save serif, dishing_angle, p, q;
save cheek_medium, left_serif_protude, right_serif_protude;
+ save lower_overshoot;
pair updir;
path serif,q,p;
dishing_angle = 5;
fill_up := 1.5 serif_thick;
straigh_len = 0.5 ex;
+ lower_overshoot := .3 serif_thick;
stem_thick = 2/6 ex;
cheek_thick = 13/32 ex;
x4r - x4l = cheek_thick;
penpos4 (whatever, 0);
- penpos5 (cheek_medium, -55);
+ penpos5 (whatever, -38);
penpos6 (stem_thick, 0);
penpos17 (straigh_len, 90 -slant);
whatever [z17l, z17r] = z4l;
y3r = ex;
z3l = 0.58 [(stem_thick, -descender), (stem_thick + cheek_width - cheek_thick, -descender)] + whatever * updir;
- y4r = 1/3 ex;
+ y4r = .38 ex;
z4r = whatever*updir + (stem_thick+ cheek_width, -descender);
z5l = whatever*updir + z3l;
- y5l = 1/12 ex;
+ y5r = -lower_overshoot;
+ y5l = y5r + cheek_medium * ypart dir(55);
z9 = z6r + whatever*updir;
y9 = .2 [y5l, y5r];
p :=
z2r{right} .. {dir( -60)}z8 & z8{dir 35} .. z3r{right}
- .. tension 1.0 .. z4r{-updir} .. z5r{left} .. z9
+ .. z4r{-updir}
+ .. tension 1.1
+ .. z5r{left} .. z9
& z9 -- z6r -- z6l -- z7{updir}
.. z2l{left} .. tension 1.2 ..
% z1r & z1r -- z1l & z1l
simple_serif (z1r, z1l, -90)
.. cycle;
+
+
+ save blot_t, corner_t;
+
+ blot_t := 0.13;
+ corner_t := xpart (p intersectiontimes z9);
+
+ z19 = point corner_t - 2 blot_t of p;
+ z20 = point corner_t + blot_t of p;
+ labels(19,20);
+
+ save blot_path;
+ path blot_path;
+
+ pickup pencircle scaled 1;
+
+ fill z19{up} .. {right}z20{updir} .. z19{-(direction corner_t - 2 blot_t of p)} .. cycle;
+
pickup pencircle scaled 1;
fill p;
i_angle := 0;
idir := dir(90- i_angle);
- i_left_space = 18/80 ex;
- i_twiddle_thick = serif_thick;
+ i_left_space = 16/80 ex;
+ i_twiddle_thick = 1.2 serif_thick;
i_twiddle_start_y = 8/16 ex;
i_twiddle_start_angle = 0;
center =(0,0);
- bottom_blot = 1.5 serif_thick;
penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
y1 = i_twiddle_start_y;
i_angle := -3.2;
idir := dir(90 - i_angle);
- i_left_space := 15/80 ex;
+ i_left_space := 14/80 ex;
z1r = right_ending;
i_thick := 23 / 80 ex;
i_angle := -6;
- i_left_space := 15/80 ex;
+ i_left_space := 14/80 ex;
idir := dir(90- i_angle);
save end_twiddle_angle;
end_twiddle_angle := 35;
- penpos6(.9 serif_thick, - end_twiddle_angle);
+ penpos6(serif_thick, - end_twiddle_angle);
y6l = 23/80 ex + ypart center;
z6l = 1.6 [z3l, z3r] + whatever * idir;
fet_endchar;
-ligtable "m" : "p" kern 0.25 ex#, "f" kern -0.1 ex#;
+
+code := 113;
+
+
+currenttransform := identity slanted ypart(dir(15));
+fet_beginchar("dynamic r", "r", "dynr");
+ set_char_box (0, .75 ex#, 0, 1ex#);
+
+
+ save base_point, stem_thick, bulb_diam;
+ save twiddle_thick, attach_len, overshoot, taille;
+ stem_thick =.26 ex;
+ bulb_diam = .30 ex;
+ twiddle_thick= 1.1 serif_thick;
+ overshoot = .5 serif_thick;
+
+ taille = -0.3 serif_thick;
+
+ pair base_point;
+ base_point = (0,0);
+
+ x1l = 0;
+ y1l = .5 bottom_blot;
+
+ penpos10(stem_thick - bottom_blot, 0);
+ y10 = 0;
+ x10 = x1;
+
+ penpos1 (stem_thick, 0);
+ y2l - y1l = 36/47 ex;
+ x2l = x1l;
+ penpos2 (stem_thick, 0);
+
+ y3 = .77 ex;
+ x3r = x2l - .2 ex;
+ penpos3(twiddle_thick, -20);
+
+ x9 = 0.15 [x1r, x1l] ;
+ y9 = y4l - .12 ex ;
+
+ x4l = -0.1 [x1l, x1r];
+ y4l = ex + overshoot;
+
+ x4r = 0.62 [x3r, x2l];
+ y4r = 0.5 [y4l, y2l];
+
+ penpos5(whatever, -74);
+ y5l - y5r = bulb_diam;
+ y5l = ex + overshoot;
+ x5 = x2r + attach_len;
+ attach_len + bulb_diam/2 + stem_thick = w;
+
+ z6 = z5;
+ penpos6 (bulb_diam, 0);
+% z7 = z6l + taille* dir(180);
+
+ save alpha;
+ alpha := 35;
+ z7 = z6 + .4 * bulb_diam * dir (-90 -alpha);
+ z8 = 9/10 [z1r, z2r];
+
+
+ save p;
+ path p;
+
+ p := z1r .. z10r --- z10l .. z1l
+ --- z2l
+ .. z4r{left}
+ .. tension 1.2
+ .. {down}simple_serif(z3r, z3l,-90){up}
+ .. tension 0.95
+ .. z4l
+ .. z9
+ & z9{curl 0}
+ .. z5l
+ .. z6r{dir(-80)}
+ .. z5r{left}
+ .. z7
+ .. z6l
+ .. tension 1.2
+ .. z8 --- cycle;
+ pickup pencircle scaled 1;
+ draw p;
+ fill p;
+ penlabels (1,2,3, 4,5,6,7,8, 9, 10);
+fet_endchar ;
+
+
+
+
+
+%%% KERNING
+
+ligtable "m" : "p" kern 0.15 ex#, "f" kern -0.1 ex#;
ligtable "f" : "f" kern -0.13 ex#;
+ligtable "r" : "f" kern 0.1 ex#;
x2r = width;
- y3 - y2l = 0.25 staff_space;
+
x2r - x1 = 0.5 staff_space;
- x3 = x1l ;
+ x3 = x1l - 0.045 staff_space ;
x4 = 1.02 bulb_diam ;
% z7 = %(bulb_diam/2,ycenter) + 0.23 staff_space * dir ( 35);
z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
- z8 = (0, ycenter + 0.5 stafflinethickness);
+ x8 = 0;
+ y8 = ycenter + 0.25 stafflinethickness;
z6 = whatever [z1l, z2l];
z6 = whatever [z2l, z4] + crook_thick * (crook_dir rotated -90);
crook_dir = normalize(z2l - z4);
- y3 := ycenter +floor (- bulb_diam/2);
+ y3 := ycenter +floor (- 0.45 bulb_diam);
penlabels (1, 2);
.. z5{left} .. z8 .. z3{right}
.. {curl 0.2}z6 -- cycle;
+% draw_staff (-2,2,0.0);
enddef;