From bd4f4c1bd44a721d97ac54486cc8cd31f594a15b Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:32:53 +0000 Subject: [PATCH] lilypond-1.3.106 --- CHANGES | 25 ++++- NEWS | 4 + VERSION | 2 +- input/test/manual-clef.ly | 26 +++++ lily/clef-engraver.cc | 137 +++++++++++--------------- lily/include/context-specced-music.hh | 5 +- lily/key-engraver.cc | 2 +- lily/key-performer.cc | 3 +- lily/lily-guile.cc | 7 +- lily/parser.yy | 64 ++++++++---- lily/piano-pedal-engraver.cc | 2 +- lily/property-engraver.cc | 10 +- lily/translator-group.cc | 18 ++-- ly/engraver.ly | 52 +--------- scm/element-descriptions.scm | 1 + scm/lily.scm | 77 +++++++++++++++ scm/translator-description.scm | 15 ++- 17 files changed, 268 insertions(+), 182 deletions(-) create mode 100644 input/test/manual-clef.ly diff --git a/CHANGES b/CHANGES index c72d0969f5..ecca8a8e2d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,26 @@ -1.3.104.jcn3 +1.3.105.jcn1 ============ +* Makeinfo html documentation generation fixes. + +1.3.105.uu1 +=========== + +* Remove Bar_req, \bar is now a frontend to setting Score.whichBar + +* Move Context_specced_music::translator_{type,id}_str_ into music +properties. + +* Don't make line breaks during note playing. + +* Clef engraver rewrite. Clef-engraver is now controlled through +properties clefPosition, clefGlyph, clefOctavation. The \clef command +is just a front-end to these, see scm/lily.scm, function +clef-name-to-properties. See also input/test/manual-clef.ly + +1.3.105 +======= + * Bit of temporary makefile hacking to stay in sync with makeinfo patch. * Separate interface description (test phase). @@ -213,7 +233,7 @@ input/test/instrument-name-grandstaff.ly * Moved Text_script_req's text_ member into mus-property. -* Renamed ChordName to ChordNames, for consistancy. +* Renamed ChordName to ChordNames, for consistency. * Resurrected most of chord names, superscripting and kerning is currently broken, though. @@ -363,7 +383,6 @@ Break_align_item::space-alist, Chord_name::chord-name-function * Added \property combineParts: part combiner switched off by default. - * Remove all print methods. * Use Scope::try_retrieve if possible. diff --git a/NEWS b/NEWS index 2f2f4347ae..fd86eddfd9 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ internals: LilyPond is smaller, cleaner, more flexible, etc. * New font selection scheme similar to Latex-NFSS. +* Medieval notation features: clefs, custodes + * Piano pedal support, Arpeggios, Custodes * MIDI: dynamics, tempo changes @@ -38,6 +40,8 @@ internals: LilyPond is smaller, cleaner, more flexible, etc. * Finished ouverture Coriolan as full orchestral score example. +* Self-documenting: generated internal documentation. + * AsciiScript: ASCII-art output * Translations into Japanese, French and Russian diff --git a/VERSION b/VERSION index 2e7b9bcdf6..a70f97234c 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=105 +PATCH_LEVEL=106 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/input/test/manual-clef.ly b/input/test/manual-clef.ly new file mode 100644 index 0000000000..f6b08e02d6 --- /dev/null +++ b/input/test/manual-clef.ly @@ -0,0 +1,26 @@ +\version "1.3.105"; + +%{ + +Test clef engraver by setting \property directly. \clef is merely a front-end to this. + +%} + +\score { \notes { + \property Staff.clefGlyph = #"clefs-F" + \property Staff.clefPosition = #2 + c'4 + \property Staff.clefGlyph = #"clefs-G" + c'4 + \property Staff.clefGlyph = #"clefs-C" + + c'4 + \property Staff.clefOctavation = #7 + c'4 + \property Staff.clefOctavation = #0 + \property Staff.clefPosition = #0 + c'4 + \clef "bla"; + c'4 + +}} diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 83eb544afe..818e3544a0 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -32,86 +32,81 @@ public: Clef_engraver (); Direction octave_dir_; - bool first_b_; protected: virtual void do_process_music (); virtual void do_pre_move_processing (); virtual void do_creation_processing (); virtual void do_post_move_processing (); - virtual bool do_try_music (Music*); virtual void acknowledge_element (Score_element_info); private: Item * clef_p_; Item * octavate_p_; Clef_change_req * clef_req_l_; - + + SCM prev_glyph_; + SCM prev_cpos_; + SCM prev_octavation_; void create_clef (); - bool set_type (String); + void set_central_c (SCM, SCM, SCM); + void set_glyph (); }; Clef_engraver::Clef_engraver () { - first_b_ = true; clef_p_ = 0; clef_req_l_ = 0; octave_dir_ = CENTER; octavate_p_ = 0; + + /* + will trigger a clef at the start since #f != '() + */ + prev_cpos_ = prev_glyph_ = SCM_BOOL_F; } -bool -Clef_engraver::set_type (String s) +void +Clef_engraver::set_central_c (SCM glyph,SCM clefpos, SCM octavation) { - if (s.right_str (2) == "_8") // Down one octave - { - octave_dir_ = DOWN; - s = s.left_str (s.length_i () - 2); - } - else if (s.right_str (2) == "^8") // Up one octave - { - octave_dir_ = UP; - s = s.left_str (s.length_i () - 2); - } - else - octave_dir_ = CENTER; + prev_cpos_ = clefpos; + prev_glyph_ = glyph; + prev_octavation_ = octavation; - SCM c = get_property ("supportedClefTypes"); SCM p = get_property ("clefPitches"); - - if (gh_list_p (c)) + int c0_position = 0; + if (gh_list_p (p)) { - SCM found = scm_assoc (ly_str02scm (s.ch_C ()), c); + SCM found = scm_assoc (glyph, p); if (found == SCM_BOOL_F) - return false; - - SCM glyph = gh_cadr (found); - SCM pos = gh_caddr (found); - - daddy_trans_l_->set_property ("clefGlyph", glyph); - daddy_trans_l_->set_property ("clefPosition", pos); - - found = scm_assoc (glyph, p); - if (found == SCM_BOOL_F) - return false; + { + c0_position =0; + } + else + { + c0_position = gh_scm2int (gh_cdr (found)); - int c0_position = gh_scm2int (pos) + gh_scm2int (gh_cdr (found)); - daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (c0_position)); + if (gh_number_p (octavation)) + c0_position -= gh_scm2int (octavation); + + if (gh_number_p (clefpos)) + c0_position += gh_scm2int (clefpos); + } + } - - int c0_position = gh_scm2int (get_property ("centralCPosition")); - c0_position -= (int)octave_dir_ * 7; daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (c0_position)); +} +void +Clef_engraver::set_glyph () +{ + SCM glyph_sym = ly_symbol2scm ("glyph"); + SCM glyph = get_property ("clefGlyph"); SCM basic = ly_symbol2scm ("Clef"); - SCM gl = ly_symbol2scm ("glyph"); - - daddy_trans_l_->execute_single_pushpop_property (basic, gl, SCM_UNDEFINED); - daddy_trans_l_->execute_single_pushpop_property (basic, gl, - get_property ("clefGlyph")); - - return true; + + daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, SCM_UNDEFINED); + daddy_trans_l_->execute_single_pushpop_property (basic, glyph_sym, glyph); } /** @@ -154,31 +149,9 @@ Clef_engraver::acknowledge_element (Score_element_info info) void Clef_engraver::do_creation_processing () { - daddy_trans_l_->set_property ("clefPosition", gh_int2scm (0)); - daddy_trans_l_->set_property ("clefGlyph", SCM_EOL); - daddy_trans_l_->set_property ("centralCPosition", gh_int2scm (0)); - - SCM def = get_property ("defaultClef"); - if (gh_string_p (def)) - { - set_type (ly_scm2string (def)); - } } -bool -Clef_engraver::do_try_music (Music * r_l) -{ - if (Clef_change_req *cl = dynamic_cast (r_l)) - { - clef_req_l_ = cl; - String t = ly_scm2string (cl->get_mus_property ("clef-type")); - if (!set_type (t)) - cl->origin ()->warning (_ ("unknown clef type")); - return true; - } - return false; -} void Clef_engraver::create_clef () @@ -186,16 +159,17 @@ Clef_engraver::create_clef () if (!clef_p_) { Item *c= new Item (get_property ("Clef")); - announce_element (c, clef_req_l_); + announce_element (c, 0); Staff_symbol_referencer::set_interface (c); clef_p_ = c; } Staff_symbol_referencer::set_position (clef_p_, - gh_scm2int (get_property ("clefPosition") - )); - if (octave_dir_) + gh_scm2int (get_property ("clefPosition"))); + + SCM oct = get_property("clefOctavation"); + if (gh_number_p (oct) && gh_scm2int (oct)) { Item * g = new Item (get_property ("OctavateEight")); @@ -204,18 +178,28 @@ Clef_engraver::create_clef () g->set_parent (clef_p_, Y_AXIS); g->set_parent (clef_p_, X_AXIS); - g->set_elt_property ("direction", gh_int2scm (octave_dir_)); + g->set_elt_property ("direction", gh_int2scm (sign (gh_scm2int (oct)))); octavate_p_ = g; - announce_element (octavate_p_, clef_req_l_); + announce_element (octavate_p_, 0); } } void Clef_engraver::do_process_music () { - if (clef_req_l_ || first_b_) + SCM glyph = get_property ("clefGlyph"); + SCM clefpos = get_property ("clefPosition"); + SCM octavation = get_property ("clefOctavation"); + + if (scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F + || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F + || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F) { + set_glyph(); + set_central_c (glyph, clefpos, octavation); + create_clef (); + clef_p_->set_elt_property ("non-default", SCM_BOOL_T); } } @@ -246,14 +230,11 @@ Clef_engraver::do_pre_move_processing () octavate_p_ = 0; } - - first_b_ = 0; } void Clef_engraver::do_post_move_processing () { - clef_req_l_ = 0; } ADD_THIS_TRANSLATOR (Clef_engraver); diff --git a/lily/include/context-specced-music.hh b/lily/include/context-specced-music.hh index abcf2c40f3..e6eb7c8b0f 100644 --- a/lily/include/context-specced-music.hh +++ b/lily/include/context-specced-music.hh @@ -14,12 +14,15 @@ class Context_specced_music : public Music_wrapper { -public: + +/* /// The kind of translation needed for this music. String translator_type_str_; /// what identification for the translation unit String translator_id_str_; +*/ +public: Context_specced_music (Music*); VIRTUAL_COPY_CONS(Music); diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index eff8a73a20..46f4d3f656 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -150,7 +150,7 @@ void Key_engraver::read_req (Key_change_req const * r) { SCM p = r->get_mus_property ("pitch-alist"); - if (p == SCM_UNDEFINED) + if (!gh_pair_p (p)) return; SCM n = scm_list_copy (p); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 79fdac637e..f13cc85d7d 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -26,7 +26,8 @@ Key_performer::~Key_performer () void Key_performer::do_process_music () { - if (key_req_l_ && key_req_l_->get_mus_property ("pitch-alist") != SCM_UNDEFINED) + if (key_req_l_ && + gh_list_p (key_req_l_->get_mus_property ("pitch-alist"))) { audio_p_ = new Audio_key (); // *key_req_l_->key_); Audio_element_info info (audio_p_, key_req_l_); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 7f56dbcf3e..91096bce8e 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -390,11 +390,6 @@ wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3) } #endif -SCM -undefd () -{ - return SCM_UNDEFINED; -} #include "version.hh" SCM @@ -413,7 +408,7 @@ init_functions () scm_make_gsubr ("ly-version", 0, 0, 0, (Scheme_function_unknown)ly_warning); scm_make_gsubr ("ly-gulp-file", 1,0, 0, (Scheme_function_unknown)ly_gulp_file); scm_make_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p); - scm_make_gsubr ("undefd", 0,0, 0, (Scheme_function_unknown)undefd); + scm_make_gsubr ("ly-number->string", 1, 0,0, (Scheme_function_unknown) ly_number2string); diff --git a/lily/parser.yy b/lily/parser.yy index 76d6d7e169..6853bc91fd 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -251,7 +251,7 @@ yylex (YYSTYPE *s, void * v_l) %type music_output_def_body %type shorthand_command_req %type post_request -%type command_req verbose_command_req +%type command_req verbose_command_req %type extender_req %type hyphen_req %type string bare_number number_expression @@ -729,9 +729,8 @@ Composite_music: CONTEXT STRING Music { Context_specced_music *csm = new Context_specced_music ($3); - csm->translator_type_str_ = ly_scm2string ($2); - csm->translator_id_str_ = ""; - + csm->set_mus_property ("context-type",$2); + csm->set_mus_property ("context-id", ly_str02scm ("")); $$ = csm; } @@ -748,8 +747,8 @@ Composite_music: | CONTEXT STRING '=' STRING Music { Context_specced_music *csm = new Context_specced_music ($5); - csm->translator_type_str_ = ly_scm2string ($2); - csm->translator_id_str_ = ly_scm2string ($4); + csm->set_mus_property ("context-type", $2); + csm->set_mus_property ("context-id", $4); $$ = csm; } @@ -854,7 +853,7 @@ property_def: $$ = csm; $$->set_spot (THIS->here_input ()); - csm-> translator_type_str_ = ly_scm2string ($2); + csm-> set_mus_property ("context-type", $2); } | PROPERTY STRING '.' STRING PUSH embedded_scm '=' embedded_scm { Music *t = new Music; @@ -866,7 +865,7 @@ property_def: $$ = csm; $$->set_spot (THIS->here_input ()); - csm-> translator_type_str_ = ly_scm2string ($2); + csm-> set_mus_property ("context-type", $2); } | PROPERTY STRING '.' STRING POP embedded_scm { Music *t = new Music; @@ -878,7 +877,7 @@ property_def: $$ = csm; $$->set_spot (THIS->here_input ()); - csm-> translator_type_str_ = ly_scm2string ($2); + csm-> set_mus_property ("context-type", $2); } ; @@ -912,6 +911,19 @@ command_element: $$-> set_spot (THIS->here_input ()); $1-> set_spot (THIS->here_input ()); } + | BAR STRING ';' { + Music *t = new Music; + + t->set_mus_property ("type", ly_symbol2scm ("property-set")); + t->set_mus_property ("symbol", ly_symbol2scm ("whichBar")); + t->set_mus_property ("value", $2); + + Context_specced_music *csm = new Context_specced_music (t); + $$ = csm; + $$->set_spot (THIS->here_input ()); + + csm->set_mus_property ("context-type", ly_str02scm ("Score")); + } | PARTIAL duration_length ';' { Music * p = new Music; p->set_mus_property ("symbol", ly_symbol2scm ( "measurePosition")); @@ -922,12 +934,31 @@ command_element: delete $2; // ugh Context_specced_music * sp = new Context_specced_music (p); $$ =sp ; - sp-> translator_type_str_ = "Score"; + sp-> set_mus_property ("context-type", ly_str02scm ( "Score")); + } + | CLEF STRING ';' { + SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL); + SCM result = gh_call1 (func, $2); + + SCM l = SCM_EOL; + for (SCM s = result ; gh_pair_p (s); s = gh_cdr (s)) { + Music * p = new Music; + for (SCM k = gh_car (s) ; gh_pair_p (k); k = gh_cdr (k)) { + p->set_mus_property (gh_caar (k), gh_cdar (k)); + } + l = gh_cons (p->self_scm (), l); + scm_unprotect_object (p->self_scm ()); + } + Sequential_music * seq = new Sequential_music (l); + + Context_specced_music * sp = new Context_specced_music (seq); + $$ =sp ; + sp-> set_mus_property("context-type", ly_str02scm("Staff")); } ; command_req: - shorthand_command_req + shorthand_command_req { $$ = $1; } | verbose_command_req semicolon { $$ = $1; } ; @@ -963,11 +994,7 @@ shorthand_command_req: verbose_command_req: - - BAR STRING { - $$ = new Bar_req (ly_scm2string ($2)); - } - | COMMANDSPANREQUEST bare_int STRING { + COMMANDSPANREQUEST bare_int STRING { Span_req * sp_p = new Span_req; sp_p-> set_span_dir ( Direction($2)); sp_p->set_mus_property ("span-type",$3); @@ -1011,11 +1038,6 @@ verbose_command_req: | tempo_request { $$ = $1; } - | CLEF STRING { - $$ = new Clef_change_req; - $$->set_mus_property ("clef-type", $2); - - } | KEY { Key_change_req *key_p= new Key_change_req; $$ = key_p; diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index a510a141ff..3f09f169e1 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -134,7 +134,7 @@ Piano_pedal_engraver::do_process_music () { for (Pedal_info*p = info_list_; p->name_; p ++) { - SCM s = SCM_UNDEFINED; + SCM s = SCM_EOL; if (p->req_l_drul_[STOP] && p->req_l_drul_[START]) { if (!p->start_req_l_) diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index baddf06bb6..9861866e82 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -109,7 +109,7 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o SCM val = get_property (prop_sym); - if (val == SCM_UNDEFINED) + if (val == SCM_EOL) ; // Not defined in context. else if (gh_apply (type_p, scm_listify (val, SCM_UNDEFINED)) == SCM_BOOL_T) // defined and right type: do it @@ -135,16 +135,16 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o else /* - we don't print a warning if VAL == #f, because we would + we don't print a warning if VAL == (), because we would get lots of warnings when we restore stuff to default, eg. - slurDash = #1 [...] slurDash = ##f + slurDash = #1 [...] slurDash = () should not cause "type error: slurDash expects number not - boolean" + boolean */ - if (val != SCM_BOOL_F) + if (val != SCM_EOL) { // not the right type: error message. SCM errport = scm_current_error_port (); warning (_("Wrong type for property")); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index cf813de963..1b85d8113a 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -282,12 +282,12 @@ Translator_group::where_defined (SCM sym) const } /* - TODO: return SCM_EOL iso. SCM_UNDEFINED when not found. + return SCM_EOL when not found. */ SCM Translator_group::get_property (SCM sym) const { - SCM val =SCM_UNDEFINED; + SCM val =SCM_EOL; if (properties_dict ()->try_retrieve (sym, &val)) return val; @@ -322,10 +322,6 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va { SCM prev = get_property (prop); - /* - we don't tack onto SCM_UNDEFINED, because it creates - errors down the line, if we do scm_assoc(). - */ if (gh_pair_p (prev) || prev == SCM_EOL) { bool ok = true; @@ -333,6 +329,13 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va SCM errport = scm_current_error_port (); SCM meta = scm_assoc (ly_symbol2scm ("meta"), prev); + + /* + We're probably in a performer. + */ + if (!gh_pair_p (meta)) + return; + SCM props = scm_assoc (ly_symbol2scm ("properties"), gh_cdr (meta)); SCM type_p = scm_assoc (eltprop, gh_cdr (props)); if (!gh_pair_p (type_p)) @@ -348,7 +351,8 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va else { type_p = gh_cdr (type_p); - if (gh_call1 (type_p, val) == SCM_BOOL_F) + if (val != SCM_EOL + && gh_call1 (type_p, val) == SCM_BOOL_F) { ok = false; scm_puts (_("Failed typecheck for #'").ch_C (),errport); diff --git a/ly/engraver.ly b/ly/engraver.ly index 383bb18c8c..be2d0f15e7 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -366,59 +366,11 @@ ScoreContext = \translator { splitInterval = #'(0 . 1) changeMoment = #`(,(make-moment 0 0) . ,(make-moment 1 512)) - defaultClef = #"treble" - StaffMinimumVerticalExtent = #(cons -4.0 4.0) barAuto = ##t voltaVisibility = ##t % name, glyph id, clef position - supportedClefTypes = #'( - ("treble" . ("clefs-G" -2)) - ("violin" . ("clefs-G" -2)) - ("G" . ("clefs-G" -2)) - ("G2" . ("clefs-G" -2)) - ("french" . ("clefs-G" -4 )) - ("soprano" . ("clefs-C" -4 )) - ("mezzosoprano" . ("clefs-C" -2 )) - ("alto" . ("clefs-C" 0 )) - ("tenor" . ("clefs-C" 2 )) - ("baritone" . ("clefs-C" 4 )) - ("varbaritone" . ("clefs-F" 0)) - ("bass" . ("clefs-F" 2 )) - ("F" . ( "clefs-F" 2)) - ("subbass" . ("clefs-F" 4)) - ("vaticana_do1" . ("clefs-vaticana_do" -1)) - ("vaticana_do2" . ("clefs-vaticana_do" 1)) - ("vaticana_do3" . ("clefs-vaticana_do" 3)) - ("vaticana_fa1" . ("clefs-vaticana_fa" -1)) - ("vaticana_fa2" . ("clefs-vaticana_fa" 1)) - ("medicaea_do1" . ("clefs-medicaea_do" -1)) - ("medicaea_do2" . ("clefs-medicaea_do" 1)) - ("medicaea_do3" . ("clefs-medicaea_do" 3)) - ("medicaea_fa1" . ("clefs-medicaea_fa" -1)) - ("medicaea_fa2" . ("clefs-medicaea_fa" 1)) - ("hufnagel_do1" . ("clefs-hufnagel_do" -1)) - ("hufnagel_do2" . ("clefs-hufnagel_do" 1)) - ("hufnagel_do3" . ("clefs-hufnagel_do" 3)) - ("hufnagel_fa1" . ("clefs-hufnagel_fa" -1)) - ("hufnagel_fa2" . ("clefs-hufnagel_fa" 1)) - ("hufnagel" . ("clefs-hufnagel_do_fa" 4)) - ("mensural1_c1" . ("clefs-mensural1_c" -4)) - ("mensural1_c2" . ("clefs-mensural1_c" -2)) - ("mensural1_c3" . ("clefs-mensural1_c" 0)) - ("mensural1_c4" . ("clefs-mensural1_c" 2)) - ("mensural2_c1" . ("clefs-mensural2_c" -4)) - ("mensural2_c2" . ("clefs-mensural2_c" -2)) - ("mensural2_c3" . ("clefs-mensural2_c" 0)) - ("mensural2_c4" . ("clefs-mensural2_c" 2)) - ("mensural2_c5" . ("clefs-mensural2_c" 4)) - ("mensural3_c1" . ("clefs-mensural3_c" -2)) - ("mensural3_c2" . ("clefs-mensural3_c" 0)) - ("mensural3_c3" . ("clefs-mensural3_c" 2)) - ("mensural3_c4" . ("clefs-mensural3_c" 4)) - ("mensural_f" . ("clefs-mensural_f" 2)) - ) % where is c0 in this clef? clefPitches = #'(("clefs-G" . -4) ("clefs-C" . 0) @@ -435,9 +387,11 @@ ScoreContext = \translator { ("clefs-mensural3_c" . 0) ("clefs-mensural_f" . 0)) + clefGlyph = #"clefs-G" + clefPosition = #-2 + automaticPhrasing = ##t; alignmentReference = \down; - defaultClef = #"treble" defaultBarType = #"|" explicitClefVisibility = #all-visible diff --git a/scm/element-descriptions.scm b/scm/element-descriptions.scm index cb5f5438d1..9adc6639cb 100644 --- a/scm/element-descriptions.scm +++ b/scm/element-descriptions.scm @@ -302,6 +302,7 @@ (Y-offset-callbacks . (,Side_position::aligned_side)) (molecule-callback . ,Text_item::brew_molecule) (font-shape . italic) + (font-family . roman) (meta . ,(element-description "OctavateEight" text-interface font-interface )) )) diff --git a/scm/lily.scm b/scm/lily.scm index be6872c677..6876a9cb65 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -767,3 +767,80 @@ (eval-string (ly-gulp-file "chord-names.scm")) (eval-string (ly-gulp-file "element-descriptions.scm")) ) + + +;; +;; (name . (glyph clef-position octavation)) +;; -- the name clefOctavation is misleading the value 7 is 1 octave not 7 Octaves. +;; +(define supported-clefs '( + ("treble" . ("clefs-G" -2 0)) + ("violin" . ("clefs-G" -2 0)) + ("G" . ("clefs-G" -2 0)) + ("G2" . ("clefs-G" -2 0)) + ("french" . ("clefs-G" -4 0)) + ("soprano" . ("clefs-C" -4 0)) + ("mezzosoprano" . ("clefs-C" -2 0)) + ("alto" . ("clefs-C" 0 0)) + ("tenor" . ("clefs-C" 2 0)) + ("baritone" . ("clefs-C" 4 0)) + ("varbaritone" . ("clefs-F" 0 0)) + ("bass" . ("clefs-F" 2 0)) + ("F" . ( "clefs-F" 2 0)) + ("subbass" . ("clefs-F" 4 0)) + + ;; should move mensural stuff to separate file? + ("vaticana_do1" . ("clefs-vaticana_do" -1 0)) + ("vaticana_do2" . ("clefs-vaticana_do" 1 0)) + ("vaticana_do3" . ("clefs-vaticana_do" 3 0)) + ("vaticana_fa1" . ("clefs-vaticana_fa" -1 0)) + ("vaticana_fa2" . ("clefs-vaticana_fa" 1 0)) + ("medicaea_do1" . ("clefs-medicaea_do" -1 0)) + ("medicaea_do2" . ("clefs-medicaea_do" 1 0)) + ("medicaea_do3" . ("clefs-medicaea_do" 3 0)) + ("medicaea_fa1" . ("clefs-medicaea_fa" -1 0)) + ("medicaea_fa2" . ("clefs-medicaea_fa" 1 0)) + ("hufnagel_do1" . ("clefs-hufnagel_do" -1 0)) + ("hufnagel_do2" . ("clefs-hufnagel_do" 1 0)) + ("hufnagel_do3" . ("clefs-hufnagel_do" 3 0)) + ("hufnagel_fa1" . ("clefs-hufnagel_fa" -1 0)) + ("hufnagel_fa2" . ("clefs-hufnagel_fa" 1 0)) + ("hufnagel" . ("clefs-hufnagel_do_fa" 4 0)) + ("mensural1_c1" . ("clefs-mensural1_c" -4 0)) + ("mensural1_c2" . ("clefs-mensural1_c" -2 0)) + ("mensural1_c3" . ("clefs-mensural1_c" 0 0)) + ("mensural1_c4" . ("clefs-mensural1_c" 2 0)) + ("mensural2_c1" . ("clefs-mensural2_c" -4 0)) + ("mensural2_c2" . ("clefs-mensural2_c" -2 0)) + ("mensural2_c3" . ("clefs-mensural2_c" 0 0)) + ("mensural2_c4" . ("clefs-mensural2_c" 2 0)) + ("mensural2_c5" . ("clefs-mensural2_c" 4 0)) + ("mensural3_c1" . ("clefs-mensural3_c" -2 0)) + ("mensural3_c2" . ("clefs-mensural3_c" 0 0)) + ("mensural3_c3" . ("clefs-mensural3_c" 2 0)) + ("mensural3_c4" . ("clefs-mensural3_c" 4 0)) + ("mensural_f" . ("clefs-mensural_f" 2 0)) + ) +) + +(define (clef-name-to-properties cl) + (let ((e (assoc cl supported-clefs)) + ) + (if (pair? e) + `(((symbol . clefGlyph) + (type . property-set) + (value . ,(cadr e)) + ) + ((symbol . clefPosition) + (type . property-set) + (value . ,(caddr e)) + ) + ((symbol . clefOctavation) + (type . property-set) + (value . ,(caddr (cdr e))) + ) + ) + (begin + (ly-warn (string-append "Unknown clef type `" cl "'\nSee scm/lily.scm for supported clefs")) + '()) + ))) diff --git a/scm/translator-description.scm b/scm/translator-description.scm index 61badb5ef9..ee58d6ba18 100644 --- a/scm/translator-description.scm +++ b/scm/translator-description.scm @@ -148,14 +148,13 @@ given in an @code{\alternative}. "Determine and set reference point for pitches" '(Clef OctavateEight) (list - (translator-property-description 'supportedClefTypes - list? "Clef settings supported. The value is an association list contain entries (NAME . (GLYPH . POSITION)), where NAME is the clef name (alto, baritone, etc.), GLYPH the glyph name, POSITION an integer where the center symbol should go.") - (translator-property-description 'clefPosition number? " where the center of the symbol should go") - (translator-property-description 'clefGlyph string? "name of the symbol within the music font") - (translator-property-description 'centralCPosition number? "place of the central C. ") - (translator-property-description 'defaultClef string? "generate this clef at the very start of this staff. If not set, don't generate a clef") - (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clefs entered as \clef.") - (translator-property-description 'clefPitches list? "alist mapping GLYPHNAME to the position of the central C for that symbol") + (translator-property-description 'clefPosition number? "Where should the center of the symbol go?") + (translator-property-description 'clefGlyph string? "Name of the symbol within the music font") + (translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.") + (translator-property-description 'clefOctavation integer? "Add +this much extra octavation. Values of 7 and -7 are common.") + (translator-property-description 'explicitClefVisibility procedure? "visibility-lambda function for clef changes.") + (translator-property-description 'clefPitches list? "an alist mapping GLYPHNAME to the position of the central C for that symbol") ))) -- 2.39.5