Index: lily/breathing-sign.cc =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/breathing-sign.cc,v retrieving revision 1.35 diff -u -r1.35 breathing-sign.cc --- lily/breathing-sign.cc 4 Mar 2003 23:11:57 -0000 1.35 +++ lily/breathing-sign.cc 21 Mar 2003 19:15:12 -0000 @@ -7,6 +7,7 @@ TODO: --> see breathing-sign-engraver.cc + Extensions for ancient notation (C) 2003 by Juergen Reuter */ #include "staff-symbol-referencer.hh" @@ -19,19 +20,34 @@ #include "dimensions.hh" #include "direction.hh" +#include "text-item.hh" +#include "font-interface.hh" + +/* + * TODO: thickness should be a grob property (unit: + * stafflinethickness) rather than hardwired to (staff_space / 6). + */ MAKE_SCHEME_CALLBACK (Breathing_sign,brew_molecule,1); SCM Breathing_sign::brew_molecule (SCM smob) { - Grob * me = unsmob_grob (smob); - Real space = Staff_symbol_referencer::staff_space (me); - - // todo: cfg'able. - Interval i1 (0, space / 6), i2 (-space / 2, space / 2); - Box b (i1, i2); - - return Lookup::filledbox (b).smobbed_copy (); + Grob *me = unsmob_grob (smob); + SCM text = me->get_grob_property ("text"); + if (text == SCM_EOL) + return divisio_minima (smob); + SCM properties = Font_interface::font_alist_chain (me); + Molecule out; + out = Text_item::text2molecule (me, text, properties); + SCM space_scm = me->get_grob_property ("word-space"); + if (gh_number_p (space_scm)) + { + Molecule mol; + mol.set_empty (false); + out.add_at_edge (X_AXIS, RIGHT, mol, gh_scm2double (space_scm) * + Staff_symbol_referencer::staff_space (me), 0); + } + return out.smobbed_copy (); } /* @@ -57,6 +73,147 @@ return l1.smobbed_copy(); } +/* + Gregorian chant divisio minima. (Actually, this was the original + breathing sign by Michael. -- jr) + */ +MAKE_SCHEME_CALLBACK (Breathing_sign,divisio_minima,1); +SCM +Breathing_sign::divisio_minima (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Real staff_space = Staff_symbol_referencer::staff_space (me); + Real staff_size; + Real thickness = me->get_paper ()->get_var ("linethickness"); + SCM lt = me->get_grob_property ("thickness"); + if (gh_number_p (lt)) + thickness *= gh_scm2double (lt); + if (Staff_symbol_referencer::get_staff_symbol (me)) + { + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; + } + else + staff_size = 0.0; + + Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + + /* + * Draw a small vertical line through the uppermost (or, depending + * on direction, lowermost) staff 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); + return out.smobbed_copy (); +} + +/* + Gregorian chant divisio maior. + */ +MAKE_SCHEME_CALLBACK (Breathing_sign,divisio_maior,1); +SCM +Breathing_sign::divisio_maior (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Real staff_space = Staff_symbol_referencer::staff_space (me); + Real staff_size; + Real thickness = me->get_paper ()->get_var ("linethickness"); + SCM lt = me->get_grob_property ("thickness"); + if (gh_number_p (lt)) + thickness *= gh_scm2double (lt); + if (Staff_symbol_referencer::get_staff_symbol (me)) + { + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; + } + else + staff_size = 0.0; + + Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + + /* + * Draw a vertical line that is vertically centered in the staff + * (just like a bar). The height of this line should be a little + * more than half the size of the staff, such that the endings of + * the line are in the middle of a staff space. + */ + int lines = Staff_symbol_referencer::line_count (me); + int height = lines / 2; // little more than half of staff size + if ((lines & 1) != (height & 1)) + height++; // ensure endings are centered in staff space + + Interval xdim (0, thickness); + Interval ydim (-0.5 * height, +0.5 * height); + Box b (xdim, ydim); + Molecule out = Lookup::roundfilledbox (b, blotdiameter); + return out.smobbed_copy (); +} + +/* + Gregorian chant divisio maxima. + */ +MAKE_SCHEME_CALLBACK (Breathing_sign,divisio_maxima,1); +SCM +Breathing_sign::divisio_maxima (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Real staff_space = Staff_symbol_referencer::staff_space (me); + Real staff_size; + Real thickness = me->get_paper ()->get_var ("linethickness"); + SCM lt = me->get_grob_property ("thickness"); + if (gh_number_p (lt)) + thickness *= gh_scm2double (lt); + if (Staff_symbol_referencer::get_staff_symbol (me)) + { + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; + } + else + staff_size = 0.0; + + Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + + // like a "|" type bar + Interval xdim (0, thickness); + Interval ydim (-0.5 * staff_size, +0.5 * staff_size); + Box b (xdim, ydim); + Molecule out = Lookup::roundfilledbox (b, blotdiameter); + return out.smobbed_copy (); +} + +/* + Gregorian chant finalis. + */ +MAKE_SCHEME_CALLBACK (Breathing_sign,finalis,1); +SCM +Breathing_sign::finalis (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Real staff_space = Staff_symbol_referencer::staff_space (me); + Real staff_size; + Real thickness = me->get_paper ()->get_var ("linethickness"); + SCM lt = me->get_grob_property ("thickness"); + if (gh_number_p (lt)) + thickness *= gh_scm2double (lt); + if (Staff_symbol_referencer::get_staff_symbol (me)) + { + staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; + } + else + staff_size = 0.0; + + Real blotdiameter = me->get_paper ()->get_var ("blotdiameter"); + + // like a "||" type bar + 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 line2 (line1); + line2.translate_axis (0.5 * staff_space, X_AXIS); + line1.add_molecule (line2); + + return line2.smobbed_copy (); +} MAKE_SCHEME_CALLBACK (Breathing_sign,offset_callback,2); SCM @@ -75,7 +232,6 @@ int sz = Staff_symbol_referencer::line_count (me)-1; return gh_double2scm (inter_f * sz * d); } - ADD_INTERFACE(Breathing_sign, "breathing-sign-interface", "A breathing sign.", Index: lily/include/breathing-sign.hh =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/include/breathing-sign.hh,v retrieving revision 1.21 diff -u -r1.21 breathing-sign.hh --- lily/include/breathing-sign.hh 4 Mar 2003 23:11:57 -0000 1.21 +++ lily/include/breathing-sign.hh 21 Mar 2003 19:15:12 -0000 @@ -21,6 +21,10 @@ public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM )); DECLARE_SCHEME_CALLBACK (railtracks, (SCM )); + DECLARE_SCHEME_CALLBACK (divisio_minima, (SCM )); + DECLARE_SCHEME_CALLBACK (divisio_maior, (SCM )); + DECLARE_SCHEME_CALLBACK (divisio_maxima, (SCM )); + DECLARE_SCHEME_CALLBACK (finalis, (SCM )); DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis)); static bool has_interface (Grob*); Index: ly/gregorian-init.ly =================================================================== RCS file: /cvsroot/lilypond/lilypond/ly/gregorian-init.ly,v retrieving revision 1.1 diff -u -r1.1 gregorian-init.ly --- ly/gregorian-init.ly 7 Jan 2003 20:07:26 -0000 1.1 +++ ly/gregorian-init.ly 21 Mar 2003 19:15:13 -0000 @@ -1,9 +1,12 @@ \version "1.7.10" +%%%%%%%% +%%%%%%%% shortcuts common for all styles of gregorian chant notation +%%%%%%%% + % -% declare shortcuts for gregorian chant notation +% declare head prefix shortcuts % - virga = \once \property Voice.LigatureHead \override #'virga = ##t stropha = @@ -30,3 +33,40 @@ \once \property Voice.LigatureHead \override #'quilisma = ##t deminutum = \once \property Voice.LigatureHead \override #'deminutum = ##t + +% +% declare divisiones shortcuts +% +virgula = { + \once \property Voice.BreathingSign \override #'text = #"scripts-rcomma" + \once \property Voice.BreathingSign \override #'font-relative-size = #-1 + \breathe +} +caesura = { + \once \property Voice.BreathingSign \override #'text = #"scripts-rvarcomma" + \once \property Voice.BreathingSign \override #'font-relative-size = #-1 + \breathe +} +divisiominima = { + \once \property Voice.BreathingSign \override #'type = #'minima + \once \property Voice.BreathingSign \override #'molecule-callback = #Breathing_sign::divisio_minima + \breathe +} +divisiomaior = { + \once \property Voice.BreathingSign \override #'type = #'maior + \once \property Voice.BreathingSign \override #'molecule-callback = #Breathing_sign::divisio_maior + \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \breathe +} +divisiomaxima = { + \once \property Voice.BreathingSign \override #'type = #'maxima + \once \property Voice.BreathingSign \override #'molecule-callback = #Breathing_sign::divisio_maxima + \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \breathe +} +finalis = { + \once \property Voice.BreathingSign \override #'type = #'finalis + \once \property Voice.BreathingSign \override #'molecule-callback = #Breathing_sign::finalis + \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \breathe +} Index: ly/script-init.ly =================================================================== RCS file: /cvsroot/lilypond/lilypond/ly/script-init.ly,v retrieving revision 1.11 diff -u -r1.11 script-init.ly --- ly/script-init.ly 21 Oct 2002 12:04:47 -0000 1.11 +++ ly/script-init.ly 21 Mar 2003 19:15:13 -0000 @@ -15,6 +15,9 @@ staccatissimo = #(make-articulation "staccatissimo") portato = #(make-articulation "portato") fermata = #(make-articulation "fermata") +shortfermata = #(make-articulation "shortfermata") +longfermata = #(make-articulation "longfermata") +verylongfermata = #(make-articulation "verylongfermata") stopped = #(make-articulation "stopped") staccato = #(make-articulation "staccato") tenuto = #(make-articulation "tenuto") @@ -42,3 +45,4 @@ downprall = #(make-articulation "downprall") segno = #(make-articulation "segno") coda = #(make-articulation "coda") +varcoda = #(make-articulation "varcoda") Index: mf/feta-schrift.mf =================================================================== RCS file: /cvsroot/lilypond/lilypond/mf/feta-schrift.mf,v retrieving revision 1.41 diff -u -r1.41 feta-schrift.mf --- mf/feta-schrift.mf 4 Mar 2003 23:11:57 -0000 1.41 +++ mf/feta-schrift.mf 21 Mar 2003 19:15:13 -0000 @@ -57,6 +57,110 @@ y_mirror_char; fet_endchar; +def draw_short_fermata = + save fat_factor, thinness, dot_radius; + set_char_box(staff_space#, staff_space#, 0, 2.2 staff_space#); + dot_radius# = 8/3*stafflinethickness#; + define_pixels(dot_radius) + + fat_factor = .11; + thinness = 1.5 stafflinethickness; + + pickup pencircle scaled thinness; + rt x2 = w; + lft x5 = -b; + bot y5 = 0; + top y3 = h; + y1 = y2 = y5; + + x3 = 0; + z1 - z4 = whatever * (charwd, -charht); + z4 = fat_factor [z3, z5]; + + filldraw z1 -- z2 -- z3 -- z4 -- cycle; + draw z3 .. z5; + + pickup pencircle scaled 2dot_radius; + x1 - 2x6 = x2; + bot y6 = -d; + drawdot z6; +enddef; + +fet_beginchar("short fermata up", "ushortfermata", "ushortfermata") + draw_short_fermata; +fet_endchar; + +fet_beginchar("short fermata down", "dshortfermata", "dshortfermata") + draw_short_fermata; + xy_mirror_char; +fet_endchar; + +def draw_long_fermata = + save stemthick, beamheight, dot_radius, wd; + define_pixels(wd, dot_radius) + + wd# = 2.5 staff_space#; + stemthick = 1.5 stafflinethickness; + beamheight = 4 stafflinethickness; + dot_radius# = 8/3*stafflinethickness#; + set_char_box(wd#/2, wd#/2, 0, 3/2 staff_space#); + + draw_rounded_block((-b, h-beamheight), (w, h), blot_diameter); + draw_rounded_block((-b, -d),(-b+stemthick, h-stemthick), stemthick); + addto currentpicture also currentpicture xscaled -1; + + pickup pencircle scaled 2dot_radius; + x4 = 0; + bot y4 = -d; + drawdot z4; +enddef; + +fet_beginchar("long fermata up", "ulongfermata", "ulongfermata") + draw_long_fermata; +fet_endchar; + +fet_beginchar("long fermata down", "dlongfermata", "dlongfermata") + draw_long_fermata; + y_mirror_char; +fet_endchar; + +def draw_very_long_fermata = + save ibeamheight, obeamheight; + save ihwd, ohwd, iht, oht; % inner/outer half_width/height + save stemthick, dot_radius; + define_pixels(ihwd, ohwd, iht, oht, dot_radius) + + ihwd# = 1.0 staff_space#; + ohwd# = 1.5 staff_space#; + iht# = 0.9 staff_space#; + oht# = 1.6 staff_space#; + stemthick = 1.5 stafflinethickness; + ibeamheight = 3 stafflinethickness; + obeamheight = 5 stafflinethickness; + dot_radius# = 8/3*stafflinethickness#; + set_char_box(ohwd#, ohwd#, 0, oht#); + + draw_rounded_block((-ohwd, oht-obeamheight), (ohwd, oht), blot_diameter); + draw_rounded_block((-ohwd, 0),(-ohwd+stemthick, ohwd-stemthick), stemthick); + draw_rounded_block((-ihwd, iht-ibeamheight), (ihwd, iht), blot_diameter); + draw_rounded_block((-ihwd, 0),(-ihwd+stemthick, ihwd-stemthick), stemthick); + addto currentpicture also currentpicture xscaled -1; + + pickup pencircle scaled 2dot_radius; + x4 = 0; + bot y4 = -d; + drawdot z4; +enddef; + +fet_beginchar("very long fermata up", "uverylongfermata", "uverylongfermata") + draw_very_long_fermata; +fet_endchar; + +fet_beginchar("very long fermata down", "dverylongfermata", "dverylongfermata") + draw_very_long_fermata; + y_mirror_char; +fet_endchar; + % % Thumbs are used in cello music. % TODO : thumbs should look like the finger-font and should be placed in @@ -708,6 +812,36 @@ fet_endchar; +fet_beginchar("Varied Coda", "varcoda", "varcoda") + save thin, thick, codawidth, codaheight; + thin# = 1.2 stafflinethickness#; + thick# = 3.5 stafflinethickness#; + codawidth# = 2/3 staff_space#; + codaheight# = 1 staff_space#; + define_pixels(thin, thick, codawidth, codaheight); + + set_char_box(codawidth#+thick#, codawidth#+thick#, + codaheight#+thick#, codaheight#+thick#); + + x1 = -codawidth; + y1 = y2 - thin; + x2 = 0; + y2 = codaheight; + draw_rounded_block(z1, z2, thick); + + x3 = x1; + y3 = -blot_diameter; + x4 = x1 + thick; + y4 = y2; + draw_rounded_block(z3, z4, thick); + + addto currentpicture also currentpicture xscaled -1; + addto currentpicture also currentpicture yscaled -1; + + draw_gridline((0,-h),(0,h),thin); + draw_gridline((-w,0),(w,0),thin); +fet_endchar; + def draw_comma = save alpha, thick, thin, ht; alpha:=35; @@ -738,6 +872,29 @@ fet_beginchar("Left Comma","lcomma","lcomma"); draw_comma; + xy_mirror_char; +fet_endchar; + +def draw_varcomma = + save thick, thin, ht, wd, alpha; + alpha:=35; + thin# = 1.2 stafflinethickness#; + thick# = 3 stafflinethickness#; + ht# = .6 staff_space#; + wd# = .25 staff_space#; + define_pixels(thin, thick, ht, alpha); + set_char_box(wd#, wd#, ht#, ht#); + z1 = (-b, -d); + z2 = (w, h); + draw_brush(z1, thin, z2, thick); +enddef; + +fet_beginchar("Right Varied Comma","rvarcomma","rvarcomma"); + draw_varcomma; +fet_endchar; + +fet_beginchar("Left Varied Comma","lvarcomma","lvarcomma"); + draw_varcomma; xy_mirror_char; fet_endchar; Index: scm/grob-description.scm =================================================================== RCS file: /cvsroot/lilypond/lilypond/scm/grob-description.scm,v retrieving revision 1.161 diff -u -r1.161 grob-description.scm --- scm/grob-description.scm 8 Mar 2003 01:55:55 -0000 1.161 +++ scm/grob-description.scm 21 Mar 2003 19:15:13 -0000 @@ -200,8 +200,9 @@ (staff-bar . (minimum-space . 1.5)) (clef . (minimum-space . 2.0)) (first-note . (minimum-space . 1.0)) + (right-edge . (extra-space . 0.1)) )) - (molecule-callback . ,Text_item::brew_molecule) + (molecule-callback . ,Breathing_sign::brew_molecule) (lookup . name) (font-family . music) (text . "scripts-rcomma") Index: scm/script.scm =================================================================== RCS file: /cvsroot/lilypond/lilypond/scm/script.scm,v retrieving revision 1.14 diff -u -r1.14 script.scm --- scm/script.scm 2 Nov 2002 02:14:32 -0000 1.14 +++ scm/script.scm 21 Mar 2003 19:15:13 -0000 @@ -26,6 +26,15 @@ ("fermata" . ((script-molecule . (feta . ("dfermata" . "ufermata"))) (direction . 1))) + ("shortfermata" . + ((script-molecule . (feta . ("dshortfermata" . "ushortfermata"))) + (direction . 1))) + ("longfermata" . + ((script-molecule . (feta . ("dlongfermata" . "ulongfermata"))) + (direction . 1))) + ("verylongfermata" . + ((script-molecule . (feta . ("dverylongfermata" . "uverylongfermata"))) + (direction . 1))) ("stopped" . ((script-molecule . (feta . ("stopped" . "stopped"))) (direction . 1) )) @@ -42,6 +51,10 @@ ((script-molecule . (feta . ("lcomma" . "rcomma"))) (follow-into-staff . #t) (direction . 1))) + ("varcomma" . + ((script-molecule . (feta . ("lvarcomma" . "rvarcomma"))) + (follow-into-staff . #t) + (direction . 1))) ("upbow" . ((script-molecule . (feta . ("upbow" . "upbow"))) (direction . 1) )) @@ -115,6 +128,9 @@ (direction . 1) )) ("coda" . ((script-molecule . (feta . ("coda" . "coda"))) + (direction . 1) )) + ("varcoda" . + ((script-molecule . (feta . ("varcoda" . "varcoda"))) (direction . 1) ))) default-script-alist) )