(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.
17 files changed:
2006-08-23 Han-Wen Nienhuys <hanwen@lilypond.org>
2006-08-23 Han-Wen Nienhuys <hanwen@lilypond.org>
+ * 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.
* lily/smobs.cc (protect_smob): switch off fancy smob protection
for now.
\header {
composer = "ARTHUR GRAY"
\header {
composer = "ARTHUR GRAY"
\header {
title = "Screech and boink"
subtitle = "Random complex notation"
\header {
title = "Screech and boink"
subtitle = "Random complex notation"
- \midi { \tempo 8 = 60 }
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 60 8)
+ }
+ }
+
+
\layout {
ragged-right = ##t
\layout {
ragged-right = ##t
#(use-modules (srfi srfi-13)
(ice-9 format))
#(use-modules (srfi srfi-13)
(ice-9 format))
\header {
texidoc = "@cindex Dynamic Absolute Volume
Absolute dynamics have an effect on MIDI files.
\header {
texidoc = "@cindex Dynamic Absolute Volume
Absolute dynamics have an effect on MIDI files.
a\sf
}
\layout{ ragged-right = ##t }
a\sf
}
\layout{ ragged-right = ##t }
-\midi{
-\tempo 1 = 60
-}
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 60 1)
+ }
+ }
+
+
#(ly:set-option 'old-relative)
#(ly:set-option 'old-relative)
\header {
texidoc = "@cindex Midi Volume Equaliser
The full orchestra plays a notes, where groups stop one after
\header {
texidoc = "@cindex Midi Volume Equaliser
The full orchestra plays a notes, where groups stop one after
flauti = \relative c' {
\set Staff.midiInstrument = #"flute"
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"
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"
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"
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
\clef bass
R1*3 c1\f R1*7
corni = \relative c' {
\set Staff.midiInstrument = #"french horn"
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"
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
\clef bass
R1*5 c1\f R1*5
timpani = \relative c' {
\set Staff.midiInstrument = #"timpani"
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"
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"
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"
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
\clef alto
R1*9 c1\f R1*1
violoncello = \relative c' {
\set Staff.midiInstrument = #"cello"
%\set Staff.midiInstrument = #"contrabass"
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."
\RemoveEmptyStaffContext
}
}
\RemoveEmptyStaffContext
}
}
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 60 1)
+ }
+ }
+
+
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 }
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 }
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 120 4)
+ }
+ }
+
+
\layout { ragged-right = ##t }
\layout { ragged-right = ##t }
\relative c'' {
\tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1
\relative c'' {
\tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 120 4)
+ }
+ }
+
+
% definitely wil be renamed to something.
%{
% definitely wil be renamed to something.
%{
\sourcefilename "music-box.ly"
\include "deutsch.ly"
\sourcefilename "music-box.ly"
\include "deutsch.ly"
- \midi {
- \tempo 4 = 80
- }
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 80 4)
+ }
+ }
+
+
used contemporary pieces with many time signature changes. "
}
used contemporary pieces with many time signature changes. "
}
\layout {
ragged-right = ##T
}
\layout {
ragged-right = ##T
}
ignoreMelisma = \set ignoreMelismata = ##t
ignoreMelismaOff = \unset ignoreMelismata
ignoreMelisma = \set ignoreMelismata = ##t
ignoreMelismaOff = \unset ignoreMelismata
\override VerticalAlignment #'forced-distance = #10
}
}
\override VerticalAlignment #'forced-distance = #10
}
}
- \midi {
- \tempo 4 = 70
+
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 70 4)
}
| SCORE_IDENTIFIER {
$$ = unsmob_score ($1);
}
| SCORE_IDENTIFIER {
$$ = unsmob_score ($1);
$$->set_spot (@$);
}
| score_body object_id_setting {
$$->set_spot (@$);
}
| score_body object_id_setting {
(define-public all-translation-properties '())
(define (translator-property-description symbol type? description)
(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)
(set-object-property! symbol 'translation-type? type?)
(set-object-property! symbol 'translation-doc description)
This will create a start-repeat bar in this staff only.
Valid values are described in @internalsref{bar-line-interface}.
")
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.")