From: fred Date: Wed, 27 Mar 2002 02:03:50 +0000 (+0000) Subject: lilypond-1.5.19 X-Git-Tag: release/1.5.59~420 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d2c167f381b9f3f9ef8751c466c57bc14b69d02b;p=lilypond.git lilypond-1.5.19 --- diff --git a/input/test/cautionaries.ly b/input/test/cautionaries.ly new file mode 100644 index 0000000000..e4f4161295 --- /dev/null +++ b/input/test/cautionaries.ly @@ -0,0 +1,15 @@ +\version "1.5.17" + +\score { \notes \context Staff \transpose c''' { + \key d \major + \property Staff.autoReminders = #'cautionary + \property Staff.Accidentals \override #'font-relative-size = #0 + cis2 d + \property Staff.Accidentals \override #'cautionary-size = #-1 + cis2 d + \property Staff.Accidentals \override #'paren-cautionaries = ##f + cis2 d + +} +} + diff --git a/input/test/drums.ly b/input/test/drums.ly index 93a0a9e700..f329913966 100644 --- a/input/test/drums.ly +++ b/input/test/drums.ly @@ -4,7 +4,7 @@ \include "drumpitch-init.ly" -\version "1.3.146" +\version "1.5.1" drh = \notes { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 } drl = \notes {\repeat "unfold" 3 {bd4 sn8 bd bd4 } bd8 tommh tommh bd toml toml bd tomfh16 tomfh } diff --git a/input/test/music-box.ly b/input/test/music-box.ly index 2ff6c639e4..de0b47e9f0 100644 --- a/input/test/music-box.ly +++ b/input/test/music-box.ly @@ -22,6 +22,7 @@ using Scheme functions to save typing work. } \include "deutsch.ly" +\version "1.5.18" #(define (transform music) (let* ((es (ly-get-mus-property music 'elements)) @@ -48,25 +49,13 @@ using Scheme functions to save typing work. #(define ((trans pitches) music) (let* ((es (ly-get-mus-property music 'elements)) (e (ly-get-mus-property music 'element)) - (p (ly-get-mus-property music 'pitch)) - (body (ly-get-mus-property music 'body)) - (alts (ly-get-mus-property music 'alternatives))) + (p (ly-get-mus-property music 'pitch))) (if (pair? es) (ly-set-mus-property music 'elements (map (trans pitches) es))) - (if (music? alts) - (ly-set-mus-property - music 'alternatives - ((trans pitches) alts))) - - (if (music? body) - (ly-set-mus-property - music 'body - ((trans pitches) body))) - (if (music? e) (ly-set-mus-property music 'element diff --git a/input/test/smart-transpose.ly b/input/test/smart-transpose.ly index 24d70d3cb1..3674d81008 100644 --- a/input/test/smart-transpose.ly +++ b/input/test/smart-transpose.ly @@ -1,4 +1,4 @@ -\version "1.3.146" +\version "1.5.18" \header { texidoc=" @@ -42,25 +42,13 @@ how useful these enharmonic modifications are. Mats B. #(define (simplify music) (let* ((es (ly-get-mus-property music 'elements)) (e (ly-get-mus-property music 'element)) - (p (ly-get-mus-property music 'pitch)) - (body (ly-get-mus-property music 'body)) - (alts (ly-get-mus-property music 'alternatives))) + (p (ly-get-mus-property music 'pitch))) (if (pair? es) (ly-set-mus-property music 'elements (map (lambda (x) (simplify x)) es))) - (if (music? alts) - (ly-set-mus-property - music 'alternatives - (simplify alts))) - - (if (music? body) - (ly-set-mus-property - music 'body - (simplify body))) - (if (music? e) (ly-set-mus-property music 'element diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index e9daee13c3..cb87b5edb3 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -39,7 +39,6 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void stop_translation_timestep (); virtual void initialize (); - virtual int number_accidentals (SCM sig, Note_req *); virtual void create_grobs (); virtual void finalize (); public: @@ -74,17 +73,18 @@ Accidental_engraver::initialize () daddy_trans_l_->set_property ("lazyKeySignature", last_keysig_); } -/** calculates the number of accidentals on basis of the current local time sig +/** calculates the number of accidentals on basis of the current local key sig * (passed as argument). * Returns number of accidentals (0, 1 or 2). * Negative (-1 or -2) if accidental has changed. **/ -int -Accidental_engraver::number_accidentals (SCM sig, Note_req * note_l) +static int +number_accidentals (SCM sig, Note_req * note_l) { - int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_; - int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ; - int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_; + Pitch *pitch = unsmob_pitch (note_l->get_mus_property ("pitch")); + int n = pitch->notename_i_; + int o = pitch->octave_i () ; + int a = pitch->alteration_i_; SCM prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), sig); if (prev == SCM_BOOL_F) @@ -189,20 +189,21 @@ Accidental_engraver::create_grobs () always do the correct thing? (???? -Rune ) */ - int n = unsmob_pitch (note_l->get_mus_property ("pitch"))->notename_i_; - int o = unsmob_pitch (note_l->get_mus_property ("pitch"))->octave_i () ; - int a = unsmob_pitch (note_l->get_mus_property ("pitch"))->alteration_i_; - SCM ON = gh_cons (gh_int2scm (o), gh_int2scm (n)); + + Pitch *pitch = unsmob_pitch (note_l->get_mus_property ("pitch")); + int n = pitch->notename_i_; + int o = pitch->octave_i () ; + int a = pitch->alteration_i_; + SCM on = gh_cons (gh_int2scm (o), gh_int2scm (n)); bool forget = to_boolean (get_property ("forgetAccidentals")); if (tie_changes) { /* Remember an alteration that is different both from that of the tied note and of the key signature. - (????? -Rune ) */ - localsig = scm_assoc_set_x (localsig, ON, SCM_BOOL_T); - lazysig = scm_assoc_set_x (lazysig, ON, SCM_BOOL_T); + localsig = scm_assoc_set_x (localsig, on, SCM_BOOL_T); + lazysig = scm_assoc_set_x (lazysig, on, SCM_BOOL_T); } else if (!forget) { @@ -210,8 +211,8 @@ Accidental_engraver::create_grobs () not really really correct if there are more than one noteheads with the same notename. */ - localsig = scm_assoc_set_x (localsig, ON, gh_int2scm (a)); - lazysig = scm_assoc_set_x (lazysig, ON, gh_int2scm (a)); + localsig = scm_assoc_set_x (localsig, on, gh_int2scm (a)); + lazysig = scm_assoc_set_x (lazysig, on, gh_int2scm (a)); } } @@ -319,5 +320,5 @@ events. Due to interaction with ties (which don't come together with note heads), this needs to be in a context higher than Tie_engraver. FIXME", /* creats*/ "Accidentals", /* acks */ "rhythmic-head-interface tie-interface arpeggio-interface", -/* reads */ "localKeySignature forgetAccidentals noResetKey", +/* reads */ "localKeySignature forgetAccidentals noResetKey autoReminders", /* write */ ""); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 2044f88500..8d13e857df 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -61,6 +61,8 @@ private: Moment extend_mom_; Moment beam_start_moment_; Moment beam_start_location_; + + bool subdivide_beams_; // We act as if beam were created, and start a grouping anyway. Beaming_info_list*grouping_p_; @@ -247,8 +249,7 @@ Auto_beam_engraver::begin_beam () grouping_p_ = new Beaming_info_list; beam_start_moment_ = now_mom (); beam_start_location_ = *unsmob_moment (get_property ("measurePosition")); - - + subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); } @@ -292,7 +293,7 @@ Auto_beam_engraver::typeset_beam () if (finished_beam_p_) { finished_grouping_p_->beamify(*unsmob_moment (get_property ("beatLength")), - (bool)gh_scm2bool(get_property("subdivideBeams"))); + subdivide_beams_); Beam::set_beaming (finished_beam_p_, finished_grouping_p_); typeset_grob (finished_beam_p_); finished_beam_p_ = 0; @@ -480,5 +481,5 @@ stemRightBeamCount. ", /* creats*/ "Beam", /* acks */ "stem-interface rest-interface beam-interface bar-line-interface", -/* reads */ "noAutoBeaming autoBeamSettings", +/* reads */ "noAutoBeaming autoBeamSettings subdivideBeams", /* write */ ""); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index b9e7eb63fe..e17a1e8e73 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -38,7 +38,9 @@ class Beam_engraver : public Engraver /// moment (global time) where beam started. Moment beam_start_mom_; - + + bool subdivide_beams_; + void typeset_beam (); void set_melisma (bool); protected: @@ -63,6 +65,7 @@ Beam_engraver::Beam_engraver () beam_info_p_ =0; reqs_drul_[LEFT] = reqs_drul_[RIGHT] =0; prev_start_req_ =0; + } bool @@ -182,7 +185,7 @@ Beam_engraver::typeset_beam () if (finished_beam_p_) { finished_beam_info_p_->beamify(*unsmob_moment (get_property ("beatLength")), - (bool)gh_scm2bool(get_property("subdivideBeams"))); + subdivide_beams_); Beam::set_beaming (finished_beam_p_, finished_beam_info_p_); typeset_grob (finished_beam_p_); @@ -204,6 +207,7 @@ Beam_engraver::start_translation_timestep () if (to_boolean (m) && to_boolean (b)) { set_melisma (true); } + subdivide_beams_ = gh_scm2bool(get_property("subdivideBeams")); } } @@ -292,5 +296,5 @@ ENTER_DESCRIPTION(Beam_engraver, printed with flags instead of beams.", /* creats*/ "Beam", /* acks */ "stem-interface rest-interface", -/* reads */ "beamMelismaBusy", +/* reads */ "beamMelismaBusy subdivideBeams", /* write */ ""); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 1ffc2c696c..52e7a65f77 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -171,8 +171,20 @@ Local_key_item::brew_molecule (SCM smob) oct_b = true; } + lastoct = p.octave_i () ; + bool cautionary = (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F); + SCM font_rel_siz = me->get_grob_property("font-relative-size"); + SCM caut_siz = me->get_grob_property("cautionary-size"); + int frs = (gh_exact_p(font_rel_siz) ? gh_scm2int(font_rel_siz) : 0); + int cs = (gh_exact_p(caut_siz) ? gh_scm2int(caut_siz) : 0); + + + // Ugh. This will only work if only called once on each grob. --rz + if (cautionary && caut_siz!=0) + me->set_grob_property ("font-relative-size",gh_int2scm(frs+cs)); + SCM c0 = me->get_grob_property ("c0-position"); Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_) * note_distance; @@ -189,8 +201,8 @@ Local_key_item::brew_molecule (SCM smob) acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0); } - if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F) - acc = parenthesize (me, acc); + if (cautionary && to_boolean(me->get_grob_property("paren-cautionaries"))) + acc = parenthesize (me, acc); acc.translate_axis (dy, Y_AXIS); octave_mol.add_at_edge (X_AXIS, RIGHT, acc, 0); diff --git a/ly/drumpitch-init.ly b/ly/drumpitch-init.ly index b55e8bb1f4..211246f081 100644 --- a/ly/drumpitch-init.ly +++ b/ly/drumpitch-init.ly @@ -47,7 +47,7 @@ (mutehiconga cghm ,(make-pitch 0 1 0)) (openhiconga cgho ,(make-pitch 0 1 1)) (hiconga cgh ,(make-pitch 0 2 -1)) - (openloconga cglo ,(make-pitch 0 1 2)) + (openloconga cglo ,(make-pitch 0 1 2)) (loconga cgl ,(make-pitch 0 2 0)) (hitimbale timh ,(make-pitch 0 3 0)) (lotimbale timl ,(make-pitch 0 3 1)) diff --git a/scm/music-property-description.scm b/scm/music-property-description.scm index 39957ee441..8914c5c3db 100644 --- a/scm/music-property-description.scm +++ b/scm/music-property-description.scm @@ -27,7 +27,6 @@ (music-property-description 'span-type symbol? "What kind of spanner should be created?") (music-property-description 'articulation-type symbol? "key for scriptDefinitions alist") (music-property-description 'bass boolean? "Set if this note is a bass note in a chord") -(music-property-description 'body music? "The body of a repeat ") (music-property-description 'cautionary boolean? "If set, this alteration needs cautionary accidental") (music-property-description 'change-to-id string? "name of the context to change to ") (music-property-description 'change-to-type string? "type of the context to change to.")