From 6b9bfd374643d1eed1ea158777d796c57a2bcd3a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 22 Sep 2002 15:38:03 +0000 Subject: [PATCH] * lily/include/translator.hh (ENTER_DESCRIPTION): add events-accepted field. * scm/music-types.scm: new file. * lily/parser.yy: put music type initialization into scheme, similar to grob initialization. Changes throughout. --- ChangeLog | 10 + lily/a2-engraver.cc | 1 + lily/accidental-engraver.cc | 1 + lily/ambitus-engraver.cc | 3 +- lily/arpeggio-engraver.cc | 3 +- lily/auto-beam-engraver.cc | 3 +- lily/axis-group-engraver.cc | 6 +- lily/bar-check-iterator.cc | 8 - lily/bar-engraver.cc | 3 +- lily/bar-number-engraver.cc | 3 +- lily/beam-engraver.cc | 6 +- lily/break-align-engraver.cc | 1 + lily/breathing-sign-engraver.cc | 3 +- lily/chord-name-engraver.cc | 3 +- lily/chord-tremolo-engraver.cc | 3 +- lily/chord.cc | 2 +- lily/clef-engraver.cc | 3 +- lily/collision-engraver.cc | 3 +- lily/completion-note-heads-engraver.cc | 3 +- lily/context-specced-music.cc | 8 - lily/custos-engraver.cc | 3 +- lily/dot-column-engraver.cc | 3 +- lily/dynamic-engraver.cc | 3 +- lily/dynamic-performer.cc | 7 +- lily/engraver-group-engraver.cc | 3 +- lily/engraver.cc | 4 +- lily/extender-engraver.cc | 3 +- lily/figured-bass-engraver.cc | 3 +- lily/fingering-engraver.cc | 3 +- lily/font-size-engraver.cc | 3 +- lily/forbid-break-engraver.cc | 3 +- lily/grace-music.cc | 6 - lily/grob-pq-engraver.cc | 3 +- lily/hyphen-engraver.cc | 3 +- lily/include/grace-music.hh | 1 - lily/include/lyric-combine-music.hh | 1 - lily/include/music-list.hh | 3 - lily/include/music-wrapper.hh | 1 - lily/include/music.hh | 6 +- lily/include/relative-music.hh | 1 - lily/include/translator.hh | 4 +- lily/include/type-swallow-translator.hh | 1 + lily/instrument-name-engraver.cc | 3 +- lily/key-engraver.cc | 3 +- lily/key-performer.cc | 5 +- lily/ligature-bracket-engraver.cc | 3 +- lily/ligature-engraver.cc | 3 +- lily/lyric-combine-music.cc | 10 +- lily/lyric-engraver.cc | 3 +- lily/lyric-performer.cc | 2 +- lily/lyric-phrasing-engraver.cc | 3 +- lily/mark-engraver.cc | 3 +- lily/melisma-engraver.cc | 3 +- lily/mensural-ligature-engraver.cc | 3 +- lily/multi-measure-rest-engraver.cc | 3 +- lily/music-constructor.cc | 5 +- lily/music-sequence.cc | 10 +- lily/music-wrapper.cc | 9 +- lily/music.cc | 52 +++- lily/note-head-line-engraver.cc | 3 +- lily/note-heads-engraver.cc | 3 +- lily/note-name-engraver.cc | 3 +- lily/note-performer.cc | 2 +- lily/output-property-engraver.cc | 3 +- lily/parser.yy | 324 ++++++++++++------------ lily/part-combine-music.cc | 11 +- lily/percent-repeat-engraver.cc | 3 +- lily/performer-group-performer.cc | 3 +- lily/phrasing-slur-engraver.cc | 3 +- lily/piano-pedal-engraver.cc | 3 +- lily/piano-pedal-performer.cc | 5 +- lily/pitch-squash-engraver.cc | 3 +- lily/porrectus-engraver.cc | 3 +- lily/relative-octave-music.cc | 7 - lily/repeat-acknowledge-engraver.cc | 3 +- lily/repeated-music.cc | 8 +- lily/request-chord.cc | 9 - lily/request.cc | 8 +- lily/rest-collision-engraver.cc | 3 +- lily/rest-engraver.cc | 3 +- lily/rhythmic-column-engraver.cc | 3 +- lily/score-engraver.cc | 3 +- lily/score-performer.cc | 3 +- lily/script-column-engraver.cc | 3 +- lily/script-engraver.cc | 3 +- lily/separating-line-group-engraver.cc | 3 +- lily/sequential-music.cc | 8 - lily/simultaneous-music.cc | 13 +- lily/slur-engraver.cc | 3 +- lily/spacing-engraver.cc | 3 +- lily/span-arpeggio-engraver.cc | 3 +- lily/span-bar-engraver.cc | 3 +- lily/span-dynamic-performer.cc | 5 +- lily/staff-collecting-engraver.cc | 3 +- lily/staff-performer.cc | 4 +- lily/staff-symbol-engraver.cc | 3 +- lily/stanza-number-engraver.cc | 3 +- lily/stem-engraver.cc | 3 +- lily/swallow-perf.cc | 3 +- lily/system-start-delimiter-engraver.cc | 3 +- lily/tab-note-heads-engraver.cc | 3 +- lily/tempo-performer.cc | 4 +- lily/text-engraver.cc | 3 +- lily/text-spanner-engraver.cc | 3 +- lily/thread-devnull-engraver.cc | 3 +- lily/tie-engraver.cc | 3 +- lily/tie-performer.cc | 4 +- lily/time-scaled-music.cc | 11 - lily/time-signature-engraver.cc | 3 +- lily/time-signature-performer.cc | 2 +- lily/timing-engraver.cc | 3 +- lily/timing-translator.cc | 2 +- lily/transposed-music.cc | 7 - lily/tuplet-engraver.cc | 3 +- lily/un-relativable-music.cc | 1 - lily/vertical-align-engraver.cc | 3 +- lily/voice-devnull-engraver.cc | 3 +- lily/volta-engraver.cc | 3 +- scm/lily.scm | 3 +- scm/music-functions.scm | 8 +- scm/music-property-description.scm | 1 + scm/music-types.scm | 306 ++++++++++++++++++++++ 122 files changed, 744 insertions(+), 396 deletions(-) create mode 100644 scm/music-types.scm diff --git a/ChangeLog b/ChangeLog index cd50bb8354..cf8b439cae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-09-22 Han-Wen Nienhuys + + * lily/include/translator.hh (ENTER_DESCRIPTION): add + events-accepted field. + + * scm/music-types.scm: new file. + + * lily/parser.yy: put music type initialization into scheme, + similar to grob initialization. Changes throughout. + 2002-09-22 Jan Nieuwenhuizen * Documentation/user/tutorial.itely: Fix links. diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index ac7177ba91..8c24c57b4b 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -211,6 +211,7 @@ up for the musicexpr called @code{one}, down for the musicexpr called ", /* creats*/ "TextScript", +/* accepts */ "general-music", /* acks */ "multi-measure-rest-interface slur-interface stem-interface tie-interface note-head-interface dynamic-interface text-interface" ,/* reads */ "combineParts noDirection soloADue soloText soloIIText aDueText split-interval unison solo unisilence unirhythm", diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 6a566d0423..96d90b21b6 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -482,6 +482,7 @@ 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.", "Accidental", +/* accepts */ "general-music", "rhythmic-head-interface tie-interface arpeggio-interface", "localKeySignature extraNatural autoAccidentals autoCautionaries", "localKeySignature"); diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 21ec794a57..d0086505d1 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -197,6 +197,7 @@ Ambitus_engraver::finalize () ENTER_DESCRIPTION(Ambitus_engraver, /* descr */ "", /* creats*/ "Ambitus", -/* acks */ "note-head-interface", +/* accepts */ "general-music", +/* acks */ "note-head-interface", /* reads */ "", /* write */ ""); diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc index 407f026510..19fc31342b 100644 --- a/lily/arpeggio-engraver.cc +++ b/lily/arpeggio-engraver.cc @@ -107,6 +107,7 @@ Arpeggio_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Arpeggio_engraver, /* descr */ "Generate an Arpeggio from a Arpeggio_req", /* creats*/ "Arpeggio", -/* acks */ "stem-interface rhythmic-head-interface note-column-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rhythmic-head-interface note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index bce4eac956..7a37e5d3e7 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -497,6 +497,7 @@ when to start and stop a beam. Overriding beaming is done through stemRightBeamCount. ", /* creats*/ "Beam", -/* acks */ "stem-interface rest-interface beam-interface bar-line-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rest-interface beam-interface bar-line-interface", /* reads */ "autoBeaming autoBeamSettings beatLength subdivideBeams", /* write */ ""); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index bdaa7e93f8..841a24c656 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -168,13 +168,15 @@ ENTER_DESCRIPTION(Hara_kiri_engraver, interesting items (ie. note heads, lyric syllables and normal rests) ", /* creats*/ "HaraKiriVerticalGroup", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); ENTER_DESCRIPTION(Axis_group_engraver, /* descr */ "Group all objects created in this context in a VerticalAxisGroup spanner.", /* creats*/ "VerticalAxisGroup", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "verticalExtent minimumVerticalExtent extraVerticalExtent", /* write */ ""); diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index af227ca0d9..3de1771365 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -26,14 +26,6 @@ public: }; IMPLEMENT_CTOR_CALLBACK(Bar_check_iterator); - -Music * get_barcheck () -{ - Music *bc = new Music; - bc->set_mus_property ("iterator-ctor", Bar_check_iterator::constructor_proc); - return bc; -} - Bar_check_iterator::Bar_check_iterator() { } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 494ef46383..180193ec26 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -112,6 +112,7 @@ ENTER_DESCRIPTION(Bar_engraver, /* descr */ "Create barlines. This engraver is controlled through the @code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point", /* creats*/ "BarLine", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "whichBar", /* write */ ""); diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 10eb2f4551..28b73fd21e 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -118,6 +118,7 @@ ENTER_DESCRIPTION(Bar_number_engraver, /* descr */ "A bar number is created whenever measurePosition is zero. It is put on top of all staves, and appears only at left side of the staff.", /* creats*/ "BarNumber", -/* acks */ "break-aligned-interface", +/* accepts */ "general-music", +/* acks */ "break-aligned-interface", /* reads */ "currentBarNumber stavesFound" , /* write */ ""); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 9b3be1c573..a126111fba 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -305,7 +305,8 @@ ENTER_DESCRIPTION(Beam_engraver, /* descr */ "Handles Beam_requests by engraving Beams. If omitted, then notes will be printed with flags instead of beams.", /* creats*/ "Beam", -/* acks */ "stem-interface rest-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rest-interface", /* reads */ "beamMelismaBusy beatLength subdivideBeams", /* write */ ""); @@ -347,7 +348,8 @@ be printed with flags instead of beams. Only engraves beams when we are at grace points in time. ", /* creats*/ "Beam", -/* acks */ "stem-interface rest-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rest-interface", /* reads */ "beamMelismaBusy beatLength subdivideBeams", /* write */ ""); diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 414d61db7b..d708eb5f86 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -148,6 +148,7 @@ Break_align_engraver::add_to_group(SCM align_name, Item*item) ENTER_DESCRIPTION(Break_align_engraver, /* descr */ "Align grobs with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder", /* creats*/ "BreakAlignment BreakAlignGroup LeftEdge", +/* accepts */ "general-music", /* acks */ "break-aligned-interface" ,/* reads */ "breakAlignOrder", /* write */ ""); diff --git a/lily/breathing-sign-engraver.cc b/lily/breathing-sign-engraver.cc index e4fc055153..fe0d3b531d 100644 --- a/lily/breathing-sign-engraver.cc +++ b/lily/breathing-sign-engraver.cc @@ -88,6 +88,7 @@ Breathing_sign_engraver::start_translation_timestep () ENTER_DESCRIPTION(Breathing_sign_engraver, /* descr */ "", /* creats*/ "BreathingSign", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index bbccd04afe..10bff134a9 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -107,6 +107,7 @@ ENTER_DESCRIPTION(Chord_name_engraver, /* descr */ "Catch Note_req's, Tonic_reqs, Inversion_reqs, Bass_req and generate the appropriate chordname.", /* creats*/ "ChordName", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "chordChanges", /* write */ ""); diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index e580e17716..05981c4c33 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -218,6 +218,7 @@ Chord_tremolo_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Chord_tremolo_engraver, /* descr */ "Generates beams for tremolo repeats.", /* creats*/ "Beam", -/* acks */ "stem-interface note-head-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface note-head-interface", /* reads */ "", /* write */ ""); diff --git a/lily/chord.cc b/lily/chord.cc index 45f7e6781d..3e26dc8474 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -363,7 +363,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) scm_gc_unprotect_object (n->self_scm ()); } - Simultaneous_music*v = new Request_chord (SCM_EOL); + Simultaneous_music*v = new Request_chord (); v->set_mus_property ("elements", list); return v; diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 091ee979a0..819ee2cedf 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -199,6 +199,7 @@ Clef_engraver::start_translation_timestep () ENTER_DESCRIPTION(Clef_engraver, /* descr */ "Determine and set reference point for pitches", /* creats*/ "Clef OctavateEight", -/* acks */ "bar-line-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface", /* reads */ "clefPosition clefGlyph centralCPosition clefOctavation explicitClefVisibility", /* write */ ""); diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index f6bbb7e1a7..41399bbeca 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -78,6 +78,7 @@ Collision_engraver::Collision_engraver () ENTER_DESCRIPTION(Collision_engraver, /* descr */ "", /* creats*/ "NoteCollision", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index ca90b3d5db..2188dedb81 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -313,6 +313,7 @@ ENTER_DESCRIPTION(Completion_heads_engraver, @code{Note_heads_engraver}. It plays some trickery to break long notes and automatically tie them into the next measure.", /* creats*/ "NoteHead Dots", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "centralCPosition measurePosition measureLength", /* write */ ""); diff --git a/lily/context-specced-music.cc b/lily/context-specced-music.cc index 620c2e4a39..333b74770e 100644 --- a/lily/context-specced-music.cc +++ b/lily/context-specced-music.cc @@ -7,18 +7,10 @@ */ #include "context-specced-music.hh" -Context_specced_music::Context_specced_music (SCM m) - : Music_wrapper (m) -{ - set_mus_property ("type", - ly_symbol2scm ("context-specced-music")); -} Context_specced_music::Context_specced_music () { - set_mus_property ("type", - ly_symbol2scm ("context-specced-music")); } ADD_MUSIC (Context_specced_music); diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index b16c637029..e8d9a820df 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -147,6 +147,7 @@ Custos_engraver::finalize () ENTER_DESCRIPTION(Custos_engraver, /* descr */ "", /* creats*/ "Custos", -/* acks */ "bar-line-interface note-head-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface note-head-interface", /* reads */ "", /* write */ ""); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 10fd4a5448..83953c5d54 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -84,6 +84,7 @@ ENTER_DESCRIPTION(Dot_column_engraver, If omitted, then dots appear on top of the notes. ", /* creats*/ "DotColumn", -/* acks */ "rhythmic-head-interface dot-column-interface stem-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface dot-column-interface stem-interface", /* reads */ "", /* write */ ""); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 5c97d814de..c6252d5a46 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -433,6 +433,7 @@ which takes care of vertical positioning. ", /* creats*/ "DynamicLineSpanner DynamicText Hairpin TextSpanner", -/* acks */ "note-column-interface script-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface script-interface", /* reads */ "", /* write */ ""); diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index e76f07cd62..c69267b5d9 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -135,4 +135,9 @@ Dynamic_performer::try_music (Music* r) } ENTER_DESCRIPTION(Dynamic_performer, - "","","","dynamicAbsoluteVolumeFunction midiMaximumVolume midiMinimumVolume midiInstrument instrumentEqualizer",""); + /*descr*/ "", + /* creats*/ "", + /* accepts */ "general-music", + /* acks */ "", + /*reads */"dynamicAbsoluteVolumeFunction midiMaximumVolume midiMinimumVolume midiInstrument instrumentEqualizer", + /*writes*/""); diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index ebf3881147..403d620489 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -174,7 +174,8 @@ Engraver_group_engraver::Engraver_group_engraver() {} ENTER_DESCRIPTION(Engraver_group_engraver, /* descr */ "A group of engravers taken together", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/engraver.cc b/lily/engraver.cc index b8cb0f4939..dac68d8f0d 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -72,5 +72,7 @@ Engraver::top_engraver () const } ENTER_DESCRIPTION(Engraver, - "", "", "", "", ""); + "", "", + "general-music", + "", "", ""); diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 914eefbe63..b6ff094700 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -144,6 +144,7 @@ Extender_engraver::start_translation_timestep () ENTER_DESCRIPTION(Extender_engraver, /* descr */ "Create lyric extenders", /* creats*/ "LyricExtender", -/* acks */ "lyric-syllable-interface", +/* accepts */ "general-music", +/* acks */ "lyric-syllable-interface", /* reads */ "", /* write */ ""); diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index 4efd7644e9..1cf1cc5cf2 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -80,6 +80,7 @@ Figured_bass_engraver::process_music () ENTER_DESCRIPTION(Figured_bass_engraver, /* descr */ "Make figured bass numbers.", /* creats*/ "BassFigure", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index ee6612cc4e..d4b59e1d53 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -244,6 +244,7 @@ Fingering_engraver::Fingering_engraver() ENTER_DESCRIPTION(Fingering_engraver, /* descr */ "Create fingering-scripts", /* creats*/ "Fingering", -/* acks */ "rhythmic-head-interface stem-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface stem-interface", /* reads */ "scriptHorizontal", /* write */ ""); diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index c72b06a85f..1e337b8c2e 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -47,6 +47,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi) ENTER_DESCRIPTION(Font_size_engraver, /* descr */ "Puts fontSize into font-relative-size grob property.", /* creats*/ "", -/* acks */ "font-interface", +/* accepts */ "general-music", +/* acks */ "font-interface", /* reads */ "fontSize", /* write */ ""); diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 3df1cdc640..0747251260 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -16,7 +16,8 @@ ENTER_DESCRIPTION(Forbid_line_break_engraver, /* descr */ "Forbid line breaks when note heads are still playing at some point.", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "busyGrobs", /* write */ ""); diff --git a/lily/grace-music.cc b/lily/grace-music.cc index 516e02ce0e..08fc36616f 100644 --- a/lily/grace-music.cc +++ b/lily/grace-music.cc @@ -39,11 +39,5 @@ Grace_music::Grace_music () Grace_iterator::constructor_proc); } -Grace_music::Grace_music (SCM p) - : Music_wrapper (p) -{ - set_mus_property ("iterator-ctor", - Grace_iterator::constructor_proc); -} ADD_MUSIC (Grace_music); diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index 3d1d350e0a..44ab000fa2 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -143,6 +143,7 @@ ENTER_DESCRIPTION(Grob_pq_engraver, engraver is a sort-of a failure, since it doesn't handle all sorts of borderline cases very well. ", /* creats*/ "", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "busyGrobs", /* write */ "busyGrobs"); diff --git a/lily/hyphen-engraver.cc b/lily/hyphen-engraver.cc index 6d5fd573f7..c15e3bee95 100644 --- a/lily/hyphen-engraver.cc +++ b/lily/hyphen-engraver.cc @@ -136,6 +136,7 @@ Hyphen_engraver::start_translation_timestep () ENTER_DESCRIPTION(Hyphen_engraver, /* descr */ "Create lyric hyphens", /* creats*/ "LyricHyphen", -/* acks */ "lyric-syllable-interface", +/* accepts */ "general-music", +/* acks */ "lyric-syllable-interface", /* reads */ "", /* write */ ""); diff --git a/lily/include/grace-music.hh b/lily/include/grace-music.hh index 5c70171f69..37d1888d87 100644 --- a/lily/include/grace-music.hh +++ b/lily/include/grace-music.hh @@ -16,7 +16,6 @@ class Grace_music : public Music_wrapper { public: VIRTUAL_COPY_CONS (Music); - Grace_music (SCM); Grace_music (); protected: virtual void compress (Moment); diff --git a/lily/include/lyric-combine-music.hh b/lily/include/lyric-combine-music.hh index b468b5b36e..2885450af6 100644 --- a/lily/include/lyric-combine-music.hh +++ b/lily/include/lyric-combine-music.hh @@ -19,7 +19,6 @@ public: Music * get_lyrics () const; Lyric_combine_music (); - Lyric_combine_music (SCM); virtual void transpose (Pitch); VIRTUAL_COPY_CONS (Music); diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index f69887aac2..1dcaaeb818 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -20,7 +20,6 @@ class Simultaneous_music : public Music_sequence { public: VIRTUAL_COPY_CONS (Music); - Simultaneous_music (SCM); virtual Pitch to_relative_octave (Pitch); virtual Moment length_mom () const; virtual Moment start_mom () const; @@ -37,7 +36,6 @@ public: VIRTUAL_COPY_CONS (Music); virtual Pitch to_relative_octave (Pitch); virtual Moment start_mom () const; - Request_chord (SCM list); Request_chord (); }; @@ -49,7 +47,6 @@ class Sequential_music : public Music_sequence { public: VIRTUAL_COPY_CONS (Music); - Sequential_music (SCM); virtual Moment length_mom () const; virtual Moment start_mom () const; diff --git a/lily/include/music-wrapper.hh b/lily/include/music-wrapper.hh index 887182b73f..bd2ebb5056 100644 --- a/lily/include/music-wrapper.hh +++ b/lily/include/music-wrapper.hh @@ -22,7 +22,6 @@ class Music_wrapper : public Music { public: - Music_wrapper (SCM); Music_wrapper (); Music * element () const; virtual void transpose (Pitch); diff --git a/lily/include/music.hh b/lily/include/music.hh index b5cbab61a1..84c40cc42f 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -42,7 +42,9 @@ public: SCM internal_get_mus_property (SCM) const; void internal_set_mus_property (SCM , SCM val); - + void add_music_type (SCM); + bool is_music_type (SCM) const; + virtual Pitch to_relative_octave (Pitch); /// The duration of this piece of music @@ -57,11 +59,11 @@ public: VIRTUAL_COPY_CONS (Music); Music (); Music (Music const &m); - Music (SCM); protected: DECLARE_SMOBS (Music,); SCM immutable_property_alist_; SCM mutable_property_alist_; + friend SCM ly_extended_make_music(SCM,SCM); }; diff --git a/lily/include/relative-music.hh b/lily/include/relative-music.hh index e8576b1bef..3b8531e60c 100644 --- a/lily/include/relative-music.hh +++ b/lily/include/relative-music.hh @@ -15,7 +15,6 @@ class Relative_octave_music : public Music_wrapper { public: - Relative_octave_music (SCM l); Relative_octave_music (); VIRTUAL_COPY_CONS (Music); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 4b27559aa9..1e88b13451 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -109,7 +109,7 @@ ADD_GLOBAL_CTOR (_ ## T ## _adder); -#define ENTER_DESCRIPTION(classname,desc,grobs,acked,read,write) \ +#define ENTER_DESCRIPTION(classname,desc,grobs,accepted,acked,read,write) \ ADD_THIS_TRANSLATOR (classname);\ SCM \ classname::static_translator_description () const \ @@ -126,6 +126,8 @@ classname::static_translator_description () const \ \ static_properties= scm_acons (ly_symbol2scm ("interfaces-acked"), \ parse_symbol_list (acked), static_properties); \ + static_properties= scm_acons (ly_symbol2scm ("events-accepted"), \ + parse_symbol_list (accepted), static_properties); \ \ static_properties= scm_acons (ly_symbol2scm ("properties-read"), \ parse_symbol_list (read), static_properties); \ diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh index 96a783a256..9bb4e68aeb 100644 --- a/lily/include/type-swallow-translator.hh +++ b/lily/include/type-swallow-translator.hh @@ -34,6 +34,7 @@ struct TYPE ## _swallow_translator : public Type_swallow_translator { \ ENTER_DESCRIPTION(TYPE ## _swallow_translator, \ "Swallow requests of " #TYPE " type.", \ "", \ + "general-music",\ "", \ "", \ ""); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 0a72163b1f..e166f48ec9 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -127,6 +127,7 @@ ENTER_DESCRIPTION(Instrument_name_engraver, at the left of the staff.", /* creats*/ "InstrumentName", -/* acks */ "bar-line-interface axis-group-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface axis-group-interface", /* reads */ "instrument instr", /* write */ ""); diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 7dc6973123..cff86db881 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -198,6 +198,7 @@ Key_engraver::initialize () ENTER_DESCRIPTION(Key_engraver, /* descr */ "", /* creats*/ "KeySignature", -/* acks */ "bar-line-interface clef-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface clef-interface", /* reads */ "keySignature lastKeySignature explicitKeySignatureVisibility createKeyOnClefChange keyAccidentalOrder keySignature", /* write */ "lastKeySignature"); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index bb4094a1e6..d52d563e6d 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -102,4 +102,7 @@ Key_performer::try_music (Music* req) return false; } -ENTER_DESCRIPTION(Key_performer,"","","","",""); +ENTER_DESCRIPTION(Key_performer, + "","", + "general-music", + "","",""); diff --git a/lily/ligature-bracket-engraver.cc b/lily/ligature-bracket-engraver.cc index 3230988cc5..5797748366 100644 --- a/lily/ligature-bracket-engraver.cc +++ b/lily/ligature-bracket-engraver.cc @@ -35,6 +35,7 @@ Ligature_bracket_engraver::create_ligature_spanner () ENTER_DESCRIPTION(Ligature_bracket_engraver, /* descr */ "Handles Ligature_requests by engraving Ligature brackets.", /* creats*/ "LigatureBracket", -/* acks */ "ligature-head-interface rest-interface", +/* accepts */ "general-music", +/* acks */ "ligature-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index f6e64da3e7..29af32f4db 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -191,6 +191,7 @@ Ligature_engraver::acknowledge_grob (Grob_info info) ENTER_DESCRIPTION (Ligature_engraver, /* descr */ "Abstract class; a concrete subclass handles Ligature_requests by engraving Ligatures in a concrete style.", /* creats*/ "Ligature", -/* acks */ "ligature-head-interface rest-interface", +/* accepts */ "general-music", +/* acks */ "ligature-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/lyric-combine-music.cc b/lily/lyric-combine-music.cc index 8e36faa674..3dbc450707 100644 --- a/lily/lyric-combine-music.cc +++ b/lily/lyric-combine-music.cc @@ -11,11 +11,9 @@ #include "lyric-combine-music-iterator.hh" #include "pitch.hh" -Lyric_combine_music::Lyric_combine_music (SCM l) - : Music (l) +Lyric_combine_music::Lyric_combine_music () + : Music () { - set_mus_property ("iterator-ctor", - Lyric_combine_music_iterator::constructor_proc); } @@ -70,9 +68,5 @@ Lyric_combine_music::get_lyrics () const return unsmob_music (gh_car (l)); } -Lyric_combine_music::Lyric_combine_music () - : Music (SCM_EOL) -{ -} ADD_MUSIC (Lyric_combine_music); diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 07cec49ce6..1da3c69a4b 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -98,6 +98,7 @@ Lyric_engraver::start_translation_timestep () ENTER_DESCRIPTION(Lyric_engraver, /* descr */ "", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 71ec186684..415fc9ce4d 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -73,4 +73,4 @@ Lyric_performer::try_music (Music* req) return false; } -ENTER_DESCRIPTION(Lyric_performer,"","","","",""); +ENTER_DESCRIPTION(Lyric_performer,"","","general-music","","",""); diff --git a/lily/lyric-phrasing-engraver.cc b/lily/lyric-phrasing-engraver.cc index 4f7a3c0d11..0dba2673df 100644 --- a/lily/lyric-phrasing-engraver.cc +++ b/lily/lyric-phrasing-engraver.cc @@ -361,6 +361,7 @@ This engraver is switched on by default. Turn it off for faster processing of orchestral scores. ", /* creats*/ "", - /* acks */ "lyric-syllable-interface note-head-interface lyric-extender-interface", + /* accepts */ "general-music", +/* acks */ "lyric-syllable-interface note-head-interface lyric-extender-interface", /* reads */ "automaticPhrasing melismaEngraverBusy associatedVoice phrasingPunctuation", /* write */ ""); diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 2aa1de4ae8..2a5e2db53d 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -190,6 +190,7 @@ Mark_engraver::process_music () ENTER_DESCRIPTION(Mark_engraver, /* descr */ "", /* creats*/ "RehearsalMark", -/* acks */ "bar-line-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface", /* reads */ "rehearsalMark stavesFound", /* write */ ""); diff --git a/lily/melisma-engraver.cc b/lily/melisma-engraver.cc index fd35082cdf..7e1353a0cd 100644 --- a/lily/melisma-engraver.cc +++ b/lily/melisma-engraver.cc @@ -52,6 +52,7 @@ Melisma_engraver::Melisma_engraver() ENTER_DESCRIPTION(Melisma_engraver, /* descr */ "", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "melismaBusy slurMelismaBusy tieMelismaBusy beamMelismaBusy", /* write */ ""); diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index 3c8637f04a..0672e9b8d9 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -563,6 +563,7 @@ Mensural_ligature_engraver::acknowledge_grob (Grob_info info) ENTER_DESCRIPTION (Mensural_ligature_engraver, /* descr */ "Handles Mensural_ligature_requests by glueing special ligature heads together.", /* creats*/ "MensuralLigature", -/* acks */ "ligature-head-interface note-head-interface rest-interface", +/* accepts */ "general-music", +/* acks */ "ligature-head-interface note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 23c0c0007a..93a33b0a00 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -181,6 +181,7 @@ ENTER_DESCRIPTION(Multi_measure_rest_engraver, measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest ", /* creats*/ "MultiMeasureRest", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "currentBarNumber currentCommandColumn measurePosition", /* write */ ""); diff --git a/lily/music-constructor.cc b/lily/music-constructor.cc index 51a2497ec6..86b4151000 100644 --- a/lily/music-constructor.cc +++ b/lily/music-constructor.cc @@ -35,6 +35,9 @@ get_music_ctor (String s) Music* make_music (String s) { - return (*get_music_ctor (s)) () ; + Music_ctor c = get_music_ctor (s); + assert (c); + + return (*c) (); } diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 44ec103c40..1dc61a3866 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -28,8 +28,8 @@ Music_sequence::append_music (Music *m) scm_gc_unprotect_object (m->self_scm ()); } -Music_sequence::Music_sequence (SCM l) - : Music (l) +Music_sequence::Music_sequence ( ) + : Music () { } @@ -134,12 +134,6 @@ Music_sequence::compress_list (SCM l, Moment m) ADD_MUSIC (Music_sequence); -Music_sequence::Music_sequence () - : Music (SCM_EOL) -{ - -} - Moment Music_sequence::minimum_start (SCM l) { diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index 3d58fca2ef..222bda0fcd 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -21,8 +21,8 @@ Music_wrapper::transpose (Pitch p) } -Music_wrapper::Music_wrapper (SCM l) - : Music (l) +Music_wrapper::Music_wrapper () + : Music () { } @@ -53,11 +53,6 @@ Music_wrapper::compress (Moment m) ADD_MUSIC (Music_wrapper); -Music_wrapper::Music_wrapper () - : Music (SCM_EOL) -{ - -} Moment Music_wrapper::start_mom () const diff --git a/lily/music.cc b/lily/music.cc index 40d913266a..df0b9c11eb 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -32,12 +32,24 @@ ly_deep_mus_copy (SCM m) } -Music::Music () + + +void +Music::add_music_type (SCM sym) { - self_scm_ = SCM_EOL; - immutable_property_alist_ = SCM_EOL; - mutable_property_alist_ = SCM_EOL; - smobify_self (); + assert (gh_symbol_p (sym)); + + SCM types= get_mus_property ("types"); + types = scm_cons (sym, types); + set_mus_property ("types", types); +} + +bool +Music::is_music_type (SCM k)const +{ + SCM ifs = get_mus_property ("types"); + + return scm_memq (k, ifs) != SCM_BOOL_F; } Music::Music (Music const &m) @@ -54,13 +66,16 @@ Music::Music (Music const &m) smobify_self (); mutable_property_alist_ = ly_deep_mus_copy (m.mutable_property_alist_); set_spot (*m.origin ()); + + add_music_type (ly_symbol2scm ("general-music")); } -Music::Music (SCM l) + +Music::Music () { self_scm_ = SCM_EOL; - immutable_property_alist_ = l; + immutable_property_alist_ = SCM_EOL; mutable_property_alist_ = SCM_EOL; smobify_self (); } @@ -117,7 +132,7 @@ print_alist (SCM a, SCM port) /* SCM_EOL -> catch malformed lists. */ - for (SCM s = a; s != SCM_EOL; s = ly_cdr (s)) + for (SCM s = a; gh_pair_p (s); s = ly_cdr (s)) { scm_display (ly_caar (s), port); scm_puts (" = ", port); @@ -279,6 +294,27 @@ LY_DEFINE(ly_music_name, "ly-music-name", 1, 0, 0, return scm_makfrom0str (nm); } + +// to do property args +LY_DEFINE(ly_extended_make_music, + "ly-extended-make-music", 2, 0, 0, (SCM type, SCM props), + " +Make a music object/expression of type @var{type}, init with +@var{props}. Warning: this interface will likely change in the near +future. + +Music is the data type that music expressions are stored in. The data +type does not yet offer many manipulations. +") +{ + SCM_ASSERT_TYPE(gh_string_p (type), type, SCM_ARG1, __FUNCTION__, "string"); + + SCM s = make_music (ly_scm2string (type))->self_scm (); + unsmob_music (s)->immutable_property_alist_ = props; + scm_gc_unprotect_object (s); + return s; +} + LY_DEFINE(ly_music_list_p,"music-list?", 1, 0, 0, (SCM l),"Type predicate: return true if @var{l} is a list of music objects.") { diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc index eb2fc894d5..77839228ff 100644 --- a/lily/note-head-line-engraver.cc +++ b/lily/note-head-line-engraver.cc @@ -154,6 +154,7 @@ ENTER_DESCRIPTION(Note_head_line_engraver, /* descr */ "Engrave a line between two note heads, for example a glissando. If followVoice is set, staff switches also generate a line.", /* creats*/ "Glissando VoiceFollower", -/* acks */ "rhythmic-head-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface", /* reads */ "followVoice", /* write */ ""); diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 97a8b97391..243783adb2 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -142,6 +142,7 @@ Note_heads_engraver::start_translation_timestep () ENTER_DESCRIPTION(Note_heads_engraver, /* descr */ "Generate one or more noteheads from Music of type Note_req.", /* creats*/ "NoteHead Dots", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "centralCPosition", /* write */ ""); diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index 1e7806e676..0ffa2d00b0 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -74,6 +74,7 @@ Note_name_engraver::Note_name_engraver() ENTER_DESCRIPTION(Note_name_engraver, /* descr */ "", /* creats*/ "NoteName", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index fafcc82941..ae8b1adf17 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -125,7 +125,7 @@ Note_performer::try_music (Music* req) return false; } -ENTER_DESCRIPTION(Note_performer,"","","","",""); +ENTER_DESCRIPTION(Note_performer,"","","general-music","","",""); Note_performer::Note_performer() { diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc index 17b025423c..fc6b297a6e 100644 --- a/lily/output-property-engraver.cc +++ b/lily/output-property-engraver.cc @@ -84,6 +84,7 @@ ENTER_DESCRIPTION(Output_property_engraver, /* descr */ "Interpret Music of Output_property type, and apply a function to any Graphic objects that satisfies the predicate.", /* creats*/ "", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); diff --git a/lily/parser.yy b/lily/parser.yy index 9e8574733d..f53c279507 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -78,18 +78,6 @@ regular_identifier_b (SCM id) } -Music* -set_property_music (SCM sym, SCM value) -{ - Music * p = new Music (SCM_EOL); - p->set_mus_property ("symbol", sym); - p->set_mus_property ("iterator-ctor", - Property_iterator::constructor_proc); - - p->set_mus_property ("value", value); - return p; -} - bool is_duration_b (int t) { @@ -106,9 +94,37 @@ set_music_properties (Music *p, SCM a) } +SCM make_music_proc; +Music* +parser_make_music (SCM sym) +{ + if (!make_music_proc) + make_music_proc = scm_primitive_eval (ly_symbol2scm ("make-music-by-name")); + + SCM rv = scm_call_1 (make_music_proc, sym); + /* + UGH. + */ + scm_gc_protect_object (rv); + return unsmob_music (rv); +} + +#define MY_MAKE_MUSIC(x) parser_make_music (ly_symbol2scm (x)) +#define TYPED_MAKE_MUSIC(x,v,y) x *v = dynamic_cast (parser_make_music (ly_symbol2scm (y))); + + + +Music* +set_property_music (SCM sym, SCM value) +{ + Music * p = MY_MAKE_MUSIC("PropertySet"); + p->set_mus_property ("symbol", sym); + p->set_mus_property ("value", value); + return p; +} // needed for bison.simple's malloc () and free () @@ -136,18 +152,14 @@ of the parse stack onto the heap. */ %union { - Link_array *reqvec; + Link_array *reqvec; String *string; // needed by the lexer as temporary scratch area. Music *music; Score *score; Scheme_hash_table *scmhash; Music_output_def * outputdef; - - Request * request; - SCM scm; - Tempo_req *tempo; int i; } @@ -276,8 +288,8 @@ yylex (YYSTYPE *s, void * v) %type output_def %type lilypond_header lilypond_header_body -%type open_request_parens close_request_parens open_request close_request -%type request_with_dir request_that_take_dir verbose_request +%type open_request_parens close_request_parens open_request close_request +%type request_with_dir request_that_take_dir verbose_request %type sub_quotes sup_quotes %type simple_element request_chord command_element Simple_music Composite_music %type Repeated_music @@ -291,7 +303,7 @@ yylex (YYSTYPE *s, void * v) %type verbose_duration %type pre_requests post_requests -%type gen_text_def +%type gen_text_def %type steno_pitch pitch absolute_pitch %type explicit_pitch steno_tonic_pitch @@ -306,12 +318,12 @@ yylex (YYSTYPE *s, void * v) %type property_def translator_change simple_property_def %type Music_list %type music_output_def_body -%type shorthand_command_req -%type post_request +%type shorthand_command_req +%type post_request %type command_req verbose_command_req -%type extender_req -%type hyphen_req -%type string_request +%type extender_req +%type hyphen_req +%type string_request %type string bare_number number_expression number_term number_factor %type score_block score_body @@ -671,7 +683,8 @@ music_output_def_body: tempo_request: TEMPO steno_duration '=' bare_unsigned { - $$ = new Tempo_req; + TYPED_MAKE_MUSIC(Tempo_req,t,"TempoEvent"); + $$ = t; $$->set_mus_property ("duration", $2); $$->set_mus_property ("metronome-count", gh_int2scm ( $4)); } @@ -728,8 +741,8 @@ Repeated_music: _("More alternatives than repeats. Junking excess alternatives.")); alts = ly_truncate_list (times, alts); } - - Repeated_music * r = new Repeated_music (SCM_EOL); + + TYPED_MAKE_MUSIC(Repeated_music,r,"RepeatedMusic"); if (beg) { r-> set_mus_property ("element", beg->self_scm ()); @@ -764,12 +777,12 @@ Repeated_music: Sequential_music: SEQUENTIAL '{' Music_list '}' { - $$ = new Sequential_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("SequentialMusic"); $$->set_mus_property ("elements", ly_car ($3)); $$->set_spot(THIS->here_input()); } | '{' Music_list '}' { - $$ = new Sequential_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("SequentialMusic"); $$->set_mus_property ("elements", ly_car ($2)); $$->set_spot(THIS->here_input()); } @@ -777,13 +790,13 @@ Sequential_music: Simultaneous_music: SIMULTANEOUS '{' Music_list '}'{ - $$ = new Simultaneous_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("SimultaneousMusic"); $$->set_mus_property ("elements", ly_car ($3)); $$->set_spot(THIS->here_input()); } | '<' Music_list '>' { - $$ = new Simultaneous_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("SimultaneousMusic"); $$->set_mus_property ("elements", ly_car ($2)); $$->set_spot(THIS->here_input()); } @@ -803,12 +816,10 @@ Simple_music: THIS->parser_error (_ ("First argument must be a procedure taking one argument")); } - Music *m = new Music (SCM_EOL); + TYPED_MAKE_MUSIC(Music,m,"OutputPropertySetMusic"); m->set_mus_property ("predicate", pred); m->set_mus_property ("grob-property", $3); m->set_mus_property ("grob-value", $5); - m->set_mus_property ("iterator-ctor", - Output_property_music_iterator::constructor_proc); $$ = m; } @@ -824,7 +835,8 @@ Simple_music: Composite_music: CONTEXT STRING Music { - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + TYPED_MAKE_MUSIC(Music,csm, "ContextSpeccedMusic"); + csm->set_mus_property ("element", $3->self_scm ()); scm_gc_unprotect_object ($3->self_scm ()); @@ -834,9 +846,8 @@ Composite_music: $$ = csm; } | AUTOCHANGE STRING Music { - Music * chm = new Music_wrapper (SCM_EOL); + TYPED_MAKE_MUSIC(Music,chm,"AutoChangeMusic"); chm->set_mus_property ("element", $3->self_scm ()); - chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc); scm_gc_unprotect_object ($3->self_scm ()); chm->set_mus_property ("what", $2); @@ -870,20 +881,23 @@ Composite_music: scm_gc_unprotect_object (startm->self_scm ()); } - Music* seq = new Sequential_music (SCM_EOL); + + Music* seq = MY_MAKE_MUSIC("SequentialMusic"); seq->set_mus_property ("elements", ms); - $$ = new Grace_music (SCM_EOL); + + $$ = MY_MAKE_MUSIC("GraceMusic"); $$->set_mus_property ("element", seq->self_scm ()); scm_gc_unprotect_object (seq->self_scm ()); #else - $$ = new Grace_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("GraceMusic"); $$->set_mus_property ("element", $2->self_scm ()); scm_gc_unprotect_object ($2->self_scm ()); #endif } | CONTEXT string '=' string Music { - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music * csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); + csm->set_mus_property ("element", $5->self_scm ()); scm_gc_unprotect_object ($5->self_scm ()); @@ -901,7 +915,7 @@ Composite_music: { int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3)); Music *mp = $4; - $$ = new Time_scaled_music (SCM_EOL); + $$= MY_MAKE_MUSIC("TimeScaledMusic"); $$->set_spot (THIS->pop_spot ()); @@ -916,7 +930,7 @@ Composite_music: | Simultaneous_music { $$ = $1; } | Sequential_music { $$ = $1; } | TRANSPOSE pitch Music { - $$ = new Transposed_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("TransposedMusic"); Music *p = $3; Pitch pit = *unsmob_pitch ($2); @@ -925,7 +939,7 @@ Composite_music: scm_gc_unprotect_object (p->self_scm ()); } | TRANSPOSE steno_tonic_pitch Music { - $$ = new Transposed_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("TransposedMusic"); Music *p = $3; Pitch pit = *unsmob_pitch ($2); @@ -939,7 +953,7 @@ Composite_music: Music *m = unsmob_music (ret); if (!m) { THIS->parser_error ("\\apply must return a Music"); - m = new Music (SCM_EOL); + m = MY_MAKE_MUSIC("Music"); } $$ = m; } @@ -953,7 +967,7 @@ Composite_music: { THIS->lexer_->push_figuredbass_state (); } Music { - Music * chm = new Untransposable_music () ; + Music * chm = MY_MAKE_MUSIC("UntransposableMusic"); chm->set_mus_property ("element", $3->self_scm ()); $$ = chm; scm_gc_unprotect_object ($3->self_scm()); @@ -964,7 +978,7 @@ Composite_music: { THIS->lexer_->push_chord_state (); } Music { - Music * chm = new Un_relativable_music ; + Music * chm = MY_MAKE_MUSIC("UnrelativableMusic"); chm->set_mus_property ("element", $3->self_scm ()); scm_gc_unprotect_object ($3->self_scm()); $$ = chm; @@ -987,7 +1001,7 @@ relative_music: RELATIVE absolute_pitch Music { Music * p = $3; Pitch pit = *unsmob_pitch ($2); - $$ = new Relative_octave_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("RelativeOctaveMusic"); $$->set_mus_property ("element", p->self_scm ()); scm_gc_unprotect_object (p->self_scm ()); @@ -999,7 +1013,7 @@ relative_music: re_rhythmed_music: ADDLYRICS Music Music { - Lyric_combine_music * l = new Lyric_combine_music (SCM_EOL); + TYPED_MAKE_MUSIC(Lyric_combine_music, l,"LyricCombineMusic"); l->set_mus_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED)); scm_gc_unprotect_object ($3->self_scm ()); scm_gc_unprotect_object ($2->self_scm ()); @@ -1009,8 +1023,7 @@ re_rhythmed_music: part_combined_music: PARTCOMBINE STRING Music Music { - Part_combine_music * p = new Part_combine_music (SCM_EOL); - +TYPED_MAKE_MUSIC(Part_combine_music,p, "PartCombineMusic"); p->set_mus_property ("what", $2); p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED)); @@ -1023,9 +1036,7 @@ part_combined_music: translator_change: TRANSLATOR STRING '=' STRING { - Music * t = new Music (SCM_EOL); - t->set_mus_property ("iterator-ctor", - Change_iterator::constructor_proc); + TYPED_MAKE_MUSIC(Music,t,"TranslatorChange"); t-> set_mus_property ("change-to-type", $2); t-> set_mus_property ("change-to-id", $4); @@ -1045,11 +1056,10 @@ property_def: simple_property_def: PROPERTY STRING '.' STRING '=' scalar { - Music *t = set_property_music (scm_string_to_symbol ($4), $6); - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); - csm->set_mus_property ("element", t->self_scm ()); + csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); $$ = csm; @@ -1058,13 +1068,11 @@ simple_property_def: csm-> set_mus_property ("context-type", $2); } | PROPERTY STRING '.' STRING UNSET { - Music *t = new Music (SCM_EOL); - - t->set_mus_property ("iterator-ctor", - Property_unset_iterator::constructor_proc); + + Music *t = MY_MAKE_MUSIC("PropertyUnset"); t->set_mus_property ("symbol", scm_string_to_symbol ($4)); - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); @@ -1077,9 +1085,8 @@ simple_property_def: bool autobeam = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings")); bool itc = internal_type_checking_global_b; - Music *t = new Music (SCM_EOL); - t->set_mus_property ("iterator-ctor", - Push_property_iterator::constructor_proc); + Music *t = MY_MAKE_MUSIC("OverrideProperty"); + t->set_mus_property ("symbol", scm_string_to_symbol ($4)); t->set_mus_property ("pop-first", SCM_BOOL_T); if (autobeam) @@ -1088,7 +1095,8 @@ simple_property_def: if (autobeam) internal_type_checking_global_b = itc; t->set_mus_property ("grob-value", $8); - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); $$ = csm; @@ -1106,11 +1114,8 @@ simple_property_def: = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings")); bool itc = internal_type_checking_global_b; - Music *t = new Music (SCM_EOL); - t->set_mus_property ("iterator-ctor", - Push_property_iterator::constructor_proc); + Music *t = MY_MAKE_MUSIC("OverrideProperty"); t->set_mus_property ("symbol", scm_string_to_symbol ($4)); - if (autobeam) internal_type_checking_global_b = false; t->set_mus_property ("grob-property", $6); @@ -1118,7 +1123,7 @@ simple_property_def: if (autobeam) internal_type_checking_global_b = itc; - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); @@ -1129,13 +1134,11 @@ simple_property_def: } | PROPERTY STRING '.' STRING REVERT embedded_scm { - Music *t = new Music (SCM_EOL); + Music *t = MY_MAKE_MUSIC("RevertProperty"); bool autobeam = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings")); bool itc = internal_type_checking_global_b; - t->set_mus_property ("iterator-ctor", - Pop_property_iterator::constructor_proc); t->set_mus_property ("symbol", scm_string_to_symbol ($4)); if (autobeam) internal_type_checking_global_b = false; @@ -1143,7 +1146,7 @@ simple_property_def: if (autobeam) internal_type_checking_global_b = itc; - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); @@ -1183,7 +1186,7 @@ request_chord: command_element: command_req { - $$ = new Request_chord (SCM_EOL); + $$ = MY_MAKE_MUSIC("RequestChord"); $$->set_mus_property ("elements", scm_cons ($1->self_scm (), SCM_EOL)); scm_gc_unprotect_object ($1->self_scm()); @@ -1191,42 +1194,41 @@ command_element: $1-> set_spot (THIS->here_input ()); } | E_LEFTSQUARE { - Span_req *l = new Span_req; - l->set_span_dir (START); + Music *l = MY_MAKE_MUSIC("SpanEvent"); + l->set_mus_property ("span-direction", gh_int2scm (START)); l->set_mus_property ("span-type", scm_makfrom0str ("ligature")); l->set_spot (THIS->here_input ()); - $$ = new Request_chord (SCM_EOL); + $$ = MY_MAKE_MUSIC("RequestChord"); $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL)); scm_gc_unprotect_object (l->self_scm()); $$->set_spot (THIS->here_input ()); } | E_RIGHTSQUARE { - Span_req *l = new Span_req; - l->set_span_dir (STOP); + Music *l = MY_MAKE_MUSIC("SpanEvent"); + l->set_mus_property ("span-direction", gh_int2scm (STOP)); l->set_mus_property ("span-type", scm_makfrom0str ("ligature")); l->set_spot (THIS->here_input ()); - $$ = new Request_chord (SCM_EOL); + $$ = MY_MAKE_MUSIC("RequestChord"); $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL)); $$->set_spot (THIS->here_input ()); scm_gc_unprotect_object (l->self_scm()); } | E_BACKSLASH { - $$ = new Music (gh_list (scm_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED)); + $$ = MY_MAKE_MUSIC("VoiceSeparator"); $$->set_spot (THIS->here_input ()); } | '|' { - extern Music * get_barcheck(); - $$ = get_barcheck (); + $$ = MY_MAKE_MUSIC("BarCheck"); $$->set_spot (THIS->here_input ()); } | BAR STRING { Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2); - Context_specced_music *csm = new Context_specced_music (SCM_EOL); + Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); csm->set_mus_property ("element", t->self_scm ()); scm_gc_unprotect_object (t->self_scm ()); @@ -1239,7 +1241,7 @@ command_element: Moment m = - unsmob_duration ($2)->length_mom (); Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ()); - Context_specced_music * sp = new Context_specced_music (SCM_EOL); + Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic"); sp->set_mus_property ("element", p->self_scm ()); scm_gc_unprotect_object (p->self_scm ()); @@ -1252,15 +1254,15 @@ command_element: SCM l = SCM_EOL; for (SCM s = result ; gh_pair_p (s); s = ly_cdr (s)) { - Music * p = new Music (SCM_EOL); + Music * p = MY_MAKE_MUSIC("Music"); set_music_properties (p, ly_car (s)); l = scm_cons (p->self_scm (), l); scm_gc_unprotect_object (p->self_scm ()); } - Sequential_music * seq = new Sequential_music (SCM_EOL); + Music * seq = MY_MAKE_MUSIC("SequentialMusic"); seq->set_mus_property ("elements", l); - Context_specced_music * sp = new Context_specced_music (SCM_EOL); + Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic"); sp->set_mus_property ("element", seq->self_scm ()); scm_gc_unprotect_object (seq->self_scm ()); @@ -1281,11 +1283,11 @@ command_element: Music *p3 = set_property_music (ly_symbol2scm ("beatLength"), one_beat.smobbed_copy ()); SCM list = scm_list_n (p1->self_scm (), p2->self_scm (), p3->self_scm(), SCM_UNDEFINED); - Sequential_music *seq = new Sequential_music (SCM_EOL); + Music *seq = MY_MAKE_MUSIC("SequentialMusic"); seq->set_mus_property ("elements", list); - Context_specced_music * sp = new Context_specced_music (SCM_EOL); + Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic"); sp->set_mus_property ("element", seq->self_scm ()); scm_gc_unprotect_object (p3->self_scm ()); @@ -1312,11 +1314,12 @@ shorthand_command_req: $$ = $1; } | '~' { - $$ = new Tie_req; + $$ = MY_MAKE_MUSIC("TieEvent"); } | '[' { - Span_req*b= new Span_req; - b->set_span_dir (START); + Music *b= MY_MAKE_MUSIC("SpanEvent"); + b->set_mus_property ("span-direction", gh_int2scm (START)) +; b->set_mus_property ("span-type", scm_makfrom0str ("beam")); $$ =b; @@ -1324,38 +1327,39 @@ shorthand_command_req: THIS->last_beam_start_ = b->self_scm (); } | ']' { - Span_req*b= new Span_req; - b->set_span_dir ( STOP); + Music *b= MY_MAKE_MUSIC("SpanEvent"); + b->set_mus_property ("span-direction", gh_int2scm (STOP)) +; b->set_mus_property ("span-type", scm_makfrom0str ("beam")); $$ = b; } | BREATHE { - $$ = new Breathing_sign_req; + $$ = MY_MAKE_MUSIC("BreathingSignEvent"); } | E_TILDE { - $$ = new Porrectus_req; + $$ = MY_MAKE_MUSIC("PorrectusEvent"); } ; verbose_command_req: COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */ - Span_req * sp = new Span_req; - sp-> set_span_dir ( Direction ($2)); + Music * sp = MY_MAKE_MUSIC("SpanEvent"); + sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2))); sp->set_mus_property ("span-type",$3); sp->set_spot (THIS->here_input ()); $$ = sp; } | MARK DEFAULT { - Mark_req * m = new Mark_req; + Music * m = MY_MAKE_MUSIC("MarkEvent"); $$ = m; } | MARK scalar { - Mark_req *m = new Mark_req; + Music *m = MY_MAKE_MUSIC("MarkEvent"); m->set_mus_property ("label", $2); $$ = m; } | PENALTY SCM_T { - Break_req * b = new Break_req; + Music * b = MY_MAKE_MUSIC("BreakEvent"); SCM s = $2; if (!gh_number_p (s)) s =gh_int2scm (0); @@ -1365,7 +1369,7 @@ verbose_command_req: $$ = b; } | SKIP duration_length { - Skip_req * skip = new Skip_req; + Music * skip = MY_MAKE_MUSIC("SkipEvent"); skip->set_mus_property ("duration", $2); $$ = skip; @@ -1374,11 +1378,11 @@ verbose_command_req: $$ = $1; } | KEY DEFAULT { - Key_change_req *key= new Key_change_req; + Music *key= MY_MAKE_MUSIC("KeyChangeEvent"); $$ = key; } | KEY NOTENAME_PITCH SCM_IDENTIFIER { - Key_change_req *key= new Key_change_req; + Music *key= MY_MAKE_MUSIC("KeyChangeEvent"); key->set_mus_property ("pitch-alist", $3); ((Music*)key)->transpose (* unsmob_pitch ($2)); @@ -1388,7 +1392,7 @@ verbose_command_req: post_requests: { - $$ = new Link_array; + $$ = new Link_array; } | post_requests post_request { $2->set_spot (THIS->here_input ()); @@ -1406,7 +1410,7 @@ post_request: string_request: E_UNSIGNED { - String_number_req* s = new String_number_req; + Music * s = MY_MAKE_MUSIC("StringNumberEvent"); s->set_mus_property ("string-number", gh_int2scm($1)); s->set_spot (THIS->here_input ()); $$ = s; @@ -1419,7 +1423,7 @@ request_that_take_dir: | verbose_request | script_abbreviation { SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1)); - Articulation_req *a = new Articulation_req; + Music *a = MY_MAKE_MUSIC("ArticulationEvent"); if (gh_string_p (s)) a->set_mus_property ("articulation-type", s); else THIS->parser_error (_ ("Expecting string as script definition")); @@ -1429,24 +1433,21 @@ request_that_take_dir: request_with_dir: script_dir request_that_take_dir { - if (Script_req * gs = dynamic_cast ($2)) - gs->set_direction (Direction ($1)); - else if ($1) - $2->origin ()->warning (_ ("Can't specify direction for this request")); + $2->set_mus_property ("direction", gh_int2scm ($1)); $$ = $2; } ; verbose_request: REQUEST_IDENTIFIER { - $$ = dynamic_cast (unsmob_music ($1)->clone ()); + $$ = unsmob_music ($1)->clone (); $$->set_spot (THIS->here_input ()); } | DYNAMICSCRIPT embedded_scm { /* TODO: junkme, use text-type == dynamic */ - Text_script_req *d = new Text_script_req; + Music *d = MY_MAKE_MUSIC("TextScriptEvent"); SCM dyn = ly_symbol2scm ("dynamic"); d->set_mus_property ("text-type" , dyn); d->set_mus_property ("text", $2); @@ -1454,34 +1455,35 @@ verbose_request: $$ = d; } | SPANREQUEST bare_int STRING { - Span_req * sp = new Span_req; - sp->set_span_dir ( Direction ($2)); + Music * sp = MY_MAKE_MUSIC("SpanEvent"); + sp->set_mus_property ("span-direction", gh_int2scm ( $2)); sp->set_mus_property ("span-type", $3); sp->set_spot (THIS->here_input ()); $$ = sp; } | tremolo_type { - Tremolo_req* a = new Tremolo_req; + Music * a = MY_MAKE_MUSIC("TremoloEvent"); a->set_spot (THIS->here_input ()); a->set_mus_property ("tremolo-type", gh_int2scm ($1)); $$ = a; } | SCRIPT STRING { - Articulation_req * a = new Articulation_req; + Music * a = MY_MAKE_MUSIC("ArticulationEvent"); a->set_mus_property ("articulation-type", $2); a->set_spot (THIS->here_input ()); $$ = a; } + /* -duh, junk this syntax from the parser, if possible. + duh, junk this syntax from the parser, if possible. */ | ARPEGGIO { - Arpeggio_req *a = new Arpeggio_req; + Music *a = MY_MAKE_MUSIC("ArpeggioEvent"); a->set_spot (THIS->here_input ()); $$ = a; } | GLISSANDO { - Glissando_req *g = new Glissando_req; + Music *g = MY_MAKE_MUSIC("GlissandoEvent"); g->set_spot /* No pun intended */ (THIS->here_input ()); $$ = g; } @@ -1579,7 +1581,7 @@ extender_req: EXTENDER { if (!THIS->lexer_->lyric_state_b ()) THIS->parser_error (_ ("Have to be in Lyric mode for lyrics")); - $$ = new Extender_req; + $$ = MY_MAKE_MUSIC("ExtenderEvent"); } ; @@ -1587,38 +1589,39 @@ hyphen_req: HYPHEN { if (!THIS->lexer_->lyric_state_b ()) THIS->parser_error (_ ("Have to be in Lyric mode for lyrics")); - $$ = new Hyphen_req; + $$ = MY_MAKE_MUSIC("HyphenEvent"); } ; close_request: close_request_parens { $$ = $1; - dynamic_cast ($$)->set_span_dir ( START); + dynamic_cast ($$)->set_mus_property ("span-direction", gh_int2scm (START)) +; } ; close_request_parens: '(' { - Span_req* s= new Span_req; + Music * s= MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ( "slur")); s->set_spot (THIS->here_input()); } | E_OPEN { - Span_req* s= new Span_req; + Music * s= MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur")); s->set_spot (THIS->here_input()); } | E_SMALLER { - Span_req*s =new Span_req; + Music *s =MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ( "crescendo")); s->set_spot (THIS->here_input()); } | E_BIGGER { - Span_req*s =new Span_req; + Music *s =MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ("decrescendo")); s->set_spot (THIS->here_input()); @@ -1629,27 +1632,28 @@ close_request_parens: open_request: open_request_parens { $$ = $1; - dynamic_cast ($$)->set_span_dir (STOP); + dynamic_cast ($$)->set_mus_property ("span-direction", gh_int2scm (STOP)) +; } ; open_request_parens: E_EXCLAMATION { - Span_req *s = new Span_req; + Music *s = MY_MAKE_MUSIC("SpanEvent"); s->set_mus_property ("span-type", scm_makfrom0str ( "crescendo")); s->set_spot (THIS->here_input()); $$ = s; } | ')' { - Span_req* s= new Span_req; + Music * s= MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ( "slur")); s->set_spot (THIS->here_input()); } | E_CLOSE { - Span_req* s= new Span_req; + Music * s= MY_MAKE_MUSIC("SpanEvent"); $$ = s; s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur")); s->set_spot (THIS->here_input()); @@ -1658,20 +1662,20 @@ open_request_parens: gen_text_def: embedded_scm { - Text_script_req *t = new Text_script_req; + Music *t = MY_MAKE_MUSIC("TextScriptEvent"); t->set_mus_property ("text", $1); t->set_spot (THIS->here_input ()); $$ = t; } | string { - Text_script_req *t = new Text_script_req; + Music *t = MY_MAKE_MUSIC("TextScriptEvent"); t->set_mus_property ("text", $1); t->set_spot (THIS->here_input ()); $$ = t; } | DIGIT { String ds = to_string ($1); - Text_script_req* t = new Text_script_req; + Music * t = MY_MAKE_MUSIC("TextScriptEvent"); SCM finger = ly_symbol2scm ("finger"); t->set_mus_property ("text", scm_makfrom0str (ds.to_str0 ())); t->set_mus_property ("text-type" , finger); @@ -1712,7 +1716,7 @@ script_dir: pre_requests: { - $$ = new Link_array; + $$ = new Link_array; } | pre_requests open_request { $$->push ($2); @@ -1829,12 +1833,12 @@ bass_mod: bass_figure: FIGURE_SPACE { - Bass_figure_req *bfr = new Bass_figure_req; + Music *bfr = MY_MAKE_MUSIC("BassFigureEvent"); $$ = bfr->self_scm(); scm_gc_unprotect_object ($$); } | bass_number { - Bass_figure_req *bfr = new Bass_figure_req; + Music *bfr = MY_MAKE_MUSIC("BassFigureEvent"); $$ = bfr->self_scm(); bfr->set_mus_property ("figure", gh_int2scm ($1)); @@ -1879,7 +1883,7 @@ figure_list: figure_spec: FIGURE_OPEN figure_list FIGURE_CLOSE { - Music * m = new Request_chord (SCM_EOL); + Music * m = MY_MAKE_MUSIC("RequestChord"); $2 = scm_reverse_x ($2, SCM_EOL); m->set_mus_property ("elements", $2); $$ = m->self_scm (); @@ -1901,9 +1905,9 @@ simple_element: Music *n = 0; if ($5) - n = new Rest_req ; + n = MY_MAKE_MUSIC("RestEvent"); else - n = new Note_req; + n = MY_MAKE_MUSIC("NoteEvent"); n->set_mus_property ("pitch", $1); n->set_mus_property ("duration", $4); @@ -1914,7 +1918,7 @@ simple_element: if ($2 % 2 || $3 % 2) n->set_mus_property ("force-accidental", SCM_BOOL_T); - Simultaneous_music*v = new Request_chord (SCM_EOL); + Music *v = MY_MAKE_MUSIC("RequestChord"); v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED)); scm_gc_unprotect_object (n->self_scm()); @@ -1938,18 +1942,18 @@ simple_element: SCM e = SCM_UNDEFINED; if (ly_scm2string ($1) =="s") { /* Space */ - Skip_req * skip = new Skip_req; + Music * skip = MY_MAKE_MUSIC("SkipEvent"); skip->set_mus_property ("duration" ,$2); skip->set_spot (i); e = skip->self_scm (); } else { - Rest_req * rest_req = new Rest_req; + Music * rest_req = MY_MAKE_MUSIC("RestEvent"); rest_req->set_mus_property ("duration", $2); rest_req->set_spot (i); e = rest_req->self_scm (); } - Simultaneous_music* velt = new Request_chord (SCM_EOL); + Music * velt = MY_MAKE_MUSIC("RequestChord"); velt-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED)); velt->set_spot (i); @@ -1958,36 +1962,38 @@ simple_element: | MULTI_MEASURE_REST optional_notemode_duration { THIS->pop_spot (); - Skip_req * sk = new Skip_req; + Music * sk = MY_MAKE_MUSIC("SkipEvent"); sk->set_mus_property ("duration", $2); - Span_req *sp1 = new Span_req; - Span_req *sp2 = new Span_req; - sp1-> set_span_dir ( START); - sp2-> set_span_dir ( STOP); + Music *sp1 = MY_MAKE_MUSIC("SpanEvent"); + Music *sp2 = MY_MAKE_MUSIC("SpanEvent"); + sp1-> set_mus_property ("span-direction", gh_int2scm (START)) +; + sp2-> set_mus_property ("span-direction", gh_int2scm (STOP)) +; SCM r = scm_makfrom0str ("rest"); sp1->set_mus_property ("span-type", r); sp2->set_mus_property ("span-type", r); - Request_chord * rqc1 = new Request_chord (SCM_EOL); + Music *rqc1 = MY_MAKE_MUSIC("RequestChord"); rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED)); - Request_chord * rqc2 = new Request_chord (SCM_EOL); + Music *rqc2 = MY_MAKE_MUSIC("RequestChord"); rqc2->set_mus_property ("elements", scm_list_n (sk->self_scm (), SCM_UNDEFINED));; - Request_chord * rqc3 = new Request_chord (SCM_EOL); + Music *rqc3 = MY_MAKE_MUSIC("RequestChord"); rqc3->set_mus_property ("elements", scm_list_n (sp2->self_scm (), SCM_UNDEFINED));; SCM ms = scm_list_n (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED); - $$ = new Sequential_music (SCM_EOL); + $$ = MY_MAKE_MUSIC("SequentialMusic"); $$->set_mus_property ("elements", ms); } | STRING optional_notemode_duration { Input i = THIS->pop_spot (); - Lyric_req* lreq = new Lyric_req; + Music * lreq = MY_MAKE_MUSIC("LyricEvent"); lreq->set_mus_property ("text", $1); lreq->set_mus_property ("duration",$2); lreq->set_spot (i); - Simultaneous_music* velt = new Request_chord (SCM_EOL); + Music * velt = MY_MAKE_MUSIC("RequestChord"); velt->set_mus_property ("elements", scm_list_n (lreq->self_scm (), SCM_UNDEFINED)); $$= velt; diff --git a/lily/part-combine-music.cc b/lily/part-combine-music.cc index da76cf1e94..8ad0fd6e98 100644 --- a/lily/part-combine-music.cc +++ b/lily/part-combine-music.cc @@ -11,11 +11,8 @@ #include "part-combine-music-iterator.hh" #include "pitch.hh" -Part_combine_music::Part_combine_music (SCM l) - : Music (l) +Part_combine_music::Part_combine_music () { - set_mus_property ("iterator-ctor", - Part_combine_music_iterator::constructor_proc); } void @@ -67,10 +64,4 @@ Part_combine_music::get_second () const return unsmob_music (gh_car (l)); } - -Part_combine_music::Part_combine_music () - : Music (SCM_EOL) -{ -} - ADD_MUSIC (Part_combine_music); diff --git a/lily/percent-repeat-engraver.cc b/lily/percent-repeat-engraver.cc index 70f1252879..1f9023ae72 100644 --- a/lily/percent-repeat-engraver.cc +++ b/lily/percent-repeat-engraver.cc @@ -240,6 +240,7 @@ Percent_repeat_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Percent_repeat_engraver, /* descr */ "Make beat, whole bar and double bar repeats.", /* creats*/ "PercentRepeat RepeatSlash DoublePercentRepeat", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "measureLength currentCommandColumn", /* write */ ""); diff --git a/lily/performer-group-performer.cc b/lily/performer-group-performer.cc index 9a10e3d16f..0e099f0259 100644 --- a/lily/performer-group-performer.cc +++ b/lily/performer-group-performer.cc @@ -16,7 +16,8 @@ ENTER_DESCRIPTION(Performer_group_performer, /* descr */ "", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 9240e78542..8495817d09 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -174,6 +174,7 @@ Phrasing_slur_engraver::start_translation_timestep () ENTER_DESCRIPTION(Phrasing_slur_engraver, /* descr */ "Print phrasing slurs. Similar to Slur_engraver", /* creats*/ "PhrasingSlur", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "slurMelismaBusy", /* write */ ""); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 13ed7a6990..4f478bea9b 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -509,6 +509,7 @@ Piano_pedal_engraver::start_translation_timestep () ENTER_DESCRIPTION (Piano_pedal_engraver, /* descr */ "Engrave piano pedal symbols and brackets.", /* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings", /* write */ ""); diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 59ed0a4469..940a148285 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -139,4 +139,7 @@ Piano_pedal_performer::try_music (Music* r) } return false; } -ENTER_DESCRIPTION (Piano_pedal_performer, "","","","","" ); + +ENTER_DESCRIPTION (Piano_pedal_performer, "","", + "general-music", + "","","" ); diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index 8008d4d9cc..002d28440e 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -40,6 +40,7 @@ the locations of accidentals stay the same. Set the position field of all note heads to zero. This useful for making a single line staff that demonstrates the rhythm of a melody.", /* creats*/ "", -/* acks */ "note-head-interface", +/* accepts */ "general-music", +/* acks */ "note-head-interface", /* reads */ "squashedPosition", /* write */ ""); diff --git a/lily/porrectus-engraver.cc b/lily/porrectus-engraver.cc index cf1b8962f5..578389b1ab 100644 --- a/lily/porrectus-engraver.cc +++ b/lily/porrectus-engraver.cc @@ -168,6 +168,7 @@ Porrectus_engraver::start_translation_timestep () ENTER_DESCRIPTION(Porrectus_engraver, /* descr */ "Join adjacent notes to a porrectus ligature.", /* creats*/ "Porrectus", -/* acks */ "rhythmic-head-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface", /* reads */ "", /* write */ ""); diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index 14890694c3..6487921b17 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -17,15 +17,8 @@ Relative_octave_music::to_relative_octave (Pitch) } -Relative_octave_music::Relative_octave_music (SCM l) - : Music_wrapper (l) -{ - set_mus_property ("type", ly_symbol2scm ("relative-octave-music")); -} - Relative_octave_music::Relative_octave_music () { - set_mus_property ("type", ly_symbol2scm ("relative-octave-music")); } ADD_MUSIC (Relative_octave_music); diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index 1b7d91104f..0c6921feca 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -114,6 +114,7 @@ ENTER_DESCRIPTION(Repeat_acknowledge_engraver, /* descr */ "Acknowledge repeated music, and convert the contents of repeatCommands ainto an appropriate setting for whichBar", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "repeatCommands whichBar", /* write */ ""); diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 7b3ffe6e4d..3a2ed5eb6c 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -26,11 +26,6 @@ Repeated_music::alternatives ()const } -Repeated_music::Repeated_music (SCM l) - : Music (l) -{ - set_mus_property ("type", ly_symbol2scm ("repeated-music")); -} Pitch @@ -164,9 +159,8 @@ Repeated_music::volta_music_length (SCM m) ADD_MUSIC (Repeated_music); Repeated_music::Repeated_music () - : Music (SCM_EOL) + : Music () { - set_mus_property ("type", ly_symbol2scm ("repeated-music")); } diff --git a/lily/request-chord.cc b/lily/request-chord.cc index 3de20f4b4f..7d9cb184f4 100644 --- a/lily/request-chord.cc +++ b/lily/request-chord.cc @@ -3,17 +3,8 @@ #include "music-list.hh" #include "musical-request.hh" -Request_chord::Request_chord (SCM s) - : Simultaneous_music (s) -{ - set_mus_property ("iterator-ctor", - Request_chord_iterator::constructor_proc); -} - Request_chord::Request_chord () { - set_mus_property ("iterator-ctor", - Request_chord_iterator::constructor_proc); } Pitch diff --git a/lily/request.cc b/lily/request.cc index 5b0911a2da..152a67aa88 100644 --- a/lily/request.cc +++ b/lily/request.cc @@ -22,9 +22,8 @@ Request::do_equal_b (Request const*) const } Request::Request () - : Music (SCM_EOL) + : Music () { - set_mus_property ("type", ly_symbol2scm ("request")); } Script_req::Script_req () @@ -60,7 +59,4 @@ Span_req::set_span_dir (Direction d) set_mus_property ("span-direction", gh_int2scm (d)); } - - - - +ADD_MUSIC(Request); diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index b5aaa7722e..cff3fbff87 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -65,6 +65,7 @@ Rest_collision_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Rest_collision_engraver, /* descr */ "Handles collisions of rests.", /* creats*/ "RestCollision", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 96d1698249..dc617ef3b7 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -122,6 +122,7 @@ Rest_engraver::try_music (Music *m) ENTER_DESCRIPTION(Rest_engraver, /* descr */ "", /* creats*/ "Rest Dots", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "centralCPosition", /* write */ ""); diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index edea4d8a95..20c86a3b11 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -182,6 +182,7 @@ Rhythmic_column_engraver::start_translation_timestep () ENTER_DESCRIPTION(Rhythmic_column_engraver, /* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.", /* creats*/ "NoteColumn NoteSpacing", -/* acks */ "stem-interface rhythmic-head-interface dot-column-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rhythmic-head-interface dot-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index ce13f5ec44..f50c398aff 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -351,6 +351,7 @@ that there are no beams or notes that prevent a breakpoint.) ", /* creats*/ "System PaperColumn NonMusicalPaperColumn", -/* acks */ "note-spacing-interface staff-spacing-interface", +/* accepts */ "general-music", +/* acks */ "note-spacing-interface staff-spacing-interface", /* reads */ "currentMusicalColumn currentCommandColumn", /* write */ ""); diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 04262d3b8a..686574f9d1 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -21,7 +21,8 @@ ENTER_DESCRIPTION(Score_performer, /* descr */ "", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index 6141568630..7af91365b7 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -87,6 +87,7 @@ Script_column_engraver::process_acknowledged_grobs () ENTER_DESCRIPTION(Script_column_engraver, /* descr */ "", /* creats*/ "ScriptColumn", -/* acks */ "side-position-interface", +/* accepts */ "general-music", +/* acks */ "side-position-interface", /* reads */ "", /* write */ ""); diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index aa16108edd..a153242688 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -209,6 +209,7 @@ ENTER_DESCRIPTION(Script_engraver, /* descr */ " Handles note ornaments generated by @code{\\script}. ", /* creats*/ "Script", -/* acks */ "stem-interface rhythmic-head-interface note-column-interface", +/* accepts */ "general-music", +/* acks */ "stem-interface rhythmic-head-interface note-column-interface", /* reads */ "scriptDefinitions scriptHorizontal", /* write */ ""); diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 28ea1082c0..cd1fa23a02 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -213,6 +213,7 @@ Separating_line_group_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Separating_line_group_engraver, /* descr */ "Generates objects for computing spacing parameters.", /* creats*/ "SeparationItem SeparatingGroupSpanner", -/* acks */ "item-interface", +/* accepts */ "general-music", +/* acks */ "item-interface", /* reads */ "", /* write */ ""); diff --git a/lily/sequential-music.cc b/lily/sequential-music.cc index 6a1c6f5240..10acadf4cc 100644 --- a/lily/sequential-music.cc +++ b/lily/sequential-music.cc @@ -2,17 +2,9 @@ #include "music-list.hh" #include "sequential-music-iterator.hh" -Sequential_music::Sequential_music (SCM head) - : Music_sequence (head) -{ - set_mus_property ("iterator-ctor", - Sequential_music_iterator::constructor_proc); -} Sequential_music::Sequential_music () : Music_sequence () { - set_mus_property ("iterator-ctor", - Sequential_music_iterator::constructor_proc); } diff --git a/lily/simultaneous-music.cc b/lily/simultaneous-music.cc index 580a6f9b9d..dcfa4c561b 100644 --- a/lily/simultaneous-music.cc +++ b/lily/simultaneous-music.cc @@ -16,19 +16,8 @@ Simultaneous_music::start_mom () const return Music_sequence::minimum_start (get_mus_property ("elements")); } -Simultaneous_music::Simultaneous_music (SCM head) - : Music_sequence (head) +Simultaneous_music::Simultaneous_music() { - set_mus_property ("iterator-ctor", - Simultaneous_music_iterator::constructor_proc); -} - -Simultaneous_music::Simultaneous_music () - : Music_sequence () -{ - set_mus_property ("iterator-ctor", - Simultaneous_music_iterator::constructor_proc); - } Pitch diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 1f0355795a..b703078f62 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -205,6 +205,7 @@ Slur_engraver::start_translation_timestep () ENTER_DESCRIPTION (Slur_engraver, /* descr */ "Build slurs from Slur_reqs", /* creats*/ "Slur", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "slurMelismaBusy", /* write */ ""); diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 52db863682..9903b10070 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -171,6 +171,7 @@ Spacing_engraver::start_translation_timestep () ENTER_DESCRIPTION(Spacing_engraver, /* descr */ "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes ", /* creats*/ "SpacingSpanner", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 137c5a7063..92f6d0f42b 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -105,6 +105,7 @@ Span_arpeggio_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Span_arpeggio_engraver, /* descr */ "", /* creats*/ "Arpeggio", -/* acks */ "arpeggio-interface", +/* accepts */ "general-music", +/* acks */ "arpeggio-interface", /* reads */ "connectArpeggios", /* write */ ""); diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 053a88c7c5..503e563a1d 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -93,6 +93,7 @@ ENTER_DESCRIPTION(Span_bar_engraver, /* descr */ "This engraver makes cross-staff barlines: It catches all normal bar lines, and draws a single span-bar across them.", /* creats*/ "SpanBar", -/* acks */ "bar-line-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface", /* reads */ "", /* write */ ""); diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index 8f6cfc95e0..6c53867584 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -184,4 +184,7 @@ Span_dynamic_performer::try_music (Music* r) } return false; } -ENTER_DESCRIPTION (Span_dynamic_performer, "","","","","" ); +ENTER_DESCRIPTION (Span_dynamic_performer, + "", "", + "general-music", + "", "", ""); diff --git a/lily/staff-collecting-engraver.cc b/lily/staff-collecting-engraver.cc index efc7f8df37..23792a7332 100644 --- a/lily/staff-collecting-engraver.cc +++ b/lily/staff-collecting-engraver.cc @@ -40,6 +40,7 @@ ENTER_DESCRIPTION(Staff_collecting_engraver, /* descr */ "Maintain the stavesFound variable", /* creats*/ "", -/* acks */ "staff-symbol-interface", +/* accepts */ "general-music", +/* acks */ "staff-symbol-interface", /* reads */ "stavesFound", /* write */ "stavesFound"); diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 0d64b09cec..d666fb6064 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -41,7 +41,9 @@ private: Audio_tempo* tempo_; }; -ENTER_DESCRIPTION (Staff_performer, "","","","","" ); +ENTER_DESCRIPTION (Staff_performer, "", "", + "general-music", + "", "", ""); Staff_performer::Staff_performer () { diff --git a/lily/staff-symbol-engraver.cc b/lily/staff-symbol-engraver.cc index 7e19c900c5..956f9a0c5b 100644 --- a/lily/staff-symbol-engraver.cc +++ b/lily/staff-symbol-engraver.cc @@ -74,6 +74,7 @@ ENTER_DESCRIPTION(Staff_symbol_engraver, /* descr */ "create the constellation of five (default) staff lines.", /* creats*/ "StaffSymbol", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index cf64afb4d1..9e1f3d1fc1 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -94,6 +94,7 @@ Stanza_number_engraver::create_text (SCM txt) ENTER_DESCRIPTION(Stanza_number_engraver, /* descr */ "", /* creats*/ "StanzaNumber", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "stz stanza", /* write */ ""); diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index b1f3eb4b99..b18a94074f 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -172,6 +172,7 @@ ENTER_DESCRIPTION(Stem_engraver, /* descr */ "Create stems and single-stem tremolos. It also works together with the beam engraver for overriding beaming.", /* creats*/ "Stem StemTremolo", -/* acks */ "rhythmic-head-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface", /* reads */ "tremoloFlags stemLeftBeamCount stemRightBeamCount", /* write */ ""); diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc index c374d78675..8f00a789c2 100644 --- a/lily/swallow-perf.cc +++ b/lily/swallow-perf.cc @@ -22,6 +22,7 @@ Swallow_performer::Swallow_performer() ENTER_DESCRIPTION(Swallow_performer, /* descr */ "", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 88646057f1..682cf4f069 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -87,6 +87,7 @@ System_start_delimiter_engraver::finalize () ENTER_DESCRIPTION(System_start_delimiter_engraver, /* descr */ "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner", /* creats*/ "SystemStartBar SystemStartBrace SystemStartBracket", -/* acks */ "system-start-delimiter-interface staff-symbol-interface", +/* accepts */ "general-music", +/* acks */ "system-start-delimiter-interface staff-symbol-interface", /* reads */ "systemStartDelimiter", /* write */ ""); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 9e8062a42f..603074d234 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -173,7 +173,8 @@ Tab_note_heads_engraver::start_translation_timestep () ENTER_DESCRIPTION(Tab_note_heads_engraver, /* descr */ "Generate one or more tablature noteheads from Music of type Note_req.", /* creats*/ "TabNoteHead Dots", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "centralCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost", /* write */ ""); diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index a6d864b5c7..682a6869d4 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -27,7 +27,9 @@ private: Audio_tempo* audio_; }; -ENTER_DESCRIPTION (Tempo_performer, "","","","","" ); +ENTER_DESCRIPTION (Tempo_performer, "","", + "general-music", + "","","" ); Tempo_performer::Tempo_performer () diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 723e111741..505a74505a 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -144,6 +144,7 @@ Text_engraver::Text_engraver(){} ENTER_DESCRIPTION(Text_engraver, /* descr */ "Create text-scripts", /* creats*/ "TextScript", -/* acks */ "rhythmic-head-interface stem-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface stem-interface", /* reads */ "scriptHorizontal", /* write */ ""); diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index 7be64f5283..0ac0944fa7 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -177,6 +177,7 @@ Text_spanner_engraver::finalize () ENTER_DESCRIPTION(Text_spanner_engraver, /* descr */ "Create text spanner from a Span_req.", /* creats*/ "TextSpanner", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/thread-devnull-engraver.cc b/lily/thread-devnull-engraver.cc index 19f4621f43..569b911a32 100644 --- a/lily/thread-devnull-engraver.cc +++ b/lily/thread-devnull-engraver.cc @@ -58,6 +58,7 @@ identical, it tells the @code{Thread_devnull_engraver} to discard everything in the second thread. ", /* creats*/ "", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index e5f9efddf9..2e97956165 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -281,6 +281,7 @@ Tie_engraver::start_translation_timestep () ENTER_DESCRIPTION(Tie_engraver, /* descr */ "Generate ties between noteheads of equal pitch.", /* creats*/ "Tie TieColumn", -/* acks */ "rhythmic-head-interface", +/* accepts */ "general-music", +/* acks */ "rhythmic-head-interface", /* reads */ "sparseTies tieMelismaBusy", /* write */ ""); diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc index b721cc963c..eb7b0f3c78 100644 --- a/lily/tie-performer.cc +++ b/lily/tie-performer.cc @@ -64,7 +64,9 @@ Tie_performer::Tie_performer () done_ = false; } -ENTER_DESCRIPTION (Tie_performer, "", "", "", "", ""); +ENTER_DESCRIPTION (Tie_performer, "", "", + "general-music", + "", "", ""); void diff --git a/lily/time-scaled-music.cc b/lily/time-scaled-music.cc index a46483a491..18ea0436de 100644 --- a/lily/time-scaled-music.cc +++ b/lily/time-scaled-music.cc @@ -10,19 +10,8 @@ #include "time-scaled-music.hh" #include "time-scaled-music-iterator.hh" -Time_scaled_music::Time_scaled_music (SCM l) - : Music_wrapper (l) -{ - set_mus_property ("iterator-ctor", - Time_scaled_music_iterator::constructor_proc); - -} - Time_scaled_music::Time_scaled_music () { } - - - ADD_MUSIC (Time_scaled_music); diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 5d3d7a6fb7..5b7b384e79 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -65,6 +65,7 @@ Time_signature_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Time_signature_engraver, /* descr */ "Create a TimeSignature whenever @code{timeSignatureFraction} changes", /* creats*/ "TimeSignature", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "", /* write */ ""); diff --git a/lily/time-signature-performer.cc b/lily/time-signature-performer.cc index 4aad0091e3..e9a556807c 100644 --- a/lily/time-signature-performer.cc +++ b/lily/time-signature-performer.cc @@ -67,4 +67,4 @@ Time_signature_performer::stop_translation_timestep () } } -ENTER_DESCRIPTION (Time_signature_performer, "","","","","" ); +ENTER_DESCRIPTION(Time_signature_performer,"","","general-music","","",""); diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index dfdf4d51d0..741956cbf3 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -95,6 +95,7 @@ Normally in @code{Score}. In order to create polyrhythmic music, this engraver should be removed from @code{Score} and placed in @code{Staff}.", /* creats*/ "", -/* acks */ "", +/* accepts */ "general-music", +/* acks */ "", /* reads */ "timeSignatureFraction barNonAuto whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber", /* write */ ""); diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 2fb3654523..01a67a8eff 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -152,4 +152,4 @@ Timing_translator::start_translation_timestep () daddy_trans_->set_property ("measurePosition", measposp.smobbed_copy ()); } -ENTER_DESCRIPTION (Timing_translator, "","","","","" ); +ENTER_DESCRIPTION(Timing_translator,"","","general-music","","",""); diff --git a/lily/transposed-music.cc b/lily/transposed-music.cc index 42f797cc75..3f32cd7627 100644 --- a/lily/transposed-music.cc +++ b/lily/transposed-music.cc @@ -10,13 +10,6 @@ #include "transposed-music.hh" #include "warn.hh" -Transposed_music::Transposed_music (SCM l) - : Music_wrapper (l) -{ - set_mus_property ("type", ly_symbol2scm ("transposed-music")); -} - - Pitch Transposed_music::to_relative_octave (Pitch p) { diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 2f4b38ffd4..052eda58a1 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -155,6 +155,7 @@ Tuplet_engraver::Tuplet_engraver(){} ENTER_DESCRIPTION(Tuplet_engraver, /* descr */ "Catch Time_scaled_music and generate appropriate bracket ", /* creats*/ "TupletBracket", -/* acks */ "note-column-interface", +/* accepts */ "general-music", +/* acks */ "note-column-interface", /* reads */ "tupletNumberFormatFunction tupletSpannerDuration tupletInvisible", /* write */ ""); diff --git a/lily/un-relativable-music.cc b/lily/un-relativable-music.cc index fc3b9a03b0..b9eebf1440 100644 --- a/lily/un-relativable-music.cc +++ b/lily/un-relativable-music.cc @@ -12,7 +12,6 @@ Un_relativable_music::Un_relativable_music ( ) { - set_mus_property ("type", ly_symbol2scm ("un-relativable-music")); } Pitch diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 7e266f7cf4..a607a32f3c 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -69,6 +69,7 @@ Vertical_align_engraver::acknowledge_grob (Grob_info i) ENTER_DESCRIPTION(Vertical_align_engraver, /* descr */ "Catch Vertical axis groups and stack them.", /* creats*/ "VerticalAlignment", -/* acks */ "axis-group-interface", +/* accepts */ "general-music", +/* acks */ "axis-group-interface", /* reads */ "", /* write */ ""); diff --git a/lily/voice-devnull-engraver.cc b/lily/voice-devnull-engraver.cc index de4988d7f3..70204ee2f5 100644 --- a/lily/voice-devnull-engraver.cc +++ b/lily/voice-devnull-engraver.cc @@ -123,6 +123,7 @@ Voice_devnull_engraver::Voice_devnull_engraver(){} ENTER_DESCRIPTION(Voice_devnull_engraver, /* descr */ "Kill off certain items and spanners if we're Voice `two' and unison or unisilence is set.", /* creats*/ "", -/* acks */ "grob-interface", +/* accepts */ "general-music", +/* acks */ "grob-interface", /* reads */ "", /* write */ ""); diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 587a9e0981..fd65be42e0 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -211,6 +211,7 @@ Volta_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Volta_engraver, /* descr */ "Make volta brackets", /* creats*/ "VoltaBracket", -/* acks */ "bar-line-interface staff-symbol-interface note-column-interface", +/* accepts */ "general-music", +/* acks */ "bar-line-interface staff-symbol-interface note-column-interface", /* reads */ "repeatCommands voltaSpannerDuration stavesFound", /* write */ ""); diff --git a/scm/lily.scm b/scm/lily.scm index 1bab46f71e..4bc71012e9 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -208,7 +208,8 @@ is the first to satisfy CRIT (if (not standalone) (map ly-load ; load-from-path - '("output-lib.scm" + '("music-types.scm" + "output-lib.scm" "c++.scm" "molecule.scm" "bass-figure.scm" diff --git a/scm/music-functions.scm b/scm/music-functions.scm index d734535f31..afddac1866 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -161,8 +161,7 @@ Fingering_engraver." this is not an override " - (let* ((m (ly-make-music "Music"))) - (ly-set-mus-property! m 'iterator-ctor Push_property_iterator::constructor) + (let* ((m (make-music-by-name 'OverrideProperty))) (ly-set-mus-property! m 'symbol grob) (ly-set-mus-property! m 'grob-property gprop) (ly-set-mus-property! m 'grob-value val) @@ -175,8 +174,7 @@ this is not an override (define-public (make-grob-property-revert grob gprop) "Revert the grob property GPROP for GROB." - (let* ((m (ly-make-music "Music"))) - (ly-set-mus-property! m 'iterator-ctor Pop_property_iterator::constructor) + (let* ((m (make-music-by-name 'OverrideProperty))) (ly-set-mus-property! m 'symbol grob) (ly-set-mus-property! m 'grob-property gprop) @@ -326,7 +324,7 @@ this is not an override )) (define-public (empty-music) - (ly-id (ly-make-music "Music")) + (ly-id (make-music-by-name "Music")) ) ;;; diff --git a/scm/music-property-description.scm b/scm/music-property-description.scm index f1eaf73f7f..c6ddde46ec 100644 --- a/scm/music-property-description.scm +++ b/scm/music-property-description.scm @@ -58,6 +58,7 @@ TODO: consider making type into symbol ") (music-property-description 'predicate procedure? "the predicate of a \outputproperty") (music-property-description 'type symbol? "The type of this music object. Determines iteration in some cases.") +(music-property-description 'types list? "The types of this music object. Determines iteration in some cases.") (music-property-description 'repeat-count integer? "do a @code{\repeat} how ofen?") (music-property-description 'span-direction dir? "Does this start or stop a spanner?") diff --git a/scm/music-types.scm b/scm/music-types.scm new file mode 100644 index 0000000000..3b7685a45d --- /dev/null +++ b/scm/music-types.scm @@ -0,0 +1,306 @@ + +(define-public music-descriptions + `( + (ArpeggioEvent + . ( + (name . "Arpeggio_req") + (types . (general-music event )) + )) + (ArticulationEvent + . ( + (name . "Articulation_req") + (types . (general-music event articulation-event script-event)) + )) + (BassFigureEvent + . ( + (name . "Bass_figure_req") + (types . (general-music event rhythmic-event bass-figure-event)) + )) + (BreakEvent + . ( + (name . "Break_req") + + (types . (general-music event)) + )) + (BreathingSignEvent + . ( + (name . "Breathing_sign_req") + + (types . (general-music event breathing-event)) + )) + (BusyPlayingEvent + . ( + (name . "Busy_playing_req") + + (types . (general-music event busy-playing-event)) + )) + (ExtenderEvent + . ( + (name . "Extender_req") + (types . (general-music event)) + )) + (GlissandoEvent + . ( + (name . "Glissando_req") + (types . (general-music event)) + )) + (GraceMusic + . ( + (name . "Grace_music") + (iterator-ctor . ,Grace_iterator::constructor) + (types . (grace-music music-wrapper-music general-music)) + )) + (HyphenEvent + . ( + (name . "Hyphen_req") + (types . (general-music event)) + )) + (KeyChangeEvent + . ( + (name . "Key_change_req") + (types . (general-music event)) + )) + (LyricEvent + . ( + (name . "Lyric_req") + (types . (general-music rhythmic-event event)) + )) + (MarkEvent + . ( + (name . "Mark_req") + (types . (general-music event)) + )) + (MelismaEvent + . ( + (name . "Melisma_playing_req") + (types . (general-music span-event event)) + )) + (Melisma_playingEvent + . ( + (name . "Melisma_req") + (types . (general-music event)) + )) + (Music + . ( + (name . "Music") + (types . (general-music)) + )) + (NoteEvent + . ( + (name . "Note_req") + (types . (general-music event rhythmic-event melodic-event)) + )) + (PorrectusEvent + . ( + (name . "Porrectus_req") + (types . (general-music event)) + )) + (RepeatedMusic + . ( + (name . "Repeated_music") + (type . repeated-music)g + (types . (general-music repeat-music)) + )) + (Request + . ( + (name . "Request") + (types . (general-music event)) + )) + (RestEvent + . ( + (name . "Rest_req") + (types . (general-music event rhythmic-event )) + )) + (RhythmicEvent + . ( + (name . "Rhythmic_req") + (types . (general-music rhythmic-event event)) + )) + (SequentialMusic + . ( + (name . "Sequential_music") + (iterator-ctor . ,Sequential_music_iterator::constructor) + (types . (general-music sequential-music)) + )) + (SimultaneousMusic + . ( + (name . "Simultaneous_music") + (iterator-ctor . ,Simultaneous_music_iterator::constructor) + + (types . (general-music simultaneous-music)) + )) + (PropertySet + . ( + (name . "Music") + (types . (layout-instruction general-music)) + (iterator-ctor . ,Property_iterator::constructor) + ) + ) + (PropertyUnset + . ( + (name . "Music") + (types . (layout-instruction general-music)) + (iterator-ctor . ,Property_unset_iterator::constructor) + ) + ) + (VoiceSeparator + . ( + (name . "Music") + (types . (separator general-music)) + )) + (BarCheck + . ( + (name . "Music") + (types . (general-music bar-check)) + (iterator-ctor . ,Bar_check_iterator::constructor) + )) + (OverrideProperty + . ( + (name . "Music") + (types . (general-music layout-instruction)) + (iterator-ctor . , Push_property_iterator::constructor) + )) + + (RevertProperty + . ( + (name . "Music") + (types . (general-music layout-instruction)) + (iterator-ctor . , Pop_property_iterator::constructor) + )) + + (OutputPropertySetMusic + . ( + (name . "Music") + (iterator-ctor . ,Output_property_music_iterator::constructor) + (types . (general-music layout-instruction)) + )) + (ContextSpeccedMusic + . ( + (name . "Context_specced_music") + (types . (context-specification general-music music-wrapper-music)) + )) + (AutoChangeMusic + . ( + (name . "Music_wrapper") + (iterator-ctor . ,Auto_change_iterator::constructor) + (types . (general-music music-wrapper-music auto-change-instruction)) + )) + (TranslatorChange + . ( + (name . "Music") + (iterator-ctor . , Change_iterator::constructor) + (types . (general-music translator-change-instruction)) + )) + + + (TimeScaledMusic + . ( + (name . "Time_scaled_music") + (iterator-ctor . ,Time_scaled_music_iterator::constructor) + (types . (time-scaled-music music-wrapper-music general-music)) + )) + (TransposedMusic + . ( + (name . "Transposed_music") + (types . (music-wrapper-music general-music transposed-music)) + )) + + (UntransposableMusic + . ( + (name . "Untransposable_music") + (types . (music-wrapper-music general-music untransposable-music)) + )) + + (UnrelativableMusic + . ( + (name . "Un_relativable_music") + (types . (music-wrapper-music general-music unrelativable-music)) + )) + + (RelativeOctaveMusic + . ( + (name . "Relative_octave_music") + (types . (music-wrapper-music general-music relative-octave-music)) + )) + + (LyricCombineMusic + . ( + (name . "Lyric_combine_music") + (types . (general-music lyric-combine-music)) + (iterator-ctor . ,Lyric_combine_music_iterator::constructor) + )) + + (PartCombineMusic + . ( + (name . "Part_combine_music") + (types . (general-music part-combine-music)) + (iterator-ctor . ,Part_combine_music_iterator::constructor) + )) + (RequestChord + . ( + (name . "Request_chord") + (iterator-ctor . ,Request_chord_iterator::constructor) + (types . (general-music simultaneous-music)) + ) + ) + + (ScriptEvent + . ( + (name . "Script_req") + + (types . (general-music event)) + )) + (SkipEvent + . ( + (name . "Skip_req") + + (types . (general-music event rhythmic-event )) + )) + (SpanEvent + . ( + (name . "Span_req") + (types . (general-music event)) + )) + (StringNumberEvent + . ( + (name . "String_number_req") + + (types . (general-music event)) + )) + (TempoEvent + . ( + (name . "Tempo_req") + + (types . (general-music event)) + )) + (TextScriptEvent + . ( + (name . "Text_script_req") + (types . (general-music script-event text-script-event event)) + )) + (TieEvent + . ( + (name . "Tie_req") + (types . (general-music tie-event event)) + )) + )) + + + +(define music-name-to-property-table (make-vector 59)) +(map (lambda (x) + (hashq-set! music-name-to-property-table (car x) (cdr x)) + ) + music-descriptions) + +(define-public (make-music-by-name x) + (let* + ( + (props (hashq-ref music-name-to-property-table x '())) + (name (if (pair? props) (cdr (assoc 'name props)) "Music")) + ) + + (if (eq? props '()) + (ly-warn (format "Could not find music type `~a'" x))) + (ly-extended-make-music name props) + )) -- 2.39.5