From e5d4b954879f39b018414cd2cb0a043e095089d9 Mon Sep 17 00:00:00 2001 From: hanwen Date: Thu, 17 Jul 2003 14:52:02 +0000 Subject: [PATCH] * input/test/staff-container.ly: update file * input/test/stem.ly: remove * lily/event.cc (LY_DEFINE): add ly: prefix. --- ChangeLog | 6 ++++ input/test/staff-bracket.ly | 19 ++++------- input/test/staff-container.ly | 53 ++++++++++++++++++++++------- input/test/staff-size.ly | 10 +++--- input/test/stem.ly | 63 ----------------------------------- input/test/time.ly | 19 +++++++---- input/test/timing.ly | 4 ++- input/test/trills.ly | 2 +- input/test/vertical-extent.ly | 9 ++--- lily/event.cc | 8 ++--- lily/include/event.hh | 2 +- lily/key-performer.cc | 2 +- lily/music-iterator.cc | 11 ++++-- lily/sequential-iterator.cc | 2 +- scm/define-music-types.scm | 11 +++++- scm/music-functions.scm | 7 ++++ 16 files changed, 112 insertions(+), 116 deletions(-) delete mode 100644 input/test/stem.ly diff --git a/ChangeLog b/ChangeLog index 0feb5c81f2..5a53f5dd0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2003-07-17 Han-Wen Nienhuys + * input/test/staff-container.ly: update file + + * input/test/stem.ly: remove + + * lily/event.cc (LY_DEFINE): add ly: prefix. + * input/test/clef-manual-control.ly: from manual-clef * input/test/repeat-shorter-bracket.ly: move from coda-kludge diff --git a/input/test/staff-bracket.ly b/input/test/staff-bracket.ly index 015c1cb85f..b8db965e89 100644 --- a/input/test/staff-bracket.ly +++ b/input/test/staff-bracket.ly @@ -6,26 +6,21 @@ Here's an example of staff brackets. " \score { - \context StaffGroup = a < - % this is broken until further notice -- see refman - % \property Staff.StaffSymbol \override #'line-count = #4 - \context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) - #'line-count = #4 - \context PianoStaff = b < - \context Staff = "c" \notes\relative c'' { b1 } - \context Staff = "d" \notes\relative c'' { b1 } - > + \context StaffGroup = "a" \notes \relative c'' < + \context Staff = "a" { b1 } + \context PianoStaff = "b" < + \context Staff = "c" \notes { b1 } + \context Staff = "d" \notes { b1 } + > > \paper { - indent=100.0\mm - linewidth=150.0\mm \translator { \StaffContext \consists Instrument_name_engraver } - raggedright=##t + raggedright=##t } } diff --git a/input/test/staff-container.ly b/input/test/staff-container.ly index acd307e6b8..4c4f628b7f 100644 --- a/input/test/staff-container.ly +++ b/input/test/staff-container.ly @@ -1,18 +1,43 @@ \version "1.7.18" -\header { texidoc = "@cindex Staff Container -By splitting the grouping (Axis_group_engraver) and -creation functionality into separate contexts, you can override -interesting things. You can also drop the \consistsend feature. " -} +\header { + + texidoc = " + +Container By splitting the grouping (Axis_group_engraver) and creation +functionality into separate contexts, you can override interesting +things. + +Notation like this is used in modern scores. Note that Lilypond is not +especially prepared for it: the clefs and time-signatures don't do +what you would expect. + + " + + } + +%% +%% s4 would create a staff. +%% +quarterSkip = #(make-nonevent-skip (ly:make-duration 2 0)) + \score { - \notes < - \context StaffContainer = SA { \property StaffContainer.StaffSymbol \set - #'staff-space = #0.8 - \context Staff { c4 c4 } } - \context StaffContainer =SB { \context Staff { d f } } + \notes \relative c'' < + \context StaffContainer = SA { + + %% need < >, otherwise we descend to the voice inside SA + < \context Staff = SA { c4 c4 } > + \quarterSkip + + < \context Staff = SB { b4 b4 } > + } + \context StaffContainer =SB { + \quarterSkip + < \context Staff { e d f } > + \quarterSkip + } > \paper { @@ -23,14 +48,18 @@ interesting things. You can also drop the \consistsend feature. " } \translator { \type Engraver_group_engraver - \consists "Axis_group_engraver" + \consists Clef_engraver + \consists Time_signature_engraver + \consistsend "Axis_group_engraver" \accepts "Staff" + \name StaffContainer - } \translator { \StaffContext \remove Axis_group_engraver + \remove Clef_engraver + \remove Time_signature_engraver } raggedright=##t } diff --git a/input/test/staff-size.ly b/input/test/staff-size.ly index c36f1a9238..05d7cde1b1 100644 --- a/input/test/staff-size.ly +++ b/input/test/staff-size.ly @@ -1,9 +1,11 @@ \version "1.7.18" \header { texidoc = "@cindex Staff Size -Setting staff sizes is a little clumsy. There -are two options: using StaffContainer and override/revert, or -\outputproperty. Both methods are shown in this example. " + +Setting staff sizes is a little clumsy. There are two options: using +@code{StaffContainer} and override/revert, or +@code{\outputproperty}. Both methods are shown in this example. " + } \score { @@ -19,7 +21,7 @@ are two options: using StaffContainer and override/revert, or c8 d e-[ f g a] b c -\ff } -\context Staff = SB { \dynamicDown c,,4 -\ff c c c } +\context Staff = SB \relative c'' { \dynamicDown c,,4 -\ff c c c } \context Staff = SC { \context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'staff-space = #0.8 diff --git a/input/test/stem.ly b/input/test/stem.ly deleted file mode 100644 index 4e8e7af999..0000000000 --- a/input/test/stem.ly +++ /dev/null @@ -1,63 +0,0 @@ -\version "1.7.18" -% regression, _so_ regression. :) =-gp - -\header{ texidoc = " -This file tests the length of stems and placement -of beams" -} - -beamintervals = \notes{ - \time 7/4 - \stemUp - \transpose c c'{ - [ c8 d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] | - [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] | - } - \transpose c c''{ - [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] | - \stemDown - } - \transpose c c'''{ - [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] | - } - \transpose c c''{ - [ c b, ] [ c a, ] [ c g, ] [ c f, ] [ c e, ] [ c d, ] [ c c, ] | - [ c d ] [ c e ] [ c f ] [ c g ] [ c a ] [ c b ] [ c c' ] | - } -} - -\score{ - \notes{ - \time 19/4 - - %% 3.50 (standard) - 0.24 (beam-thickness / 2) = 3.26 ... - %% yields beams almost as [Ross] wants them. - - %% Differences are only half a beam-thickness, probably giving - %% Lily's beams a slightly better slope - - \property Staff.Stem \set #'beamed-lengths = #'(3.26) - - \relative c'{ - \stemUp - g4 a b c d e f g a b c d e f g a b c d - \stemDown - d c b a g f e d c b a g f e d c b a g - } - \beamintervals - \transpose c d \beamintervals - \transpose c e \beamintervals - \transpose c f \beamintervals - \transpose c g \beamintervals - \transpose c a \beamintervals - \transpose c b \beamintervals - } - \paper{ - indent = 0.0\mm - } -} - -%%% Local variables: -%%% LilyPond-indent-level:2 -%%% End: - diff --git a/input/test/time.ly b/input/test/time.ly index 699a5cf34d..90458d854e 100644 --- a/input/test/time.ly +++ b/input/test/time.ly @@ -2,12 +2,8 @@ % TODO: This file could be old. Ask about it later. -gp \header { texidoc = "@cindex Time -IMPORTANT NOTE: The current selection scheme for time signature -symbols is not flexible enough for future extensions such as various -flavours of early mensural notation or complex signatures as in -contemporary music. Therefore, the semantics of time-signature -properties will quite definitely change, and maybe the syntax of the -\time request will possibly be extended. See the input file for TODOs. + +Old time signatures. For further information, consult the file. " } @@ -30,6 +26,17 @@ style), and "notehead" (which should place a proper notehead to the right side of the nominator). -- jr +**************** + +IMPORTANT NOTE: The current selection scheme for time signature +symbols is not flexible enough for future extensions such as various +flavours of early mensural notation or complex signatures as in +contemporary music. Therefore, the semantics of time-signature +properties will quite definitely change, and maybe the syntax of the +\time request will possibly be extended. See the input file for TODOs. + +**************** + %} \score { diff --git a/input/test/timing.ly b/input/test/timing.ly index da749f4243..118938056a 100644 --- a/input/test/timing.ly +++ b/input/test/timing.ly @@ -2,7 +2,9 @@ % possible rename to bar-something. \header{ texidoc = "@cindex Bar Length -You can alter the length of bars in a number of ways. " + +You can alter the length of bars by setting +@code{measureLength} or by resetting @code{measurePosition}. " } \score { diff --git a/input/test/trills.ly b/input/test/trills.ly index 83fd5c7fd2..33f869b6fa 100644 --- a/input/test/trills.ly +++ b/input/test/trills.ly @@ -96,7 +96,7 @@ endHorizScript = { } \context Lyrics=two \lyrics { "simple"4 - "appuy\'e"4. + "appuy\\'e"4. %{ \skip 1*3 \skip 4 \skip 4. "voix et montant" diff --git a/input/test/vertical-extent.ly b/input/test/vertical-extent.ly index b51a0d91c9..336ae0d8f5 100644 --- a/input/test/vertical-extent.ly +++ b/input/test/vertical-extent.ly @@ -13,19 +13,16 @@ associated context finishes, so using it in \property works. \context Staff = upper { \property Staff.verticalExtent = #'(-15.0 . 0.0) \clef alto - c1 \break c1 + c1 } \context Staff = lower { \property Staff.verticalExtent = #'(-0.0 . 15.0) \clef alto - g1 \break g1 + g1 } > \paper{ - interscoreline = 13.0\mm - interscorelinefill = 0 - \translator{\ScoreContext \remove "Bar_number_engraver"} - \translator{\StaffContext minimumVerticalExtent = #'(-2.0 . 2.0)} + raggedright = ##t } } diff --git a/lily/event.cc b/lily/event.cc index fd86b435ef..85a9472591 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -74,7 +74,7 @@ Event::Event () } ADD_MUSIC(Event); -LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0, +LY_DEFINE(ly_music_duration_length, "ly:music-duration-length", 1, 0,0, (SCM mus), "Extract the duration field from @var{mus}, and return the length.") { @@ -96,7 +96,7 @@ LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0, } -LY_DEFINE(music_duration_compress, "ly:music-duration-compress", 2, 0,0, +LY_DEFINE(ly_music_duration_compress, "ly:music-duration-compress", 2, 0,0, (SCM mus, SCM factor), "Extract the duration field from @var{mus}, and compress it.") { @@ -120,7 +120,7 @@ LY_DEFINE(music_duration_compress, "ly:music-duration-compress", 2, 0,0, TODO: this should use ly:pitch. */ -LY_DEFINE(transpose_key_alist, "ly:transpose-key-alist", +LY_DEFINE(ly_transpose_key_alist, "ly:transpose-key-alist", 2, 0,0, (SCM l, SCM pitch), "Make a new key alist of @var{l} transposed by pitch @var{pitch}") { @@ -163,7 +163,7 @@ Key_change_ev::transpose (Pitch p) { SCM pa = get_mus_property ("pitch-alist"); - set_mus_property ("pitch-alist", transpose_key_alist (pa, p.smobbed_copy())); + set_mus_property ("pitch-alist", ly_transpose_key_alist (pa, p.smobbed_copy())); Pitch tonic = *unsmob_pitch (get_mus_property ("tonic")); set_mus_property ("tonic", tonic.smobbed_copy ()); diff --git a/lily/include/event.hh b/lily/include/event.hh index 1782226e4f..47864b2e56 100644 --- a/lily/include/event.hh +++ b/lily/include/event.hh @@ -47,7 +47,7 @@ protected: void transpose (Pitch d); }; -SCM transpose_key_alist (SCM,SCM); +SCM ly_transpose_key_alist (SCM,SCM); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 8ebe88b0eb..52d5f42e6c 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -63,7 +63,7 @@ Key_performer::create_audio_elements () my_do = my_do.transposed (to_c); to_c = my_do.transposed (Pitch(0,0,- my_do.get_alteration ())); - SCM c_pitchlist = transpose_key_alist (pitchlist, to_c.smobbed_copy()); + SCM c_pitchlist = ly_transpose_key_alist (pitchlist, to_c.smobbed_copy()); /* MIDI keys are too limited for lilypond scales. diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index cdb214167f..9964be5b7b 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -9,13 +9,14 @@ /* UGH. too many includes. */ +#include + #include "warn.hh" #include "music-iterator.hh" #include "translator-group.hh" #include "music-wrapper.hh" #include "music-wrapper-iterator.hh" #include "simple-music-iterator.hh" -#include "ly-smobs.icc" #include "ly-smobs.icc" @@ -203,9 +204,13 @@ Music_iterator::mark_smob (SCM smob) } int -Music_iterator::print_smob (SCM , SCM port, scm_print_state*) +Music_iterator::print_smob (SCM sm , SCM port, scm_print_state*) { - scm_puts ("#", port); + char s[1000]; + + Music_iterator *iter = unsmob_iterator (sm); + sprintf (s, "#<%s>", classname (iter)); + scm_puts (s, port); return 1; } diff --git a/lily/sequential-iterator.cc b/lily/sequential-iterator.cc index e5ef71e315..e8812c486e 100644 --- a/lily/sequential-iterator.cc +++ b/lily/sequential-iterator.cc @@ -252,7 +252,7 @@ Sequential_iterator::descend_to_child () */ SCM -Sequential_iterator::get_pending_events (Moment until)const +Sequential_iterator::get_pending_events (Moment until) const { SCM s = SCM_EOL; if (until < pending_moment ()) diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index e23324770c..546dcca283 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -498,7 +498,16 @@ For example, transposed music.") (internal-class-name . "Event") (types . (general-music event)) )) - + + (NonEventSkip + . ( + (description . "Filler that takes up duration, but does not print anything. This also does not create any event-accepting contexts. ") + (internal-class-name . "Music") + (length . ,ly:music-duration-length) + (iterator-ctor . ,Simple_music_iterator::constructor) + (types . (general-music event rhythmic-event skip-event)) + )) + (SkipEvent . ( (description . "Filler that takes up duration, but does not print anything.") diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 2ffc50f951..ac26282fe3 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -230,7 +230,14 @@ i.e. this is not an override" m )) +(define-public (make-nonevent-skip dur) + (let* ((m (make-music-by-name 'NonEventSkip))) + (ly:set-mus-property! m 'duration dur) + m + )) + ;;;;;;;;;;;;;;;; + ;; mmrest (define-public (make-multi-measure-rest duration location) (let* -- 2.39.5