(\t\)
@end macro
+
+TODO:
+
+
@table @samp
@item @code{Generic_property_list}
Defines names and types for generic properties. These are properties
@cindex properties!Score
+
+
+
@table @samp
@item @code{skipBars}@indexcode{skipBars} @propertytype{boolean}
Set to 1 to skip the empty bars that are produced by
"Time_signature"
)
@end example
+
+
+@item @code{timing}@indexcode{timing} @propertytype{boolean}
+ Keep administration of measure length, position, bar number, etc?
+Switch off for cadenzas.
+
+@item @code{currentBarNumber}@indexcode{currentBarNumber} @propertytype{integer}
+ Contains the current barnumber. This property is incremented at
+every barline.
+
+@item @code{measurePosition}@indexcode{measurePosition} @propertytype{Moment}
+
+ How much of the current measure (measured in whole notes) have we had?
+
+@item @code{oneBeat}@indexcode{oneBeat} @propertytype{Moment}
+
+ How long does one beat in the current time signature last?
+
+@item @code{measureLength}@indexcode{measureLength} @propertytype{Moment}
+
+ How long does one measure in the current time signature last?
+
@end table
@subsubheading ChordNamesVoice properties
--- /dev/null
+
+voice4 = \notes {
+\clef bass;
+ \property Staff.instrument = "Bass"
+ \property Staff.instr = "B"
+ \time 4/4; f,2 ( ) f,8 r8 f8 e8
+\repeat volta 2
+{
+ d8. d16 e8. f16 f8 c8 c16 c8.
+}
+\alternative
+{
+ { f,2 ( ) f,8 r8 f8 e8 ( \break }
+ { ) f,2. r8 c16 c16 |
+ }
+}
+}
+voicedefault = \notes {
+ \property Staff.timeSignatureStyle="C"
+ \time 4/4; \key f;
+ \tempo 4 = 200;
+}
+\score{
+ \notes <
+
+
+ \context Staff="4"
+ {
+ \$voicedefault
+ \$voice4
+ }
+
+ >
+ \paper {
+ font_normal = 12.;
+ \translator {
+ \StaffContext
+ \consists Instrument_name_engraver;
+ }
+ }
+}
+
\context Voice = two { \stemdown s2 e4 |
fis2 fis4 }
>
- \stemdown cis2 e4 |
- b4. b8 b4 |
+ \stemboth cis2 [e16( fis a \clef "treble"; b] |
+ d'4 ) b8 b8 b4 |
%19
}
%19
}
-
-
% these should be two separate scores...
\score{
\context Score \notes <
\property Score.midiInstrument = "church organ"
- \praeludiumRight r1 \fugaIIRight }
- \context Staff = bass {
+ \praeludiumRight
+ r1 \mark "B";
+ \fugaIIRight }
+ \context Staff = bass {
+ \property Staff.instrument = #"left"
+ \property Staff.instr = #"lt"
\praeludiumLeft r1 \fugaIILeft }
>
\context Staff = pedal \relative c <
{
- \property Staff.instrument = #"left"
- \property Staff.instr = #"lt"
+ \property Staff.instrument = #"bass"
+ \property Staff.instr = #"bs"
\time 4/4;
\key e;
\paper {
- \translator { \OrchestralScoreContext }
+ \translator {
+ \OrchestralScoreContext
+ }
\translator { \PianoStaffContext
\consists "Instrument_name_engraver";
}
(c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "bar-number-engraver.hh"
-#include "engraver-group-engraver.hh"
+
+#include "lily-guile.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol.hh"
#include "text-item.hh"
#include "moment.hh"
+#include "engraver.hh"
+#include "protected-scm.hh"
-Bar_number_engraver::Bar_number_engraver()
+class Bar_number_engraver : public Engraver
{
- axis_ = Y_AXIS;
- type_ = "barNumber";
-}
-
+protected:
+ Text_item* text_p_;
+ Protected_scm visibility_lambda_;
+ Protected_scm staffs_;
+protected:
+ virtual void do_creation_processing ();
+ virtual void do_pre_move_processing ();
+ virtual void acknowledge_element (Score_element_info);
+ void create_items();
+ void do_process_music ();
+public:
+ VIRTUAL_COPY_CONS(Translator);
+ Bar_number_engraver();
+};
void
Bar_number_engraver::do_process_music ()
if (gh_number_p (bn) &&
!mp && now_mom () > Moment (0))
{
- create_items (0);
+ create_items ();
// guh.
text_p_->set_elt_property ("text",
ly_str02scm (to_str (gh_scm2int (bn)).ch_C()));
-
}
}
ADD_THIS_TRANSLATOR(Bar_number_engraver);
+
+Bar_number_engraver::Bar_number_engraver ()
+{
+ text_p_ =0;
+ staffs_ = SCM_EOL;
+}
+
+void
+Bar_number_engraver::do_creation_processing ()
+{
+ String t = "barNumberVisibilityFunction";
+ SCM proc = get_property (t);
+
+ if (gh_procedure_p (proc))
+ visibility_lambda_ = proc;
+}
+
+
+
+void
+Bar_number_engraver::acknowledge_element (Score_element_info inf)
+{
+ Score_element * s = inf.elem_l_;
+ if (dynamic_cast<Staff_symbol*> (s))
+ {
+ staffs_ = gh_cons (inf.elem_l_->self_scm_, staffs_);
+ }
+ else if (text_p_
+ && dynamic_cast<Item*> (s)
+ && s->get_elt_property ("break-align-symbol") == ly_symbol2scm ("Left_edge_item"))
+ {
+ /*
+ By default this would land on the Paper_column -- so why
+ doesn't it work when you leave this out? */
+ text_p_->set_parent (s, X_AXIS);
+ }
+}
+
+void
+Bar_number_engraver::do_pre_move_processing ()
+{
+ if (text_p_)
+ {
+ text_p_->set_elt_property ("side-support", staffs_);
+ typeset_element (text_p_);
+ text_p_ =0;
+ }
+}
+
+
+void
+Bar_number_engraver::create_items ()
+{
+ if (text_p_)
+ return;
+
+ text_p_ = new Text_item;
+ text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+ Side_position_interface staffside(text_p_);
+ staffside.set_axis (Y_AXIS);
+
+ SCM prop = get_property ("barNumberDirection");
+ if (!isdir_b (prop))
+ {
+ prop = gh_int2scm (UP);
+ }
+ text_p_->set_elt_property ("direction", prop);
+
+ SCM padding = get_property ("barNumberScriptPadding");
+ if (gh_number_p(padding))
+ {
+ text_p_->set_elt_property ("padding", padding);
+ }
+ else
+ {
+ text_p_
+ ->set_elt_property ("padding",
+ gh_double2scm(paper_l ()->get_var ("interline")));
+ }
+
+ if (gh_procedure_p (visibility_lambda_))
+ text_p_->set_elt_property ("visibility-lambda",
+ visibility_lambda_);
+
+ announce_element (Score_element_info (text_p_, 0));
+}
+
(c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+
+#include "bar.hh"
+#include "clef-item.hh"
#include "command-request.hh"
-#include "bar-script-engraver.hh"
+#include "dimension-cache.hh"
#include "engraver-group-engraver.hh"
+#include "engraver.hh"
+#include "lily-guile.hh"
+#include "paper-column.hh"
+#include "paper-def.hh"
+#include "protected-scm.hh"
+#include "side-position-interface.hh"
+#include "staff-symbol-referencer.hh"
+#include "staff-symbol.hh"
#include "text-item.hh"
-/**Print rehearsal marks.
- */
-class Mark_engraver : public Bar_script_engraver
+/**
+ put stuff over or next to bars. Examples: bar numbers, marginal notes,
+ rehearsal marks.
+ */
+class Mark_engraver : public Engraver
{
public:
- Mark_engraver ();
VIRTUAL_COPY_CONS(Translator);
+ Mark_engraver ();
protected:
+ Text_item* text_p_;
+ Protected_scm visibility_lambda_;
+ Protected_scm staffs_;
+
+protected:
+ virtual void do_creation_processing ();
+ virtual void do_pre_move_processing ();
+ virtual void acknowledge_element (Score_element_info);
+ void create_items(Request*);
virtual bool do_try_music (Music *req_l);
virtual void do_process_music ();
virtual void do_post_move_processing ();
ADD_THIS_TRANSLATOR (Mark_engraver);
+
Mark_engraver::Mark_engraver ()
{
+ text_p_ =0;
mark_req_l_ = 0;
- axis_ = Y_AXIS;
- type_ = "mark";
+ staffs_ = SCM_EOL;
+}
+
+void
+Mark_engraver::do_creation_processing ()
+{
+ String t = "markVisibilityFunction";
+ SCM proc = get_property (t);
+
+ if (gh_procedure_p (proc))
+ visibility_lambda_ = proc;
+}
+
+
+
+void
+Mark_engraver::acknowledge_element (Score_element_info inf)
+{
+ Score_element * s = inf.elem_l_;
+ if (dynamic_cast<Staff_symbol*> (s))
+ {
+ staffs_ = gh_cons (inf.elem_l_->self_scm_, staffs_);
+ }
+ else if (text_p_ && dynamic_cast<Bar*> (s))
+ {
+ /*
+ Ugh. Figure out how to do this right at beginning of line, (without
+ creating class Bar_script : public Text_item).
+ */
+ text_p_->set_parent (s, X_AXIS);
+ }
}
+void
+Mark_engraver::do_pre_move_processing ()
+{
+ if (text_p_)
+ {
+ text_p_->set_elt_property ("side-support" , staffs_);
+ typeset_element (text_p_);
+ text_p_ =0;
+ }
+}
+
+
+void
+Mark_engraver::create_items (Request *rq)
+{
+ if (text_p_)
+ return;
+
+ text_p_ = new Text_item;
+ text_p_->set_elt_property ("breakable", SCM_BOOL_T); // ugh
+ Side_position_interface staffside(text_p_);
+ staffside.set_axis (Y_AXIS);
+
+ SCM prop = get_property ("markDirection");
+ if (!isdir_b (prop))
+ {
+ prop = gh_int2scm (UP);
+ }
+ text_p_->set_elt_property ("direction", prop);
+
+ SCM padding = get_property ("markScriptPadding");
+ if (gh_number_p(padding))
+ {
+ text_p_->set_elt_property ("padding", padding);
+ }
+ else
+ {
+ text_p_
+ ->set_elt_property ("padding",
+ gh_double2scm(paper_l ()->get_var ("interline")));
+ }
+
+ if (gh_procedure_p (visibility_lambda_))
+ text_p_->set_elt_property ("visibility-lambda",
+ visibility_lambda_);
+
+ announce_element (Score_element_info (text_p_, rq));
+}
+
+
void
Mark_engraver::do_post_move_processing ()
{
String t;
+ /*
+ automatic marks.
+ */
SCM m = (mark_req_l_->mark_label_ == SCM_UNDEFINED)
? get_property ("rehearsalMark")
: SCM(mark_req_l_->mark_label_);
SCM support = me->get_elt_property ("side-support");
for (SCM s = support; s != SCM_EOL; s = gh_cdr (s))
{
- Score_element * e = unsmob_element ( gh_car (s));
+ Score_element * e = unsmob_element (gh_car (s));
if (e)
common = common->common_refpoint (e, axis);
}
/*
this is too complicated. Yet another version of side-positioning,
- badly implemented. */
+ badly implemented.
+
+ --
+
+ Should look for system_start_delim to find left edge of staff.
+*/
Molecule
Volta_spanner::do_brew_molecule () const
{
systemStartDelimiterGlyph = #'bracket
- \consistsend "Axis_group_engraver" ;
+
\name StaffGroup;
Time_signature
)
\consists "Spacing_engraver";
+
\consists "Vertical_align_engraver";
alignmentReference = \down;
defaultClef = #"treble"