X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-music-types.scm;h=658027c88c24a6dd5f545c9aac71bc4a0f1e2901;hb=9bef4c41f80988822469f80337c3c007e4adb4d1;hp=ba4459b8a32a671404fd62ce0c446f3cb4606954;hpb=0387f04497978e37b335a8b99eec905499d6ad0f;p=lilypond.git diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index ba4459b8a3..658027c88c 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -1,25 +1,25 @@ -;;;; define-music-types.scm -- +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 1998--2008 Han-Wen Nienhuys +;;;; Copyright (C) 1998--2012 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen +;;;; +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . -;; TODO: should link back into user manual. +; for define-safe-public when byte-compiling using Guile V2 +(use-modules (scm safe-utility-defs)) -(define (mm-rest-child-list music) - "Generate events for multimeasure rests, -to be used by the sequential-iterator" - (let ((location (ly:music-property music 'origin)) - (duration (ly:music-property music 'duration))) - (list (make-music 'BarCheck - 'origin location) - (make-event-chord (cons (make-music 'MultiMeasureRestEvent - 'origin location - 'duration duration) - (ly:music-property music 'articulations))) - (make-music 'BarCheck - 'origin location)))) +;; TODO: should link back into user manual. (define-public music-descriptions `( @@ -29,7 +29,12 @@ to be used by the sequential-iterator" Syntax: @var{note}@code{\\x}, where @code{\\x} is a dynamic mark like @code{\\ppp} or @code{\\sfz}. A complete list is in file @file{ly/@/dynamic-scripts-init.ly}.") - (types . (general-music event dynamic-event absolute-dynamic-event)) + (types . (general-music post-event event dynamic-event absolute-dynamic-event)) + )) + + (AlternativeEvent + . ((description . "Create a alternative event.") + (types . (general-music event alternative-event)) )) (AnnotateOutputEvent @@ -58,8 +63,8 @@ context, and 3.@tie{}the context where @var{func} is called.") (ArpeggioEvent . ((description . "Make an arpeggio on this note. -Syntax: @var{note}@code{-\\arpeggio}") - (types . (general-music arpeggio-event event)) +Syntax: @w{@var{note}@code{-\\arpeggio}}") + (types . (general-music post-event arpeggio-event event)) )) ;; todo: use articulation-event for slur as well. @@ -69,10 +74,10 @@ Syntax: @var{note}@code{-\\arpeggio}") Syntax: @var{note}@code{x}@code{y}, where @code{x} is a direction (@code{^} for up or @code{_} for down), or LilyPond's choice -(no direction specified)), and where @code{y} is an articulation -(such as @code{-.}, @code{->}, @code{\\tenuto}, @code{\\downbow}). +(no direction specified), and where @code{y} is an articulation +(such as @w{@code{-.}}, @w{@code{->}}, @code{\\tenuto}, @code{\\downbow}). See the Notation Reference for details.") - (types . (general-music event articulation-event script-event)) + (types . (general-music post-event event articulation-event script-event)) )) (AutoChangeMusic @@ -100,17 +105,22 @@ the start of the measure.") . ((description . "Start or stop a beam. Syntax for manual control: @code{c8-[ c c-] c8}") - (types . (general-music event beam-event span-event)) + (types . (general-music post-event event beam-event span-event)) )) (BeamForbidEvent . ((description . "Specify that a note may not auto-beamed.") - (types . (general-music event beam-forbid-event)) + (types . (general-music post-event event beam-forbid-event)) + )) + + (BreakDynamicSpanEvent + . ((description . "End an alignment spanner for dynamics here.") + (types . (general-music post-event break-span-event break-dynamic-span-event event)) )) (BendAfterEvent - . ((description . "A drop/fall/doit jazz articulation.") - (types . (general-music bend-after-event event)))) + . ((description . "A drop/@/fall/@/doit jazz articulation.") + (types . (general-music post-event bend-after-event event)))) (BreathingEvent . ((description . "Create a @q{breath mark} or @q{comma}. @@ -120,6 +130,21 @@ Syntax: @var{note}@code{\\breathe}") (types . (general-music event breathing-event)) )) + (ClusterNoteEvent + . ((description . "A note that is part of a cluster.") + ;; not a note-event, to ensure that Note_heads_engraver doesn't eat it. + (iterator-ctor . ,ly:rhythmic-music-iterator::constructor) + (types . (general-music cluster-note-event melodic-event + rhythmic-event event)) + )) + + (CompletizeExtenderEvent + . ((description . "Used internally to signal the end of a lyrics block to +ensure extenders are completed correctly when a @code{Lyrics} context ends +before its associated @code{Voice} context.") + (types . (general-music completize-extender-event event)) + )) + (ContextChange . ((description . "Change staves in Piano staff. @@ -128,13 +153,6 @@ Syntax: @code{\\change Staff = @var{new-id}}") (types . (general-music translator-change-instruction)) )) - (ClusterNoteEvent - . ((description . "A note that is part of a cluster.") - ;; not a note-event, to ensure that Note_engraver doesn't eat it. - (types . (general-music cluster-note-event melodic-event - rhythmic-event event)) - )) - (ContextSpeccedMusic . ((description . "Interpret the argument music within a specific context.") @@ -147,23 +165,33 @@ specific context.") (CrescendoEvent . ((description . "Begin or end a crescendo. -Syntax: @var{note}@code{\\cr} @dots{} @var{note}@code{\\rc} +Syntax: @var{note}@code{\\<} @dots{} @var{note}@code{\\!} -You can also use @code{\\<}, @code{\\!}, @code{\\cresc}, and -@code{\\endcresc}. See the Notation Reference for details.") - (types . (general-music span-event span-dynamic-event crescendo-event +An alternative syntax is @var{note}@code{\\cr} @dots{} +@var{note}@code{\\endcr}.") + (types . (general-music post-event span-event span-dynamic-event crescendo-event event)) )) (DecrescendoEvent - . ((description . "See @ref{CrescendoEvent}.") - (types . (general-music span-event span-dynamic-event decrescendo-event + . ((description . "Begin or end a decrescendo. + +Syntax: @var{note}@code{\\>} @dots{} @var{note}@code{\\!} + +An alternative syntax is @var{note}@code{\\decr} @dots{} +@var{note}@code{\\enddecr}.") + (types . (general-music post-event span-event span-dynamic-event decrescendo-event event)) )) - (ExtenderEvent - . ((description . "Extend lyrics.") - (types . (general-music extender-event event)) + (DoublePercentEvent + . ((description . "Used internally to signal double percent repeats.") + (types . (general-music event double-percent-event rhythmic-event)) + )) + + (EpisemaEvent + . ((description . "Begin or end an episema.") + (types . (general-music post-event span-event event episema-event)) )) (Event @@ -172,22 +200,40 @@ You can also use @code{\\<}, @code{\\!}, @code{\\cresc}, and )) (EventChord - . ((description . "Internally used to group a set of events.") + . ((description . "Explicitly entered chords. + +When iterated, @code{elements} are converted to events at the current +timestep, followed by any @code{articulations}. Per-chord postevents +attached by the parser just follow any rhythmic events in +@code{elements} instead of utilizing @code{articulations}. + +An unexpanded chord repetition @samp{q} is recognizable by having its +duration stored in @code{duration}.") (iterator-ctor . ,ly:event-chord-iterator::constructor) - (length-callback . ,ly:music-sequence::maximum-length-callback) + (length-callback . ,ly:music-sequence::event-chord-length-callback) (to-relative-callback . ,ly:music-sequence::event-chord-relative-callback) (types . (general-music event-chord simultaneous-music)) )) + (ExtenderEvent + . ((description . "Extend lyrics.") + (types . (general-music post-event extender-event event)) + )) + (FingeringEvent . ((description . "Specify what finger to use for this note.") - (types . (general-music fingering-event event)) + (types . (general-music post-event fingering-event event)) + )) + + (FootnoteEvent + . ((description . "Footnote a grob.") + (types . (general-music event post-event footnote-event)) )) (GlissandoEvent . ((description . "Start a glissando on this note.") - (types . (general-music glissando-event event)) + (types . (general-music post-event glissando-event event)) )) (GraceMusic @@ -200,12 +246,12 @@ You can also use @code{\\<}, @code{\\!}, @code{\\cresc}, and (HarmonicEvent . ((description . "Mark a note as harmonic.") - (types . (general-music event harmonic-event)) + (types . (general-music post-event event harmonic-event)) )) (HyphenEvent . ((description . "A hyphen between lyric syllables.") - (types . (general-music hyphen-event event)) + (types . (general-music post-event hyphen-event event)) )) (KeyChangeEvent @@ -225,12 +271,11 @@ Syntax: @code{\\key} @var{name} @var{scale}") . ((description . "Don't damp this chord. Syntax: @var{note}@code{\\laissezVibrer}") - (types . (general-music event laissez-vibrer-event)) + (types . (general-music post-event event laissez-vibrer-event)) )) (LigatureEvent . ((description . "Start or end a ligature.") - (span-type . ligature) (types . (general-music span-event ligature-event event)) )) @@ -251,6 +296,7 @@ Syntax: @code{\\lyricsto} @var{voicename} @var{lyrics}") (LyricEvent . ((description . "A lyric syllable. Must be entered in lyrics mode, i.e., @code{\\lyrics @{ twinkle4 twinkle4 @} }.") + (iterator-ctor . ,ly:rhythmic-music-iterator::constructor) (types . (general-music rhythmic-event lyric-event event)) )) @@ -285,7 +331,7 @@ Syntax: @code{R2.*4} for 4 measures in 3/4 time.") Syntax: @code{R-\\markup @{ \\roman \"bla\" @}} Note the explicit font switch.") - (types . (general-music event multi-measure-text-event)) + (types . (general-music post-event event multi-measure-text-event)) )) (Music @@ -294,14 +340,27 @@ Note the explicit font switch.") )) (NoteEvent - . ((description . "A note.") + . ((description . "A note. + +Outside of chords, any events in @code{articulations} with a listener +are broadcast like chord articulations, the others are retained. + +For iteration inside of chords, @xref{EventChord}.") + (iterator-ctor . ,ly:rhythmic-music-iterator::constructor) (types . (general-music event note-event rhythmic-event melodic-event)) )) (NoteGroupingEvent . ((description . "Start or stop grouping brackets.") - (types . (general-music event note-grouping-event)) + (types . (general-music post-event event note-grouping-event)) + )) + + (OttavaMusic + . ((description . "Start or stop an ottava bracket.") + (iterator-ctor . ,ly:sequential-iterator::constructor) + (elements-callback . ,make-ottava-set) + (types . (general-music ottava-music)) )) (OverrideProperty @@ -324,6 +383,17 @@ Syntax: @code{\\override} [ @var{context} @code{.} ] (types . (general-music break-event page-turn-event event)) )) + (PartCombineForceEvent + . ((description . "Override the part-combiner's strategy.") + (types . (general-music part-combine-force-event event)) + )) + + (PartialSet + . ((description . "Create an anacrusis or upbeat (partial measure).") + (iterator-ctor . ,ly:partial-iterator::constructor) + (types . (general-music partial-set)) + )) + (PartCombineMusic . ((description . "Combine two parts on a staff, either merged or as separate voices.") @@ -339,7 +409,7 @@ as separate voices.") )) (PercentRepeatedMusic - . ((description . "Repeats encoded by percents.") + . ((description . "Repeats encoded by percents and slashes.") (iterator-ctor . ,ly:percent-repeat-iterator::constructor) (start-callback . ,ly:repeated-music::first-start) (length-callback . ,ly:repeated-music::unfolded-music-length) @@ -357,20 +427,23 @@ goes down).") . ((description . "Start or end phrasing slur. Syntax: @var{note}@code{\\(} and @var{note}@code{\\)}") - (types . (general-music span-event event phrasing-slur-event)) + (spanner-id . "") + (types . (general-music post-event span-event event phrasing-slur-event)) )) (PropertySet . ((description . "Set a context property. -Syntax: @code{\\property @var{context}.@var{prop} = @var{scheme-val}}") +Syntax: @code{\\set @var{context}.@var{prop} = @var{scheme-val}}") (types . (layout-instruction-event general-music)) (iterator-ctor . ,ly:property-iterator::constructor) )) (PropertyUnset - . ((description . "Remove the definition of a context -@code{\\property}.") + . ((description . "Restore the default setting for a context +property. See @ref{PropertySet}. + +Syntax: @code{\\unset @var{context}.@var{prop}}") (types . (layout-instruction-event general-music)) (iterator-ctor . ,ly:property-unset-iterator::constructor) )) @@ -398,20 +471,26 @@ Syntax: @code{\\property @var{context}.@var{prop} = @var{scheme-val}}") (types . (music-wrapper-music general-music relative-octave-music)) )) - (RepeatTieEvent - . ((description . "Ties for starting a second volta bracket.") - (types . (general-music event repeat-tie-event)) - )) - (RepeatedMusic . ((description . "Repeat music in different ways.") (types . (general-music repeated-music)) )) + (RepeatSlashEvent + . ((description . "Used internally to signal beat repeats.") + (types . (general-music event repeat-slash-event rhythmic-event)) + )) + + (RepeatTieEvent + . ((description . "Ties for starting a second volta bracket.") + (types . (general-music post-event event repeat-tie-event)) + )) + (RestEvent . ((description . "A Rest. Syntax: @code{r4} for a quarter rest.") + (iterator-ctor . ,ly:rhythmic-music-iterator::constructor) (types . (general-music event rhythmic-event rest-event)) )) @@ -455,6 +534,7 @@ Syntax: @code{\\simultaneous @{ @dots{} @}} or @code{<< @dots{} >>}") print anything. Syntax: @code{s4} for a skip equivalent to a quarter rest.") + (iterator-ctor . ,ly:rhythmic-music-iterator::constructor) (types . (general-music event rhythmic-event skip-event)) )) @@ -465,14 +545,15 @@ print anything, and also does not create staves or voices implicitly. Syntax: @code{\\skip} @var{duration}") (length-callback . ,ly:music-duration-length) (iterator-ctor . ,ly:simple-music-iterator::constructor) - (types . (general-music event rhythmic-event skip-event)) + (types . (general-music event skip-event)) )) (SlurEvent . ((description . "Start or end slur. Syntax: @var{note}@code{(} and @var{note}@code{)}") - (types . (general-music span-event event slur-event)) + (spanner-id . "") + (types . (general-music post-event span-event event slur-event)) )) (SoloOneEvent @@ -489,7 +570,7 @@ Syntax: @var{note}@code{(} and @var{note}@code{)}") (SostenutoEvent . ((description . "Depress or release sostenuto pedal.") - (types . (general-music event pedal-event sostenuto-event)) + (types . (general-music post-event event pedal-event sostenuto-event)) )) (SpacingSectionEvent @@ -511,49 +592,62 @@ different time than stopped.") . ((description . "Specify on which string to play this note. Syntax: @code{\\@var{number}}") - (types . (general-music string-number-event event)) + (types . (general-music post-event string-number-event event)) )) (StrokeFingerEvent . ((description . "Specify with which finger to pluck a string. Syntax: @code{\\rightHandFinger @var{text}}") - (types . (general-music stroke-finger-event event)) + (types . (general-music post-event stroke-finger-event event)) )) (SustainEvent . ((description . "Depress or release sustain pedal.") - (types . (general-music event pedal-event sustain-event)) + (types . (general-music post-event event pedal-event sustain-event)) + )) + + (TempoChangeEvent + . ((description . "A metronome mark or tempo indication.") + (types . (general-music event tempo-change-event)) )) (TextScriptEvent . ((description . "Print text.") - (types . (general-music script-event text-script-event event)) + (types . (general-music post-event script-event text-script-event event)) )) (TextSpanEvent - . ((description . "Start a text spanner, e.g., 8va.....|") - (types . (general-music span-event event text-span-event)) + . ((description . "Start a text spanner, for example, an +octavation.") + (types . (general-music post-event span-event event text-span-event)) )) (TieEvent . ((description . "A tie. -Syntax: @var{note}@code{-~}") - (types . (general-music tie-event event)) +Syntax: @w{@var{note}@code{-~}}") + (types . (general-music post-event tie-event event)) )) (TimeScaledMusic . ((description . "Multiply durations, as in tuplets. -Syntax: @code{\\times @var{fraction} @var{music}}, e.g. +Syntax: @code{\\times @var{fraction} @var{music}}, e.g., @code{\\times 2/3 @{ @dots{} @}} for triplets.") (length-callback . ,ly:music-wrapper::length-callback) (start-callback . ,ly:music-wrapper::start-callback) - (iterator-ctor . ,ly:time-scaled-music-iterator::constructor) + (iterator-ctor . ,ly:tuplet-iterator::constructor) (types . (time-scaled-music music-wrapper-music general-music)) )) + (TimeSignatureMusic + . ((description . "Set a new time signature") + (iterator-ctor . ,ly:sequential-iterator::constructor) + (elements-callback . ,make-time-signature-set) + (types . (general-music time-signature-music)) + )) + (TransposedMusic . ((description . "Music that has been transposed.") (iterator-ctor . ,ly:music-wrapper-iterator::constructor) @@ -566,7 +660,7 @@ Syntax: @code{\\times @var{fraction} @var{music}}, e.g. (TremoloEvent . ((description . "Unmeasured tremolo.") - (types . (general-music event tremolo-event)) + (types . (general-music post-event event tremolo-event)) )) (TremoloRepeatedMusic @@ -579,24 +673,24 @@ Syntax: @code{\\times @var{fraction} @var{music}}, e.g. )) (TremoloSpanEvent - . ((description . "Tremolo over two stems") + . ((description . "Tremolo over two stems.") (types . (general-music event span-event tremolo-span-event)) )) (TrillSpanEvent - . ((description . "Start a trill spanner tr~~~") - (types . (general-music span-event event trill-span-event)) + . ((description . "Start a trill spanner.") + (types . (general-music post-event span-event event trill-span-event)) )) (TupletSpanEvent . ((description . "Used internally to signal where tuplet brackets start and stop.") - (types . (tuplet-span-event span-event event general-music)) + (types . (tuplet-span-event span-event event general-music post-event)) )) (UnaCordaEvent . ((description . "Depress or release una-corda pedal.") - (types . (general-music event pedal-event una-corda-event)) + (types . (general-music post-event event pedal-event una-corda-event)) )) (UnfoldedRepeatedMusic @@ -632,6 +726,7 @@ Syntax: @code{\\\\}") (VoltaRepeatedMusic . ((description . "Repeats with alternatives placed sequentially.") (iterator-ctor . ,ly:volta-repeat-iterator::constructor) + (elements-callback . ,make-volta-set) (start-callback . ,ly:repeated-music::first-start) (length-callback . ,ly:repeated-music::volta-music-length) (types . (general-music repeated-music volta-repeated-music)) @@ -641,7 +736,7 @@ Syntax: @code{\\\\}") (set! music-descriptions (sort music-descriptions alist