From: Han-Wen Nienhuys Date: Wed, 23 Aug 2006 21:19:36 +0000 (+0000) Subject: * scm/define-context-properties.scm X-Git-Tag: release/2.10.0-2~361 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f5b1f319b1b5b7517972dfebdac2292a99531d67;p=lilypond.git * scm/define-context-properties.scm (translator-property-description): robustness: detect type errors in property definitions. * lily/parser.yy (score_body): protect SCORE_IDENTIFIER result after getting it from SCM. * lily/parser.yy (Lily_lexer::try_special_identifiers): unprotect clones after creation. This plugs a huge memory leak. --- diff --git a/ChangeLog b/ChangeLog index 5fefaf8d20..6b309f37da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-08-23 Han-Wen Nienhuys + * scm/define-context-properties.scm + (translator-property-description): robustness: detect type errors + in property definitions. + + * lily/parser.yy (score_body): protect SCORE_IDENTIFIER result + after getting it from SCM. + * lily/smobs.cc (protect_smob): switch off fancy smob protection for now. diff --git a/input/les-nereides.ly b/input/les-nereides.ly index c987b46d5a..ea0943c700 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -1,4 +1,4 @@ -\version "2.7.39" +\version "2.9.16" \header { composer = "ARTHUR GRAY" diff --git a/input/manual/screech-boink.ly b/input/manual/screech-boink.ly index 7528ce7e51..7b11aa079f 100644 --- a/input/manual/screech-boink.ly +++ b/input/manual/screech-boink.ly @@ -1,4 +1,4 @@ -\version "2.7.39" +\version "2.9.16" \header { title = "Screech and boink" subtitle = "Random complex notation" @@ -51,7 +51,15 @@ >> } >> - \midi { \tempo 8 = 60 } + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 60 8) + } + } + + \layout { ragged-right = ##t diff --git a/input/no-notation/display-lily-tests.ly b/input/no-notation/display-lily-tests.ly index 8c99abf835..5b931ad495 100644 --- a/input/no-notation/display-lily-tests.ly +++ b/input/no-notation/display-lily-tests.ly @@ -1,4 +1,4 @@ -\version "2.9.5" +\version "2.9.16" #(use-modules (srfi srfi-13) (ice-9 format)) diff --git a/input/no-notation/dynamic-absolute-volume.ly b/input/no-notation/dynamic-absolute-volume.ly index 6a6397c54c..c91d8a02bf 100644 --- a/input/no-notation/dynamic-absolute-volume.ly +++ b/input/no-notation/dynamic-absolute-volume.ly @@ -1,5 +1,5 @@ -\version "2.7.39" +\version "2.9.16" \header { texidoc = "@cindex Dynamic Absolute Volume Absolute dynamics have an effect on MIDI files. @@ -21,8 +21,14 @@ a\fff a\sf } \layout{ ragged-right = ##t } -\midi{ -\tempo 1 = 60 -} + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 60 1) + } + } + + } diff --git a/input/no-notation/midi-volume-equaliser.ly b/input/no-notation/midi-volume-equaliser.ly index a8dbfa7451..d577ebd256 100644 --- a/input/no-notation/midi-volume-equaliser.ly +++ b/input/no-notation/midi-volume-equaliser.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.7.39" +\version "2.9.16" \header { texidoc = "@cindex Midi Volume Equaliser The full orchestra plays a notes, where groups stop one after @@ -23,32 +23,32 @@ Override, see scm/midi.scm: flauti = \relative c' { \set Staff.midiInstrument = #"flute" - \set Staff.instrument = #"2 Flauti" - \set Staff.instr = #"Fl." + \set Staff.instrumentName = #"2 Flauti" + \set Staff.shortInstrumentName = #"Fl." c1\f R1*10 } oboi = \relative c' { \set Staff.midiInstrument = #"oboe" - \set Staff.instrument = #"2 Oboi" - \set Staff.instr = #"Ob." + \set Staff.instrumentName = #"2 Oboi" + \set Staff.shortInstrumentName = #"Ob." R1*1 c1\f R1*9 } clarinetti = \relative c' { \set Staff.midiInstrument = #"clarinet" - \set Staff.instrument = #"Clarinetti" - \set Staff.instr = #"Cl" + \set Staff.instrumentName = #"Clarinetti" + \set Staff.shortInstrumentName = #"Cl" R1*2 c1\f R1*8 } fagotti = \relative c' { \set Staff.midiInstrument = #"bassoon" - \set Staff.instrument = #"2 Fagotti" - \set Staff.instr = #"Fg." + \set Staff.instrumentName = #"2 Fagotti" + \set Staff.shortInstrumentName = #"Fg." \clef bass R1*3 c1\f R1*7 @@ -56,16 +56,16 @@ fagotti = \relative c' { corni = \relative c' { \set Staff.midiInstrument = #"french horn" - \set Staff.instrument = #"Corni" - \set Staff.instr = #"Cor" + \set Staff.instrumentName = #"Corni" + \set Staff.shortInstrumentName = #"Cor" R1*4 c1\f R1*6 } trombe = \relative c' { \set Staff.midiInstrument = #"trumpet" - \set Staff.instrument = #"Trombe" - \set Staff.instr = #"Tp." + \set Staff.instrumentName = #"Trombe" + \set Staff.shortInstrumentName = #"Tp." \clef bass R1*5 c1\f R1*5 @@ -73,32 +73,32 @@ trombe = \relative c' { timpani = \relative c' { \set Staff.midiInstrument = #"timpani" - \set Staff.instrument = #"Timpani" - \set Staff.instr = #"Timp." + \set Staff.instrumentName = #"Timpani" + \set Staff.shortInstrumentName = #"Timp." R1*6 c1\f R1*4 } violinoI = \relative c' { \set Staff.midiInstrument = #"violin" - \set Staff.instrument = #"Violino I " - \set Staff.instr = #"Vl. I " + \set Staff.instrumentName = #"Violino I " + \set Staff.shortInstrumentName = #"Vl. I " R1*7 c1\f R1*3 } violinoII = \relative c' { \set Staff.midiInstrument = #"violin" - \set Staff.instrument = #"Violino II " - \set Staff.instr = #"Vl. II " + \set Staff.instrumentName = #"Violino II " + \set Staff.shortInstrumentName = #"Vl. II " R1*8 c1\f R1*2 } viola = \relative c' { \set Staff.midiInstrument = #"viola" - \set Staff.instrument = #"Viola" - \set Staff.instr = #"Vla." + \set Staff.instrumentName = #"Viola" + \set Staff.shortInstrumentName = #"Vla." \clef alto R1*9 c1\f R1*1 @@ -107,8 +107,8 @@ viola = \relative c' { violoncello = \relative c' { \set Staff.midiInstrument = #"cello" %\set Staff.midiInstrument = #"contrabass" - \set Staff.instrument = #"Violoncello" - \set Staff.instr = #"Vc." + \set Staff.instrumentName = #"Violoncello" + \set Staff.shortInstrumentName = #"Vc." \clef bass R1*10 c1\f @@ -153,9 +153,15 @@ violoncello = \relative c' { \RemoveEmptyStaffContext } } + \midi { - \tempo 1 = 60 - } + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 60 1) + } + } + + } diff --git a/input/regression/drums.ly b/input/regression/drums.ly index c5a24aeb09..908514a56d 100644 --- a/input/regression/drums.ly +++ b/input/regression/drums.ly @@ -7,7 +7,7 @@ } -\version "2.9.13" +\version "2.9.16" drh = \drummode { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 } drl = \drummode {\repeat "unfold" 3 {bd4 sn8 bd bd4 << bd ss >> } bd8 tommh tommh bd toml toml bd tomfh16 tomfh } @@ -34,7 +34,15 @@ timb = \drummode { \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r \layout {} %% broken: - \midi{ \tempo 4=120 } + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 120 4) + } + } + + } diff --git a/input/regression/metronome-marking.ly b/input/regression/metronome-marking.ly index e8bf64e0cb..e6b9efd2f8 100644 --- a/input/regression/metronome-marking.ly +++ b/input/regression/metronome-marking.ly @@ -14,7 +14,7 @@ The marking is left aligned with the time signature, if there is one. \layout { ragged-right = ##t } -\version "2.7.39" +\version "2.9.16" \relative c'' { \tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1 diff --git a/input/sakura-sakura.ly b/input/sakura-sakura.ly index 4a617fce5f..d178f2241e 100644 --- a/input/sakura-sakura.ly +++ b/input/sakura-sakura.ly @@ -1,6 +1,6 @@ %% sakura-sakura.ly -\version "2.7.39" +\version "2.9.16" \header { @@ -50,7 +50,15 @@ } >> \layout { } - \midi { \tempo 4=120 } + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 120 4) + } + } + + } %%% Local Variables: diff --git a/input/test/extra-staff.ly b/input/test/extra-staff.ly index 71a54da3f2..0cba000abd 100644 --- a/input/test/extra-staff.ly +++ b/input/test/extra-staff.ly @@ -1,5 +1,5 @@ -\version "2.7.39" +\version "2.9.16" % definitely wil be renamed to something. %{ diff --git a/input/test/music-box.ly b/input/test/music-box.ly index 9d8fe6fabd..af8efd382b 100644 --- a/input/test/music-box.ly +++ b/input/test/music-box.ly @@ -1,4 +1,4 @@ -\version "2.9.7" +\version "2.9.16" \sourcefilename "music-box.ly" \include "deutsch.ly" @@ -133,8 +133,14 @@ prelude = line-width = 18.0 \cm } - \midi { - \tempo 4 = 80 - } + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 80 4) + } + } + + } diff --git a/input/test/staff-container.ly b/input/test/staff-container.ly index 31495ac7c3..5a3e3419e1 100644 --- a/input/test/staff-container.ly +++ b/input/test/staff-container.ly @@ -1,4 +1,4 @@ -\version "2.7.39" +\version "2.9.16" \header { diff --git a/input/test/temporary-stave.ly b/input/test/temporary-stave.ly index 8283c03860..5dd7d1bf58 100644 --- a/input/test/temporary-stave.ly +++ b/input/test/temporary-stave.ly @@ -1,5 +1,5 @@ -\version "2.7.39" +\version "2.9.16" \header { diff --git a/input/test/time-signature-staff.ly b/input/test/time-signature-staff.ly index f9aa6baab2..089b36e355 100644 --- a/input/test/time-signature-staff.ly +++ b/input/test/time-signature-staff.ly @@ -6,7 +6,7 @@ used contemporary pieces with many time signature changes. " } -\version "2.7.39" +\version "2.9.16" \layout { ragged-right = ##T } diff --git a/input/typography-demo.ly b/input/typography-demo.ly index e56612f84b..0683bced63 100644 --- a/input/typography-demo.ly +++ b/input/typography-demo.ly @@ -8,7 +8,7 @@ heavily mutilated Edition Peters Morgenlied by Schubert" } -\version "2.9.13" +\version "2.9.16" ignoreMelisma = \set ignoreMelismata = ##t ignoreMelismaOff = \unset ignoreMelismata @@ -162,9 +162,15 @@ pianoLH = \relative c'' \repeat volta 2\new Voice { \override VerticalAlignment #'forced-distance = #10 } } - \midi { - \tempo 4 = 70 + + \midi { + \context { + \Score + tempoWholesPerMinute = #(ly:make-moment 70 4) } } + + + } } diff --git a/lily/parser.yy b/lily/parser.yy index c9dbb79f98..52356a44d0 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -694,6 +694,7 @@ score_body: } | SCORE_IDENTIFIER { $$ = unsmob_score ($1); + $$->protect (); $$->set_spot (@$); } | score_body object_id_setting { diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index caaa39c704..2eee74626a 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -9,8 +9,15 @@ (define-public all-translation-properties '()) (define (translator-property-description symbol type? description) - (if (not (equal? #f (object-property symbol 'translation-doc))) - (ly:error (_ "symbol ~S redefined" symbol))) + (if (not (and + (symbol? symbol) + (procedure? type?) + (string? description))) + (throw 'init-format-error)) + + + (if (not (equal? #f (object-property symbol 'translation-doc))) + (ly:error (_ "symbol ~S redefined" symbol))) (set-object-property! symbol 'translation-type? type?) (set-object-property! symbol 'translation-doc description) @@ -472,9 +479,9 @@ Example: This will create a start-repeat bar in this staff only. Valid values are described in @internalsref{bar-line-interface}. ") - (tempoWholesPerMinute 'ly:moment? "The tempo in whole notes per minute.") - (tempoUnitDuration 'ly:duration? "Unit for specifying tempo.") - (tempoUnitCount 'number? "Count for specifying tempo.") + (tempoWholesPerMinute ,ly:moment? "The tempo in whole notes per minute.") + (tempoUnitDuration ,ly:duration? "Unit for specifying tempo.") + (tempoUnitCount ,number? "Count for specifying tempo.") )))