bar line@barre (de mesure)@Taktstrich@@maatstreep@stanghetta@
bar; measure@mesure@Takt@@maat, maatstreep@@
baritone@bariton@Bariton@@bariton@@
-bass clef@clé de fa@Bass-Schlüssel, F-Schlüssel@@F sleutel, bas sleutel@chiave di basso@
+@@F-Schlüssel@@F sleutel@@A clef shaped as a curl with two dots. The position between the dots is the\rline of the F below central C.
+bass clef@clé de fa@Bass-Schlüssel@@bas sleutel@chiave di basso@A clef setting with central C on the first top ledger line.
bass@basse@Bass@@bas@@
beam@barre@Balken@@waardestreep/balk@barra@
beat@temps@Takt(-schlag)@@tel@@
brace@accolade@Klammer@@accolade, haak@accolada@Symbol at the start of a system that connects staffs.
brass@@Blechbläser@@koper (blazers)@@
-C clef@clé d'ut@Altschlüssel, C-Schlüssel@@C sleutel, alt sleutel@chiave di tenore@
+alto clef@clé d'ut@Altschlüssel@@alt sleutel@chiave di tenore@Clef setting that has central C on the middle staff line.
+C clef@@@@C sleutel. @@A clef symbol that looks like a horizontally mirrored 3. It\rindicates the position of the central C. Used in different\rpositions.
C@do@c@@C@@
C@ut@c@@@@
cadence@cadence@Kadenz@@cadens@@
tone@ton@Ton@@toon@@
tonic@tonique@Tonika@@tonica@@
transposition@transposition@Transposition@@transpositie@@Shifting a melody up or down in pitch, while keeping the same relative pitches.
-treble clef@clé de sol@Violinschlüssel, G-Schlüssel@@G sleutel, viool sleutel@chiave di violino@
+G clef@@@@G sleutel@@A clef symbol with a loop at the top and a spiral in the center. The center of the spiral indicates the G above central C.
+treble clef@clé de sol@Violinschlüssel@@viool sleutel@chiave di violino@Clef setting where the second lowest line is the G above central C.
tremolo@trèmolo@Tremolo@@tremolo@tremolo@
trill; shake@trille, tremblement, battement (cadence)@Triller@@triller@trillo@
triple meter@temps ternaire@@@driedelige maatsoort@@
\mudelafile{stem-tremolo.ly}
+Beams, stems and noteheads often have communication troubles, since
+the two systems for y dimensions (1 unit = staffspace, 1 unit = 1
+point) are mixed.
+
\section{Beams, slurs and other spanners}
\mudelafile{tup.ly}
+\section{Repeats}
+
+LilyPond has three modes for repeats: folded, unfolded and
+semi-unfolded. Unfolded repeats are fully written out. Semi unfolded
+repeats have the body written and all alternatives sequentially.
+Folded repeats have the body written and all alternatives
+simultaneously. If the number of alternatives is larger than the
+repeat count, the excess alternatives are ignored. If the number of
+alternatives is smaller, the first alternative is multiplied to get to
+the number of repeats.
+
+Unfolded behavior:
+
+\mudelafile{repeat-unfold.ly}
+
+Semi (un)0folded behavior:
+
+\mudelafile{repeat-semifold.ly}
+
\section{Multiple notes}
Rests should not collide with beams, stems and noteheads. Rests may
\mudelafile{staff-margin.ly}
+Breathing signs, also used for phrasing, do normally not influence
+global spacing -- only if space gets tight, notes are shifted to make
+room for the breathing sign. Breathing signs break beams running
+through their voice. In the following example, the notes in the first
+two bars all have the same distance from each other:
+
+\mudelafile{breathing-sign.ly}
+
\section{Clefs and Time Signatures}
Grep for TODO and ugh/ugr/urg.
.* BUGS
-. * junk separate mudela versioning.
. * indent = 0.0 with linewidth=-1.0
. * PostScript
. * header for PS enteredby = "bla <bla@bar.com>"
. * ps/lily.ps see comments.
-. * By the way, I'm not sure the translation of 'C, G, and F clef'
-> should include Alto, Violin, Bass <clef translated>.
-[..]
-
-I understand your point. It should be changed.
-
-
->
-> The terms C-clef, G-clef, F-clef stand for the signs, being
-> mutated forms of a C, a G and an F.
->
-> The terms Violin Clef etc. stand for the signs being used in
-> special positions on the staff.
->
-> The G-clef-sign indicates g' on the line around which the
-> snake centers. It is a Violin Clef if it is centered around the
-> second line (from below), and a French Violin Clef if it is
-> centered around the lowest.
->
-> The C-clef indicates c' on the line that gets
-> 'pinched' by it. It is a Soprano, Mezzosoprano (English?), Alto, Tenor
-> and (don't remember exactly, maybe Baritone) Clef, depending on
-> the line (from highest to lowest).
->
-> The F-clef-sign indicates f on the line between
-> the two dots. If it's on the second line from above, it is called
-> Bass Clef. If it's on the middle line, it is called (maybe
-> Baritone) Clef too, because it indicates the same pitches as the
-> C-Clef on the highest line. So, you could write an Alto Clef by
-> putting the F-clef sign on the lowest line (but that's _very_
-> uncommon).
->
-> Sorry, this is written very messy because I'm in a hurry,
-> but I hope you understand what I want to say.
->
. * didot / big point.
. * midi key.
. * Repeats
. * kind of 'initial property' iso fold/volta(semi)/unfold strings
. * fix singleStaffBracket
. * declare performers in \midi
+. * input/test/stem-spacing.ly: 12/4 touches first note
+4 too high?
. * fix MIDI
. * \shape 1st dim skipped?
. * turn slope-damping on/off
. * We need feta-din*.mf files for more sizes than 10.
. * fix dynamics decently, ie. use kerning & ligatures.
+. *
+BUGS:
+> +
+> + Causes segfault:
+> +
+> + \score{
+> + \notes{ \context Voice {
+> + \repeat fold 2 { a b c d } {}
+> + }
+> + }
+> + }
+> +
. * dots & rest collisions?
. * mudela-book.py
. * fix \mudelafile{} to have decent functionality
preMudelaExample[eps]{}, and change it in document body sometimes.
. * use less RE's
. * slurs colllide with lyrics.
-. * Is there any reasonable way to do this: I would like to have one file
-that can generate the same tune in two different modes without having
-to go through and rewrite all the music in the other mode.
-
-Lyrics and scripts collide.
-. * Phrasing: Indicating the textual underlay of a piece, or
-otherwise dividing a piece into phrases.
-
-There are distinct ways of specifying the first two (although at
-present, they're not properly distinguished) but no distinct way to
-specify the third. Should there be?
-. * rest collision minimum dist.
+. * junk _ in lyric mode for " "
+. * Lyrics and scripts collide.
. * a note with a circle after it, meaning:
note + circle = note + 1/4 of its length
possible with lily?
. * tuplets that are written as "number : note", for example
"3 : [image of a half note here]". possible?
-. * repeat engraver, gallina.ly
. * Matanya's tips:
+. * don't shorten stems/staffs closer to each other.
. * accidentals closer to note head
. * to space the staffs/staffgroups contained in the score.
. * heavier beams?
.* Cleanups needed
+. * \$ and $ identifier syntax.
+. * Y dimension units: staffspace vs. Point
. * Beam
. * Stem
. * Slur
. * Abstraction for engravers:
. * make "in-between" engraver (Tie, Extender)
. * make wide_spanner_engraver (line_group_spanner, staff_symbol)
-. * remove Interval dim_ from Dimension_cache and rename the struct.
. * do scaled fonts generally
. * The Lilypond accidental symbols are available through the TeX macros,
\textflat, \textsharp and \textnatural defined in the init file
are installed but they are generated in the mf/out/ directory during the
compilation.
. * make dependencies () a virtual function.
-. * one big ly2dvi input that includes *all* tests.
. * store req -> element, element -> element causes for warnings
. * include examples in RPM.
. * fix partial measures in meaningful way.
-. * add scripts to bars eg. |^"bla"
. * relative mode for mi2mu
. * uniformise recent feta contributions.
-. * use SCM and Molecules for {accordeon stuff, }
. * bigger and fatter 4/4 C
. * sort out directory stuff.
. * --prefix option?
. * do --safe for PS output?
. * convert-mudela --output
. * Staff_margin (with a partial measure.)
-. * fix pletvisibility properties:
-. * bracket on/off/no-bracket-when-beam
-. * num on/off/no-num-when-beam
-. * fix: standchen.
-. * junk text{sharp,flat,etc}
. * fix convert-mudela manpage
. * decimal point in \paper {}
. * { \voiceone <a'4.*2/3 d''4.*2/3 fis''4.*2/3> [g''8 fis'' e''] d''4 |}
. * scm-ify \property values.
. * move class Lookup {} into scm
. * msgfmt -o check?
-. * \breathmark TeX macro
. * add new glyphs to font.ly
. * formatting of input stuff.
. * \notes{ a \< b \cr } vs \notes{ a \< b \! }
.* STUFF
. * compulsory hshift
+. *
+My wish list for lyrics. I dream of a time when I will have enough time to
+become familiar enough with the source code to be able to implement some of
+these myself, but I don't know when that will be, so I thought I'd "publish"
+my suggestions in case someone else is in a position to give them some
+priority. Otherwise, perhaps they could go on the todo list?
+
+If any of these are already implemented, please let me what the syntax is to
+use them!
+
+1. Stanza numbering. Numbering at the beginning of a song with the number
+set to the left of the first note. It would also be nice (but not as
+important) to be able to have some form of automatic numbering at the
+beginning of each new line. This would make it easier to follow songs with a
+large number of stanzas.
+
+2. Hyphens between syllables. At the moment there appears to be no easy way
+to position a hyphen mid-way between the syllables it breaks.
+
+3. Notes centred above/below lyrics rather than left-aligned.
+
+4. It would be very nice to be able to build some kind of phrasing into the
+lyrics of hymns, etc, so that the first words of a phrase are left aligned
+with each other, the last words are right aligned, and the words in between
+are centred.
+
+5. In a song, with (say) four stanzas and a chorus, it would be nice to be
+able to vertically align the chorus midway between the staves.
+
+6. It would be nice to be able to put vertical brackets either side of a
+repeated section with different words for each repeat.
+
. * Give # lines in linebreaking.
. * arrows on slurs.
. * rewrite context defs using Scheme
. * add mudela-book-doc source to webstie.
. * Rethink Time_description
\cadenza , \meter, \grouping should all be \properties
+. * fix singleStaffBracket
. * rename
. * measure -> bar
-. * abbrev -> tremolo
. * abbreviation-beam -> (measured/unmeasured) tremolo
. * partial -> anacrouse
. * robustify Beam (in case of no stems, 32nd notes)
small sizes.
.* 3RD PARTY BUGS
+. * UMR: Uninitialized memory read
+ This is occurring while in:
+ qst [qsort.c]
+ qsort [libc.so.1]
+ Keyword_table::Keyword_table(Keyword_ent*) [keyword.cc:28]
+ My_lily_lexer::My_lily_lexer() [my-lily-lexer.cc:78]
+ My_lily_parser::parse_file(String,String) [my-lily-parser.cc:54]
+ do_one_file(String,String) [scores.cc:124]
+ Reading 4 bytes from 0xefffeca8 on the stack.
+ Address 0xefffeca8 is 728 bytes below frame pointer in function
. * GNU diff 2.7: diff -rN does not see a new directory with empty file
. * mf-to-table -> add space before ; in AFM output. (-> check AFM
spec. Is this a bug in afm2tfm?)
. * specify number of lines
.* INPUTLANGUAGE
-. * \rhythms 4 16 16 16 16; c c c c c -> c4 c16 etc.
+. * \rhythms 4 16 16 16 16; c c c c c -> c4 c16 etc.
+. * convention for slurs vs. phrasing marks.
. * Language:
. * \translator -> ?
. * fix \partial
. * \bla {} vs \bla ;
. * mix engraver hacking with music ?
. * \once\property KEY = VAL
-. * \addtranslator, \removetranslator
-. * junk ^ and _ for scripts
-. * junk _ for lyrics.
+. * input property
. * abstract grammar.
. * Figure out semicolons.
. * c4 4 4 4 for c4 c4 c4 c4?
. * lyric in staff (sharpsharp in staff, text below)
-. * half sharps/flats
-
. * write Dynamic_line (to group dynamics horizontally)
. * use Real for all y positions.
. * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
-. * stafftypes: voice names/ instrument names.
-
. * lily \tempo
. * % toe to bheel four to five
(where "to" is a tiny bow)
. * auxilliary file for caching info.
-
. * Text_crescendo
-. * revise calcideal
-
.* IDEAS
. * Output data structures of Mudela in XML/SGML.
. * create libmudela, or liblily_frontend
. * Spacing_request for manually adjusting spacing
. * caching breakpoints
. * used fixedpoint arithmetic for min. energy.
-. * move towards incremental algorithms.
-. * versioning stuff (cvt mudela, mudela, etc.)
-. * dynamic loading of engravers?
-.* SMOBS
-Han-Wen Nienhuys <hanwen@cs.uu.nl> writes:
-
-> class Foo_class {
-> Foo_smob *smob_ptr_;
-> }
->
-> struct Foo_smob {
-> Foo_class *class_ptr_
-> }
-
-Usually you can get away without having this interlinked structure.
-One piece of information you need when exporting objects to scheme is
-the smob tag for your class. You might store this value (a long) into
-a class static variable, or a file static variable. I'll use a class
-static variable in this example.
-
-I typically use code that works like this (untested code ahead):
-
-class Foo_class {
- static long *Foo_smob_tag;
- SCM obj; // representation as a scheme object, description comes later
-}
-
-// call this once on startup
-void init_Foo_class {
- static scm_smobfuns type_rec;
-
- type_rec.mark = foo_mark;
- type_rec.free = foo_free;
- type_rec.print = foo_display;
- type_rec.equalp = 0;
- Foo_class::Foo_smob_tag = new int(scm_new_smob(type_rec));
-}
-
-When you want to export an object to scheme, you put a pointer to the
-object itself in the cdr of the cell, and the tag in the car of the
-cell. The code looks like this:
-
-// Is this a Foo?
-static int
-foo_p(SCM obj)
-{
- return(SCM_NIMP(obj) && SCM_CAR(obj) == Foo_class::Foo_smob_tag);
-}
-
-// given a Scheme representation, return, a C++ representation
-static Foo_class *
-foo_unbox(SCM obj)
-{
- return((Foo_class*)SCM_CDR(obj));
-}
-
-// the SCM representation of the object is stored inside itself
-// this will become useful when destructor gets called
-static SCM
-foo_box(Foo_class *foo)
-{
- SCM_DEFER_INTS;
- SCM_NEWCELL(foo->obj);
- SCM_SETCAR(foo->obj, Foo_class::Foo_smob_tag);
- SCM_SETCDR(foo->obj, (SCM)foo);
- SCM_ALLOW_INTS;
- return foo->obj;
-}
-
-> C++ determines life time, so what is the strategy?
-
-What happens now when the destructor gets called? Lets set the cdr to
-NULL, and then check for that in all of the primitive functions that
-use your smob. We'll call this notion 'live'; a scheme object is
-'live' if the C++ representation still exists, it's dead if the C++
-object is gone. You can still have references to dead objects in
-scheme code; it's just an error to use them. This idea is stolen from
-Emacs's handling of buffers ('buffer-live-p' and friends).
-
-Add another function, foo_live_p:
-
-static int
-foo_live_p(SCM obj)
-{
- return(foo_p(obj) && SCM_CDR(obj) != NULL);
-}
-
-In you destructor, you need to do:
-
-~Foo_class()
-{
- SCM_CDR(this->obj, NULL);
-}
-
-When writing new primitives, now just check foo_live_p().
-
-I hope the above helps,
-
* OUTLINE SETUP
.* .EMACS
c4 d e f
\repeat semi 3 { g a b c }
\alternative { { c b a g } { f e d c } } c c c c
- \alternative { { c b a g } { f e d c } { c d e f } }
+% \alternative { { c b a g } { f e d c } { c d e f } }
g g g g
\repeat semi 2 { c c c c }
\repeat semi 2 { c c c c }
\score{
\context Staff \notes\relative c'{
- \repeat unfold 4 { g a b c }
+ \repeat unfold 4 { g a b c }%\alternative {c1 d e f}
}
}
--- /dev/null
+
+% no alts.
+\score { \notes\context Staff\relative c'' {
+\repeat semi 3 { c^"3$\\times$ 0alt" d }
+% less alts than body
+\repeat semi 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
+% more alts than body
+\repeat semi 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
+}}
+
--- /dev/null
+
+\score { \notes\context Staff\relative c'' {
+\repeat unfold 3 { c^"3$\\times$ 0alt" d }
+% less alts than body
+\repeat unfold 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
+% more alts than body
+\repeat unfold 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
+}}
+
--- /dev/null
+
+% no alts.
+\score { \notes\context Staff\relative c'' {
+\repeat semi 3 { c^"3$\\times$ 0alt" d }
+% less alts than body
+\repeat semi 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
+% more alts than body
+\repeat semi 2 { c^"2$\\times$ 3alt" d } \alternative { e f g }
+}}
+
\stemup
\transpose c'' { [c''8 r8 c''8 c''8]
[c8 r8 c8 c8]
+ [c8 r8 r8 c'''8]
\stemdown
[c8 r8 c8 c8]
- [c''8 r8 c''8 c''8] }
+ [c''8 r8 c''8 c''8]
+ [c'8 r8 r8 c'''8]
+
+ }
}
\score{
return text_str_.length_i() ? new Midi_text(this) : 0;
}
-
-
-
void
Audio_item::do_print () const
{
}
a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
- Molecule* mol_p = new Molecule;
- mol_p->add_molecule (a);
-
- return mol_p;
+ return new Molecule (a);
}
Offset
Bow::center () const
{
Real dy = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
-
Real dx = extent(X_AXIS).length ();
return Offset (dx / 2, dy);
Array<Offset> c (get_controls());
for (int i=0; i < c.size (); i++)
{
- Real y = c[i][Y_AXIS];
+ Real y = c[i][Y_AXIS] + dy_f_drul_[LEFT];
iv.unite (Interval (y,y));
}
return iv;
enum Dir_algorithm { /* DOWN=-1, UP=1, */ MAJORITY=2, MEAN, MEDIAN };
Link_array<Stem> stems_;
- /// the slope of the beam in posns / point (dimension)
+ /**
+ the slope of the beam in (staffpositions) per (X-dimension, in PT).
+ UGH. standardise this for once and for all.
+ */
Real slope_f_;
/// position of leftmost end of beam
virtual void transpose (Musical_pitch );
virtual void compress (Moment);
void add_music (Music *music_p);
-
+ int length_i () const;
Moment cumulative_length () const;
Moment maximum_length () const;
+ virtual ~Music_sequence ();
+
protected:
virtual Musical_pitch to_relative_octave (Musical_pitch);
virtual void do_print() const;
If the number of repeats is smaller than the number of alternatives, then
-
- FIXME
+ the excess alternatives are ignored for all timing purposes.
If the number of repeats is bigger than the number of alternatives, then
-
- FIXME
+ the first alternative is assumed to be repeated.
*/
class New_repeated_music : public Music
*/
int done_count_;
+
/// are we busy doing the body?
bool do_main_b_;
This excludes the elt currently being iterated.
*/
Moment done_mom_;
-
+ int alternative_count_i_;
Music_iterator * current_iter_p_;
+
+ /// pointer to the alternative that will be processed next.
Cons<Music> *alternative_cons_l_;
~Unfolded_repeat_iterator();
Unfolded_repeat_iterator ();
return dur;
}
+int
+Music_sequence::length_i () const
+{
+ return cons_list_size_i (music_p_list_p_->head_);
+}
#include "musical-request.hh"
#include "misc.hh"
#include "debug.hh"
-
#include "music-list.hh"
void
}
/**
- translate the rest symbols
+ translate the rest symbols vertically by amount DY_I.
*/
void
Note_column::translate_rests (int dy_i)
add_element (d);
}
- /*
- [TODO]
- handle rest under beam (do_post: beams are calculated now)
- what about combination of collisions and rest under beam.
+/*
+ [TODO]
+ handle rest under beam (do_post: beams are calculated now)
+ what about combination of collisions and rest under beam.
- Should lookup
+ Should lookup
- rest -> stem -> beam -> interpolate_y_position ()
+ rest -> stem -> beam -> interpolate_y_position ()
- */
+*/
void
Note_column::do_post_processing ()
return;
Beam * b = stem_l_->beam_l_;
- if (!b)
+ if (!b || !b->stems_.size ())
return;
-
- /* ugh. Should be done by beam. */
- Real x = stem_l_->hpos_f ();
+
+ /* ugh. Should be done by beam. */
Direction d = stem_l_->get_dir ();
- Real beamy = x * b->slope_f_ + b->left_y_;
- Interval restdim = extent (Y_AXIS);
+ Real beamy = (stem_l_->hpos_f () - b->stems_[0]->hpos_f ()) * b->slope_f_ + b->left_y_;
Real staff_space = rest_l_arr_[0]->staff_line_leading_f ();
- Real internote_f = staff_space/2;
+ Real rest_dim = extent (Y_AXIS)[d]*2.0 /staff_space ;
+
Real minimum_dist
- = paper_l ()->get_var ("restcollision_minimum_beamdist") * internote_f;
+ = paper_l ()->get_var ("restcollision_minimum_beamdist") ;
Real dist =
- minimum_dist + -d * (beamy - restdim[d]) >? 0;
+ minimum_dist + -d * (beamy - rest_dim) >? 0;
int stafflines = rest_l_arr_[0]->lines_i ();
-
+
// move discretely by half spaces.
- int discrete_dist = int (ceil (dist / (0.5 *staff_space)));
+ int discrete_dist = int (ceil (dist ));
// move by whole spaces inside the staff.
if (discrete_dist < stafflines+1)
#include "transposed-music.hh"
#include "time-scaled-music.hh"
#include "new-repeated-music.hh"
+#include "version.hh"
+
// mmm
Mudela_version oldest_version ("1.0.20");
-Mudela_version version ("1.0.21");
+Mudela_version version ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
+
void
print_mudela_versions (ostream &os)
// needed for bison.simple's malloc() and free()
#include <malloc.h>
-struct Assignment {
- String *name_p_;
- Identifier *id_p_;
- ~Assignment () {
- delete name_p_;
- delete id_p_;
- }
- Assignment () {
- name_p_ = 0;
- id_p_ =0;
- }
- Assignment (Assignment const&s)
- {
- name_p_ = new String (*s.name_p_);
- id_p_ = s.id_p_->clone ();
- }
-};
-
-Paper_def* current_paper = 0;
-
#ifndef NDEBUG
#define YYDEBUG 1
#endif
%token ACCEPTS
%token ALTERNATIVE
%token BAR
+%token BREATHE
%token CADENZA
%token CHORDMODIFIERS
%token CHORDS
b->span_type_str_ = "beam";
$$ = b;
}
+ | BREATHE {
+ $$ = new Breathing_sign_req;
+ }
;
--- /dev/null
+/*
+ new-repeated-music-iterator.cc -- implement Folded_repeat_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "folded-repeat-iterator.hh"
+#include "new-repeated-music.hh"
+#include "music-list.hh"
+#include "simultaneous-music-iterator.hh"
+#include "translator-group.hh"
+
+Folded_repeat_iterator::Folded_repeat_iterator ()
+{
+ main_iter_p_ = 0;
+ alternative_iter_p_ = 0;
+}
+
+bool
+Folded_repeat_iterator::ok () const
+{
+ return main_iter_p_ || alternative_iter_p_;
+}
+
+Folded_repeat_iterator::~Folded_repeat_iterator ()
+{
+ delete main_iter_p_;
+ delete alternative_iter_p_;
+}
+
+Moment
+Folded_repeat_iterator::next_moment () const
+{
+ if (main_iter_p_)
+ {
+ return main_iter_p_->next_moment ();
+ }
+ else
+ return main_length_mom_ + alternative_iter_p_->next_moment ();
+}
+
+void
+Folded_repeat_iterator::construct_children ()
+{
+ New_repeated_music const * mus = dynamic_cast<New_repeated_music const*> (music_l_);
+ main_iter_p_ = get_iterator_p (mus->repeat_body_p_);
+ if (!main_iter_p_->ok())
+ {
+ leave_body ();
+ enter_alternative ();
+ }
+}
+
+void
+Folded_repeat_iterator::do_process_and_next (Moment m)
+{
+ if (!m)
+ {
+ bool success = report_to_l ()->try_music (music_l_);
+ if (!success)
+ music_l_->warning ( _("No one to print a volta bracket"));
+ }
+
+ New_repeated_music const * mus = dynamic_cast<New_repeated_music const*> (music_l_);
+
+ if (main_iter_p_)
+ {
+ main_iter_p_->process_and_next (m);
+ if (!main_iter_p_->ok ())
+ leave_body ();
+ }
+
+ if (!main_iter_p_ && !alternative_iter_p_)
+ {
+ enter_alternative ();
+ }
+
+ if (alternative_iter_p_)
+ {
+ alternative_iter_p_->process_and_next (m - main_length_mom_);
+ if (!alternative_iter_p_->ok ())
+ {
+ delete alternative_iter_p_;
+ alternative_iter_p_ =0;
+ }
+ }
+}
+
+void
+Folded_repeat_iterator::leave_body ()
+{
+ New_repeated_music const * mus = dynamic_cast<New_repeated_music const*> (music_l_);
+ delete main_iter_p_;
+ main_iter_p_ = 0;
+ main_length_mom_ += mus->repeat_body_p_->length_mom ();
+}
+
+void
+Folded_repeat_iterator::enter_alternative ()
+{
+ New_repeated_music const * mus = dynamic_cast<New_repeated_music const*> (music_l_);
+ Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
+ s->separate_contexts_b_ = true;
+ s->init_translator (mus->alternatives_p_, report_to_l ());
+
+ alternative_iter_p_ = s;
+ alternative_iter_p_->construct_children ();
+}
+
+void
+Folded_repeat_iterator::do_print () const
+{
+#ifndef NPRINT
+#endif
+}
--- /dev/null
+/*
+ new-repeated-music.cc -- implement New_repeated_music
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "new-repeated-music.hh"
+#include "music-list.hh"
+#include "musical-pitch.hh"
+#include "debug.hh"
+
+New_repeated_music::New_repeated_music(Music *beg, int times, Music_sequence * alts)
+{
+ repeat_body_p_ = beg;
+ fold_b_ = false;
+ repeats_i_ = times;
+ alternatives_p_ = alts;
+ semi_fold_b_ = true;
+}
+
+New_repeated_music::New_repeated_music (New_repeated_music const &s)
+ : Music (s)
+{
+ repeats_i_ = s.repeats_i_;
+ fold_b_ = s.fold_b_;
+ semi_fold_b_ = s.semi_fold_b_;
+
+ repeat_body_p_ = s.repeat_body_p_ ? s.repeat_body_p_->clone () : 0;
+ alternatives_p_ = s.alternatives_p_
+ ? dynamic_cast<Music_sequence*> (s.alternatives_p_->clone ()):0;
+}
+
+New_repeated_music::~New_repeated_music ()
+{
+ delete repeat_body_p_;
+ delete alternatives_p_;
+}
+
+void
+New_repeated_music::do_print () const
+{
+#ifndef NPRINT
+ DOUT << "Fold = " << fold_b_ << " reps: " << repeats_i_;
+
+ if (repeat_body_p_)
+ repeat_body_p_->print();
+
+ if (alternatives_p_)
+ alternatives_p_->print();
+#endif
+}
+
+Musical_pitch
+New_repeated_music::to_relative_octave (Musical_pitch p)
+{
+ if (repeat_body_p_)
+ p = repeat_body_p_->to_relative_octave (p);
+
+ if (alternatives_p_)
+ p = alternatives_p_->do_relative_octave (p, true);
+ return p;
+}
+
+
+void
+New_repeated_music::transpose (Musical_pitch p)
+{
+ if (repeat_body_p_)
+ repeat_body_p_->transpose (p);
+
+ if (alternatives_p_)
+ alternatives_p_->transpose (p);
+}
+
+void
+New_repeated_music::compress (Moment p)
+{
+ if (repeat_body_p_)
+ repeat_body_p_->compress (p);
+
+ if (alternatives_p_)
+ alternatives_p_->compress (p);
+}
+
+Moment
+New_repeated_music::alternatives_length_mom () const
+{
+ if (!alternatives_p_ )
+ return 0;
+
+ if (fold_b_)
+ alternatives_p_->maximum_length ();
+
+ Moment m =0;
+ int done =0;
+ Cons<Music> *p = alternatives_p_->music_p_list_p_->head_;
+ while (p && done < repeats_i_)
+ {
+ m = m + p->car_->length_mom ();
+ done ++;
+ if (repeats_i_ - done < alternatives_p_->length_i ())
+ p = p->next_;
+ }
+ return m;
+}
+
+Moment
+New_repeated_music::length_mom () const
+{
+ Moment m =0;
+ if (fold_b_)
+ {
+ if (repeat_body_p_)
+ m += repeat_body_p_->length_mom ();
+ }
+ else
+ {
+ Moment beg = (repeat_body_p_) ? repeat_body_p_->length_mom () : Rational(0);
+ if (!semi_fold_b_)
+ beg *= Rational (repeats_i_);
+ m += beg;
+ }
+
+ m += alternatives_length_mom ();
+ return m;
+}
+
--- /dev/null
+/*
+ specialty-engraver.cc -- implement Specialty_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+
+#include "engraver.hh"
+
+class Specialty_engraver : public Engraver
+{
+
+public:
+ VIRTUAL_COPY_CONS(Translator);
+protected:
+ void acknowledge_element (Score_element_info);
+};
+
+
+void
+Specialty_engraver::acknowledge_element (Score_element_info i)
+{
+ /*
+ We could do groovy stuff, by inserting our own custom (FUNC,FONT)
+ pairs (Atoms in fact) into acknowledged elements.
+
+ But not yet. This would be cleaner if we had SCM as properties.
+ */
+}
done_count_ =0;
current_iter_p_ =0;
do_main_b_ = false;
+ alternative_count_i_ =0;
}
/**
if (do_main_b_)
{
done_mom_ += mus->repeat_body_p_->length_mom ();
+
+ if (!mus->semi_fold_b_)
+ done_count_ ++;
+
if (alternative_cons_l_)
{
current_iter_p_ = get_iterator_p (alternative_cons_l_->car_);
do_main_b_ = false;
}
+ else if (done_count_ < mus->repeats_i_ && !mus->semi_fold_b_)
+ {
+ current_iter_p_ = get_iterator_p (mus->repeat_body_p_);
+ do_main_b_ = true;
+ }
}
else
{
+ /*
+ we're not in the main part. So we're either in an alternative, or
+ we just finished.
+ */
if (alternative_cons_l_)
{
done_mom_ += alternative_cons_l_->car_->length_mom ();
- alternative_cons_l_ = alternative_cons_l_->next_;
- done_count_ ++;
- }
+ if (mus->semi_fold_b_ ||
+ mus->repeats_i_ - done_count_ < alternative_count_i_)
+ alternative_cons_l_ = alternative_cons_l_->next_;
+
+ /*
+ we've done the main body as well, but didn't go over the other
+ increment. */
+ if (mus->semi_fold_b_)
+ done_count_ ++;
+ }
+
if (done_count_ < mus->repeats_i_ && alternative_cons_l_)
{
if (mus->semi_fold_b_)
}
}
+
bool
Unfolded_repeat_iterator::ok () const
{
? mus->alternatives_p_->music_p_list_p_->head_
: 0;
+ for (Cons<Music> *p = alternative_cons_l_; p; p = p->next_)
+ alternative_count_i_ ++;
+
if (mus->repeat_body_p_)
{
current_iter_p_ = get_iterator_p (mus->repeat_body_p_);
marcato = \script "marcato"
staccatissimo = \script "staccatissimo"
-% portato is indicated by slurred & dotted notes. Not really supported.
+% portato is indicated
+% either by
+% * slurred & dotted notes.
+%or by
+% * slur and dash notes.
+% Neither are really supported, but c4-.-- should work.
% portato = \script "portato"
fermata = \script "fermata"
\version "1.0.21";
-$vocal_verse1 = \notes\relative c''{
- % ugh: treble/bass
- % ?
- \clef treble;
+vocalVerse = \notes\relative c''{
\property Voice.dynamicdir=1
\times 2/3 { [ g8( )as] g } c4. g8 |
\times 2/3 { [ f8( )g] f } c'4 f,8 r |
g4.-> f8 \times 2/3 { [ f( )es] d } |
es2 r4 |
- % ugh: a whole should be a measure
- %r1 |
R2. |
R2. |
\times 2/3 { [ g8( )as] g } es'4. g,8 |
c!2. |
}
-$vocal_through = \notes\relative c{
+vocalThrough = \notes\relative c{
\property Voice.dynamicdir=1
g''8. g16 b8. b16 d8. d16 |
c4 b r |
e2 r4 |
}
-$lyric_verse1 = \lyrics{
+lyricVerse1 = \lyrics{
% 5
\times 2/3 { Lei-4 se8 } fleh-4. en8 |
- \times 2/3 { mei-4 ne8 } Lie-4 der8 _8 |
+ \times 2/3 { mei-4 ne8 } Lie-4 der8 " "8 |
Durch4. die8 \times 2/3 { Nacht4 zu8 } |
- dir;2 _4 |
- _4 _ _ |
- _ _ _ |
+ dir;2 " "4 |
+ " "4 " " " " |
+ " " " " " " |
% 11
\times 2/3 { In4 den8 } stil-4. len8 |
\times 2/3 { Hain4 her-8 } nie-4. der8 |
Lieb-4. chen,8 \times 2/3 { komm4 zu8 } |
- mir!2 _4 |
- _4 _ _ |
- _ _ _ |
+ mir!2 " "4 |
+ " "4 " " " " |
+ " " " " " " |
% 17
Fl\"us-8. ternd16 schlan-4. ke8 |
Wip-8. fel16 rau-4. schen8 |
nicht.2. |
}
-$lyric_verse2 = \lyrics{
+lyricVerse2 = \lyrics{
% 5
\times 2/3 { H\"orst4 die8 } Nach-4. ti-8
- \times 2/3 { gal-4 len8 } schla-4 gen?8 _8
+ \times 2/3 { gal-4 len8 } schla-4 gen?8 " "8
ach!4. sie8 \times 2/3 { fleh-4 en8 }
- dich,2 _4
- _4 _ _
- _4_ _
+ dich,2 " "4
+ " "4 " " " "
+ " "4" " " "
% 11
\times 2/3 { Mit4 der8 } T\"o-4. ne8
- \times 2/3 { s\"u-4 "\ss{}en"8 } Kla-4. gen8
+ \times 2/3 { s\"u-4 "\ss en"8 } Kla-4. gen8
Fleh-4. en8 \times 2/3 { sie4 f\"ur8 }
- mich2 _4
- _4_ _
- _4_ _
+ mich2 " "4
+ " "4" " " "
+ " "4" " " "
% 17
Sie-8. ver-16 stehn4. des8
Herz.2.
}
-$lyric_through = \lyrics{
+lyricThrough = \lyrics{
% 37
La\ss8. auch16 dir8. die16 Brust8. be-16 |
- we-4 gen _ |
+ we-4 gen " " |
Lieb-4. chen,8 h\"o-8. re16 |
- mich!2 _4 |
+ mich!2 " "4 |
Be-4. bend8 \times 2/3 { harr'4 ich8} |
- dir8. ent-16 ge-4 gen!8 _8 |
- _2. |
- _2. |
+ dir8. ent-16 ge-4 gen!8 " "8 |
+ " "2. |
+ " "2. |
\times 2/3 { Komm4 be-8 } gl\"u4. cke8 |
mich!2. |
\times 2/3 { Komm4 be-8 } gl\"u4. cke8 |
mich,2. __ |
- _2 be-4 |
+ " "2 be-4 |
gl\"u-2. |
cke2. |
- mich!2 _4 |
+ mich!2 " "4 |
}
-$treble_intro = \notes\relative c{
+trebleIntro = \notes\relative c{
\clef violin;
% ugh: id like to type this!
- %r8\pp [<g'-. c-.> <c-. es-.> <g-. c-.> <c-. es-.> <g-. c-.>] |
r8^"\bf m\\\"assig"\pp [<g'-. c-.> <c-. es-.> <g-. c-.> <c-. es-.> <g-. c-.>] |
r8 [<as-. c-.> <c-. es-.> <as-. c-.> <c-. es-.> <as-. c-.>] |
r8 [<as-. c-.> <c-. d-.> <as-. c-.> <c-. d-.> <as-. c-.>] |
\break
}
-$treble_verse1 = \notes\relative c{
-% \clef violin;
+trebleVerse1 = \notes\relative c{
%5
r8 [<g' c> <c es> <g c> <c es> <g c>] |
r8 [<f c'> <c' d> <f, c'> <c' d> <f, c'>] |
r8 [<f c'> <c' d> <f, c'> <c' d> <f, c'>] |
r8 [<f as bes> <as bes d> <f g bes> <as bes d> <f g bes>] |
r8 [<es g bes> <g bes es> <es g bes> <g bes es>]
- <{ es'~ | d4. ~ f8}{ c'~ | bes4. ~ as8 } >
+ <{ es'( ) d4.() f8}{ c' | bes4. as8 } >
\times 2/3 { < [f( as> <es g> <)d f] > } |
%16
<es2. g> |
< {a4.- > )f8} { a4. f8 } > |
}
-$treble_eentje = \notes \relative c'{
+trebleEentje = \notes \relative c'{
<e2 e'> <e4 g>|
<f2\mf as!(> [<as8.->( c> <)f16 )as>] |
<e4. g> [<e8-. g-.(> <e-. g-.> <e-. )g-.>] |
<e2. g> |
}
-$treble_through = \notes \relative c'{
+trebleThrough = \notes \relative c'{
<e2. e'> |
%61
R2. |
[<g,8.\< g'> <g16 g'> <b8. b'> <\! b16\> b'16> <d8. d'> <d16 d'>] |
< { c4( )b } { c'4( )b } > \!r |
-% ugh
-% <g4. g> <b8 b> [<d8.-> d->> c16] |
+
<g4. g'> <b8 b'> [<d'8.-> d,-> > c16] |
-% ugh ugh: connecting chords
%65
< { d,2.\f a'2} { e2. ~ e2 } { b'2. c,2 }> r4 |
\context Staff <
{
\voiceone
- [a8. b16] c4-> ~ a8 r |
- [a8. b16] c4-> ~ a8 r |
+ [a8. b16] c4-> () a8 r |
+ [a8. b16] c4-> () a8 r |
}
{
\voicetwo
<g2.-\fermata e' g> |
}
-$bass_intro = \notes\relative c{
+bassIntro = \notes\relative c{
\clef bass;
\property Voice.dynamicdir=1
%1
<g2 g'> r4 |
}
-$bass_verse1 = \notes\relative c{
+bassVerse1 = \notes\relative c{
% \clef bass;
\property Voice.dynamicdir=1
%5
c,8 [<c' e g> <e g c> <c e g> <e g c> <c e g>] |
}
-$bass_eentje = \notes\relative c{
+bassEentje = \notes\relative c{
\property Voice.dynamicdir=1
<c,8 c'> [<c' f as!> <f as c> <c f as> <f as c> <c f as>] |
c,8 [<c' e g> <e g c> <c e g> <e g c> <c e g>] |
c,8 [<e' g> <g c> <e g> <g c> <e g>] |
}
-$bass_through = \notes\relative c{
+bassThrough = \notes\relative c{
\property Voice.dynamicdir=1
%61
<g,8^"cresc." g'> [<g' b d> <b d f> <g b d> <as!-> b-> d->> <b d f>] |
}
-$lyric_four = \lyrics{
- _4 _ _
- _ _ _
- _ _ _
- _ _ _
+lyricFour = \lyrics{
+ " "4 " " " "
+ " " " " " "
+ " " " " " "
+ " " " " " "
}
allLyrics = {
\time 3/4;
% \skip 4 * 12;
- \$lyric_four
- \$lyric_verse1
+ \lyricFour
+ \lyricVerse1
% \skip 4 * 24;
- \$lyric_four
- \$lyric_four
- \$lyric_verse2
- \$lyric_through
+ \lyricFour
+ \lyricFour
+ \lyricVerse2
+ \lyricThrough
}
-$lyric_staff = \context Lyrics = lyric<
+lyricStaff = \context Lyrics = lyric<
\allLyrics
>
vocals = \notes{
+ \clef treble;
\property Voice.dynamicdir=UP
\skip 4 * 12;
- \$vocal_verse1
+ \vocalVerse
\skip 4 * 24;
- \$vocal_verse1
- \$vocal_through
+ \vocalVerse
+ \vocalThrough
}
-$vocal_staff = \context Staff = vocal<
+vocalStaff = \context Staff = vocal<
\property Staff.instrument = "alto sax"
\global
- \$vocals
+ \vocals
>
treble = {
- \$treble_intro
- \$treble_verse1
- \$treble_eentje
- \$treble_verse1
- \$treble_through
+ \trebleIntro
+ \trebleVerse1
+ \trebleEentje
+ \trebleVerse1
+ \trebleThrough
}
-$treble_staff = \context Staff = treble<
+trebleStaff = \context Staff = treble<
\global
\treble
>
bass = {
- \$bass_intro
- \$bass_verse1
- \$bass_eentje
- \$bass_verse1
- \$bass_through
+ \bassIntro
+ \bassVerse1
+ \bassEentje
+ \bassVerse1
+ \bassThrough
}
-$bass_staff = \context Staff = bass<
+bassStaff = \context Staff = bass<
\global
\bass
>
-$grand_staff = \context GrandStaff<
- \$treble_staff
- \$bass_staff
+grandStaff = \context GrandStaff<
+ \trebleStaff
+ \bassStaff
>
\score{
% \transpose a gives a' to d'' (for basses, who sing an octave down)
<
% kjoet, but i like the original better -- jcn
-% { \notes \transpose a { \$vocal_staff } }
-% \$lyric_staff
-% { \notes \transpose a { \$grand_staff } }
- { \notes { \$vocal_staff } }
- \$lyric_staff
- { \notes { \$grand_staff } }
+% { \notes \transpose a { \vocalStaff } }
+% \lyricStaff
+% { \notes \transpose a { \grandStaff } }
+ { \notes { \vocalStaff } }
+ \lyricStaff
+ { \notes { \grandStaff } }
>
\paper {
% \translator { \OrchestralScoreContext }