From bfa123b6b5fd419490bef192485bb5facc99a18e Mon Sep 17 00:00:00 2001 From: hanwen Date: Tue, 9 Apr 2002 23:21:21 +0000 Subject: [PATCH] '' --- ChangeLog | 14 +++ Documentation/user/refman.itely | 15 +-- VERSION | 2 +- input/mozart-hrn3-romanze.ly | 2 +- input/regression/dynamics-glyphs.ly | 1 + lily/arpeggio.cc | 49 ++++++++- lily/include/arpeggio.hh | 1 + lilypond-mode.el | 26 ++++- ly/property-init.ly | 7 ++ mf/feta-din-code.mf | 151 +++++++++++++++++++++++++--- mf/feta-eindelijk.mf | 10 +- 11 files changed, 245 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6b7966f19..3720b62e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-04-09 Chris Jackson + + * 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 * mf/feta-din-code.mf: tweaks for p, s. New dynamic r sign. @@ -20,6 +31,9 @@ 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 * input/regression/script-stack-order.ly: new file. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index ec472a3fd4..d0a5b015b6 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -2016,7 +2016,7 @@ to the chords in both staves, and set @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 @@ -2031,19 +2031,20 @@ 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 { } \context Voice = other { \clef bass } > -@ e nd lilypond -@end ignore +@end lilypond @refbugs diff --git a/VERSION b/VERSION index c7e7eef60b..a94c8d5d61 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond 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 diff --git a/input/mozart-hrn3-romanze.ly b/input/mozart-hrn3-romanze.ly index 54d840d46c..c6dccf0f54 100644 --- a/input/mozart-hrn3-romanze.ly +++ b/input/mozart-hrn3-romanze.ly @@ -65,7 +65,7 @@ romanze = \notes \relative c' { [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 % -. ? diff --git a/input/regression/dynamics-glyphs.ly b/input/regression/dynamics-glyphs.ly index 3cb389a100..ed6d268a01 100644 --- a/input/regression/dynamics-glyphs.ly +++ b/input/regression/dynamics-glyphs.ly @@ -7,6 +7,7 @@ of the hairpin signs." \notes\relative c'' { c4-\ff c \f + c \rfz c \mf c \mp \> \! c \pp \< \! diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index dcf1a03dac..dfd112887b 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -1,5 +1,5 @@ /* - arpegggio.cc -- implement Arpeggio + arpeggio.cc -- implement Arpeggio source file of the GNU LilyPond music typesetter @@ -15,6 +15,7 @@ #include "staff-symbol.hh" #include "warn.hh" #include "font-interface.hh" +#include "lookup.hh" bool Arpeggio::has_interface (Grob* me) @@ -93,6 +94,52 @@ Arpeggio::brew_molecule (SCM smob) return mol.smobbed_copy () ; } +/* Draws a vertical bracket to the left of a chord + Chris Jackson */ + +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. diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh index d397abcfed..aa29b173b6 100644 --- a/lily/include/arpeggio.hh +++ b/lily/include/arpeggio.hh @@ -16,6 +16,7 @@ class Arpeggio { 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*); }; diff --git a/lilypond-mode.el b/lilypond-mode.el index af14b7c5b2..5914ed2017 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -149,13 +149,13 @@ in LilyPond-include-path." :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 @@ -369,6 +369,25 @@ Must be the car of an entry in `LilyPond-command-alist'." ".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") @@ -571,6 +590,7 @@ command." '([ "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 diff --git a/ly/property-init.ly b/ly/property-init.ly index dca3b4930d..a49e7e1f39 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -220,3 +220,10 @@ forgetAccidentals = { % 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)) diff --git a/mf/feta-din-code.mf b/mf/feta-din-code.mf index 0d760c2c1e..ba4009587a 100644 --- a/mf/feta-din-code.mf +++ b/mf/feta-din-code.mf @@ -3,6 +3,7 @@ save serif_thick; serif_thick# = 1.1 stafflinethickness#; define_blacker_pixels (serif_thick); med_thick = round (1.5 stafflinethickness); +bottom_blot = 1.3 serif_thick; @@ -123,7 +124,7 @@ fet_endchar; 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; @@ -135,10 +136,12 @@ fet_beginchar("dynamic s", "s", "dyns"); 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); @@ -236,6 +239,7 @@ fet_beginchar("dynamic p", "p", "dynp") 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; @@ -248,6 +252,7 @@ fet_beginchar("dynamic p", "p", "dynp") 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; @@ -261,7 +266,7 @@ fet_beginchar("dynamic p", "p", "dynp") 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; @@ -282,23 +287,44 @@ fet_beginchar("dynamic p", "p", "dynp") 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; @@ -375,12 +401,11 @@ fet_beginchar("dynamic m", "m", "dynm"); 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; @@ -414,7 +439,7 @@ fet_beginchar("dynamic m", "m", "dynm"); i_angle := -3.2; idir := dir(90 - i_angle); - i_left_space := 15/80 ex; + i_left_space := 14/80 ex; z1r = right_ending; @@ -447,7 +472,7 @@ fet_beginchar("dynamic m", "m", "dynm"); 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); @@ -468,7 +493,7 @@ fet_beginchar("dynamic m", "m", "dynm"); 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; @@ -500,8 +525,102 @@ fet_beginchar("dynamic m", "m", "dynm"); 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#; diff --git a/mf/feta-eindelijk.mf b/mf/feta-eindelijk.mf index e2709e6d38..b8c97f2f17 100644 --- a/mf/feta-eindelijk.mf +++ b/mf/feta-eindelijk.mf @@ -222,10 +222,10 @@ def draw_eighth_rest = 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 ; @@ -238,13 +238,14 @@ def draw_eighth_rest = % 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); @@ -256,6 +257,7 @@ def draw_eighth_rest = .. z5{left} .. z8 .. z3{right} .. {curl 0.2}z6 -- cycle; +% draw_staff (-2,2,0.0); enddef; -- 2.39.5