@section Introduction
-This document tries give a brief overview of LilyPond features. When
-the text correspond with the shown notation, we consider LilyPond
-Officially BugFree (tm). This document is intended for finding bugs,
-and documenting bugfixes.
+This document presents a brief overview of LilyPond features. When the
+text correspond with the shown notation, we consider LilyPond Officially
+BugFree (tm). This document is intended for finding bugs, and
+documenting bugfixes.
@section Notes and rests
@section Grace notes
+Grace note do weird things with timing. Fragile.
+
+
@lilypondfile[printfilename]{grace.ly}
+@lilypondfile[printfilename]{grace-bar-line.ly}
+
+@lilypondfile[printfilename]{grace-nest2.ly}
+
+@lilypondfile[printfilename]{grace-nest3.ly}
+
+@lilypondfile[printfilename]{grace-nest4.ly}
+
+@lilypondfile[printfilename]{grace-nest.ly}
+
+@lilypondfile[printfilename]{grace-start.ly}
+
+@lilypondfile[printfilename]{grace-sync.ly}
@section Beams
@lilypondfile[printfilename]{rest-collision.ly}
@lilypondfile[printfilename]{collisions.ly}
+
@lilypondfile[printfilename]{collision-dots.ly}
@lilypondfile[printfilename]{number-staff-lines.ly}
@lilypondfile[printfilename]{spacing-loose.ly}
+@lilypondfile[printfilename]{spacing-accidentals.ly}
+
+@lilypondfile[printfilename]{spacing-accidentals-staff.ly}
+
+@lilypondfile[printfilename]{spacing-accidentals.ly}
+
+@lilypondfile[printfilename]{spacing-accidentals-staff.ly}
+
@lilypondfile[printfilename]{lyrics-bar.ly}
@lilypondfile[printfilename]{non-empty-text.ly}
\header {
-
-texidoc = "Bar line should come before the grace note.";
+texidoc = "Bar line should come before the grace note."
}
\score {\notes \relative c' \context Staff {
- f1 \ngrace { [a'16 f] } g1 }
+ f1 \grace { [a'16 f] } g1 }
\paper { linewidth = -1. }
}
--- /dev/null
+\header {
+texidoc = "grace code should not be confused by nested sequential musics, containing grace notes; practically speaking, this means that the end-bar and measure bar coincide in this example."
+
+}
+\score{
+\notes
+
+{ c''2 { \grace b'16 c''2 } \bar "|." }
+ \paper {
+}
+ }
+
}
\score { \notes \context Voice {
- { \grace b'4 c''2 }
- \grace b'4 c''2 \bar "|."
+ { \grace b'8 c''2 }
+ \grace b'16 c''4 c''4 \bar "|."
}}
--- /dev/null
+\header {
+texidoc = "Another combination of grace note nesting."
+}
+
+\score { \notes \context Voice {
+
+ <
+ { \grace g32 f4 }
+ >
+ \grace c16 c2. \bar "|."
+}
+}
+
+
--- /dev/null
+
+\score
+{ \notes {
+ s2 <f4>
+ \grace g e4
+}
+}
\score {\notes < \context Staff { c2
\grace c8
- c2 c4 }
+ c4 c4 }
\context Staff = SB { c2 \clef bass
\grace { [dis8 ( d8] }
- ) c2 c4 }
- \context Staff = SC { c2 c2 c4 }
+ ) c4 c4 }
+ \context Staff = SC { c2 c4 c4 \bar "|." }
>
\paper { linewidth = -1. }
}
\version "1.3.146"
\header{
-
texidoc=" The number of stafflines of a staff can be set. Ledger
lines both on note heads and rests are adjusted. Barlines also are
adjusted. "
-
}
\score {
{
count_i_ = 0;
stem_l_arr_p_ = 0;
- shortest_mom_ = Moment (1, 8);
+ shortest_mom_ = Moment (Rational (1, 8));
finished_beam_p_ = 0;
finished_grouping_p_ = 0;
grouping_p_ = 0;
delete grouping_p_;
grouping_p_ = 0;
- shortest_mom_ = Moment (1, 8);
+ shortest_mom_ = Moment (Rational (1, 8));
}
void
grouping_p_ = 0;
}
- shortest_mom_ = Moment (1, 8);
+ shortest_mom_ = Moment (Rational (1, 8));
}
void
Chord_tremolo_iterator::construct_children ()
{
Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l ());
- factor_ = Moment (1, rep->repeat_count ());
+ factor_ = Moment (Rational(1, rep->repeat_count ()));
child_iter_p_ = get_iterator_p (rep->body ());
}
Duration::str () const
{
String s = to_str (durlog_i_) + to_str ('.', dots_i_);
- if (factor_ != Moment (1,1))
+ if (factor_ != Moment (Rational (1,1)))
{
s += "*" + factor_.str ();
}
if (iter-> ok ())
prev_mom_ = now_mom_ = iter->pending_moment ();
-
bool first = true;
while (iter->ok () || moments_left_i ())
{
smobify_self ();
+ /*
+ TODO:
+
+ destill this into a function, so we can re-init the immutable
+ properties with a new BASICPROPS value after creation. Convenient
+ eg. when using \override with StaffSymbol. */
+
char const*onames[] = {"X-offset-callbacks", "Y-offset-callbacks"};
char const*enames[] = {"X-extent-callback", "Y-extent-callback"};
- for (int a = X_AXIS; a <= Y_AXIS; a++){
- SCM l = get_grob_property (onames[a]);
-
- if (scm_ilength (l) >=0)
- {
- dim_cache_[a].offset_callbacks_ = l;
- dim_cache_[a].offsets_left_ = scm_ilength (l);
- }
- else
- {
- programming_error ("[XY]-offset-callbacks must be a list");
- }
-
- SCM cb = get_grob_property (enames[a]);
-
- /*
- Should change default to be empty?
- */
- if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb))
- cb = molecule_extent_proc;
+ for (int a = X_AXIS; a <= Y_AXIS; a++)
+ {
+ SCM l = get_grob_property (onames[a]);
+
+ if (scm_ilength (l) >=0)
+ {
+ dim_cache_[a].offset_callbacks_ = l;
+ dim_cache_[a].offsets_left_ = scm_ilength (l);
+ }
+ else
+ {
+ programming_error ("[XY]-offset-callbacks must be a list");
+ }
+
+ SCM cb = get_grob_property (enames[a]);
+
+ /*
+ Should change default to be empty?
+ */
+ if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb))
+ cb = molecule_extent_proc;
- dim_cache_[a].dimension_ = cb;
- }
+ dim_cache_[a].dimension_ = cb;
+ }
SCM meta = get_grob_property ("meta");
SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
public:
Moment ();
Moment (int m);
- Moment (int m, int n);
+ Moment (Rational, Rational);
Moment (Rational m);
Moment operator - () const;
by initting here_mom_ with Music::start_music (); no fixups are needed.
*/
-struct Grace_skip
+struct Grace_fixup
{
Moment start_;
- Rational length_;
+ Moment length_;
Rational grace_start_;
- Grace_skip *next_;
+ Grace_fixup *next_;
};
/** Sequential_music iteration: walk each element in turn, and
class Sequential_music_iterator : public Music_iterator
{
public:
- Grace_skip * grace_skips_;
+ Grace_fixup * grace_fixups_;
VIRTUAL_COPY_CONS (Music_iterator);
static SCM constructor_cxx_function;
Midi_def::Midi_def ()
{
// ugh
- set_tempo (Moment (1, 4), 60);
+ set_tempo (Moment (Rational (1, 4)), 60);
}
int
{
Moment m = audio_l_->length_mom_;
#if 0
- if (m < Moment (1, 1000))
+ //junkme?
+ if (m < Moment (Rational (1, 1000)))
{
warning (_ ("silly duration"));
m = 1;
Midi_walker::~Midi_walker ()
{
// ugh
- do_stop_notes (last_mom_ + Moment (10, 1));
+ do_stop_notes (last_mom_ + Moment (Rational (10, 1)));
}
/**
SCM
make_rational (SCM n, SCM d)
{
- Moment m (1,1);
+ Moment m (Rational (1,1));
if (SCM_INUMP (n) && SCM_INUMP (d))
{
- m = Moment (gh_scm2int (n), gh_scm2int (d));
+ m = Moment (Rational (gh_scm2int (n), gh_scm2int (d)));
}
else
{
grace_part_ = Rational( 0);
}
-Moment::Moment (int m, int n)
+Moment::Moment (Rational m, Rational g)
{
- main_part_ = Rational (m,n);
- grace_part_ = Rational (0);
+ main_part_ = m;
+ grace_part_ = g;
}
Moment::Moment (Rational m)
last_len.grace_part_ = Rational (0);
cumulative += last_len;
+
+ cumulative += - first_start ();
return cumulative;
}
{
Moment dur = 0;
for (SCM s = music_list (); gh_pair_p (s); s = gh_cdr (s))
- dur = dur >? unsmob_music (gh_car (s))->length_mom ();
+ {
+ Music * m = unsmob_music (gh_car (s));
+ Moment l = m->length_mom () + m->start_mom ();
+ dur = dur >? l;
+ }
+ dur -= minimum_start ();
+
return dur;
}
int
UGH: KLUDGE!
*/
- // if (delta_t > Moment (1,32))
+ // if (delta_t > Moment (Rational (1,32)))
hinterfleisch += stem_dir_correction (me, l, r);
}
scm_gc_unprotect_object (mp->self_scm ());
$$->set_mus_property ("numerator", gh_int2scm (n));
$$->set_mus_property ("denominator", gh_int2scm (d));
- $$->compress (Moment (n,d));
+ $$->compress (Moment (Rational (n,d)));
}
| Repeated_music { $$ = $1; }
meas_len = *unsmob_moment (m);
if (body_length_ < meas_len &&
- meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (0,0))
+ meas_len.main_part_.mod_rat (body_length_.main_part_) == Moment (Rational (0,0)))
repeat_sign_type_ = BEAT;
else if (meas_len == body_length_)
repeat_sign_type_ = MEASURE;
midi_track.add (Moment (0), &track_name);
// Some sequencers read track 0 last.
- // Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (1, 4)));
+ // Audio_tempo tempo_a (midi_l_->get_tempo_i (Moment (Rational (1, 4))));
// Midi_tempo tempo (&tempo_a);
// midi_track.add (Moment (0), &tempo);
int
Score_performer::get_tempo_i () const
{
- return performance_p_->midi_l_->get_tempo_i (Moment (1, 4));
+ return performance_p_->midi_l_->get_tempo_i (Moment (Rational (1, 4)));
}
void
UGH: KLUDGE!
*/
- if (delta_t > Moment (1,32))
+ if (delta_t > Moment (Rational (1,32)))
dist += stem_dir_correction (me, lc,rc);
SCM met = tempo_req_l_->get_mus_property ("metronome-count");
Duration *d = unsmob_duration (tempo_req_l_->get_mus_property ("duration"));
- Rational r = (d->length_mom () / Moment (1, 4) * Moment (gh_scm2int (met))).main_part_;
+ Rational r = (d->length_mom () / Moment (Rational (1, 4)) * Moment (gh_scm2int (met))).main_part_;
audio_p_ = new Audio_tempo (int (r));
daddy_trans_l_->set_property ("timeSignatureFraction",
gh_cons (gh_int2scm (4), gh_int2scm (4)));
- daddy_trans_l_->set_property ("measurePosition", Moment (0).smobbed_copy ());
- daddy_trans_l_->set_property ("measureLength", Moment (1).smobbed_copy ());
- daddy_trans_l_->set_property ("beatLength", Moment (1,4).smobbed_copy ());
+ daddy_trans_l_->set_property ("measurePosition", Moment (Rational (0)).smobbed_copy ());
+ daddy_trans_l_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
+ daddy_trans_l_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
}
Rational
\property Voice.Stem \override #'lengths =
#(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))
\property Voice.Stem \override #'beamed-lengths =
- #(map (lambda (x) (* 1.25 x)) '(0.0 2.5 2.0 1.5))
+ #(map (lambda (x) (* 0.8 x)) '(0.0 2.5 2.0 1.5))
\property Voice.Stem \override #'beamed-minimum-lengths =
- #(map (lambda (x) (* 1.25 x)) '(0.0 1.5 1.25 1.0))
+ #(map (lambda (x) (* 0.8 x)) '(0.0 1.5 1.25 1.0))
\property Voice.Stem \override #'no-stem-extend = ##t
\property Voice.Stem \override #'flag-style = #"grace"
\property Voice.Beam \override #'space-function = #grace-beam-space-function
- \property Voice.Beam \override #'thickness = #0.3
+ \property Voice.Beam \override #'thickness = #0.384
% Can't use Staff.fontSize, since time sigs, keys sigs, etc. will
% be smaller as well.
\property Voice.fontSize = #-2
- \property Staff.LocalKeyItem \override #'font-relative-size = #-2
+ \property Staff.Accidentals \override #'font-relative-size = #-2
}
stopGraceMusic = {
(grob-property-description 'left-padding number? "space left of accs.")
(grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.")
(grob-property-description 'lengths list? "Stem length given multiplicity of flag.")
-(grob-property-description 'line-count integer? "Number of staff lines.")
+(grob-property-description 'line-count integer? "Number of staff
+lines. If you want to override this for staffs individually, you must
+use @code{\outputproperty}. @code{\property .. \override} will not
+work: @code{\override} is processed after the StaffSymbol is created,
+and will have no effect.
+")
(grob-property-description 'line-thickness number? "the thickness[stafflinethickness] of the line.")
(grob-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name.")
(grob-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts.")