+2002-09-28 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * scm/engraver-documentation-lib.scm
+ (engraver-accepts-music-types?): add links from music to engraver,
+ from music-type to engraver.
+
+ * lily/include/command-request.hh: removed
+ lily/include/musical-request.hh: removed. Removed all _req classes
+ except Key_change_req. Changes throughout.
+
2002-09-28 Jan Nieuwenhuizen <janneke@gnu.org>
* lily/tuplet-engraver.cc (try_music): Compile kludge.
Modified 2001-2002 by Rune Zedeler <rz@daimi.au.dk>
*/
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
#include "item.hh"
#include "tie.hh"
#include "rhythmic-head.hh"
#include "item.hh"
#include "note-head.hh"
#include "staff-symbol-referencer.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "pitch.hh"
/*
#include "engraver.hh"
#include "group-interface.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "arpeggio.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
*/
#include "beaming.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "beam.hh"
#include "stem.hh"
#include "warn.hh"
#include "engraver.hh"
#include "item.hh"
#include "spanner.hh"
+#include "duration.hh"
/*
TODO: figure what to do in grace?
#include "music.hh"
#include "auto-change-iterator.hh"
#include "translator-group.hh"
-#include "musical-request.hh"
+#include "request.hh"
*/
#include "simple-music-iterator.hh"
-#include "command-request.hh"
+#include "request.hh"
#include "translator-group.hh"
/*
#include "bar-line.hh"
#include "score-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "engraver-group-engraver.hh"
#include "warn.hh"
#include "item.hh"
*/
#include "engraver-group-engraver.hh"
#include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "beam.hh"
#include "stem.hh"
#include "warn.hh"
#include "paper-score.hh"
#include "paper-column.hh"
#include "cpu-timer.hh"
-#include "command-request.hh"
+
#include "simple-spacer.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "breathing-sign.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
#include "engraver-group-engraver.hh"
#include "item.hh"
#include "engraver.hh"
-#include "command-request.hh"
+
class Breathing_sign_engraver : public Engraver {
public:
#include "engraver.hh"
#include "chord-name.hh"
#include "chord.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "paper-def.hh"
#include "font-interface.hh"
#include "paper-def.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
#include "engraver-group-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "warn.hh"
#include "misc.hh"
#include "note-head.hh"
*/
#include "chord.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "warn.hh"
#include "music-list.hh"
-#include "musical-request.hh"
+#include "request.hh"
SCM
-/*
- command-request.cc -- implement non-musical reqs
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "command-request.hh"
-
-#include "musical-request.hh"
-
-
-
-LY_DEFINE(transpose_key_alist,"transpose-key-alist",
- 2, 0,0, (SCM l, SCM pitch),
- "Make a new key alist of @var{l} transposed by pitch @var{pitch}")
-{
- SCM newlist = SCM_EOL;
- Pitch *p = unsmob_pitch (pitch);
-
- for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
- {
- SCM key = ly_caar (s);
- SCM alter = ly_cdar (s);
- if (gh_pair_p (key))
- {
- Pitch orig (gh_scm2int (ly_car (key)),
- gh_scm2int (ly_cdr (key)),
- gh_scm2int (alter));
-
- orig.transpose (*p);
-
- SCM key = gh_cons (scm_int2num (orig.get_octave ()),
- scm_int2num (orig.notename_));
-
- newlist = gh_cons (gh_cons (key, scm_int2num (orig.alteration_)),
- newlist);
- }
- else if (gh_number_p (key))
- {
- Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
- orig.transpose (*p);
-
- key =scm_int2num (orig.notename_);
- alter = scm_int2num (orig.alteration_);
- newlist = gh_cons (gh_cons (key, alter), newlist);
- }
- }
- return scm_reverse_x (newlist, SCM_EOL);
-}
-
-void
-Key_change_req::transpose (Pitch p)
-{
- SCM pa = get_mus_property ("pitch-alist");
-
- set_mus_property ("pitch-alist", transpose_key_alist (pa, p.smobbed_copy()));
-}
-
-
-bool
-alist_equal_p (SCM a, SCM b)
-{
- for (SCM s = a;
- gh_pair_p (s); s = ly_cdr (s))
- {
- SCM key = ly_caar (s);
- SCM val = ly_cdar (s);
- SCM l = scm_assoc (key, b);
-
- if (l == SCM_BOOL_F
- || !gh_equal_p ( ly_cdr (l), val))
-
- return false;
- }
- return true;
-}
-
-bool
-Key_change_req::do_equal_b (Request const * m )const
-{
- Key_change_req const * kc =dynamic_cast<Key_change_req const*> (m);
-
- if(!kc)
- return false;
- return alist_equal_p (get_mus_property ("pitch-alist"),
- kc->get_mus_property ("pitch-alist"));
-}
-
-
-
-ADD_MUSIC (Articulation_req);
-ADD_MUSIC (Key_change_req);
-ADD_MUSIC (Lyric_req);
-ADD_MUSIC (Porrectus_req);
-ADD_MUSIC (Rhythmic_req);
-ADD_MUSIC (Script_req);
-ADD_MUSIC (Span_req);
-ADD_MUSIC (Text_script_req);
-ADD_MUSIC (Tremolo_req);
#include "rhythmic-head.hh"
#include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
#include "staff-symbol-referencer.hh"
#include "warn.hh"
-#include "musical-request.hh"
+#include "request.hh"
/*
This class implements an engraver for custos symbols.
#include "warn.hh"
#include "dimensions.hh"
#include "hairpin.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "paper-column.hh"
#include "note-column.hh"
#include "item.hh"
Spanner * finished_cresc_;
Spanner * cresc_;
- Text_script_req* script_req_;
+ Music* script_req_;
Music * current_cresc_req_;
Drul_array<Music*> accepted_spanreqs_drul_;
bool
Dynamic_engraver::try_music (Music * m)
{
- if (dynamic_cast <Text_script_req*> (m)
- && m->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
+ if (m->is_mus_type ("dynamic-event"))
{
- script_req_ = dynamic_cast<Text_script_req*> (m);
+ /*
+ TODO: probably broken.
+ */
+ script_req_ = m;
return true;
}
else if (m->is_mus_type ("abort-event"))
script_ = new Item (get_property ("DynamicText"));
script_->set_grob_property ("text",
script_req_->get_mus_property ("text"));
+
- if (Direction d = script_req_->get_direction ())
+ if (Direction d = to_dir (script_req_->get_mus_property ("direction")))
Directional_element_interface::set (line_spanner_, d);
Axis_group_interface::add_element (line_spanner_, script_);
*/
#include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "audio-item.hh"
/*
{
if (!script_req_)
{
- if (dynamic_cast <Text_script_req*> (r)
- && r->get_mus_property ("text-type") == ly_symbol2scm ("dynamic"))
+ if (r->is_mus_type ("dynamic-event")) // fixme.
{
script_req_ = r;
return true;
*/
#include "flower-proto.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "lyric-extender.hh"
#include "paper-column.hh"
#include "item.hh"
#include "engraver.hh"
#include "text-item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "item.hh"
class Figured_bass_engraver : public Engraver
#include "engraver.hh"
#include "side-position-interface.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
*/
#include "grob-pitch-tuple.hh"
#include "pitch.hh"
-#include "musical-request.hh"
+#include "request.hh"
int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
*/
#include "flower-proto.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "hyphen-spanner.hh"
#include "paper-column.hh"
#include "item.hh"
+++ /dev/null
-/*
- command-request.hh -- declare non-musical requests
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef COMMANDREQUEST_HH
-#define COMMANDREQUEST_HH
-
-#include "request.hh"
-#include "array.hh"
-#include "duration.hh"
-#include "pitch.hh"
-
-
-class Break_req : public Request {
-public:
-protected:
- VIRTUAL_COPY_CONS (Music);
-};
-
-class Porrectus_req : public Request {
- VIRTUAL_COPY_CONS (Music);
-};
-
-/**
- Handle key changes.
-*/
-class Key_change_req : public Request
-{
-public:
- SCM pitch_alist ();
-
-protected:
- VIRTUAL_COPY_CONS (Music);
- bool do_equal_b (Request const * ) const;
- void transpose (Pitch d);
-};
-
-SCM transpose_key_alist (SCM,SCM);
-
-#endif // COMMANDREQUEST_HH
-
class Adobe_font_metric;
class All_font_metrics;
-class Articulation_req;
class Audio_column;
class Audio_dynamic;
class Audio_element;
class Axis_group_engraver;
class Bar_engraver;
class Bar_req_collect_engraver;
-class Barcheck_req;
class Base_span_bar_engraver;
class Beaming_info_list;
class Bezier;
class Bezier_bow;
class Break_algorithm;
-class Break_req;
-class Breathing_sign_req;
-class Busy_playing_req;
class Change_iterator;
class Change_translator;
class Chord_tremolo_iterator;
-
class Column_x_positions;
class Context_specced_music;
class Engraver;
class Engraver;
class Engraver_group_engraver;
-class Extender_req;
class Folded_repeat_iterator;
class Font_metric;
class Font_size_engraver;
class Global_translator;
-class Glissando_req;
class Gourlay_breaking;
class Grace_engraver_group;
class Grace_iterator;
class Grace_performer_group;
class Hara_kiri_engraver;
class Hara_kiri_line_group_engraver;
-class Hyphen_req;
-
class Includable_lexer;
class Input_file_results;
class Input;
class Item;
-class Key_change_req;
class Key_performer;
class Keyword_ent;
class Keyword_table;
class Lyric_engraver;
class Lyric_performer;
class Lyric_phrasing_engraver;
-class Lyric_req;
-class Mark_req;
-class Melisma_playing_req;
-class Melisma_req;
-class Melodic_req;
class Mensural_ligature_engraver;
class Midi_chunk;
class Midi_def;
class Music_wrapper;
class Music_wrapper_iterator;
class Pitch;
-class Musical_req;
class My_lily_lexer;
class Note_performer;
class Output_property;
class Performer;
class Performer_group_performer;
class Piano_bar_engraver;
-
class Pitch_squash_engraver;
-class Porrectus_req;
class Property_iterator;
class Rational;
class Relative_octave_music;
class Request;
class Request_chord;
class Request_chord_iterator;
-class Rest_req;
-class Rhythmic_req;
class Scaled_font_metric;
class Scheme_hash_table;
class Score;
class Grob;
class Score_engraver;
class Score_performer;
-class Script_req;
class Sequential_music;
class Sequential_music_iterator;
class Simple_music_iterator;
class Simple_spacer;
class Simultaneous_music;
class Simultaneous_music_iterator;
-class Skip_req;
class Slur_bezier_bow;
-class Span_req;
class Span_score_bar_engraver;
class Spanner;
class Staff_group_bar_engraver;
class Swallow_engraver;
class Swallow_performer;
class Tempo_performer;
-class Tempo_req;
class Tex_font_metric;
-class Text_script_req;
class Tie;
class Tie_performer;
-class Tie_req;
class Time_scaled_music;
class Time_scaled_music_iterator;
class Time_signature_performer;
class Translator_change;
class Translator_group;
class Transposed_music;
-class Tremolo_req;
class Type_swallow_translator;
class yyFlexLexer;
#endif // LILY_PROTO_HH;
{
public:
VIRTUAL_COPY_CONS (Music);
- virtual Pitch to_relative_octave (Pitch);
virtual Moment start_mom () const;
Request_chord ();
+++ /dev/null
-/*
- musical-request.hh -- declare Musical requests
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef MUSICALREQUESTS_HH
-#define MUSICALREQUESTS_HH
-
-#include "lily-proto.hh"
-#include "request.hh"
-#include "duration.hh"
-#include "pitch.hh"
-#include "array.hh"
-
-/** a request with a duration.
- This request is used only used as a base class.
- */
-class Rhythmic_req : public virtual Request {
-public:
- void compress (Moment);
- virtual Moment length_mom () const;
- static int compare (Rhythmic_req const&,Rhythmic_req const&);
- VIRTUAL_COPY_CONS (Music);
-};
-
-
-
-struct Tremolo_req : public Request {
- VIRTUAL_COPY_CONS (Music);
- Tremolo_req ();
-};
-
-struct Chord_tremolo_notify_req : public Request
-{
- Rational factor_;
- VIRTUAL_COPY_CONS(Chord_tremolo_notify_req);
- Chord_tremolo_notify_req();
-};
-
-
-/**
- a syllable or lyric is a string with rhythm.
- */
-class Lyric_req : public Rhythmic_req
-{
-protected:
- VIRTUAL_COPY_CONS (Music);
-};
-
-
-class Articulation_req : public Script_req
-{
-public:
- String get_articulation_string ();
-protected:
- virtual bool do_equal_b (Request const*) const;
- VIRTUAL_COPY_CONS (Music);
-};
-
-class Text_script_req : public Script_req
-{
-protected:
- VIRTUAL_COPY_CONS (Music);
- virtual bool do_equal_b (Request const*) const;
-};
-
-/// request which has some kind of pitch
-struct Melodic_req :virtual Request
-{
- static int compare (Melodic_req const&,Melodic_req const&);
-
-protected:
- virtual bool do_equal_b (Request const*) const;
-
- VIRTUAL_COPY_CONS (Music);
-};
-
-
-
-#endif // MUSICALREQUESTS_HH
#include "virtual-methods.hh"
#include "input.hh"
#include "music.hh"
-#include "direction.hh"
-
+#include "duration.hh"
+#include "pitch.hh"
/** An atom of musical information. This is an abstract class for any
piece of music that does not contain other Music.
- Hungarian postfix: req
*/
class Request : public Music {
public:
Request ();
VIRTUAL_COPY_CONS (Music);
- bool equal_b (Request const*) const;
-protected:
- virtual bool do_equal_b (Request const*) const;
-
-};
-
-
-
-class Script_req : public virtual Request
-{
-public:
- void set_direction (Direction d);
- Direction get_direction () const;
- VIRTUAL_COPY_CONS (Music);
- Script_req ();
+ virtual void compress (Moment);
+ virtual void transpose (Pitch);
+ virtual Moment length_mom () const;
+ virtual Pitch to_relative_octave (Pitch);
};
/**
- Requests to start or stop something.
- This type of request typically results in the creation of a #Spanner#
+ Handle key changes.
*/
-class Span_req : public virtual Request {
+class Key_change_req : public Request
+{
public:
- String get_span_type_string () const;
- void set_span_type_string (String);
- void set_span_dir (Direction d);
- Direction get_span_dir () const;
+ SCM pitch_alist ();
- Span_req ();
protected:
-
- virtual bool do_equal_b (Request const*) const;
-
VIRTUAL_COPY_CONS (Music);
+ bool do_equal_b (Request const * ) const;
+ void transpose (Pitch d);
};
-/**
- Start a tie at this note, end it at the next
- */
-class Tie_req : public Request {
-public:
- VIRTUAL_COPY_CONS (Music);
-};
+SCM transpose_key_alist (SCM,SCM);
+
+
#endif
#define Tuplet_bracket_HH
#include "lily-guile.hh"
+#include "lily-proto.hh"
/*
*/
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "item.hh"
#include "bar-line.hh"
#include "staff-symbol-referencer.hh"
{
if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req))
{
- if (keyreq_ && !keyreq_->equal_b (kc))
- {
- kc->origin ()->warning (_ ("Conflicting key signatures found."));
- keyreq_->origin ()->warning (_ ("This was the other key definition."));
- return false;
- }
-
if (!keyreq_)
{
/*
*/
#include "lily-guile.hh"
-#include "command-request.hh"
+
#include "audio-item.hh"
#include "performer.hh"
#include "warn.hh"
#include "parser.hh"
#include "warn.hh"
#include "main.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "version.hh"
#include "lilypond-input-version.hh"
#include "translator-def.hh"
#include "translator-group.hh"
#include "lyric-combine-music-iterator.hh"
#include "lyric-combine-music.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "note-head.hh"
#include "grob.hh"
*/
#include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "item.hh"
#include "paper-def.hh"
#include "font-metric.hh"
public:
TRANSLATOR_DECLARATIONS(Lyric_engraver);
private:
- Lyric_req * req_;
+ Music * req_;
Item* text_;
};
bool
Lyric_engraver::try_music (Music*r)
{
- if (Lyric_req* l = dynamic_cast <Lyric_req *> (r))
+ if (r->is_mus_type ("lyric-event"))
{
if (req_)
return false;
- req_ =l;
+ req_ =r;
return true;
}
return false;
ENTER_DESCRIPTION(Lyric_engraver,
/* descr */ "",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "lyric-event",
/* acks */ "",
/* reads */ "",
/* write */ "");
(c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "musical-request.hh"
+#include "request.hh"
#include "audio-item.hh"
#include "lily-proto.hh"
#include "performer.hh"
virtual void create_audio_elements ();
private:
- Link_array<Lyric_req> lreqs_;
+ Link_array<Music> lreqs_;
Audio_text* audio_;
};
bool
Lyric_performer::try_music (Music* req)
{
- if (Lyric_req *lr = dynamic_cast <Lyric_req *> (req))
+ if (req->is_mus_type ("lyric-event"))
{
- lreqs_.push (lr);
+ lreqs_.push (req);
return true;
}
return false;
}
-ENTER_DESCRIPTION(Lyric_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Lyric_performer,"","","lyric-event","","","");
#include <ctype.h>
#include "bar-line.hh"
-#include "command-request.hh"
+
#include "staff-symbol.hh"
#include "engraver-group-engraver.hh"
#include "engraver.hh"
*/
#include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "grob.hh"
#include "translator-group.hh"
#include "mensural-ligature.hh"
#include "ligature-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "warn.hh"
#include "item.hh"
#include "spanner.hh"
Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "musical-request.hh"
+#include "request.hh"
#include "multi-measure-rest.hh"
#include "paper-column.hh"
#include "engraver-group-engraver.hh"
virtual void finalize ();
private:
- Span_req * new_req_;
- Span_req * busy_span_req_;
- Span_req * stop_req_;
+ Music * new_req_;
+ Music * busy_span_req_;
+ Music * stop_req_;
int start_measure_;
Moment start_moment_;
bool
Multi_measure_rest_engraver::try_music (Music* req)
{
- if (Span_req * sp = dynamic_cast<Span_req*> (req))
+ if (req->is_mus_type ("multi-measure-rest-event"))
{
-
- if (scm_equal_p (sp->get_mus_property ("span-type"),
- scm_makfrom0str ("rest")) == SCM_BOOL_T)
+ Direction d = to_dir (req->get_mus_property ("span-direction"));
+ if (d == STOP)
{
- if (sp->get_span_dir () == STOP)
- {
- stop_req_ = sp;
- }
- else if (sp->get_span_dir () == START && !new_req_)
- {
- new_req_ = sp;
- }
- return true;
+ stop_req_ = req;
}
+ else if (d == START&& !new_req_)
+ {
+ new_req_ = req;
+ }
+ return true;
}
return false;
}
measurePosition and currentBarNumber to determine what number to print over the MultiMeasureRest
",
/* creats*/ "MultiMeasureRest",
-/* accepts */ "general-music",
+/* accepts */ "multi-measure-rest-event",
/* acks */ "",
/* reads */ "currentBarNumber currentCommandColumn measurePosition",
/* write */ "");
return m;
}
-
-
-
-
-
bool
Music::internal_is_music_type (SCM k)const
{
return scm_memq (k, ifs) != SCM_BOOL_F;
}
+void
+Music::transpose (Pitch)
+{
+}
+
+void
+Music::compress (Moment)
+{
+}
+
+
Music::Music (Music const &m)
{
immutable_property_alist_ = m.immutable_property_alist_;
return SCM_EOL;
}
-void
-Music::compress (Moment f)
-{
- SCM l = get_mus_property ("compress-procedure");
- if (gh_procedure_p (l))
- {
- SCM res = gh_call2 (l, self_scm (), f.smobbed_copy());
- }
-}
-
-
Moment
Music::length_mom () const
{
}
-void
-Music::transpose (Pitch delta)
-{
- Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
- if (!p)
- return ;
-
- Pitch np = *p;
- np.transpose (delta);
-
- if (abs (np.alteration_) > 2)
- {
- warning (_f ("Transposition by %s makes accidental larger than two",
- delta.string ()));
- }
-
- set_mus_property ("pitch", np.smobbed_copy ());
-}
-
IMPLEMENT_TYPE_P (Music, "music?");
IMPLEMENT_SMOBS (Music);
-/*
- request.cc -- implement all musical requests.
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "musical-request.hh"
-#include "misc.hh"
-#include "warn.hh"
-#include "music-list.hh"
-
-
-Tremolo_req::Tremolo_req ()
-{
-}
-
-LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0,
- (SCM mus),
- "Extract the duration field from @var{mus}, and return the length.")
-{
- Music* m = unsmob_music(mus);
- SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
-
- Duration *d = unsmob_duration (m->get_mus_property ("duration"));
-
- Moment l ;
-
- if (d)
- {
- l = d->length_mom ();
- }
- else
- programming_error("Rhythmic_req has no duration");
- return l.smobbed_copy();
-
-}
-
-
-LY_DEFINE(music_duration_compress, "music-duration-compress", 2, 0,0,
- (SCM mus, SCM factor),
- "Extract the duration field from @var{mus}, and compress it.")
-{
- Music* m = unsmob_music(mus);
- Moment * f = unsmob_moment (factor);
- SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
- SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment");
-
- Duration *d = unsmob_duration (m->get_mus_property ("duration"));
- if (d)
- m->set_mus_property ("duration", d->compressed (f->main_part_).smobbed_copy());
- return SCM_UNSPECIFIED;
-}
-
-
-Moment
-Rhythmic_req::length_mom () const
-{
- Duration *d = unsmob_duration (get_mus_property ("duration"));
- if (!d)
- {
- Moment m ;
- programming_error("Rhythmic_req has no duration");
- return m;
- }
- return d->length_mom ();
-}
-
-void
-Rhythmic_req::compress (Moment m)
-{
- Duration *d = unsmob_duration (get_mus_property ("duration"));
- if (d)
- set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
-}
-
-
-
-bool
-Span_req::do_equal_b (Request const*r) const
-{
- Span_req const* s = dynamic_cast <Span_req const*> (r);
- return s && get_span_dir () == s->get_span_dir ();
-}
-
-Span_req::Span_req ()
-{
-}
-
-
-bool
-Text_script_req::do_equal_b (Request const* r) const
-{
- Text_script_req const* t = dynamic_cast<Text_script_req const*> (r);
- return t && gh_equal_p (get_mus_property ("text"),
- t->get_mus_property ("text"));
-}
-
-bool
-Articulation_req::do_equal_b (Request const* r) const
-{
- Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
-
- return a && gh_equal_p (get_mus_property ("articulation-type"),
- r->get_mus_property ("articulation-type"))
- && get_direction () == a->get_direction ();
-}
-
*/
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
#include "item.hh"
#include "tie.hh"
#include "rhythmic-head.hh"
with note heads), this needs to be in a context higher than Tie_engraver.",
"Accidental",
-/* accepts */ "general-music",
+/* accepts */ "",
"rhythmic-head-interface tie-interface arpeggio-interface",
"localKeySignature localKeySignatureChanges extraNatural autoAccidentals autoCautionaries",
"localKeySignature localKeySignatureChanges");
#include "engraver.hh"
#include "group-interface.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "spanner.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
#include "warn.hh"
#include "font-interface.hh"
#include "molecule.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "rhythmic-head.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
#include "rhythmic-head.hh"
#include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "staff-symbol-referencer.hh"
*/
#include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "item.hh"
class Note_name_engraver : public Engraver
ENTER_DESCRIPTION(Note_name_engraver,
/* descr */ "",
/* creats*/ "NoteName",
-/* accepts */ "general-music",
+/* accepts */ "note-event",
/* acks */ "",
/* reads */ "",
/* write */ "");
*/
#include "performer.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "audio-item.hh"
#include "audio-column.hh"
#include "global-translator.hh"
return false;
}
-ENTER_DESCRIPTION(Note_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Note_performer,"","","note-event","","","");
Note_performer::Note_performer()
{
bool
Output_property_engraver::try_music (Music* m)
{
- if (m->get_mus_property ("iterator-ctor") ==
- Output_property_music_iterator::constructor_proc)
+ if (m->is_mus_type ("layout-instruction"))
{
props_.push (m);
return true;
/* descr */ "Interpret Music of Output_property type, and apply a function
to any Graphic objects that satisfies the predicate.",
/* creats*/ "",
-/* accepts */ "general-music",
-/* acks */ "grob-interface",
+/* accepts */ "layout-instruction",
+/* acks */ "grob-interface",
/* reads */ "",
/* write */ "");
#include "file-path.hh"
#include "warn.hh"
#include "dimensions.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "my-lily-parser.hh"
#include "context-specced-music.hh"
#include "score.hh"
return p;
}
+Music*
+make_span_req (SCM name)
+{
+ static SCM proc;
+ if (!proc)
+ proc = scm_c_eval_string ("old-span-request->event");
+ SCM m = scm_call_1 (proc, name);
+ scm_gc_protect_object (m);
+ return unsmob_music (m);
+}
// needed for bison.simple's malloc () and free ()
;
verbose_command_req:
- COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */
- Music * sp = MY_MAKE_MUSIC("SpanEvent");
+ COMMANDSPANREQUEST bare_int STRING {
+ Music *sp = make_span_req ($3);
sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2)));
- sp->set_mus_property ("span-type",$3);
sp->set_spot (THIS->here_input ());
$$ = sp;
}
$$ = d;
}
| SPANREQUEST bare_int STRING {
- Music * sp = MY_MAKE_MUSIC("SpanEvent");
+
+ Music * sp = make_span_req ($3);
sp->set_mus_property ("span-direction", gh_int2scm ( $2));
- sp->set_mus_property ("span-type", $3);
sp->set_spot (THIS->here_input ());
$$ = sp;
}
close_request_parens:
'(' {
- Music * s= MY_MAKE_MUSIC("SpanEvent");
+ Music * s= MY_MAKE_MUSIC("SlurEvent");
$$ = s;
- s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
s->set_spot (THIS->here_input());
}
| E_OPEN {
- Music * s= MY_MAKE_MUSIC("SpanEvent");
+ Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
$$ = s;
- s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
s->set_spot (THIS->here_input());
}
| E_SMALLER {
$$ = s;
}
| ')' {
- Music * s= MY_MAKE_MUSIC("SpanEvent");
+ Music * s= MY_MAKE_MUSIC("SlurEvent");
$$ = s;
- s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
s->set_spot (THIS->here_input());
}
| E_CLOSE {
- Music * s= MY_MAKE_MUSIC("SpanEvent");
+ Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
$$ = s;
s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
s->set_spot (THIS->here_input());
Music * sk = MY_MAKE_MUSIC("SkipEvent");
sk->set_mus_property ("duration", $2);
- Music *sp1 = MY_MAKE_MUSIC("SpanEvent");
- Music *sp2 = MY_MAKE_MUSIC("SpanEvent");
+ Music *sp1 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
+ Music *sp2 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
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);
-
Music *rqc1 = MY_MAKE_MUSIC("RequestChord");
rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
Music *rqc2 = MY_MAKE_MUSIC("RequestChord");
#include "part-combine-music.hh"
#include "part-combine-music-iterator.hh"
#include "translator-group.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "music-sequence.hh"
#include "lily-guile.hh"
#include "warn.hh"
{
SCM d = m->get_mus_property ("duration");
if (d == SCM_EOL)
- m->origin ()->warning ("Rhythmic_req has no duration\n");
+ m->origin ()->warning ("Music has no duration\n");
else
*durations = gh_cons (d, *durations);
}
ENTER_DESCRIPTION(Percent_repeat_engraver,
/* descr */ "Make beat, whole bar and double bar repeats.",
/* creats*/ "PercentRepeat RepeatSlash DoublePercentRepeat",
-/* accepts */ "general-music",
+/* accepts */ "repeated-music",
/* acks */ "",
/* reads */ "measureLength currentCommandColumn",
/* write */ "");
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "musical-request.hh"
+#include "request.hh"
#include "slur.hh"
#include "warn.hh"
#include "note-column.hh"
class Phrasing_slur_engraver : public Engraver
{
- Link_array<Span_req> requestses_;
- Link_array<Span_req> new_phrasing_slur_reqs_;
+ Link_array<Music> requestses_;
+ Link_array<Music> new_phrasing_slur_reqs_;
Link_array<Grob> phrasing_slur_l_stack_;
Link_array<Grob> end_phrasing_slurs_;
Moment last_start_;
bool
Phrasing_slur_engraver::try_music (Music *req)
{
- if (Span_req *sl = dynamic_cast <Span_req *> (req))
+ if (req->is_mus_type ("abort-event"))
{
- String t = ly_scm2string (sl->get_mus_property ("span-type"));
- if (t == "abort")
- {
for (int i = 0; i < phrasing_slur_l_stack_.size (); i++)
{
phrasing_slur_l_stack_[i]->suicide ();
end_phrasing_slurs_.clear ();
requestses_.clear ();
new_phrasing_slur_reqs_.clear ();
- }
- else if (t == "phrasing-slur")
+ }
+ else if (req->is_mus_type ("phrasing-slur-event"))
+ {
+ /*
+ Let's not start more than one phrasing slur per moment.
+ */
+
+ Direction d = to_dir (req->get_mus_property ("span-direction"));
+
+ if (d == START)
{
- /*
- Let's not start more than one phrasing slur per moment.
- */
- if (sl->get_span_dir () == START)
+ if (now_mom () > last_start_)
{
- if (now_mom () > last_start_)
- {
- new_phrasing_slur_reqs_.push (sl);
- last_start_ = now_mom ();
- return true;
- }
- }
- else
- {
- new_phrasing_slur_reqs_.push (sl);
+ new_phrasing_slur_reqs_.push (req);
+ last_start_ = now_mom ();
return true;
}
}
+ else
+ {
+ new_phrasing_slur_reqs_.push (req);
+ return true;
+ }
}
return false;
}
Link_array<Grob> start_phrasing_slurs;
for (int i=0; i< new_phrasing_slur_reqs_.size (); i++)
{
- Span_req* phrasing_slur_req = new_phrasing_slur_reqs_[i];
+ Music* phrasing_slur_req = new_phrasing_slur_reqs_[i];
// end phrasing slur: move the phrasing slur to other array
- if (phrasing_slur_req->get_span_dir () == STOP)
+
+ Direction d = to_dir (phrasing_slur_req->get_mus_property ("span-direction"));
+
+ if (d == STOP)
{
if (phrasing_slur_l_stack_.empty ())
phrasing_slur_req->origin ()->warning (_f ("can't find start of phrasing slur"));
requestses_.pop ();
}
}
- else if (phrasing_slur_req->get_span_dir () == START)
+ else if (d == START)
{
// push a new phrasing_slur onto stack.
// (use temp. array to wait for all phrasing_slur STOPs)
ENTER_DESCRIPTION(Phrasing_slur_engraver,
/* descr */ "Print phrasing slurs. Similar to Slur_engraver",
/* creats*/ "PhrasingSlur",
-/* accepts */ "general-music",
-/* acks */ "note-column-interface",
+/* accepts */ "phrasing-slur-event",
+/* acks */ "note-column-interface",
/* reads */ "slurMelismaBusy",
/* write */ "");
*/
#include "engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "grob.hh"
#include "item.hh"
#include "lily-guile.hh"
struct Pedal_info
{
char const * name_;
- Span_req* start_req_;
- Drul_array<Span_req*> req_l_drul_;
+ Music* start_req_;
+ Drul_array<Music*> req_l_drul_;
Item* item_;
Spanner* bracket_; // A single portion of a pedal bracket
Spanner* finished_bracket_;
*/
Spanner* line_spanner_;
Spanner* finished_line_spanner_;
- Span_req* current_bracket_req_;
+ Music* current_bracket_req_;
};
bool
Piano_pedal_engraver::try_music (Music *m)
{
- if (Span_req * s = dynamic_cast<Span_req*> (m))
+ if (m->is_mus_type ("abort-event"))
{
for (Pedal_info*p = info_list_; p->name_; p ++)
{
- if (ly_scm2string (s->get_mus_property ("span-type")) == "abort")
- {
- p->req_l_drul_[START] = 0;
- p->req_l_drul_[STOP] = 0;
-
+ p->req_l_drul_[START] = 0;
+ p->req_l_drul_[STOP] = 0;
+
if (p->bracket_)
p->bracket_->suicide (); /* as in dynamic-engraver.cc */
p->bracket_ = 0;
- }
- if (scm_equal_p (s->get_mus_property ("span-type"),
- scm_makfrom0str (p->name_))==SCM_BOOL_T)
+ }
+ }
+ else if (m->is_mus_type ("pedal-event"))
+ {
+ for (Pedal_info*p = info_list_; p->name_; p ++)
+ {
+ String nm = p->name_ + String ("Event");
+ if (gh_equal_p (m->get_mus_property ("name") ,
+ scm_makfrom0str (nm.to_str0())))
{
- p->req_l_drul_[s->get_span_dir ()] = s;
+ Direction d = to_dir (m->get_mus_property ("span-direction"));
+ p->req_l_drul_[d] = m;
return true;
}
}
ENTER_DESCRIPTION (Piano_pedal_engraver,
/* descr */ "Engrave piano pedal symbols and brackets.",
/* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
-/* accepts */ "general-music",
+/* accepts */ "pedal-event abort-event",
/* acks */ "note-column-interface",
/* reads */ "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings",
/* write */ "");
*/
#include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "audio-item.hh"
/**
struct Pedal_info
{
char const *name_;
- Span_req* start_req_;
- Drul_array<Span_req*> req_l_drul_;
+ Music* start_req_;
+ Drul_array<Music*> req_l_drul_;
};
public:
bool
Piano_pedal_performer::try_music (Music* r)
{
- if (Span_req * s = dynamic_cast<Span_req*> (r))
+ if (r->is_mus_type ("pedal-event"))
{
for (Pedal_info*p = info_alist_; p->name_; p ++)
{
- if (scm_equal_p (s->get_mus_property ("span-type"),
- scm_makfrom0str (p->name_)) == SCM_BOOL_T)
+ String nm = p->name_ + String ("Event");
+ if (gh_equal_p (r->get_mus_property ("name") ,
+ scm_makfrom0str (nm.to_str0())))
{
- p->req_l_drul_[s->get_span_dir ()] = s;
+ Direction d = to_dir (r->get_mus_property ("span-direction"));
+ p->req_l_drul_[d] = r;
return true;
}
}
}
ENTER_DESCRIPTION (Piano_pedal_performer, "","",
- "general-music",
+ "pedal-event",
"","","" );
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*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "note-head-interface",
/* reads */ "squashedPosition",
/* write */ "");
#include "staff-symbol-referencer.hh"
#include "porrectus.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
+#include "request.hh"
+
#include "rhythmic-head.hh"
#include "item.hh"
#include "engraver.hh"
private:
PQueue<Grob_pitch_tuple> past_notes_pq_;
- Porrectus_req *porrectus_req_;
+ Music *porrectus_req_;
Array<Grob_pitch_tuple> left_heads_;
Array<Grob_pitch_tuple> right_heads_;
Link_array<Grob> porrectuses_;
bool
Porrectus_engraver::try_music (Music *m)
{
- if (Porrectus_req *req_ = dynamic_cast <Porrectus_req *> (m))
+ if (m->is_mus_type ("porrectus-event"))
{
- porrectus_req_ = req_;
+ porrectus_req_ = m;
return true;
}
else
ENTER_DESCRIPTION(Porrectus_engraver,
/* descr */ "Join adjacent notes to a porrectus ligature.",
/* creats*/ "Porrectus",
-/* accepts */ "general-music",
+/* accepts */ "porrectus-event",
/* acks */ "rhythmic-head-interface",
/* reads */ "",
/* write */ "");
/* descr */ "Acknowledge repeated music, and convert the contents of
repeatCommands ainto an appropriate setting for whichBar",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "",
/* reads */ "repeatCommands whichBar",
/* write */ "");
#include "pitch.hh"
#include "request-chord-iterator.hh"
#include "music-list.hh"
-#include "musical-request.hh"
+#include "request.hh"
Request_chord::Request_chord ()
{
}
-Pitch
-Request_chord::to_relative_octave (Pitch last)
-{
- for (SCM s = music_list (); gh_pair_p (s); s = ly_cdr (s))
- {
- Music * mus = unsmob_music (ly_car (s));
-
- if (mus->is_mus_type ("melodic-event")
- || mus->is_mus_type ("rest-event"))
- {
- Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch"));
- if (!old_pit)
- continue;
-
- Pitch new_pit = *old_pit;
- new_pit.to_relative_octave (last);
- mus->set_mus_property ("pitch", new_pit.smobbed_copy ());
-
- return new_pit;
- }
-
- }
- return last;
-}
-
Moment
Request_chord::start_mom () const
{
#include "request.hh"
#include "warn.hh"
-bool
-Request::equal_b (Request const* r) const
+
+
+
+Moment
+Request::length_mom () const
{
- return r->do_equal_b (this) || this->do_equal_b (r) ;
+ Duration *d = unsmob_duration (get_mus_property ("duration"));
+ if (!d)
+ {
+ Moment m ;
+ return m;
+ }
+ return d->length_mom ();
}
-bool
-Request::do_equal_b (Request const*) const
+void
+Request::compress (Moment m)
{
- return true;
+ Duration *d = unsmob_duration (get_mus_property ("duration"));
+ if (d)
+ set_mus_property ("duration", d ->compressed (m.main_part_).smobbed_copy ());
+}
+
+void
+Request::transpose (Pitch delta)
+{
+ Pitch *p = unsmob_pitch (get_mus_property ("pitch"));
+ if (!p)
+ return ;
+
+ Pitch np = *p;
+ np.transpose (delta);
+
+ if (abs (np.alteration_) > 2)
+ {
+ warning (_f ("Transposition by %s makes accidental larger than two",
+ delta.string ()));
+ }
+
+ set_mus_property ("pitch", np.smobbed_copy ());
+}
+
+Pitch
+ Request::to_relative_octave (Pitch last)
+{
+ Pitch *old_pit = unsmob_pitch (get_mus_property ("pitch"));
+ if (old_pit)
+ {
+ Pitch new_pit = *old_pit;
+ new_pit.to_relative_octave (last);
+ set_mus_property ("pitch", new_pit.smobbed_copy ());
+
+ return new_pit;
+ }
+ return last;
}
Request::Request ()
{
}
-Script_req::Script_req ()
+ADD_MUSIC(Request);
+LY_DEFINE(music_duration_length, "music-duration-length", 1, 0,0,
+ (SCM mus),
+ "Extract the duration field from @var{mus}, and return the length.")
{
- set_direction (CENTER);
+ Music* m = unsmob_music(mus);
+ SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
+
+ Duration *d = unsmob_duration (m->get_mus_property ("duration"));
+
+ Moment l ;
+
+ if (d)
+ {
+ l = d->length_mom ();
+ }
+ else
+ programming_error("Music has no duration");
+ return l.smobbed_copy();
+
}
-void
-Script_req::set_direction (Direction d)
+
+LY_DEFINE(music_duration_compress, "music-duration-compress", 2, 0,0,
+ (SCM mus, SCM factor),
+ "Extract the duration field from @var{mus}, and compress it.")
{
- set_mus_property ("direction", gh_int2scm (d));
+ Music* m = unsmob_music(mus);
+ Moment * f = unsmob_moment (factor);
+ SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__, "Music");
+ SCM_ASSERT_TYPE(f, factor, SCM_ARG2, __FUNCTION__, "Moment");
+
+ Duration *d = unsmob_duration (m->get_mus_property ("duration"));
+ if (d)
+ m->set_mus_property ("duration", d->compressed (f->main_part_).smobbed_copy());
+ return SCM_UNSPECIFIED;
}
-Direction
-Script_req::get_direction () const
+
+
+
+
+
+
+#include "request.hh"
+
+
+
+LY_DEFINE(transpose_key_alist,"transpose-key-alist",
+ 2, 0,0, (SCM l, SCM pitch),
+ "Make a new key alist of @var{l} transposed by pitch @var{pitch}")
+{
+ SCM newlist = SCM_EOL;
+ Pitch *p = unsmob_pitch (pitch);
+
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
+ {
+ SCM key = ly_caar (s);
+ SCM alter = ly_cdar (s);
+ if (gh_pair_p (key))
+ {
+ Pitch orig (gh_scm2int (ly_car (key)),
+ gh_scm2int (ly_cdr (key)),
+ gh_scm2int (alter));
+
+ orig.transpose (*p);
+
+ SCM key = gh_cons (scm_int2num (orig.get_octave ()),
+ scm_int2num (orig.notename_));
+
+ newlist = gh_cons (gh_cons (key, scm_int2num (orig.alteration_)),
+ newlist);
+ }
+ else if (gh_number_p (key))
+ {
+ Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
+ orig.transpose (*p);
+
+ key =scm_int2num (orig.notename_);
+ alter = scm_int2num (orig.alteration_);
+ newlist = gh_cons (gh_cons (key, alter), newlist);
+ }
+ }
+ return scm_reverse_x (newlist, SCM_EOL);
+}
+
+void
+Key_change_req::transpose (Pitch p)
{
- SCM d = get_mus_property ("direction");
+ SCM pa = get_mus_property ("pitch-alist");
- return (ly_dir_p (d)) ? to_dir (d) : CENTER;
+ set_mus_property ("pitch-alist", transpose_key_alist (pa, p.smobbed_copy()));
}
-Direction
-Span_req::get_span_dir () const
+
+bool
+alist_equal_p (SCM a, SCM b)
{
- SCM d = get_mus_property ("span-direction");
+ for (SCM s = a;
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ SCM key = ly_caar (s);
+ SCM val = ly_cdar (s);
+ SCM l = scm_assoc (key, b);
- return (ly_dir_p (d)) ? to_dir (d) : CENTER;
+ if (l == SCM_BOOL_F
+ || !gh_equal_p ( ly_cdr (l), val))
+
+ return false;
+ }
+ return true;
}
-void
-Span_req::set_span_dir (Direction d)
+bool
+Key_change_req::do_equal_b (Request const * m )const
{
- set_mus_property ("span-direction", gh_int2scm (d));
+ Key_change_req const * kc =dynamic_cast<Key_change_req const*> (m);
+
+ if(!kc)
+ return false;
+ return alist_equal_p (get_mus_property ("pitch-alist"),
+ kc->get_mus_property ("pitch-alist"));
}
-ADD_MUSIC(Request);
+ADD_MUSIC (Key_change_req);
ENTER_DESCRIPTION(Rest_collision_engraver,
/* descr */ "Handles collisions of rests.",
/* creats*/ "RestCollision",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "note-column-interface",
/* reads */ "",
/* write */ "");
*/
#include "item.hh"
#include "staff-symbol-referencer.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "dots.hh"
#include "rhythmic-head.hh"
#include "engraver.hh"
#include "stem.hh"
#include "note-column.hh"
#include "dot-column.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "item.hh"
#include "group-interface.hh"
ENTER_DESCRIPTION(Rhythmic_column_engraver,
/* descr */ "Generates NoteColumn, an objects that groups stems, noteheads and rests.",
/* creats*/ "NoteColumn NoteSpacing",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "stem-interface rhythmic-head-interface dot-column-interface",
/* reads */ "",
/* write */ "");
#include "score-engraver.hh"
#include "paper-score.hh"
#include "paper-column.hh"
-#include "command-request.hh"
+
#include "paper-def.hh"
#include "axis-group-interface.hh"
#include "translator-def.hh"
ENTER_DESCRIPTION(Score_performer,
/* descr */ "",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "",
/* reads */ "",
/* write */ "");
ENTER_DESCRIPTION(Script_column_engraver,
/* descr */ "",
/* creats*/ "ScriptColumn",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "side-position-interface",
/* reads */ "",
/* write */ "");
#include "script.hh"
#include "side-position-interface.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
#include "engraver.hh"
class Script_engraver : public Engraver
{
Link_array<Grob> scripts_;
- Link_array<Articulation_req> script_reqs_;
+ Link_array<Music> script_reqs_;
public:
TRANSLATOR_DECLARATIONS(Script_engraver);
bool
Script_engraver::try_music (Music *r)
{
- if (Articulation_req *mr = dynamic_cast <Articulation_req *> (r))
+ if (r->is_mus_type ("articulation-event"))
{
- for (int i=0; i < script_reqs_.size (); i++)
- {
- if (script_reqs_[i]->equal_b (mr))
- return true;
- }
- script_reqs_.push (mr);
+ script_reqs_.push (r);
return true;
}
return false;
{
for (int i=0; i < script_reqs_.size (); i++)
{
- Articulation_req* l=script_reqs_[i];
+ Music* l=script_reqs_[i];
SCM alist = get_property ("scriptDefinitions");
SCM art = scm_assoc (l->get_mus_property ("articulation-type"), alist);
/* descr */ " Handles note ornaments generated by @code{\\script}.
",
/* creats*/ "Script",
-/* accepts */ "general-music",
+/* accepts */ "script-event articulation-event",
/* acks */ "stem-interface rhythmic-head-interface note-column-interface",
/* reads */ "scriptDefinitions scriptHorizontal",
/* write */ "");
ENTER_DESCRIPTION(Separating_line_group_engraver,
/* descr */ "Generates objects for computing spacing parameters.",
/* creats*/ "SeparationItem SeparatingGroupSpanner",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "item-interface",
/* reads */ "",
/* write */ "");
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "musical-request.hh"
+#include "request.hh"
#include "slur.hh"
#include "warn.hh"
#include "note-column.hh"
*/
class Slur_engraver : public Engraver
{
- Link_array<Span_req> requests_;
- Link_array<Span_req> new_slur_reqs_;
+ Link_array<Music> requests_;
+ Link_array<Music> new_slur_reqs_;
Link_array<Grob> slur_stack_;
Link_array<Grob> end_slurs_;
Moment last_start_;
bool
Slur_engraver::try_music (Music *req)
{
- if (Span_req *sl = dynamic_cast <Span_req *> (req))
+ if (req->is_mus_type ("abort-event"))
{
- String t = ly_scm2string (sl->get_mus_property ("span-type"));
- if (t == "abort")
+ for (int i = 0; i < slur_stack_.size (); i++)
{
- for (int i = 0; i < slur_stack_.size (); i++)
- {
- slur_stack_[i]->suicide ();
- }
- slur_stack_.clear ();
- for (int i = 0; i < end_slurs_.size (); i++)
+ slur_stack_[i]->suicide ();
+ }
+ slur_stack_.clear ();
+ for (int i = 0; i < end_slurs_.size (); i++)
+ {
+ end_slurs_[i]->suicide ();
+ }
+ end_slurs_.clear ();
+ requests_.clear ();
+ new_slur_reqs_.clear ();
+ }
+ else if (req->is_mus_type ("slur-event"))
+ {
+ /*
+ Let's not start more than one slur per moment.
+ */
+ Direction d = to_dir (req->get_mus_property ("span-direction"));
+ if (d == START)
+ {
+ if (now_mom () > last_start_)
{
- end_slurs_[i]->suicide ();
+ new_slur_reqs_.push (req);
+ last_start_ = now_mom ();
}
- end_slurs_.clear ();
- requests_.clear ();
- new_slur_reqs_.clear ();
+
+ /*
+ But we swallow other slur requests.
+ */
+
+ return true;
+
}
- else if (t == "slur")
+ else if (d == STOP)
{
/*
- Let's not start more than one slur per moment.
- */
- if (sl->get_span_dir () == START)
+ Swallow other requests.
+ */
+ for (int j = new_slur_reqs_.size(); j--;)
{
- if (now_mom () > last_start_)
- {
- new_slur_reqs_.push (sl);
- last_start_ = now_mom ();
- }
-
- /*
- But we swallow other slur requests.
- */
+ Direction nd = to_dir (new_slur_reqs_[j]->get_mus_property ("span-direction"));
- return true;
-
+ if (nd == STOP)
+ return true;
}
- else if (sl->get_span_dir () == STOP)
- {
- /*
- Swallow other requests.
- */
- for (int j = new_slur_reqs_.size(); j--;)
- if (new_slur_reqs_[j]->get_span_dir() == STOP)
- return true;
- new_slur_reqs_.push (sl);
- return true;
- }
+ new_slur_reqs_.push (req);
+ return true;
}
}
return false;
Link_array<Grob> start_slurs;
for (int i=0; i< new_slur_reqs_.size (); i++)
{
- Span_req* slur_req = new_slur_reqs_[i];
+ Music* slur_req = new_slur_reqs_[i];
// end slur: move the slur to other array
- if (slur_req->get_span_dir () == STOP)
+ Direction d = to_dir (slur_req->get_mus_property ("span-direction"));
+ if (d== STOP)
{
if (slur_stack_.empty ())
/* How to shut up this warning, when Voice_devnull_engraver has
requests_.pop ();
}
}
- else if (slur_req->get_span_dir () == START)
+ else if (d == START)
{
// push a new slur onto stack.
// (use temp. array to wait for all slur STOPs)
ENTER_DESCRIPTION (Slur_engraver,
/* descr */ "Build slurs from Slur_reqs",
/* creats*/ "Slur",
-/* accepts */ "general-music",
+/* accepts */ "slur-event",
/* acks */ "note-column-interface",
/* reads */ "slurMelismaBusy",
/* write */ "");
*/
-#include "musical-request.hh"
+#include "request.hh"
#include "paper-column.hh"
#include "engraver.hh"
#include "pqueue.hh"
*/
if (!now_.grace_part_)
{
- if (Rhythmic_req * r = dynamic_cast<Rhythmic_req*> (i.music_cause ()))
+ Music *r = i.music_cause ();
+ if (r && r->is_mus_type ("rhythmic-event"))
{
Moment len = r->length_mom ();
Rhythmic_tuple t (i, now_mom () + len);
ENTER_DESCRIPTION(Spacing_engraver,
/* descr */ "make a SpacingSpanner and do bookkeeping of shortest starting and playing notes ",
/* creats*/ "SpacingSpanner",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "grob-interface",
/* reads */ "",
/* write */ "");
ENTER_DESCRIPTION(Span_arpeggio_engraver,
/* descr */ "",
/* creats*/ "Arpeggio",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "arpeggio-interface",
/* reads */ "connectArpeggios",
/* write */ "");
/* descr */ "This engraver makes cross-staff barlines: It catches all normal
bar lines, and draws a single span-bar across them.",
/* creats*/ "SpanBar",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "bar-line-interface",
/* reads */ "",
/* write */ "");
*/
#include "performer.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "audio-item.hh"
struct Audio_dynamic_tuple
private:
Audio_dynamic* audio_;
Real last_volume_;
- Span_req* span_start_req_;
- Drul_array<Span_req*> span_req_l_drul_;
+ Music* span_start_req_;
+ Drul_array<Music*> span_req_l_drul_;
Array<Audio_dynamic_tuple> dynamic_tuples_;
Array<Audio_dynamic_tuple> finished_dynamic_tuples_;
Direction dir_;
bool
Span_dynamic_performer::try_music (Music* r)
{
- if (Span_req * s = dynamic_cast<Span_req*> (r))
+ if (r->is_mus_type ("dynamic-event")) // fixme.
{
- String t = ly_scm2string (s->get_mus_property ("span-type"));
- if (t == "crescendo" || t == "decrescendo")
- {
- span_req_l_drul_[s->get_span_dir ()] = s;
- return true;
- }
+ Direction d = to_dir (r->get_mus_property ("span-direction"));
+ span_req_l_drul_[d] = r;
+ return true;
}
return false;
}
ENTER_DESCRIPTION (Span_dynamic_performer,
"", "",
- "general-music",
+ "dynamic-event",
"", "", "");
/* descr */ "Maintain the stavesFound variable",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "staff-symbol-interface",
/* reads */ "stavesFound",
/* write */ "stavesFound");
};
ENTER_DESCRIPTION (Staff_performer, "", "",
- "general-music",
+ "",
"", "", "");
Staff_performer::Staff_performer ()
/* descr */ "create the constellation of five (default)
staff lines.",
/* creats*/ "StaffSymbol",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "grob-interface",
/* reads */ "",
/* write */ "");
ENTER_DESCRIPTION(Stanza_number_engraver,
/* descr */ "",
/* creats*/ "StanzaNumber",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "",
/* reads */ "stz stanza",
/* write */ "");
#include "staff-symbol-referencer.hh"
#include "rhythmic-head.hh"
#include "stem.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "misc.hh"
#include "stem-tremolo.hh"
#include "item.hh"
private:
Grob *stem_;
Grob *tremolo_;
- Rhythmic_req *rhythmic_req_;
- Tremolo_req* tremolo_req_;
+ Music *rhythmic_req_;
+ Music* tremolo_req_;
};
Stem_engraver::Stem_engraver ()
bool
Stem_engraver::try_music (Music* r)
{
- if (Tremolo_req* a = dynamic_cast <Tremolo_req *> (r))
+ if (r->is_mus_type ("tremolo-event"))
{
- tremolo_req_ = a;
+ tremolo_req_ = r;
return true;
}
return false;
/* descr */ "Create stems and single-stem tremolos. It also works together with
the beam engraver for overriding beaming.",
/* creats*/ "Stem StemTremolo",
-/* accepts */ "general-music",
+/* accepts */ "tremolo-event",
/* acks */ "rhythmic-head-interface",
/* reads */ "tremoloFlags stemLeftBeamCount stemRightBeamCount",
/* write */ "");
ENTER_DESCRIPTION(System_start_delimiter_engraver,
/* descr */ "Creates a system start delimiter (ie. SystemStart@{Bar,Brace,Bracket@} spanner",
/* creats*/ "SystemStartBar SystemStartBrace SystemStartBracket",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "system-start-delimiter-interface staff-symbol-interface",
/* reads */ "systemStartDelimiter",
/* write */ "");
#include "rhythmic-head.hh"
#include "paper-def.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "dots.hh"
#include "dot-column.hh"
#include "staff-symbol-referencer.hh"
(c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "command-request.hh"
+
#include "audio-item.hh"
#include "performer.hh"
#include "engraver.hh"
#include "side-position-interface.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
*/
class Text_engraver : public Engraver
{
- Link_array<Text_script_req> reqs_;
+ Link_array<Music> reqs_;
Link_array<Item> texts_;
public:
TRANSLATOR_DECLARATIONS(Text_engraver);
bool
Text_engraver::try_music (Music *m)
{
- if (dynamic_cast<Text_script_req*> (m)
- && m->get_mus_property ("text-type") != ly_symbol2scm ("finger")
- && m->get_mus_property ("text-type") != ly_symbol2scm ("dynamic"))
+ if (m->is_mus_type ("text-script-event"))
{
- reqs_.push (dynamic_cast<Text_script_req*> (m));
+ reqs_.push (m);
return true;
}
return false;
return;
for (int i=0; i < reqs_.size (); i++)
{
- Text_script_req * r = reqs_[i];
+ Music * r = reqs_[i];
// URG: Text vs TextScript
String basic = "TextScript";
text->set_grob_property ("script-priority", gh_int2scm (priority));
- if (r->get_direction ())
- Side_position_interface::set_direction (text, r->get_direction ());
+ Direction dir = to_dir (r->get_mus_property ("direction"));
+ if (dir)
+ Side_position_interface::set_direction (text, dir);
text->set_grob_property ("text", r->get_mus_property ("text"));
announce_grob (text, r->self_scm ());
ENTER_DESCRIPTION(Text_engraver,
/* descr */ "Create text-scripts",
/* creats*/ "TextScript",
-/* accepts */ "general-music",
+/* accepts */ "text-script-event",
/* acks */ "rhythmic-head-interface stem-interface",
/* reads */ "scriptHorizontal",
/* write */ "");
*/
#include "dimensions.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "paper-column.hh"
#include "note-column.hh"
#include "item.hh"
private:
Spanner *span_;
Spanner *finished_;
- Span_req *current_req_;
- Drul_array<Span_req*> req_drul_;
+ Music *current_req_;
+ Drul_array<Music*> req_drul_;
void typeset_all ();
};
bool
Text_spanner_engraver::try_music (Music *m)
{
- if (Span_req *s = dynamic_cast <Span_req*> (m))
+ if (m->is_mus_type ("text-span-event"))
{
- String t = ly_scm2string (s->get_mus_property ("span-type"));
- if (t == "abort")
- {
- req_drul_[LEFT] = 0;
- req_drul_[RIGHT] = 0;
- if (span_)
- span_->suicide ();
- span_ = 0;
- }
- else if (t == "text")
- {
- req_drul_[s->get_span_dir ()] = s;
- return true;
- }
+
+ Direction d = to_dir (m->get_mus_property ("span-direction"));
+ req_drul_[d] = m;
+ return true;
}
+ else if (m->is_mus_type ("abort-event"))
+ {
+ req_drul_[LEFT] = 0;
+ req_drul_[RIGHT] = 0;
+ if (span_)
+ span_->suicide ();
+ span_ = 0;
+ }
+
return false;
}
}
ENTER_DESCRIPTION(Text_spanner_engraver,
-/* descr */ "Create text spanner from a Span_req.",
+/* descr */ "Create text spanner from a Music.",
/* creats*/ "TextSpanner",
-/* accepts */ "general-music",
+/* accepts */ "text-span-event",
/* acks */ "note-column-interface",
/* reads */ "",
/* write */ "");
#include "engraver.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "translator-group.hh"
class Thread_devnull_engraver : public Engraver
everything in the second thread.
",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "grob-interface",
/* reads */ "",
/* write */ "");
*/
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
#include "tie.hh"
#include "translator-group.hh"
#include "spanner.hh"
*/
-#include "command-request.hh"
+
#include "audio-item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "pqueue.hh"
#include "performer.hh"
#include "time-scaled-music-iterator.hh"
#include "time-scaled-music.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "translator-group.hh"
-#include "command-request.hh"
+
void
Time_scaled_music_iterator::process (Moment m)
*/
#include "time-signature.hh"
-#include "command-request.hh"
+
#include "engraver.hh"
#include "engraver-group-engraver.hh"
}
}
-ENTER_DESCRIPTION(Time_signature_performer,"","","general-music","","","");
+ENTER_DESCRIPTION(Time_signature_performer,"","","","","","");
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "translator-group.hh"
-#include "command-request.hh"
+
#include "grob-info.hh"
#include "multi-measure-rest.hh"
#include "timing-translator.hh"
this engraver should be removed from @code{Score} and placed in
@code{Staff}.",
/* creats*/ "",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "",
/* reads */ "timeSignatureFraction barNonAuto whichBar barAlways defaultBarType skipBars timing oneBeat measureLength measurePosition currentBarNumber",
/* write */ "");
#include "warn.hh"
#include "timing-translator.hh"
-#include "command-request.hh"
+
#include "translator-group.hh"
#include "global-translator.hh"
#include "multi-measure-rest.hh"
daddy_trans_->set_property ("measurePosition", measposp.smobbed_copy ());
}
-ENTER_DESCRIPTION(Timing_translator,"","","general-music","","","");
+ENTER_DESCRIPTION(Timing_translator,"","","","","","");
*/
-#include "command-request.hh"
+
#include "tuplet-bracket.hh"
#include "note-column.hh"
#include "time-scaled-music.hh"
TRANSLATOR_DECLARATIONS(Tuplet_engraver);
protected:
- Link_array<Time_scaled_music> time_scaled_musics_;
+ Link_array<Music> time_scaled_musics_;
/// when does the scaled music stop? Array order is synced with time_scaled_musics_
Array<Rational> stop_moments_;
/// when does the current spanner stop? Array order is synced with time_scaled_musics_
};
bool
-Tuplet_engraver::try_music (Music *r)
+Tuplet_engraver::try_music (Music *c)
{
-#if 1
- if (Time_scaled_music * c = dynamic_cast<Time_scaled_music *> (r))
- {
- Music *el = c->element ();
-#else
- if (r->is_mus_type ("time-scaled-music"))
+ if (c->is_mus_type ("time-scaled-music"))
{
Music *el = unsmob_music (c->get_mus_property ("element"));
-#endif
- if (!dynamic_cast<Request_chord*> (el))
+ if (el && !el->is_mus_type ("request-chord"))
{
time_scaled_musics_.push (c);
Rational m = now_mom ().main_part_ + c->length_mom ().main_part_;
*/
#include "translator.hh"
-#include "musical-request.hh"
+#include "request.hh"
class Skip_req_swallow_translator : public virtual Translator
{
ENTER_DESCRIPTION(Vertical_align_engraver,
/* descr */ "Catch Vertical axis groups and stack them.",
/* creats*/ "VerticalAlignment",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "axis-group-interface",
/* reads */ "",
/* write */ "");
#include "engraver.hh"
#include "item.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "translator-group.hh"
class Voice_devnull_engraver : public Engraver
};
+/*
+
+ARGH .
+
+
+This really sucks.
+ */
static char const *eat_spanners[] = {
"beam",
"crescendo",
&& (to_boolean (get_property ("unison"))
|| to_boolean (get_property ("unisilence")))))
{
- if (Span_req *s = dynamic_cast <Span_req *> (m))
+ if (m->is_mus_type ("span-event"))
{
- SCM t = s->get_mus_property ("span-type");
+ SCM t = m->get_mus_property ("span-type");
for (char const **p = eat_spanners; *p; p++)
{
ENTER_DESCRIPTION(Voice_devnull_engraver,
/* descr */ "Kill off certain items and spanners if we're Voice `two' and unison or unisilence is set.",
/* creats*/ "",
-/* accepts */ "general-music tie-event",
+/* accepts */ "general-music", /*UGH.*/
/* acks */ "grob-interface",
/* reads */ "",
/* write */ "");
ENTER_DESCRIPTION(Volta_engraver,
/* descr */ "Make volta brackets",
/* creats*/ "VoltaBracket",
-/* accepts */ "general-music",
+/* accepts */ "",
/* acks */ "bar-line-interface staff-symbol-interface note-column-interface",
/* reads */ "repeatCommands voltaSpannerDuration stavesFound",
/* write */ "");
))
))
-(define (engraver-makes-grob? name-symbol grav)
- (memq name-symbol (assoc 'grobs-created (ly-translator-description grav)))
- )
-
(define (all-grobs-doc)
(make <texi-node>
#:name "All Graphical objects"
;;; Jan Nieuwenhuizen <janneke@gnu.org>
+(define (engraver-makes-grob? name-symbol grav)
+ (memq name-symbol (assoc 'grobs-created (ly-translator-description grav)))
+ )
+(define (engraver-accepts-music-type? name-symbol grav)
+ (memq name-symbol (assoc 'events-accepted (ly-translator-description grav)))
+
+ )
+
+(define (engraver-accepts-music-types? types grav)
+ (if (null? types)
+ #f
+ (or
+ (engraver-accepts-music-type? (car types) grav)
+ (engraver-accepts-music-types? (cdr types) grav)))
+ )
-;; First level Engraver description and
-;; second level Context description
(define (engraver-doc-string engraver)
(let* (
(propsr (cdr (assoc 'properties-read (ly-translator-description engraver))))
-
-
(define (music-props-doc)
(make <texi-node>
#:name "Music properties"
(map (lambda (entry)
(let*
(
- (types (assoc 'types (cdr entry) ))
+ (types (cdr (assoc 'types (cdr entry) )))
)
(map (lambda (type)
(hashq-set! music-types->names type
"Convert table t to list"
(apply append
(vector->list t)
-
))
(define (strip-description x)
(sort
(map (lambda (x) (ref-ify (symbol->string x)))
(cdr entry)) string<?))
+
+ "\n\nAccepted by: "
+ (human-listify
+ (map ref-ify
+ (map ly-translator-name
+ (filter-list
+ (lambda (x) (engraver-accepts-music-type? (car entry) x)) all-engravers-list))))
"\n\n"
)))
(hash-table->alist music-types->names) alist<?))
))
-(define (music-object-doc obj)
- (make <texi-node>
- #:name (symbol->string (car obj))
- #:text (string-append
- (object-property (car obj) 'music-description)
+(define (music-doc-str obj)
+ (let*
+ (
+ (namesym (car obj))
+ (props (cdr obj))
+ (types (cdr (assoc 'types props)))
+ )
+
+ (string-append
+ (object-property namesym 'music-description)
+ "\n\nMusic types:\n"
+ (human-listify (map ref-ify (map symbol->string types)))
+ "\n\n"
+ "\n\nAccepted by: "
+ (human-listify
+ (map ref-ify
+ (map ly-translator-name
+ (filter-list
+ (lambda (x) (engraver-accepts-music-types? types x)) all-engravers-list))))
"\n\nProperties: \n"
(description-list->texi
(map
- (lambda (x) (document-property x 'music (cdr obj)))
- (map car (cdr obj))))
- ))
-)
+ (lambda (x) (document-property x 'music props))
+ (map car props)))
+
+ )
+ ))
+
+(define (music-object-doc obj)
+ (make <texi-node>
+ #:name (symbol->string (car obj))
+ #:text (music-doc-str obj)
+ ))
(define (music-expressions-doc)
(make <texi-node>
(map music-object-doc music-descriptions)
))
-
(define (music-doc-node)
(make <texi-node>
#:name "Music definitions"
(AbortEvent
. (
(description . "Abort currently running spanners.")
- (internal-class-name . "Span_req")
+ (internal-class-name . "Request")
(span-type . "abort")
(types . (general-music event abort-event))
))
(internal-class-name . "Request")
(types . (general-music arpeggio-event event))
))
+
+ ;; todo: use articulation-event for slur as well.
+ ;; separate non articulation scripts
(ArticulationEvent
. (
(description . "")
- (internal-class-name . "Articulation_req")
+ (internal-class-name . "Request")
(types . (general-music event articulation-event script-event))
))
+ (AutoChangeMusic
+ . (
+ (description . "")
+
+ (internal-class-name . "Music_wrapper")
+ (iterator-ctor . ,Auto_change_iterator::constructor)
+ (types . (general-music music-wrapper-music auto-change-instruction))
+ ))
+ (BarCheck
+ . (
+ (description . "")
+
+ (internal-class-name . "Music")
+ (types . (general-music bar-check))
+ (iterator-ctor . ,Bar_check_iterator::constructor)
+ ))
(BassFigureEvent
. (
(description . "")
(internal-class-name . "Request")
(types . (general-music event busy-playing-event))
))
- (ExtenderEvent
+ (ContextSpeccedMusic
+ . (
+ (description . "")
+
+ (internal-class-name . "Context_specced_music")
+ (types . (context-specification general-music music-wrapper-music))
+ ))
+ (CrescendoEvent
+ . (
+ (description . "")
+
+ (internal-class-name . "Request")
+ (types . (general-music dynamic-event crescendo-event event))
+ ))
+ (DecrescendoEvent
+ . (
+ (description . "")
+
+ (internal-class-name . "Request")
+ (types . (general-music dynamic-event decrescendo-event event))
+ ))
+ (ExtenderEvent
. (
(description . "")
(internal-class-name . "Key_change_req")
(types . (general-music key-change-event event))
))
- (LyricEvent
+ (LyricCombineMusic
. (
(description . "")
- (internal-class-name . "Lyric_req")
- (types . (general-music rhythmic-event event))
+ (internal-class-name . "Lyric_combine_music")
+ (types . (general-music lyric-combine-music))
+ (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
+ ))
+
+ (LyricEvent
+ . (
+ (description . "A lyric syllable. Must be entered in lyrics mode, i.e.
+@code{\lyrics @{ twinkle4 twinkle4 @} } .")
+
+ (length . ,music-duration-length)
+ (compress-procedure . ,music-duration-compress)
+ (internal-class-name . "Request")
+ (types . (general-music rhythmic-event lyric-event event))
))
(LigatureEvent
. (
(internal-class-name . "Request")
(types . (general-music event))
))
+ (MultiMeasureRestEvent
+ . (
+ (description . "Rests that may be compressed into Multi rests. Syntax
+@code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
+ (internal-class-name . "Request")
+ (types . (general-music event multi-measure-rest-event))
+ ))
(Music
. (
(description . "")
(compress-procedure . ,music-duration-compress)
(types . (general-music event note-event rhythmic-event melodic-event))
))
- (PorrectusEvent
+ (OverrideProperty
+ . (
+ (description . "")
+
+ (internal-class-name . "Music")
+ (types . (general-music layout-instruction))
+ (iterator-ctor . , Push_property_iterator::constructor)
+ ))
+
+ (PartCombineMusic
. (
(description . "")
- (internal-class-name . "Porrectus_req")
- (types . (general-music event))
+ (internal-class-name . "Part_combine_music")
+ (types . (general-music part-combine-music))
+ (iterator-ctor . ,Part_combine_music_iterator::constructor)
+ ))
+ (PhrasingSlurEvent
+ . (
+ (description . "Start or end phrasing slur. Syntax NOTE \( and \) NOTE")
+ (internal-class-name . "Request")
+ (types . (general-music span-event phrasing-slur-event slur-event))
+ ))
+ (PropertySet
+ . (
+ (description . "")
+ (internal-class-name . "Music")
+ (types . (layout-instruction general-music))
+ (iterator-ctor . ,Property_iterator::constructor)
+ )
+ )
+ (PropertyUnset
+ . (
+ (description . "")
+
+ (internal-class-name . "Music")
+ (types . (layout-instruction general-music))
+ (iterator-ctor . ,Property_unset_iterator::constructor)
+ )
+ )
+ (PorrectusEvent
+ . (
+ (description . "")
+
+ (internal-class-name . "Request")
+ (types . (general-music porrectus-event event))
))
(RepeatedMusic
. (
(internal-class-name . "Repeated_music")
(type . repeated-music)
- (types . (general-music repeat-music))
+ (types . (general-music repeated-music))
))
(Request
. (
(compress-procedure . ,music-duration-compress)
(types . (general-music event rhythmic-event rest-event))
))
- (RhythmicEvent
- . (
- (description . "")
-
- (internal-class-name . "Rhythmic_req")
- (length . ,music-duration-length)
- (compress-procedure . ,music-duration-compress)
- (types . (general-music rhythmic-event event))
- ))
(SequentialMusic
. (
- (description . "")
+ (description . "Music expressions concatenated. Syntax \sequential @{..@} or simply @{..@} .")
(internal-class-name . "Sequential_music")
(iterator-ctor . ,Sequential_music_iterator::constructor)
))
(SimultaneousMusic
. (
- (description . "")
+ (description . "Music playing together. Syntax: \simultaneous @{ .. @} or < .. >.")
(internal-class-name . "Simultaneous_music")
(iterator-ctor . ,Simultaneous_music_iterator::constructor)
(types . (general-music simultaneous-music))
))
- (PropertySet
- . (
- (description . "")
-
- (internal-class-name . "Music")
- (types . (layout-instruction general-music))
- (iterator-ctor . ,Property_iterator::constructor)
- )
- )
- (PropertyUnset
+ (SlurEvent
. (
- (description . "")
-
- (internal-class-name . "Music")
- (types . (layout-instruction general-music))
- (iterator-ctor . ,Property_unset_iterator::constructor)
- )
- )
- (VoiceSeparator
- . (
- (description . "")
-
- (internal-class-name . "Music")
- (types . (separator general-music))
- ))
- (BarCheck
- . (
- (description . "")
-
- (internal-class-name . "Music")
- (types . (general-music bar-check))
- (iterator-ctor . ,Bar_check_iterator::constructor)
- ))
- (OverrideProperty
- . (
- (description . "")
+ (description . "Start or end slur. Syntax NOTE( and )NOTE")
+ (internal-class-name . "Request")
+ (types . (general-music span-event slur-event))
+ ))
- (internal-class-name . "Music")
- (types . (general-music layout-instruction))
- (iterator-ctor . , Push_property_iterator::constructor)
- ))
- (RevertProperty
+ (RevertProperty
. (
(description . "")
(iterator-ctor . ,Output_property_music_iterator::constructor)
(types . (general-music layout-instruction))
))
- (ContextSpeccedMusic
+
+ (TextSpanEvent
. (
- (description . "")
-
- (internal-class-name . "Context_specced_music")
- (types . (context-specification general-music music-wrapper-music))
- ))
- (AutoChangeMusic
- . (
- (description . "")
-
- (internal-class-name . "Music_wrapper")
- (iterator-ctor . ,Auto_change_iterator::constructor)
- (types . (general-music music-wrapper-music auto-change-instruction))
+ (description . "Start a text spanner like 8va.....|")
+ (internal-class-name . "Request")
+ (types . (general-music span-event text-span-event))
))
(TranslatorChange
. (
(TimeScaledMusic
. (
(description . "")
-
(internal-class-name . "Time_scaled_music")
(iterator-ctor . ,Time_scaled_music_iterator::constructor)
(types . (time-scaled-music music-wrapper-music general-music))
(types . (music-wrapper-music general-music relative-octave-music))
))
- (LyricCombineMusic
- . (
- (description . "")
-
- (internal-class-name . "Lyric_combine_music")
- (types . (general-music lyric-combine-music))
- (iterator-ctor . ,Lyric_combine_music_iterator::constructor)
- ))
-
- (PartCombineMusic
- . (
- (description . "")
-
- (internal-class-name . "Part_combine_music")
- (types . (general-music part-combine-music))
- (iterator-ctor . ,Part_combine_music_iterator::constructor)
- ))
+
(RequestChord
. (
(description . "")
(internal-class-name . "Request_chord")
(iterator-ctor . ,Request_chord_iterator::constructor)
- (types . (general-music simultaneous-music))
+ (types . (general-music request-chord simultaneous-music))
)
)
. (
(description . "")
- (internal-class-name . "Script_req")
+ (internal-class-name . "Request")
(types . (general-music event))
))
(SkipEvent
(types . (general-music event rhythmic-event skip-event))
))
(SpanEvent
- . (
- (description . "")
-
- (internal-class-name . "Span_req")
- (types . (general-music event))
- ))
- (DecrescendoEvent
- . (
- (description . "")
-
- (internal-class-name . "Request")
- (types . (general-music dynamic-event decrescendo-event event))
- ))
- (CrescendoEvent
. (
(description . "")
(internal-class-name . "Request")
- (types . (general-music dynamic-event crescendo-event event))
+ (types . (general-music event))
))
+ (SustainPedalEvent
+ . (
+ (description . "")
+ (internal-class-name . "Request")
+ (types . (general-music pedal-event sustain-pedal-event))
+ ))
+ (SostenutoEvent
+ . (
+ (description . "")
+ (internal-class-name . "Request")
+ (types . (general-music pedal-event sostenuto-pedal-event))
+ ))
+ (UnaCordaEvent
+ . (
+ (description . "")
+ (internal-class-name . "Request")
+ (types . (general-music pedal-event una-corda-pedal-event))
+ ))
(StringNumberEvent
. (
(description . "")
(TextScriptEvent
. (
(description . "")
- (internal-class-name . "Text_script_req")
+ (internal-class-name . "Request")
(types . (general-music script-event text-script-event event))
))
(TieEvent
(internal-class-name . "Request")
(types . (general-music tie-event event))
))
+ (TremoloEvent
+ . (
+ (description . "Un measured tremolo.")
+ (internal-class-name . "Request")
+ (types . (general-music event tremolo-event))
+ ))
+ (VoiceSeparator
+ . (
+ (description . "")
+
+ (internal-class-name . "Music")
+ (types . (separator general-music))
+ ))
+
))
(set! music-descriptions
(ly-make-bare-music name props)
))
+
+(define-public (old-span-request->event name)
+ (let
+ (
+ (entry (assoc
+ name
+ '(
+ ("text" . TextSpanEvent)
+ ("decrescendo" . DecrescendoEvent)
+ ("crescendo" . CrescendoEvent)
+ ("Sustain" . SustainPedalEvent)
+ ("UnaCorda" . UnaCordaEvent)
+ ("Sostenuto" . SostenutoEvent)
+ )))
+ )
+ (if (eq? entry #f)
+ (error (format "Could not find span type ~a" name))
+
+ (make-music-by-name (cdr entry))
+ )
+ ))