# yydebug
InitParser 1
-Parser 0
-
+Parser 1
# FlexLexer debug
+InitLexer 1
Lexer 1
parse_duration 1
TXTS=$(PODS:.pod=.txt)
MANS=$(PODS:.pod=.1)
HTMLS=$(PODS:.pod=.html)
-DISTFILES=$(PODS) Makefile
+DISTFILES=$(PODS) Makefile lelie_logo.png #lelieblond.gif
default:
=head1 DESCRIPTION
-
-Q: I want to enter meterchanges inside the music.
-
-A: You can't; a meterchange is scorewide (well, staffwide in some
-modern music). If allowed inside the music, we get complicated and
-conflicting situations if two voices asked for (possibly different)
-meterchanges.
-
-You can mark certain spots, though: please check out F<cadenza.ly>
-
-
Q: Why are [] around the notes, and () inbetween?
A: [] designate beams, a note can only be in one beam at the same
a()a()a
+Q: I want a DOS/NT/W95 port.
+
+A: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm,
+please :). No, I'm not considering compilation in W95, but feel free to give it a try.
+
+Q: Why GPL?
+
+A: Yes.
that voice.
After C<Staff> made up her mind, the resultant items and
-spanners are put on the PScore, and pointers to these items are
-stored in the C<Voice_element>. This construction enables the
-beams/stems to look up the balls it has to connect to.
+spanners are put on the PScore.
=over 5
=head1 SPACING
-I think my way is the most elegant algorithm i've seen so far. Some
-terminology: I call a vertical group of symbols (notes) which start at
-the same time a "column". Each line of a score has notes in it,
-grouped in columns. The difference in starting time between those
+I think my method is the most elegant algorithm i've seen so far.
+Some terminology: I call a vertical group of symbols (notes) which
+start at the same time a "column". Each line of a score has notes in
+it, grouped in columns. The difference in starting time between those
columns makes it possible to determine ideal distances between those
columns.
alldeps: #$(ALLDEPS)
touch $(DEPDIR)/dummy.dep
-$(DEPDIR)/%.dep: $(CCDIR)/%.cc
- $(DODEP) $(CXX) -E $(CXXFLAGS) $^ > /dev/null
+#$(DEPDIR)/%.dep: $(CCDIR)/%.cc
+# $(DODEP) $(CXX) -E $(CXXFLAGS) $^ > /dev/null
done
distclean: clean
- rm -f version.hh $(gencc) .GENERATE *~ deps/*.dep
+ rm -f version.hh $(gencc) .GENERATE *~ $(ALLDEPS)
all: kompijl doc
include $(DEPDIR)/*.dep
-version.o: $(obs) version.hh
+$(OBJECTDIR)/version.o: $(obs) $(HEADERDIR)/version.hh
include Generate.make
+pl 26
+ - Documentation/lelie_logo.png
+ - 8-bit chars for input (see ltest.tex) (MB)
+ - quotes around string now optional
+Bugfixes:
+ - unmatched ] (MB)
+Internal:
+ - print/name methods of Staff_elem
+ - added Request_register
+ - Voice_group_registers, Voice_registers, *_register
+ - Complex_staff
+
pl 25
- other clefs added, keys typeset properly (MB)
# sourcefiles to be shipped. Also for dependencies
hdr= accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\
- command.hh const.hh debug.hh dimen.hh directionalspanner.hh\
+ command.hh complexwalker.hh complexstaff.hh\
+ const.hh debug.hh dimen.hh directionalspanner.hh\
getcommand.hh glob.hh globvars.hh grouping.hh idealspacing.hh\
identifier.hh identparent.hh inputcommand.hh inputcommands.hh\
inputmusic.hh inputscore.hh inputstaff.hh item.hh key.hh keyitem.hh\
main.hh melodicstaff.hh meter.hh misc.hh\
molecule.hh moment.hh notehead.hh notename.hh offset.hh paper.hh\
parseconstruct.hh pcol.hh proto.hh pscore.hh pstaff.hh qlp.hh\
- qlpsolve.hh request.hh rest.hh rhythmstaff.hh sccol.hh score.hh\
+ qlpsolve.hh register.hh request.hh rest.hh rhythmstaff.hh\
+ sccol.hh score.hh\
scoreline.hh script.hh scriptdef.hh simplestaff.hh simplewalker.hh\
slur.hh spanner.hh staff.hh staffcommands.hh staffelem.hh staffline.hh\
- stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh tex.hh textdef.hh\
+ stcol.hh stem.hh staffwalker.hh symbol.hh symtable.hh\
+ tex.hh textdef.hh\
textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh
mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\
- clefitem.cc command.cc debug.cc dimen.cc directionalspanner.cc\
- getcommands.cc grouping.cc idealspacing.cc identifier.cc\
+ clefitem.cc command.cc complexstaff.cc complexwalker.cc \
+ complexmelodicstaff.cc complexprint.cc debug.cc dimen.cc\
+ directionalspanner.cc\
+ getcommands.cc grouping.cc groupregs.cc idealspacing.cc identifier.cc\
inputcommand.cc inputcommands.cc inputmusic.cc inputscore.cc\
inputstaff.cc item.cc key.cc keyitem.cc keyword.cc\
leastsquares.cc lexerinit.cc linespace.cc linepstaff.cc\
main.cc melodicstaff.cc meter.cc\
misc.cc molecule.cc mylexer.cc note.cc notehead.cc notename.cc\
paper.cc pcol.cc pscore.cc pstaff.cc qlp.cc qlpsolve.cc\
- request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
+ register.cc request.cc rest.cc rhythmstaff.cc sccol.cc score.cc\
scoreline.cc scores.cc script.cc scriptdef.cc simpleprint.cc\
simplestaff.cc simplewalker.cc slur.cc spanner.cc staff.cc\
staffcommands.cc staffelem.cc staffline.cc stcol.cc stem.cc\
staffwalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.cc\
texslur.cc textdef.cc textitem.cc textspanner.cc\
- timedescription.cc tstream.cc voice.cc warn.cc wordwrap.cc\
+ timedescription.cc tstream.cc voice.cc voiceregs.cc voicegroup.cc\
+ warn.cc wordwrap.cc\
template1.cc template2.cc template3.cc template4.cc\
- template5.cc version.cc
\ No newline at end of file
+ template5.cc template6.cc version.cc
\ No newline at end of file
BUGS
- * first clef
+ * first clef isn't printed
SEVERELY LACKING:
INPUTLANGUAGE
- * lexer condition stack
-
- * lose the $ and @?
+ * lose the $ and @ ?
* figured bass?
* make spanner for staffsym
- * Lyric_req : Text_req, Rhythmic_req
+ * Lyric_req: Text_req, Rhythmic_req
* Lookup::tex_glissando, Lookup::tex_bracket,
Lookup::tex_cresc, Lookup::tex_decresc (use texbeam.cc as an
* C meter iso 4/4
- * textspanner: dir of beam.
+ * textspanner: center position
* script-spacing
* space rest.
- * use (char *) iso. String for communication between lexer and parser.
+ * use (char *) iso. String for communication between lexer and
+ parser.
* As vs. as notename.
* configure idealspacing: arithmetic spacing
- * fix symbols in parser.o: `Warning: size of symbol'
+ * fix linking: `Warning: size of symbol'
+
+BIGGISH PROJECT
+
+ * merge musical & non-musical column. Scrap Commands in favour
+ of Requests, and do multiparralel meters
DOC
* all errors
FUTURE
- * Command_req
-
- * scrap stem_request?
- * put requests on barcommands
+ * syntax: grouping 2*4 3*8.
+
+ * put scripts on barcommands
* glissando
* QLP for beams?
- * stacked slurs.
-
* revise calcideal
* eentje/tweetje
IDEAS
+ * voice terminate req.
+
+ * keep input in mem, store char* to define spots
+
+ * enter Requests directly
+
* itemcolumns
* check out PMX
# version info
MAJVER=0
MINVER=0
-PATCHLEVEL=25
+PATCHLEVEL=26
VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
CXXVER=`$(CXX) --version`
-#flower version
-NEEDEFLOWERVER=1.0.20
-
# directories
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
OBJECTDIR=objects
MAKFILES=Makefile Variables.make Sources.make Initial.make Generate.make \
configure
OFILES=COPYING README NEWS TODO
-IFILES= standchen.tex titledefs.tex pavane.tex lilyponddefs.tex test.tex .dstreamrc dimen.tex
+IFILES= standchen.tex titledefs.tex pavane.tex lilyponddefs.tex \
+ ltest.tex test.tex .dstreamrc dimen.tex
DFILES=$(MAKFILES) $(OFILES) $(IFILES) $(SCRIPTS)
#compiling
#!/bin/sh
+PREFIX=${PREFIX:-.}
+echo using PREFIX=$PREFIX
-NEEDFLOWERVER=1.0.21
+NEEDFLOWERVER=1.0.22
flowertar=flower-$NEEDFLOWERVER
here=`pwd`
-if [ -x ../flower ]
+cd ..
+if [ -x flower ]
then
echo Found flowerdir
else
- cd ../
- if [ ! -f $flowertar ]
+
+ if [ ! -d $flowertar ]
then
echo "can't find $flowertar"
exit 1;
fi
echo Compiling Library
-cd flower; make
+(cd flower;make)
+
cd $here
-PREFIX="."
echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
-touch depend
make -f Initial.make
DISTFILES=Makefile
+
+default:
+
+
dist:
ln $(DISTFILES) $(DDIR)/$(SUBDIR)
clean:
- rm *.dep
+ rm -f *.dep
$(CXX) -MM $(cc) > depend
clean:
- rm -f $(obs) $(staticlib)
+ rm -f $(obs) $(staticlib) fversion.hh
realclean: clean
rm -f depend
MAJVER=1
MINVER=0
-PATCHLEVEL=21
+PATCHLEVEL=22
PACKAGENAME=flower
#PROFILEFLAG=-pg
staticlib=libflower.a
ALLSOURCES=$(hh) $(cc) $(inl) $(templatecc)
DFILES=$(ALLSOURCES) Makefile Variables.make make_version\
- Sources.make TODO README
+ Sources.make TODO README NEWS
DDIR=$(DNAME)
Assoc_ent_<K,V> ae;
ae.free = false;
ae.key = key;
- arr.add(ae);
+ arr.push(ae);
return arr.size() -1;
}
public:
File_path(String);
/// add to end of path.
- Array<String>:: add;
+ Array<String>:: push;
};
/**
{
Array<Real> r;
for (int j = 0; j < w; j++)
- r.add(els[n][j]);
+ r.push(els[n][j]);
return r;
}
Array<Real> r;
for (int i = 0; i<h; i++)
- r.add(els[i][n]);
+ r.push(els[i][n]);
return r;
}
Array<T>::pop();
return l;
}
- void push(T l) { add(l); }
};
/**
Same as for #Array# goes here.
while ((s = get_word()) != "")
{
- fields.add(s);
+ fields.push(s);
gobble_white();
}
}
/// add to the end of array
- void add(T x) {
+ void push(T x) {
if (size_ == max)
remax(2*max + 1);
#include "item.hh"
struct Accidental : Item {
+const char * name() const;
int type,pos;
void preprocess();
Accidental(int type, int position);
- void print()const;
+ void do_print()constt;
private:
void brew_molecule();
};
#include "item.hh"
struct Bar: Item {
+ const char * name() const;
String type;
Bar(String type);
/// dir: -1 below heads, +1 above heads.
/****************/
+ const char * name() const;
virtual Interval width()const;
Offset center() const;
void do_pre_processing();
void do_post_processing();
- void print() const;
+ void do_print() const;
void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
void set_stemlens();
~Beam();
struct Clef_item : Item {
+ const char * name() const;
String type;
int y_off;
bool change;
--- /dev/null
+/*
+ complexstaff.hh -- part of LilyPond
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef COMPLEXSTAF_HH
+#define COMPLEXSTAF_HH
+
+
+#include "key.hh"
+#include "stcol.hh"
+#include "staff.hh"
+#include "staffwalker.hh"
+
+/// column of Complex_staff: store one request
+struct Complex_column : Staff_column {
+
+ Array<Request*> todo_l_arr_;
+ Complex_staff* staff_l_;
+
+ /****************/
+
+ Slur_req *find_slur(Voice *);
+
+ void typeset_item(Item *, int=1);
+ void typeset_item_directional(Item *, int dir, int=1);
+ Molecule *create_command_mol(Command *com);
+
+ void take_request(Request *rq);
+ virtual void setup_requests();
+
+ Complex_column(Score_column*s,Complex_staff*rs);
+};
+
+
+/// Complex staff: one voicegroup at a time
+struct Complex_staff : Staff {
+ /// indirection to the PStaff.
+ PStaff *theline_l_;
+
+ /****************/
+ Staff_column*create_col(Score_column*);
+ virtual Item *get_TYPESET_item(Command*);
+ virtual void set_output(PScore *);
+ void process_commands( PCursor<Command*> &where);
+ virtual void walk();
+
+ Complex_staff();
+};
+
+#endif // COMPLEXSTAF_HH
+
--- /dev/null
+/*
+ complexwalker.hh -- part of LilyPond
+
+ (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef COMPLEXWALKER_HH
+#define COMPLEXWALKER_HH
+
+#include "proto.hh"
+#include "grouping.hh"
+#include "voicegroup.hh"
+#include "assoc.hh"
+#include "staffwalker.hh"
+#include "key.hh"
+#include "clef.hh"
+
+struct Complex_walker: Staff_walker {
+ Local_key local_key_;
+ Key key_;
+ Array<int> *oldkey_undo;
+ Array<int> typesetkey;
+
+ int processed_bar_priority;
+ bool processed_key;
+ bool processed_clef;
+ Clef clef_;
+ Rhythmic_grouping default_grouping;
+
+
+ IPointerList<Voice_registers *> voice_reg_list_;
+// Assoc<Voice*, Voice_registers*> voice_reg_map_;
+ //IPointerList<Voice_group_registers *> voice_reg_list_;
+ //Assoc<int, Voice_group_registers*> group_reg_map_;
+ Voice_group_registers group_regs_;
+ Local_key_register local_key_reg_;
+ Array<Staff_elem_info> announce_info_arr_;
+
+ /****************/
+ Voice_registers *find_voice_reg(Voice*v_l);
+
+ void regs_process_requests();
+ void do_announces();
+ void try_request(Request*req);
+ void typeset_element(Staff_elem *elem_p);
+ void announce_element(Staff_elem_info);
+ virtual void do_TYPESET_command(Command*);
+ virtual void do_INTERPRET_command(Command*);
+ virtual void process_requests();
+ virtual void do_post_move();
+ virtual void do_pre_move();
+
+ void do_note(CNote_info);
+ Complex_walker(Complex_staff*);
+ Complex_column *col();
+ Complex_staff *staff();
+
+ void do_local_key(Note_req*, Notehead*);
+
+};
+
+
+#endif // SIMPLEWALKER_HH
+
+
void error_t(const String& s, Time_description const & t_tdes);
void error_t(String const &s, const Moment &when);
// warnings
-void warning(String s);
+//void warning(String s);
#define WARN warnout << "warning: "<<__FUNCTION__ << "(): "
extern ostream &warnout ;
typedef Interval_t<Moment> MInterval;
/// data structure which represents rhythmic units
-struct Rhythmic_grouping {
-
+struct Rhythmic_grouping {
Array<Rhythmic_grouping*> children;
MInterval *interval_;
~Rhythmic_grouping();
void add_child(Moment start, Moment len);
-
+ bool child_fit_query(Moment start);
void split(Rhythmic_grouping r);
void split(Array<MInterval>);
void split(int n);
#include "string.hh"
#include "staffelem.hh"
-
/// a horizontally fixed size element of the score
struct Item : Staff_elem {
/// indirection to the column it is in
PCol * pcol_l_;
/****************/
-
+ virtual Item *item() { return this; }
Item();
- void print()const;
+ void do_print()const;
+ const char*name()const;
};
/** Item is the datastructure for printables whose width is known
before the spacing is calculated
///
struct Keyitem : Item {
+ const char * name() const;
Array<int> pitch;
Array<int> acc;
int c_position;
};
struct Local_key_item : Item {
+ const char * name() const;
Array<Local_acc> accs;
- Array<Notehead*> group;
+ Array<Item*> group;
int c0_position; // move into walker
/****************/
Local_key_item(int c0position);
- void add(int oct, int pitch, int acc, Notehead*);
-
+ void add(Item*);
+ void add(int oct, int pitch, int acc);
+ void add(Melodic_req*);
void do_pre_processing();
Molecule* brew_molecule_p()const;
};
#include "key.hh"
#include "stcol.hh"
#include "staff.hh"
-#include "staffwalker.hh"
struct Lyric_staff;
Lyric_staff* lstaff_l_;
void typeset_item(Item *, int=1);
-// void typeset_item_directional(Item *, int dir, int=1);
-
-// Molecule *create_command_mol(Command *com);
-
-// void take_request(Request *rq);
- virtual void process_requests();
+ virtual void setup_requests();
Lyric_column(Score_column*s,Lyric_staff*rs);
};
Array<Lyric_item*> litem_l_array_;
/****************/
-
+
virtual void do_TYPESET_command(Command*);
virtual void do_INTERPRET_command(Command*);
virtual void process_requests();
virtual void set_output(PScore *);
virtual Item* get_TYPESET_item(Command*);
- virtual Stem * get_stem(Stem_req *rq,Moment);
+ virtual Stem * get_stem(Stem_req *rq);
virtual Notehead * get_notehead(Note_req *rq, int bot);
virtual Local_key_item* get_local_key_item();
};
#include "varray.hh"
struct Meter: Item {
+ const char * name() const;
Array<Scalar> args;
/****************/
#include "item.hh"
/// ball at the end of the stem
-struct Notehead : public Item
-{
+struct Notehead : Item {
+ const char * name() const;
int position;
/// -1 = lowest, 0 = inside, 1 = top
int extremal;
/****************/
-
+ void set_rhythmic(Rhythmic_req *);
Notehead(int staff_size);
/**
position of top line (5 linestaff: 8)
*/
- void print()const;
+ void do_print()const;
static int compare(Notehead*&a, Notehead*&b) ;
Molecule* brew_molecule_p()const;
};
void get_default_duration(int *);
void set_default_octave(String);
void set_plet(int,int);
-Staff * get_new_rhythmstaff();
Voice_element * get_note_element(String,int * ,int *);
Voice_element* get_rest_element(String,int *);
Voice_element* get_word_element(Text_def*, int*);
-Staff * get_new_melodicstaff();
-Staff * get_new_lyricstaff();
void add_requests( Voice_element*v, Array<Request*>&req);
Request* get_request(char);
void set_text_style(String);
struct Beam_req;
struct Box;
struct Bracket_req;
+struct CNote_info;
struct Chord;
struct Clef;
struct Clef_item;
+struct Col_configuration;
struct Colinfo;
struct Command;
+struct Commands_at ;
+struct Complex_column;
+struct Complex_music;
+struct Complex_staff;
+struct Complex_walker;
struct Cresc_req;
struct Decresc_req;
struct Dynamic;
struct Idealspacing;
struct Identifier;
+struct Input_command;
struct Input_commands;
+struct Input_file;
+struct Input_music;
+struct Input_score;
+struct Input_staff;
struct Item;
struct Key;
struct Keyitem;
struct Keyword;
+struct Keyword_table;
struct Line_of_score;
struct Line_of_staff;
struct Linestaff;
struct Local_key_item;
struct Lookup;
struct Lyric_req;
+struct Lyric_req;
struct Mark_req;
+struct Melodic_req;
struct Mixed_qp;
struct Molecule;
-struct Rational;
-typedef Rational Moment;
+struct Music_general_chord;
+struct Music_voice;
struct Note_req;
struct Notehead;
+struct Notename_tab;
struct Offset;
struct Output;
struct PCol;
struct PStaff;
struct Paperdef;
struct Parametric_symbol;
+struct Rational;
struct Request;
+struct Request_register;
struct Rest;
struct Rest_req;
+struct Rhythmic_grouping;
struct Rhythmic_req;
struct Score;
struct Score_column;
-struct Staff_commands;
+struct Script_def;
struct Script_req;
+struct Simple_music;
struct Slur;
struct Slur_req;
struct Span_req;
struct Spanner;
struct Staff;
-struct Staff_command_req;
-struct Col_configuration;
struct Staff_column;
+struct Staff_command_req;
+struct Staff_commands;
+struct Staff_commands_at ;
+struct Staff_elem;
+struct Staff_elem_info;
+struct Staff_walker;
struct Stem;
struct Stem_req;
struct String;
struct Symtable;
struct Symtables;
struct Tex_stream;
+struct Text_def;
struct Text_gob;
+struct Text_req;
+struct Time_description;
struct Voice;
struct Voice_element;
-struct Voicegroup;
-
+struct Voice_group_registers;
struct Voice_list;
-struct Input_music;
-struct Simple_music;
-struct Complex_music;
-struct Music_voice;
-struct Music_general_chord;
-
-struct Input_score;
-struct Input_staff;
-struct Input_command;
-struct Notename_tab;
-struct Input_file;
-struct Keyword_table;
-struct Rhythmic_grouping;
-struct Staff_commands_at ;
-struct Commands_at ;
-struct Time_description;
-struct Script_def;
-struct Text_def;
-struct Text_req;
-struct Lyric_req;
-struct Melodic_req;
+struct Voice_registers;
+struct Voicegroup;
+typedef Rational Moment;
#endif // PROTO_HH
--- /dev/null
+/*
+ register.hh -- part of LilyPond
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#ifndef REGISTER_HH
+#define REGISTER_HH
+#include "proto.hh"
+#include "sstack.hh"
+
+/// data container.
+struct Staff_elem_info {
+ Staff_elem * elem_p_;
+// Array<const Request*> requestor_l_arr_;
+ Request*req_l_;
+ const Voice * voice_l_;
+ Voice_group_registers * group_regs_l_;
+ int group;
+ Request_register * origin_reg_l_;
+
+ /****/
+ Staff_elem_info(Staff_elem*, Request*, Request_register*);
+ Staff_elem_info();
+};
+
+/// Hungarian postfix: reg
+struct Request_register {
+ Complex_walker * walk_l_;
+ Array<Request*> accepted_req_arr_;
+
+ /****************/
+
+ Request_register(Complex_walker*);
+ Request_register();
+ virtual ~Request_register(){}
+
+ /// take note of item/spaanner
+ virtual void acknowledge_element(Staff_elem_info){}
+ /**
+ put item in spanner. Adjust local key; etc.
+ */
+
+ ///
+ virtual bool try_request(Request *req_l) =0;
+ /**
+ try to fit the request in this register
+
+ RETURN
+ false: request noted, but not taken.
+
+ true: request swallowed, now owned by this
+
+ (may be we could use C++ exceptions.. :-)
+ */
+
+ /// make items/spanners with the requests you got
+ virtual void process_request()=0;
+
+ /// typeset any spanners. Empty accepted_req_arr_
+ void pre_move_processing();
+ void post_move_processing();
+
+protected:
+ /// virtual, called by pre_move_process()
+ virtual void do_pre_move_process(){}
+ virtual void do_post_move_process(){}
+};
+/**
+ a struct which processes requests, and creates the Staff_elems
+ */
+
+struct Notehead_register : Request_register {
+ Item* note_l_;
+ /****************/
+ Notehead_register(Complex_walker*);
+ virtual bool try_request(Request *req_l) ;
+ virtual void process_request();
+ virtual void do_pre_move_process();
+};
+
+struct Slur_register : Request_register {
+ sstack<Slur *> slur_l_stack_;
+ Array<Slur*> end_slur_l_arr_;
+
+
+ /****************/
+ ~Slur_register();
+ Slur_register(Complex_walker*);
+ virtual bool try_request(Request*);
+ virtual void process_request();
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void do_pre_move_process();
+};
+
+struct Stem_beam_register : Request_register {
+ Stem * stem_p_;
+ Beam * beam_p_;
+ Beam_req * beam_req_l_;
+ Stem_req * stem_req_l_;
+ bool end_beam_b_;
+ Rhythmic_grouping *current_grouping;
+
+ /****************/
+ Stem_beam_register(Complex_walker*);
+ ~Stem_beam_register();
+ virtual bool try_request(Request*);
+ virtual void process_request();
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void do_pre_move_process();
+ virtual void do_post_move_process();
+};
+
+#if 0
+struct Script_register : Request_register {
+ Script * script_p_;
+ /****************/
+ Script_register(Complex_walker*);
+ virtual bool try_request(Request*);
+ virtual void process_request();
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void do_pre_move_process();
+};
+
+struct Text_register:Request_register{
+ Text_item * text_p_;
+
+ /****************/
+ Text_register(Complex_walker*);
+ virtual bool try_request(Request*);
+ virtual void process_request();
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void do_pre_move_process();
+};
+#endif
+
+struct Local_key_register : Request_register {
+ Local_key_item* key_item_p_;
+
+ /****************/
+
+ virtual bool try_request(Request*);
+ virtual void process_request();
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void do_pre_move_process();
+ Local_key_register(Complex_walker*);
+};
+
+#endif // REGISTER_HH
+
Voice_element*elt_l_;
/****************/
-
Request();
Request(Request const&);
virtual ~Request(){}
- virtual void print()const ;
- virtual Moment duration() const { return 0.0; }
+ virtual const char * name() const { return "Request";}
virtual Request* clone() const =0;
+ void print()const ;
+
+ virtual Moment duration() const { return 0; }
/* accessors for children */
virtual Barcheck_req *barcheck() { return 0; }
virtual Melodic_req *melodic() { return 0; }
virtual Mark_req * mark() { return 0; }
virtual Staff_command_req* command() { return 0;}
+protected:
+ virtual void do_print()const ;
};
-
/**
a voice element wants something printed.
see lilygut page
*/
+
+
+#define REQUESTMETHODS(T,accessor) \
+virtual T * accessor() { return this;}\
+virtual const char* name()const { return #T; }\
+virtual Request *clone() const { return new T(*this); } \
+virtual void do_print() const
struct Barcheck_req : Request {
- virtual Barcheck_req *barcheck() { return this; }
- void print ()const;
- Request*clone() const;
+ REQUESTMETHODS(Barcheck_req,barcheck);
};
/// a request with a duration
int dots;
Moment plet_factor;
/****************/
-
+ static int compare(const Rhythmic_req &, const Rhythmic_req &);
Moment duration() const;
Rhythmic_req();
- Rhythmic_req*rhythmic() { return this;}
- void print ()const;
- Request*clone() const;
+ Rhythmic_req(int,int);
+ REQUESTMETHODS(Rhythmic_req, rhythmic);
};
int dir_i_;
Text_def *tdef_p_;
/****************/
- Text_req* text() { return this; }
- virtual void print() const;
- Request *clone()const;
-
Text_req(int d, Text_def*);
~Text_req();
Text_req(Text_req const&);
+ REQUESTMETHODS(Text_req,text);
};
struct Lyric_req : public Rhythmic_req, Text_req {
Lyric_req(Text_def* t_p);
- void print() const;
- Lyric_req* lreq_l() { return this; }
- Request* clone() const;
+ REQUESTMETHODS(Lyric_req, lreq_l);
};
struct Melodic_req :virtual Request
{
/// 0 is c
- int name;
+ int notename;
int octave;
int accidental;
bool forceacc;
// return height from central c (in halflines)
int height()const;
Melodic_req();
- Melodic_req*melodic() { return this;}
- virtual void print() const;
- Request*clone() const;
+
+ REQUESTMETHODS(Melodic_req,melodic);
};
/// Put a note of specified type, height, and with accidental on the staff.
struct Note_req : Rhythmic_req, virtual Melodic_req {
- Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
- Note_req*note() { return this;}
- virtual void print() const;
- Request*clone() const;
-};
+
+ Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
+ REQUESTMETHODS(Note_req, note);
+ };
/**
*/
///Put a rest on the staff.
struct Rest_req : Rhythmic_req {
- void print()const;
-
- Rest_req * rest() { return this;}
- Request*clone() const ;
+ REQUESTMETHODS(Rest_req,rest);
};
/**
Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded.
*/
/// attach a stem to the noteball
-struct Stem_req : Request {
- /// 4,8,16, ..
- int stem_number;
-
- virtual Stem_req *stem() {return this;}
- Stem_req(int s) { stem_number = s; }
- Request*clone() const;
- virtual void print() const;
+struct Stem_req : Rhythmic_req {
+ Stem_req(int s, int dots);
+ REQUESTMETHODS(Stem_req,stem);
};
+/**
+ Rhythmic_req parent needed to determine if it will fit inside a beam.
+ */
/// requests to start or stop something.
struct Span_req : Request {
enum {
NOSPAN, START, STOP
} spantype ;
+ static int compare(const Span_req &r1, const Span_req &r2);
+ REQUESTMETHODS(Span_req,span);
- virtual void print() const;
- Span_req*span() { return this; }
Span_req();
- virtual Request*clone()const;
+
};
/**
This type of request typically results in the creation of a #Spanner#
int nplet;
/****************/
-
+ REQUESTMETHODS(Beam_req,beam);
+
Beam_req();
- virtual Beam_req * beam() { return this; }
- virtual Request*clone()const;
};
+
/** if #nplet# is set, the staff will try to put an
appropriate number over the beam
*/
/// a slur
struct Slur_req : Span_req {
+ REQUESTMETHODS(Slur_req,slur);
- virtual Request*clone()const;
- virtual Slur_req*slur() { return this; }
};
Script_def *scriptdef;
/****************/
- Script_req*script() { return this; }
- virtual void print() const;
- Request *clone()const;
Script_req(int d, Script_def*);
+ REQUESTMETHODS(Script_req,script);
~Script_req();
Script_req(Script_req const&);
};
String mark_str_;
/****************/
Mark_req(String);
- Mark_req* mark() { return this; }
- virtual void print() const;
- Request *clone() const;
+ REQUESTMETHODS(Mark_req,mark);
};
struct Staff_command_req : Request {
Input_command * com_p_;
- Staff_command_req* command() { return this;}
+ /****************/
Staff_command_req(Staff_command_req const&);
~Staff_command_req();
Staff_command_req(Input_command*);
- Request*clone()const;
- void print()const;
+ REQUESTMETHODS(Staff_command_req,command);
};
#if 0
struct Bracket_req : Span_req {
int nplet; // print a number over the beam.
};
-
/**
Start/stop a bracket at this note. if #nplet# is set, the staff will
try to put an appropriate number over the bracket
#include "item.hh"
/// ball at the end of the stem
-struct Rest : public Item
-{
+struct Rest : Item {
+
int dots;
int balltype;
Rest(int dur,int dots);
- void print()const;
-
+ void do_print()const;
+ const char * name() const;
Molecule* brew_molecule_p()const;
};
/**
/****************/
virtual Item *get_TYPESET_item(Command*);
- virtual Stem *get_stem(Stem_req *rq,Moment);
+ virtual Stem *get_stem(Stem_req *rq);
virtual Notehead * get_notehead(Note_req *rq, int b);
virtual void set_output(PScore *);
};
#include "scriptdef.hh"
#include "item.hh"
-struct Script : Item{
+struct Script : Item {
int dir;
int symdir;
int pos;
int staffsize;
- Script_def*specs_l_;
- Stem * stem_l_;
- Item * support;
+ Script_def *specs_l_;
+ Stem *stem_l_;
+ Array<Item *> support;
/****************/
-
+ const char * name() const;
void set_symdir();
void set_default_dir();
void set_default_pos();
Molecule* brew_molecule_p()const;
virtual void do_post_processing();
virtual void do_pre_processing();
- Script(Script_req*, Item*,int,Stem*p=0);
+ Script(Script_req*, int);
+ void set_support(Item*);
+ void set_stem(Stem*);
+ Interval support_height()const;
virtual Interval width() const;
};
Beam_req *beam_;
Simple_staff* staff_l_;
Text_req *text_;
- Lyric_req* lreq_p_;
/****************/
Slur_req * find_slur(Voice *);
Molecule *create_command_mol(Command *com);
void take_request(Request *rq);
- virtual void process_requests();
+ virtual void setup_requests();
Simple_column(Score_column*s,Simple_staff*rs);
};
Staff_column*create_col(Score_column*);
virtual Item *get_TYPESET_item(Command*);
- virtual Stem *get_stem(Stem_req *rq, Moment)=0;
+ virtual Stem *get_stem(Stem_req *rq)=0;
virtual Notehead *get_notehead(Note_req *rq, int b)=0;
virtual Rest *get_rest(Rest_req *rq);
virtual void set_output(PScore *);
#include "proto.hh"
#include "grouping.hh"
+
struct Simple_walker: Staff_walker {
Stem *stem_;
Array<Notehead *>noteheads;
virtual void do_TYPESET_command(Command*);
virtual void do_INTERPRET_command(Command*);
virtual void process_requests();
- virtual void reset();
-
+ virtual void do_post_move();
+ ~Simple_walker();
+ Simple_walker(Simple_walker const& c);
void do_note(Note_info);
Simple_walker(Simple_staff*);
Simple_column *col();
/****************/
Offset center() const;
Slur();
- void print() const;
void do_post_processing();
void do_pre_processing();
void add(Notehead*);
Spanner* do_break_at( PCol*, PCol*) const;
void process();
private:
-Molecule*brew_molecule_p()const;
+ Molecule*brew_molecule_p()const;
+ const char * name() const;
};
#endif // SLUR_HH
Spanner();
virtual Interval width()const;
- void print()const;
-
+ void do_print()const;
+ const char* name()const;
Spanner *broken_at(PCol *c1, PCol *c2) const;
+ virtual Spanner* spanner() { return this; }
protected:
/// clone a piece of this spanner.
virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0;
c1 >= start, c2 <= stop
*/
};
-/**
- A spanner is a symbol whose final appearance can only be calculated
- after the breaking problem is solved.
+/** A spanner is a symbol which spans across several columns, so its
+ final appearance can only be calculated after the breaking problem
+ is solved.
Examples
Score *score_l_;
PScore *pscore_l_;
String define_spot_str_;
+
/****************************************************************/
+
void add(PointerList<Voice*> &s);
void do_commands(PointerList<Input_command*> score_wide,
PointerList<Input_command*> staff_wide);
void pre_processing();
void post_processing();
void molecule_processing();
-
+ virtual const char *name() const; // to find out derived classes.
+ virtual Spanner* spanner() { return 0; }
+ virtual Item * item() { return 0; }
protected:
+
+ /// do printing of derived info.
+ virtual void do_print() const=0;
/// generate the molecule
virtual Molecule* brew_molecule_p()const=0;
///executed directly after the item is added to the PScore
accomplished with the dependencies field of struct Staff_elem.
*/
+
+#define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c
#endif // STAFFELEM_HH
#include "staff.hh"
struct Staff_walker : public PCursor<Staff_column*> {
- Staff * staff_;
- PScore * pscore_;
+ Staff * staff_l_;
+ PScore * pscore_l_;
int break_status;
****************/
/// every time ++ is called
- virtual void reset(){}
+ virtual void do_pre_move(){}
+ virtual void do_post_move(){}
virtual void process_requests()=0;
virtual void do_TYPESET_command(Command*)=0;
virtual void do_INTERPRET_command(Command*)=0 ;
VIRTUAL
****************************************************************/
- virtual void process_requests()=0;
+ virtual void setup_requests()=0;
virtual ~Staff_column();
private:
#include "moment.hh"
/// the rule attached to the ball
-struct Stem : public Item {
+struct Stem : Item {
+/*
/// rhythmical length
Moment note_length;
-
+ */
// heads the stem encompasses (positions)
int minnote, maxnote;
Array<Notehead*> heads;
/****************/
- Stem(int center, Moment duration);
+ Stem(int center); //, Moment duration);
/// ensure that this Stem also encompasses the Notehead #n#
void add(Notehead*n);
+ const char * name() const;
Real hpos()const;
- void print() const;
+ void do_print() const;
void set_stemend(Real);
void set_default_dir();
void set_default_stemlen();
void set_default_extents();
void set_noteheads();
-
-
void do_pre_processing();
Interval width() const;
#include "item.hh"
struct Text_item : Item {
+ const char * name() const;
int pos_i_;
int staffsize_i_;
int dir_i_;
Text_def spec;
Offset tpos;
Directional_spanner*support;
+
/****************/
+
+ const char * name() const;
virtual void do_pre_processing();
virtual void do_post_processing();
Molecule* brew_molecule_p()const;
virtual Interval height() const ;
- void print() const;
+ void do_print() const;
virtual Spanner* do_break_at(PCol*,PCol*)const;
- Text_spanner(Directional_spanner*);
+ Text_spanner();
+ void set_support(Directional_spanner*);
};
/**
Use for triplets, eentweetjes, ottava, etc.
*/
-struct Voicegroup {
- /// don't know how to identify these.
-};
-
/// one horizontal bit.
struct Voice_element {
Moment duration;
- const Voicegroup *group;
- const Voice *voice_;
+ const Voice *voice_l_;
IPointerList<Request*> reqs;
/****************/
Voice_element(Voice_element const & src );
void print ()const;
};
-/** Apart from being a container for the requests, Voice_element is
- glue between related items and spanners, between requests and
- (voice)groups
+/** Apart from being a container for the requests, Voice_element is nothing
*/
#endif
default: ;
DISTFILES=Makefile kortjakje.ly pavane.ly maartje.ly\
- cadenza.ly scales.ly standchen.lily twinkle.ly
+ cadenza.ly scales.ly standchen.ly twinkle.ly
dist:
ln $(DISTFILES) $(DDIR)/$(SUBDIR)
%
%
-
-
-ritme = staff {rhythmic
+ritme = staff {
+ rhythmic
music {$
c8
|[a8() a8. a8 a16 a16 a16] c4.
melody=
staff { melodic
+% complex
music{$
c8
|r4 r4 r4 r4
skip 2:0
key
skip 5:0
- clef "bass"
+ clef bass
}
}
horn =
staff {
- melodic
+% melodic
+ complex
music{ $
\octave { ' }
\duration { 8}
% 1
- d2( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
+ d2(( [)d e cis `b] |
+ `a4 [`b cis] [cis `b] )`b4 |
+ fis2(( [)fis g e d] |
cis4 [d e(] [)e fis d cis] |
`b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
+ )cis2 r2^"c\'edez" |
r4 fis2 fis4 |
- fis2^"en mesure" ()[fis e a fis]|
- fis4-- e4-- d4-- e4-- |
+ fis2^"en mesure" (()[fis e a fis]|
+ fis4-- e4-- d4-- )e4-- |
`b2()[`b^"un peu retenu" `a( d cis]|
% 11
)`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
`fis2 r2 |
- cis4^"1er mouvement" d4^"tr\`es lontain" ()[d cis d e]
+ cis4^"1er mouvement"( d4^"tr\`es lontain" ()[d cis d e]
\octave { }
- | a4 gis2. |
- a4 b4()[b a b 'cis] |
- fis4 e4 cis2 |
- e4 fis4 () [fis e fis gis] |
- cis4 `b4()`b8 r8 r4^"tr\`es soutenu" |
+ | a4 )gis2. |
+ a4 (b4()[b a b 'cis] |
+ fis4 e4 )cis2 |
+ e4( fis4 () [fis e fis gis] |
+ cis4 `b4())`b8 r8 r4^"tr\`es soutenu" |
\command { \meter 2 *4 } r4 r4 |
\command { \meter 4 *4 }
- 'cis4_"\dyn ppp" 'd4 () ['d 'cis 'd 'e] |
- a4 gis2. |
- a4 b4()[b a b 'cis] |
- fis4 e4 cis2 |
- e4_"\dyn pp" fis4()[fis e fis gis] |
- cis4_"\dyn mf" `b4()`b8 r8 r4^"un peu plus lent" |
+ 'cis4_"\dyn ppp"( 'd4 () ['d 'cis 'd 'e] |
+ a4 )gis2. |
+ a4 (b4()[b a b 'cis] |
+ fis4 e4 )cis2 |
+ e4_"\dyn pp"( fis4()[fis e fis gis] |
+ cis4_"\dyn mf" `b4())`b8 r8 r4^"un peu plus lent" |
r1 |
r2 r4 r4 %^\fermata
%% cut 'n paste.
\octave { ' }
- | d2^"Reprenez le mouvement"( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
+ | d2^"Reprenez le mouvement"( ([)d e cis `b] |
+ `a4 [`b cis] [cis `b] )`b4 |
+ fis2(( [)fis g e d] |
cis4 [d e(] [)e fis d cis] |
`b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
+ )cis2 r2^"c\'edez" |
r4 fis2 fis4 |
- fis2^"en mesure"()[fis e a fis] |
+ fis2(^"en mesure"()[fis e a fis] |
fis4-- e4-- d4-- e4-- |
`b2() [`b `a-. d-. cis-.] |
- `b-. [`fis^"large" `a `b] cis4 `b4 `fis2 r2 |
+ )`b-. [`fis^"large" `a `b] cis4 `b4 `fis2 r2 |
%% mark B
r1^"1er mouvement"
\command { \meter 4 *4 }
\octave { ' }
- |d2( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
+ |d2(( [)d e cis `b] |
+ `a4 [`b cis] [cis `b] )`b4 |
+ fis2( ([)fis g e d] |
cis4 [d e(] [)e fis d cis] |
`b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
+ )cis2 r2^"c\'edez" |
r4 fis2 fis4 |
- fis2()[fis e a fis] |
+ fis2(()[fis e a fis] |
fis4-- e4-- d4-- e4--
\octave{ }
| b2()[b a 'd 'cis] |
- b [fis a b ] 'cis4 b4 |
+ )b [fis a b ] 'cis4 b4 |
fis2 r2 |
r1-\fermata
$}
geometric 1.4
}
commands {
- meter 6 8
+ meter 6* 8
skip 6:0
- meter 4 4
+ meter 4* 4
skip 2:0
skip 11:0
+++ /dev/null
-% st\"andchen.lily
-% Franz Schubert (? - ?)
-%
-% comments with # note missing stuff
-% heu, make that %#%
-%
-%% Still looks fairly on the "ugh" side the beauty scale, mainly because of
-%% LilyPond's naive idealspacing calc.
-%%
-
-%
-%#%%
-%#%\title{St\"andchen}
-%#%\subtitle{Serenade}
-%#%%
-%#%\composer{`franz Schubert}
-%#%\tempo{M\"a\ss ig}
-%#%%
-%#%\meter{3/4}
-%#%\key\`f
-%#%\clef\treble
-%#%%
-%#%\barnumbering5
-%#%%\staffnumbers
-%#%\barnumberstyle\boxed
-%#%%
-%#%\staffseparation{12}
-%#%%
-%#%\duration8
-%%1
-melodie = music { $
- \duration{ 8 }
- r_"pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] }
-%%2
- r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] }
-%%3
- r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
-%%4
- r { [ `a cis } e { `a cis } e { `a cis ] }
-%#%:|
-%%5
- \plet{ 2/3 } [ a()bes a ] \plet{ 1/1 } 'd4. a
-%%6
- \plet{ 2/3 } [ g()a g ] \plet{ 1/1 } 'd4 a r
-%#%\tighten
-%#%\newline
-%%7
- a4.^> g \plet{ 2/3 } [ g( f )e ] \plet{ 1/1 }
-%%8
- f2 r4
-%%9
-%#% { 'a4.( 'cis4.\stemdown_p } { ) 'g 'e_{dolce} }
-%#% { 'g( 'e } 'f ) 'e
- 'a4.( )g \plet{ 2/3 } { 'g 'e } { 'f } { 'e } \plet{ 1/1 }
-%%10
- { 'f2. 'd2. }
-%%11
- \plet { 2/3 } [ a_"pp"( )bes a ] \plet { 1/1 } 'f4. a
-%%12
- \plet { 2/3 } [ g( ) a g ] \plet { 1/1 } 'e4. 'd
-%%13
- 'c4. bes \plet { 2/3 } [ bes( ) a g ] \plet { 1/1 }
-%%14
-%#% a2 r { 'd(^ f_p(v }
- a2 r { 'd f_"p" }
-%%15
-%#% { ) e4. ) 'c4.\stemup_{dolce} } { bes g }
- { e4. 'c4._"dolce" } { bes g }
- \plet { 2/3 } { [ bes g } a g ] \plet { 1/1 }
-%%16
- { a2. f2. }
-%%17
- [ a8._"cresc." 'cis16 ] 'f4. 'e
-%%18
- [ 'd8. a16 ] f4. d
-%%19
-%#% 'c\grace\stemup
- \plet { 2/3 } [ bes_"pp"( ) a bes ] \plet { 1/1 } 'd4. bes
-%%20
- a2.
-%%21
-%#% a\grace
- \plet { 2/3 } [ g( )fis g ] \plet { 1/1 } bes4.^> g
-%%22
-%#% =f2.
- f2.
-%%23
- [ a8._"mf" 'cis16 ] 'f4. 'e
-%%24
- [ 'd8. a16 ] fis4. d
-%%25
-%#% 'cis\grace\stemup
- \plet { 2/3 } [ b_"mf"( ) ais b ] \plet { 1/1 } 'd4. b
-%%26
- { a2. fis2. }
-%#%\tighten\newline
-%%27
- \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4. 'cis
-%%28
- { 'd2. fis2. }
-%#%\volta1
-%%29
-%#% { bes2(^++++ g2_{mf} }
- { bes2 g2_"mf" }
-%#% [v { 'd8.( bes8. } { bes16 ) )++ g16 } ]
- { [ 'd8. bes8. } { bes16 g16 ] }
-%%30
- { a4. fis4. }
-%#% [ { [ a_. f_.( } { a_. f_. } { a_. ) f_. } ]
- { [ a_. f_. } { a_. f_. } { a_. f_. ] }
-%%31
- { a4. g4. }
-%#% [ { a cis_.( } { a e_. } { a )- g_. } ]
- { [ a cis_. } { a e_. } { a g_. ] }
-%%32
- { a2 fis2_"pp" } { a4 fis4 }
-%%33
-%#% { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ]
- { b2( g2 } { [ 'd8. b8. } { b16 g16 ] }
-%%34
-%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
- { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
-%%35
-%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
- { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
-%%36
- { a2. fis2. }
-%#%\volta2
-%#%:|
-%%37
- [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ]
-%%38
- 'd4( )'cis4 r4
-%%39
-%#% > a4. [ 'cis 'e8. >! 'd16 ]
- a4. [ 'cis 'e8. 'd16 ]
-%%40
- 'cis2 r4
-%%41
-%#% { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ] \plet { 1/1 }
- { 'fis4. 'cis4._"f" } 'e \plet { 2/3 } [ 'e( )'d 'cis ] \plet { 1/1 }
-%%42
- [ b8. 'cis16 ] 'd4^> b r
-%%43
-%#% [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r
- [ b8._"f" 'cis16 ] 'd4^> b r
-%%44
-%#% [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r
-% typo?
- [ b8. 'cis16 ] 'd4^> b r
-%%45
-%#% 'cis\grace\stemup
- \plet { 2/3 } [ b_"p"( )ais b ] \plet { 1/1 } 'd4. b
-%%46
-%#% { =a2. fis2. }
- { a2. fis2. }
-%%47
- \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4.^> 'cis
-%%48
-%#% { fis2.(v ='d2.\stemup(^ }
- { fis2. 'd2. }
-%%49
-%#% { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup
- 'd4 r4_"decresc." 'd4
-%%50
- { bes2. e2. }
-%%51
- { a2. cis2. }
-%%52
- { fis2 d2 } { a4 f4_"pp" }
-%%53
-%#% { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ]
- { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] }
-%%54
-%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
- { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
-%%55
-%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
- { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
-%%56
- { a2. fis2._"dim." }
-%%57
- { a2. fis2. }
-%%58
- { a2.^\fermata fis2. }
-%#%\tighten
-$ }
-
-begeleiding = music { $
- \duration{2}
- `d r4
-%%2
- ``bes r4
-
-%%3
- ``g r4
-
-%%4
- ``a r4
-%#%:|
-%%5
-%#%\stemlength2
-\duration{ 8 }
-%#% { =`f `d2 } `a d `a { d r4 } `a
-% i-d rather type:
-% { \music{ [ `f `a d `a d `a ] } \music{ `d2 r4 } }
-% output little better...
-% { `d2 \music{ [ `f `a d `a } } { \music{ d `a ] } r4 }
- [ `f `a d `a d `a ]
-%%6
-%#% { `d ``bes2 } `e `g `e { `g r4 } `e
- [ `d `e `g `e `g `e ]
-%%7
-%#% { `cis ``a2 } `e `g `e { `g r4 } `e
- [ `cis `e `g `e `g `e ]
-%%8
-%#% { `d `d2 } `a d `a { d r4 } `a
- [ `d `a d `a d `a ]
-%%9
-%#% `a e f e f e
- [ `a e f e f e ]
-%%10
-%#% `d `a d `a d `a
- [ `d `a d `a d `a ]
-%%11
-%#% [^ { `f `d2 } `a d `a { d r4 } `a ]
- [ `f `a d `a d `a ]
-
-%%12 == 6
-%#% { `d ``bes2 } `e `g `e { `g r4 } `e
- [ `d `e `g `e `g `e ]
-%13
-%#% { `e ``bes2 } `e `g `e { `g r4 } `e
- [ `e `e `g `e `g `e ]
-%%14
-%#% { `a `f2 } c f c { f r4 } c
- [ `a c f c f c ]
-%%15
- [ `c `g `bes `g `bes `g ]
-%%16
- [ ``f `c `f `c `f `c ]
-%%17
-%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
- [ ``a `e `g `e `g `e ]
-%%18
-%#% [^ { `d `d2 } `a d `a { d r4 } `a ]
- [ `d `a d `a d `a ]
-%%19
-%#% s8 % skip space of `grace note
-%#% [^ { ``bes ``bes2 } `f `bes `f { `bes r4 } `f ]
- [ ``bes `f `bes `f `bes `f ]
-%%20
-%#% [^ { ``f ``f2 } `c `f `c { `f r4 } `c ]
- [ ``f `c `f `c `f `c ]
-%%21
-%#% s8 % skip space of `grace note
-%#% [ { `e `c } `g c `g c `g ]
- { [ `e `c } `g c `g c `g ]
-%%22
- [ `f `a c `a `f `c ]
-%%23
-%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
- [ ``a `e `g `e `g `e ]
-%%24
-%#% [^ { `d `d2 } `fis `a `fis { `a r4 } `fis]
- [ `d `fis `a `fis `a `fis ]
-%%25
-%#% s8 % skip space of `grace note
-%#% [^ { ``g ``g2 } `d `b `d { `b r4 } `d]
- [ ``g `d `b `d `b `d ]
-%%26
-%#% [^ { `d `d2 } `a d `a { d r4 } `a]
- [ `d `a d `a d `a ]
-%%27
- { [ `cis ``a } `e `a `e `a `e ]
-%%28
- [ `d `a d `a d `a ]
-%%29
-%#% [ `d `g @ `bes `g `bes `g ]
- [ `d `g `bes `g `bes `g ]
-%#%\volta1
-%%30
- [ `d `fis `a `fis `a `fis ]
-%%31
- [ `a `e `a `e `a `e ]
-%%32
- [ `d `fis `a `fis `a `fis ]
-%%33
- [ `d `g `b `g `b `g ]
-%%34
- [ `d `fis `a `fis `a `fis ]
-%%35
- [ `a `e `a `e `a `e ]
-%%36
- [ `d `fis `a `fis `a `fis ]
-%#%\volta2
-%#%:|
-%%37
- [ `a `e `g `e ``bes^> `e ]
-%%38
- [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }
-%%39
- [ `a `e `g `e ``bes^> `e ]
-%%40
- [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }
-%%41
- [ `ais `e `gis `e `gis `e ]
-%%42
- { [ `d ``b } `fis `b `fis `b `fis ]
-%%43
- { [ `e ``b } `g `b `g `b `g ]
-%%44
- { [ `d ``b } `fis `b `fis `b `fis ]
-%%45
-%#% s8 % skip space of `grace note
-%#% [^{ ``g ``g2 } `d `b `d { `b r4 } `d]
- [ ``g `d `b `d `b `d ]
-%%46
-%#% [^ { `d `d2 } `a d `a { d r4 } `a ]
- [ `d `a d `a d `a ]
-%%47
- { [ `cis ``a } `e `a `e `a `e ]
-%%48
- [ `d `fis `a `fis `a `fis ]
-%%49
- [ `d `a d `a d `a ]
-%%50
- [ ``g `e `g `e `g `e ]
-%%51
- [ `a `e `g `e `g `e ]
-%%52
- [ ``d `d `fis `d `fis `d ]
-%%53
- [ `d `g `bes `g `bes `g ]
-%%54
- [ `d `fis `a `fis `a `fis ]
-%%55
- [ `a `e `g `e `g `e ]
-%%56
- [ ``d ``a `d ``a `d ``a ]
-%%57
- [ ``d ``a `d ``a `d ``a ]
-%%58
- { `d2.^\fermata ``d2. }
-$ }
-
-tekst1 = music {
- @
- \duration{4}
- _ _ _
- _ _ _
- _ _ _
- _ _ _
- % 5
- \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8
- \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
- Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 }
- dir;2 _
- _ _ _
- _ _ _
- % 11
- \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8
- \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
- Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 }
- mir!2 _
- _ _ _
- _ _ _
-
- % 17
- Fl\"us-8. ternd16 schlan-4. ke8
- Wip-8. fel16 rau-4. schen8
- \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8
- Licht;2.
- _ _ _
- _ _ _
-
- % 23
- Des8. Ver-16 r\"a-4. ters8
- feind-8. lich16 Lau-4. schen8
- \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8
- nicht.2.
- _ _ _
- _ _ _
-
- % volta 1
- % 29
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
-
- % volta 2
- % 37
- La\ss8. auch16 dir8. die16 Brust8. be-16
- we- gen, _
- Lieb-4. chen,8 h\"o-8. re16
- mich!2 _
- _ _ _
- _ _ _
- Be-8. bend16 harr' ich8 _8
- dir8. ent-16 ge- gen!8 _8
- \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8
- mich!2.
- % 47
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- % 57
- _ _ _ _ _ _
- @
- }
-
- tekst2 = music {
- @
- \duration{4}
- _ _ _
- _ _ _
- _ _ _
- _ _ _
- % 5
- \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8
- \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
- Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 }
- dich,2 _
- _ _ _
- _ _ _
-
- % 11
- \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
- \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
- Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
- mich.2 _
- _ _ _
- _ _ _
-
- % 17 ok tot hier
- Sie-8. ver-16 stehn4. des8
- Bus-8. ens16 Seh-4. nen,8
- \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8
- schmerz,2.
- _ _ _
- _ _ _
-
- % 23
- R\"uh-8. ren16 mit4. den8
- Sil-8. ber-16 t\"o-4. nen8
- \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8
- Herz.2.
- _ _ _
- _ _ _
-
- % volta 1
- % 29
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
-
- % volta 2
- % 37
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % 47
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % 57
- % _ _ _ _ _ _
- @
- }
-
-score {
- paper {
- symboltables { table_sixteen }
- output "standchen.uit"
- unitspace 2.4 cm
- % unitspace 4.0 cm % leaves all text stand free
-geometric 1.4
- }
- staff {
- melodic music { melodie }
- commands {
- key $bes$
- clef "violin"
- }
- }
- staff {
- lyric
- music { tekst1 }
- music { tekst2 }
- }
- staff {
- melodic music { begeleiding }
- commands {
- key $bes$
- clef "bass"
- }
- }
- commands {
- meter 3*4
- skip 4:0
- bar ":|"
- skip 32:0
- bar ":|"
- skip 22:0
- bar "||"
- }
-}
--- /dev/null
+% st\"andchen.lily
+% Franz Schubert (? - ?)
+%
+% comments with # note missing stuff
+% heu, make that %#%
+%
+%% Still looks fairly on the "ugh" side the beauty scale, mainly because of
+%% LilyPond's naive idealspacing calc.
+%%
+
+%
+%#%%
+%#%\title{St\"andchen}
+%#%\subtitle{Serenade}
+%#%%
+%#%\composer{`franz Schubert}
+%#%\tempo{M\"a\ss ig}
+%#%%
+%#%\meter{3/4}
+%#%\key\`f
+%#%\clef\treble
+%#%%
+%#%\barnumbering5
+%#%%\staffnumbers
+%#%\barnumberstyle\boxed
+%#%%
+%#%\staffseparation{12}
+%#%%
+%#%\duration8
+%%1
+melodie = music { $
+ \duration{ 8 }
+ r_"pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] }
+%%2
+ r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] }
+%%3
+ r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
+%%4
+ r { [ `a cis } e { `a cis } e { `a cis ] }
+%#%:|
+%%5
+ \plet{ 2/3 } [ a()bes a ] \plet{ 1/1 } 'd4. a
+%%6
+ \plet{ 2/3 } [ g()a g ] \plet{ 1/1 } 'd4 a r
+%#%\tighten
+%#%\newline
+%%7
+ a4.^> g \plet{ 2/3 } [ g( f )e ] \plet{ 1/1 }
+%%8
+ f2 r4
+%%9
+%#% { 'a4.( 'cis4.\stemdown_p } { ) 'g 'e_{dolce} }
+%#% { 'g( 'e } 'f ) 'e
+ 'a4.( )g \plet{ 2/3 } { 'g 'e } { 'f } { 'e } \plet{ 1/1 }
+%%10
+ { 'f2. 'd2. }
+%%11
+ \plet { 2/3 } [ a_"pp"( )bes a ] \plet { 1/1 } 'f4. a
+%%12
+ \plet { 2/3 } [ g( ) a g ] \plet { 1/1 } 'e4. 'd
+%%13
+ 'c4. bes \plet { 2/3 } [ bes( ) a g ] \plet { 1/1 }
+%%14
+%#% a2 r { 'd(^ f_p(v }
+ a2 r { 'd f_"p" }
+%%15
+%#% { ) e4. ) 'c4.\stemup_{dolce} } { bes g }
+ { e4. 'c4._"dolce" } { bes g }
+ \plet { 2/3 } { [ bes g } a g ] \plet { 1/1 }
+%%16
+ { a2. f2. }
+%%17
+ [ a8._"cresc." 'cis16 ] 'f4. 'e
+%%18
+ [ 'd8. a16 ] f4. d
+%%19
+%#% 'c\grace\stemup
+ \plet { 2/3 } [ bes_"pp"( ) a bes ] \plet { 1/1 } 'd4. bes
+%%20
+ a2.
+%%21
+%#% a\grace
+ \plet { 2/3 } [ g( )fis g ] \plet { 1/1 } bes4.^> g
+%%22
+%#% =f2.
+ f2.
+%%23
+ [ a8._"mf" 'cis16 ] 'f4. 'e
+%%24
+ [ 'd8. a16 ] fis4. d
+%%25
+%#% 'cis\grace\stemup
+ \plet { 2/3 } [ b_"mf"( ) ais b ] \plet { 1/1 } 'd4. b
+%%26
+ { a2. fis2. }
+%#%\tighten\newline
+%%27
+ \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4. 'cis
+%%28
+ { 'd2. fis2. }
+%#%\volta1
+%%29
+%#% { bes2(^++++ g2_{mf} }
+ { bes2 g2_"mf" }
+%#% [v { 'd8.( bes8. } { bes16 ) )++ g16 } ]
+ { [ 'd8. bes8. } { bes16 g16 ] }
+%%30
+ { a4. fis4. }
+%#% [ { [ a_. f_.( } { a_. f_. } { a_. ) f_. } ]
+ { [ a_. f_. } { a_. f_. } { a_. f_. ] }
+%%31
+ { a4. g4. }
+%#% [ { a cis_.( } { a e_. } { a )- g_. } ]
+ { [ a cis_. } { a e_. } { a g_. ] }
+%%32
+ { a2 fis2_"pp" } { a4 fis4 }
+%%33
+%#% { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ]
+ { b2( g2 } { [ 'd8. b8. } { b16 g16 ] }
+%%34
+%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
+ { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
+%%35
+%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
+ { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
+%%36
+ { a2. fis2. }
+%#%\volta2
+%#%:|
+%%37
+ [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ]
+%%38
+ 'd4( )'cis4 r4
+%%39
+%#% > a4. [ 'cis 'e8. >! 'd16 ]
+ a4. [ 'cis 'e8. 'd16 ]
+%%40
+ 'cis2 r4
+%%41
+%#% { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ] \plet { 1/1 }
+ { 'fis4. 'cis4._"f" } 'e \plet { 2/3 } [ 'e( )'d 'cis ] \plet { 1/1 }
+%%42
+ [ b8. 'cis16 ] 'd4^> b r
+%%43
+%#% [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r
+ [ b8._"f" 'cis16 ] 'd4^> b r
+%%44
+%#% [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r
+% typo?
+ [ b8. 'cis16 ] 'd4^> b r
+%%45
+%#% 'cis\grace\stemup
+ \plet { 2/3 } [ b_"p"( )ais b ] \plet { 1/1 } 'd4. b
+%%46
+%#% { =a2. fis2. }
+ { a2. fis2. }
+%%47
+ \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4.^> 'cis
+%%48
+%#% { fis2.(v ='d2.\stemup(^ }
+ { fis2. 'd2. }
+%%49
+%#% { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup
+ 'd4 r4_"decresc." 'd4
+%%50
+ { bes2. e2. }
+%%51
+ { a2. cis2. }
+%%52
+ { fis2 d2 } { a4 f4_"pp" }
+%%53
+%#% { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ]
+ { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] }
+%%54
+%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
+ { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
+%%55
+%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ]
+ { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] }
+%%56
+ { a2. fis2._"dim." }
+%%57
+ { a2. fis2. }
+%%58
+ { a2.^\fermata fis2. }
+%#%\tighten
+$ }
+
+begeleiding = music { $
+ \duration{2}
+ `d r4
+%%2
+ ``bes r4
+
+%%3
+ ``g r4
+
+%%4
+ ``a r4
+%#%:|
+%%5
+%#%\stemlength2
+\duration{ 8 }
+%#% { =`f `d2 } `a d `a { d r4 } `a
+% i-d rather type:
+% { \music{ [ `f `a d `a d `a ] } \music{ `d2 r4 } }
+% output little better...
+% { `d2 \music{ [ `f `a d `a } } { \music{ d `a ] } r4 }
+ [ `f `a d `a d `a ]
+%%6
+%#% { `d ``bes2 } `e `g `e { `g r4 } `e
+ [ `d `e `g `e `g `e ]
+%%7
+%#% { `cis ``a2 } `e `g `e { `g r4 } `e
+ [ `cis `e `g `e `g `e ]
+%%8
+%#% { `d `d2 } `a d `a { d r4 } `a
+ [ `d `a d `a d `a ]
+%%9
+%#% `a e f e f e
+ [ `a e f e f e ]
+%%10
+%#% `d `a d `a d `a
+ [ `d `a d `a d `a ]
+%%11
+%#% [^ { `f `d2 } `a d `a { d r4 } `a ]
+ [ `f `a d `a d `a ]
+
+%%12 == 6
+%#% { `d ``bes2 } `e `g `e { `g r4 } `e
+ [ `d `e `g `e `g `e ]
+%13
+%#% { `e ``bes2 } `e `g `e { `g r4 } `e
+ [ `e `e `g `e `g `e ]
+%%14
+%#% { `a `f2 } c f c { f r4 } c
+ [ `a c f c f c ]
+%%15
+ [ `c `g `bes `g `bes `g ]
+%%16
+ [ ``f `c `f `c `f `c ]
+%%17
+%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
+ [ ``a `e `g `e `g `e ]
+%%18
+%#% [^ { `d `d2 } `a d `a { d r4 } `a ]
+ [ `d `a d `a d `a ]
+%%19
+%#% s8 % skip space of `grace note
+%#% [^ { ``bes ``bes2 } `f `bes `f { `bes r4 } `f ]
+ [ ``bes `f `bes `f `bes `f ]
+%%20
+%#% [^ { ``f ``f2 } `c `f `c { `f r4 } `c ]
+ [ ``f `c `f `c `f `c ]
+%%21
+%#% s8 % skip space of `grace note
+%#% [ { `e `c } `g c `g c `g ]
+ { [ `e `c } `g c `g c `g ]
+%%22
+ [ `f `a c `a `f `c ]
+%%23
+%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ]
+ [ ``a `e `g `e `g `e ]
+%%24
+%#% [^ { `d `d2 } `fis `a `fis { `a r4 } `fis]
+ [ `d `fis `a `fis `a `fis ]
+%%25
+%#% s8 % skip space of `grace note
+%#% [^ { ``g ``g2 } `d `b `d { `b r4 } `d]
+ [ ``g `d `b `d `b `d ]
+%%26
+%#% [^ { `d `d2 } `a d `a { d r4 } `a]
+ [ `d `a d `a d `a ]
+%%27
+ { [ `cis ``a } `e `a `e `a `e ]
+%%28
+ [ `d `a d `a d `a ]
+%%29
+%#% [ `d `g @ `bes `g `bes `g ]
+ [ `d `g `bes `g `bes `g ]
+%#%\volta1
+%%30
+ [ `d `fis `a `fis `a `fis ]
+%%31
+ [ `a `e `a `e `a `e ]
+%%32
+ [ `d `fis `a `fis `a `fis ]
+%%33
+ [ `d `g `b `g `b `g ]
+%%34
+ [ `d `fis `a `fis `a `fis ]
+%%35
+ [ `a `e `a `e `a `e ]
+%%36
+ [ `d `fis `a `fis `a `fis ]
+%#%\volta2
+%#%:|
+%%37
+ [ `a `e `g `e ``bes^> `e ]
+%%38
+ [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }
+%%39
+ [ `a `e `g `e ``bes^> `e ]
+%%40
+ [ `a { e cis `a } { e cis `a } { e cis `a } { e cis `a } { e cis `a ] }
+%%41
+ [ `ais `e `gis `e `gis `e ]
+%%42
+ { [ `d ``b } `fis `b `fis `b `fis ]
+%%43
+ { [ `e ``b } `g `b `g `b `g ]
+%%44
+ { [ `d ``b } `fis `b `fis `b `fis ]
+%%45
+%#% s8 % skip space of `grace note
+%#% [^{ ``g ``g2 } `d `b `d { `b r4 } `d]
+ [ ``g `d `b `d `b `d ]
+%%46
+%#% [^ { `d `d2 } `a d `a { d r4 } `a ]
+ [ `d `a d `a d `a ]
+%%47
+ { [ `cis ``a } `e `a `e `a `e ]
+%%48
+ [ `d `fis `a `fis `a `fis ]
+%%49
+ [ `d `a d `a d `a ]
+%%50
+ [ ``g `e `g `e `g `e ]
+%%51
+ [ `a `e `g `e `g `e ]
+%%52
+ [ ``d `d `fis `d `fis `d ]
+%%53
+ [ `d `g `bes `g `bes `g ]
+%%54
+ [ `d `fis `a `fis `a `fis ]
+%%55
+ [ `a `e `g `e `g `e ]
+%%56
+ [ ``d ``a `d ``a `d ``a ]
+%%57
+ [ ``d ``a `d ``a `d ``a ]
+%%58
+ { `d2.^\fermata ``d2. }
+$ }
+
+tekst1 = music {
+ @
+ \duration{4}
+ _ _ _
+ _ _ _
+ _ _ _
+ _ _ _
+ % 5
+ \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8
+ \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
+ Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 }
+ dir;2 _
+ _ _ _
+ _ _ _
+ % 11
+ \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8
+ \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
+ Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 }
+ mir!2 _
+ _ _ _
+ _ _ _
+
+ % 17
+ Fl\"us-8. ternd16 schlan-4. ke8
+ Wip-8. fel16 rau-4. schen8
+ \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8
+ Licht;2.
+ _ _ _
+ _ _ _
+
+ % 23
+ Des8. Ver-16 r\"a-4. ters8
+ feind-8. lich16 Lau-4. schen8
+ \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8
+ nicht.2.
+ _ _ _
+ _ _ _
+
+ % volta 1
+ % 29
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+
+ % volta 2
+ % 37
+ La\ss8. auch16 dir8. die16 Brust8. be-16
+ we- gen, _
+ Lieb-4. chen,8 h\"o-8. re16
+ mich!2 _
+ _ _ _
+ _ _ _
+ Be-8. bend16 harr' ich8 _8
+ dir8. ent-16 ge- gen!8 _8
+ \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8
+ mich!2.
+ % 47
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ % 57
+ _ _ _ _ _ _
+ @
+ }
+
+ tekst2 = music {
+ @
+ \duration{4}
+ _ _ _
+ _ _ _
+ _ _ _
+ _ _ _
+ % 5
+ \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8
+ \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
+ Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 }
+ dich,2 _
+ _ _ _
+ _ _ _
+
+ % 11
+ \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
+ \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
+ Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
+ mich.2 _
+ _ _ _
+ _ _ _
+
+ % 17 ok tot hier
+ Sie-8. ver-16 stehn4. des8
+ Bus-8. ens16 Seh-4. nen,8
+ \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8
+ schmerz,2.
+ _ _ _
+ _ _ _
+
+ % 23
+ R\"uh-8. ren16 mit4. den8
+ Sil-8. ber-16 t\"o-4. nen8
+ \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8
+ Herz.2.
+ _ _ _
+ _ _ _
+
+ % volta 1
+ % 29
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+
+ % volta 2
+ % 37
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % 47
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % _ _ _ _ _ _
+ % 57
+ % _ _ _ _ _ _
+ @
+ }
+
+score {
+ paper {
+ symboltables { table_sixteen }
+ output "standchen.uit"
+ unitspace 2.4 cm
+ % unitspace 4.0 cm % leaves all text stand free
+geometric 1.4
+ }
+ staff {
+ melodic music { melodie }
+ commands {
+ key $bes$
+ clef "violin"
+ }
+ }
+ staff {
+ lyric
+ music { tekst1 }
+ music { tekst2 }
+ }
+ staff {
+ melodic music { begeleiding }
+ commands {
+ key $bes$
+ clef "bass"
+ }
+ }
+ commands {
+ meter 3*4
+ skip 4:0
+ bar ":|"
+ skip 32:0
+ bar ":|"
+ skip 22:0
+ bar "||"
+ }
+}
}
mstaf = staff {
- melodic
+% melodic
+ complex
music { melodie }
commands { clef "violin" }
}
bass_staf = staff {
- melodic
+% melodic
+ complex
music { begeleiding }
commands { clef "bass" }
}
staff { english_staf }
staff { bass_staf }
paper {
- unitspace 2.5cm % a whole note takes 2.5 cm ideally.
+ unitspace 2.5cm
}
commands {
meter 2 * 4
--- /dev/null
+% Mats Bengtsson
+\documentclass[a4paper, 10pt]{article}
+
+% Allow for 8-bit characters:
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+
+\begin{document}
+\input lilyponddefs
+\input titledefs
+
+\def\settext#1{\normalfont #1} % Allow for 8-bit characters
+
+\input lelie.out
+\end{document}
#include "paper.hh"
#include "lookup.hh"
+NAME_METHOD(Bar);
Bar::Bar( String t)
{
type = t;
}
+
Molecule*
Bar::brew_molecule_p()const
{
Symbol s = paper()->lookup_p_->bar(type);
-Molecule* output = new Molecule(Atom(s));
-return output;
-
+ Molecule* output = new Molecule(Atom(s));
+ return output;
}
#include "lookup.hh"
#include "grouping.hh"
+NAME_METHOD(Beam);
+
struct Stem_info {
Real x;
Real idealy;
Beam::add(Stem*s)
{
stems.bottom().add(s);
- s->dependencies.add(this);
+ s->dependencies.push(this);
s->print_flag = false;
}
for (iter_top(stems,i); i.ok(); i++) {
i->set_default_extents();
Stem_info info(i);
- sinfo.add(info);
+ sinfo.push(info);
}
Real leftx = sinfo[0].x;
Least_squares l;
for (int i=0; i < sinfo.size(); i++) {
sinfo[i].x -= leftx;
- l.input.add(Offset(sinfo[i].x, sinfo[i].idealy));
+ l.input.push(Offset(sinfo[i].x, sinfo[i].idealy));
}
l.minimise(slope, left_pos);
for (; s.ok(); s++) {
int f = intlog2(abs(s->flag))-2;
assert(f>0);
- flags.add(f);
+ flags.push(f);
}
int fi =0;
b= cur.generate_beams(flags, fi);
b.insert(0,0);
- b.add(0);
+ b.push(0);
assert(stems.size() == b.size()/2);
}
}
void
-Beam::print()const
+Beam::do_print()const
{
#ifndef NPRINT
- mtor << "{ slope " <<slope << "left ypos " << left_pos;
+ mtor << "slope " <<slope << "left ypos " << left_pos;
Spanner::print();
- mtor << "}\n";
#endif
}
Array<PCol *> retval;
for (iter_top(pscore_.cols,c); c.ok(); c++)
if (c->breakable())
- retval.add(c);
+ retval.push(c);
return retval;
}
void
Col_configuration::add( PCol*c)
{
- cols.add(c);
+ cols.push(c);
}
void
#include "lookup.hh"
#include "clef.hh"
+NAME_METHOD(Clef_item);
+
Clef_item::Clef_item()
{
change = true;
read("violin");
}
+
void
Clef_item::read(String t)
{
--- /dev/null
+#include "keyitem.hh"
+#include "stem.hh"
+#include "rest.hh"
+#include "notehead.hh"
+#include "paper.hh"
+#include "molecule.hh"
+#include "linepstaff.hh"
+#include "complexmelodicstaff.hh"
+#include "sccol.hh"
+#include "localkeyitem.hh"
+#include "request.hh"
+
+const int NO_LINES=5;
+
+
+void
+Complex_melodic_staff::set_output(PScore*ps)
+{
+ theline_l_ = new Linestaff(NO_LINES,ps); // theline_l_ is added to pscore later.
+ Complex_staff::set_output(ps);
+}
+
+Item *
+Complex_melodic_staff::get_TYPESET_item(Command*com)
+{
+ if (com->args[0] == "KEY") {
+ return new Keyitem(NO_LINES); // urgh. depends on clef.
+ } else
+ return Complex_staff::get_TYPESET_item(com);
+}
+
--- /dev/null
+#include "request.hh"
+#include "pscore.hh"
+#include "paper.hh"
+#include "complexstaff.hh"
+#include "sccol.hh"
+#include "debug.hh"
+
+#include "clefitem.hh"
+#include "bar.hh"
+#include "meter.hh"
+
+Item *
+Complex_staff::get_TYPESET_item(Command *com)
+{
+ Item *s=0;
+ Array<Scalar> arg( com->args);
+ String type =arg[0];
+ arg.del(0);
+ if (type == "BAR" ) {
+ s = new Bar(com->args[1]);
+ } else if (type == "METER") {
+ s = new Meter(arg);
+ } else if (type == "CLEF" || type == "CURRENTCLEF") {
+ Clef_item * c = new Clef_item;
+ s = c;
+ c->change = (type == "CLEF");
+ }else{
+ WARN << "ignoring TYPESET command for " << type << '\n';
+ }
+ return s;
+}
+
+
+Interval
+citemlist_width(const Array<Item*> &its)
+{
+ Interval iv ;
+ iv.set_empty();
+
+ for (int j =0; j < its.size(); j++){
+ iv.unite (its[j]->width());
+
+ }
+ return iv;
+}
+
+void
+Complex_column::typeset_item(Item *i, int breakst)
+{
+ assert(i);
+
+ staff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
+ staff_l_->theline_l_,breakst);
+
+ if (breakst == BREAK_PRE - BREAK_PRE) {
+
+ Array<Item*> to_move(
+ staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
+ score_column_l_->pcol_l_->prebreak_p_));
+ Interval column_wid = citemlist_width(to_move);
+ assert(!column_wid.empty());
+
+ for (int j=0; j < to_move.size(); j++) {
+ to_move[j]->translate(Offset(-column_wid.right, 0));
+ }
+ }
+}
+/*
+ UGGGG
+ */
+void
+Complex_column::typeset_item_directional(Item *i, int dir, int breakst) // UGH!
+{
+ assert(i);
+ PCol * c=score_column_l_->pcol_l_;
+ if (breakst == 0)
+ c = c->prebreak_p_;
+ else if (breakst == 2)
+ c = c->postbreak_p_;
+
+ Array<Item*> to_move(staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
+ c));
+ typeset_item(i, breakst);
+
+ Interval column_wid = citemlist_width(to_move);
+ if (column_wid.empty())
+ column_wid = Interval(0,0);
+ i->translate(Offset(column_wid[dir] - i->width()[-dir], 0));
+}
+
+void
+Complex_staff::set_output(PScore* ps )
+{
+ pscore_l_ = ps;
+ pscore_l_->add(theline_l_);
+}
+
+
--- /dev/null
+#include "request.hh"
+#include "voice.hh"
+#include "staffwalker.hh"
+#include "debug.hh"
+#include "clef.hh"
+#include "staff.hh"
+#include "command.hh"
+#include "complexstaff.hh"
+#include "sccol.hh"
+#include "complexwalker.hh"
+
+
+
+Complex_column::Complex_column(Score_column*s, Complex_staff *rs)
+ : Staff_column(s)
+{
+ staff_l_ = rs;
+}
+
+Complex_staff::Complex_staff()
+{
+ theline_l_ = 0;
+}
+
+void
+Complex_column::setup_requests()
+{
+ for (int i = 0 ; i < v_elts.size(); i ++)
+ for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
+
+ if (j->barcheck()) {
+ if (tdescription_->whole_in_measure) {
+ error("Barcheck failed, " + tdescription_->str());
+ }
+ continue;
+ }
+ if (j->mark())
+ continue;
+ if (j->command())
+ continue;
+ todo_l_arr_.push(j);
+ }
+}
+
+Staff_column*
+Complex_staff::create_col(Score_column*s)
+{
+ return new Complex_column(s,this);
+}
+
+void
+Complex_staff::walk()
+{
+ for (Complex_walker sc(this); sc.ok(); sc++) {
+ sc.col()->setup_requests();// TODO
+ sc.process();
+ }
+}
--- /dev/null
+#include "associter.hh"
+#include "script.hh"
+#include "request.hh"
+#include "voice.hh"
+#include "clef.hh"
+#include "pscore.hh"
+#include "complexstaff.hh"
+#include "complexwalker.hh"
+#include "sccol.hh"
+#include "debug.hh"
+#include "keyitem.hh"
+#include "clefitem.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Rhythmic_grouping
+cparse_grouping(Array<Scalar> a, Moment one_beat)
+{
+ Array<int> r;
+ for (int i= 0 ; i < a.size(); i++)
+ r.push(a[i]);
+ Moment here =0.0;
+
+ Array<Rhythmic_grouping*> children;
+ for (int i=0; i < r.size(); i++) {
+
+ Moment last = here;
+ here += one_beat * r[i];
+ children.push(
+ new Rhythmic_grouping(MInterval(last, here), r[i] )
+ );
+ }
+ return Rhythmic_grouping(children);
+}
+
+void
+Complex_walker::do_INTERPRET_command(Command*com)
+{
+ Array<Scalar> args(com->args);
+ args.del(0);
+ if (com->args[0] == "GROUPING") {
+ default_grouping = cparse_grouping(args,
+ col()->tdescription_->one_beat);
+ }else if (com->args[0] == "NEWMEASURE") {
+ local_key_.reset(key_);
+
+ } else if (com->args[0] == "KEY") {
+
+ if (col()->when() > Moment(0)) {
+ assert(!oldkey_undo);
+ oldkey_undo = new Array<int>( key_.oldkey_undo(args));
+ }
+
+ typesetkey = key_.read(args);
+ local_key_.reset(key_);
+ } else if (com->args[0] == "CLEF") {
+ clef_.read(args);
+ } else {
+ WARN << " ignoring INTERPRET command: " << com->args[0]<< "\n";
+ }
+}
+
+void
+Complex_walker::do_TYPESET_command(Command*com)
+{
+ /* ignore these commands if non-default versions have been
+ processed. */
+ if (com->args[0] == "CURRENTKEY")
+ if (processed_key)
+ return;
+ else
+ com->args[0] = "KEY"; // urgh
+
+ if (com->args[0] == "CURRENTCLEF") {
+ if (processed_clef)
+ return;
+ }
+ if (com->args[0] == "BAR") {
+
+ if (processed_bar_priority > com->priority)
+ return;
+ else
+ processed_bar_priority = com->priority;
+ }
+
+ Item* i = staff()->get_TYPESET_item(com);
+ if (!i)
+ return;
+
+ if (com->args[0] == "KEY") {
+ ((Keyitem*) i)->read(clef_);
+ if (oldkey_undo) {
+ ((Keyitem*) i)->read(*oldkey_undo);
+ delete oldkey_undo;
+ oldkey_undo = 0;
+ }
+ processed_key = true;
+
+ ((Keyitem*) i)->read(typesetkey); // ugh
+ }
+
+ if (com->args[0] == "CLEF"||com->args[0] == "CURRENTCLEF") {
+ processed_clef =true;
+ Clef_item*c=(Clef_item*)i;
+ c->read(clef_);
+ c->change = (break_status != BREAK_POST - BREAK_PRE);
+ }
+ col()->typeset_item_directional(i, 1, break_status);
+}
+
+void
+Complex_walker::announce_element(Staff_elem_info info)
+{
+ announce_info_arr_.push(info);
+}
+
+void
+Complex_walker::do_announces()
+{
+
+ for (int i = 0; i < announce_info_arr_.size(); i++){
+ Staff_elem_info info = announce_info_arr_[i];
+ for (iter_top(voice_reg_list_,j); j.ok(); j++) {
+ j->announce_element(info);
+ }
+ group_regs_.announce_element(info);
+ local_key_reg_.acknowledge_element(info);
+ }
+}
+
+Voice_registers *
+Complex_walker::find_voice_reg(Voice*v_l)
+{
+ for (iter_top(voice_reg_list_, i); i.ok(); i++) {
+ if (i->voice_l_ == v_l)
+ return i;
+ }
+
+ Voice_registers *regs_p=new Voice_registers(this,v_l);
+ voice_reg_list_.bottom().add (regs_p);
+ //voice_reg_map_[v_l] = regs_p;
+ return regs_p;
+}
+
+void
+Complex_walker::try_request(Request*req)
+{
+ bool b;
+ if (req->note() || req->rest()|| req->slur()) {
+ Voice *v_l = req->elt_l_->voice_l_;
+ Voice_registers *vregs_l = find_voice_reg(v_l);
+
+ b = vregs_l->try_request(req);
+
+ } else {
+ b = group_regs_.try_request(req);
+ if (!b)
+ b = local_key_reg_.try_request(req);
+ }
+ if (!b)
+ WARN<< "junking request: " <<req->name() <<"\n";
+}
+
+void
+Complex_walker::process_requests()
+{
+ Complex_column*c = col();
+// Complex_staff *s = staff();
+
+ for (int i=0; i < c->todo_l_arr_.size(); i++) {
+ try_request(c->todo_l_arr_[i]);
+ }
+
+ regs_process_requests();
+ do_announces();
+}
+
+void
+Complex_walker::regs_process_requests()
+{
+ for (iter_top(voice_reg_list_,j); j.ok(); j++) {
+ j->process_requests();
+ }
+ group_regs_.process_requests();
+ local_key_reg_.process_request();
+}
+
+void
+Complex_walker::typeset_element(Staff_elem *elem_p)
+{
+ if (elem_p->spanner())
+ pscore_l_->typeset_spanner(elem_p->spanner(), staff()->theline_l_);
+ else
+ col()->typeset_item(elem_p->item());
+}
+
+Complex_walker::Complex_walker(Complex_staff*s)
+ : Staff_walker(s, s->theline_l_->pscore_l_),
+ group_regs_(this),
+ local_key_reg_(this)
+{
+ oldkey_undo = 0;
+ do_post_move();
+}
+
+Complex_staff*
+Complex_walker::staff()
+{
+ return (Complex_staff*) staff_l_;
+}
+
+Complex_column*
+Complex_walker::col()
+{
+ return (Complex_column*) *(*this);
+}
+
+void
+Complex_walker::do_pre_move()
+{
+ for (iter_top(voice_reg_list_,i); i.ok(); i++) {
+ i->pre_move_processing();
+ }
+ group_regs_.pre_move_processing();
+ local_key_reg_.pre_move_processing();
+}
+
+void
+Complex_walker::do_post_move()
+{
+ processed_clef =false;
+ processed_key = false;
+ processed_bar_priority = 0;
+
+ for (iter_top(voice_reg_list_,i); i.ok(); i++) {
+ i->post_move_processing();
+ }
+ announce_info_arr_.set_size(0);
+ group_regs_.post_move_processing();
+ local_key_reg_.post_move_processing();
+}
Command*c = new Command;
c->code = TYPESET;
- c->args.add( "METER");
- c->args.add( n );
- c->args.add( m );
+ c->args.push( "METER");
+ c->args.push( n );
+ c->args.push( m );
c->priority = 40;
return c;
}
{
Command c;
c.code = TYPESET;
- c.args.add("BAR");
- c.args.add("default");
+ c.args.push("BAR");
+ c.args.push("default");
return c;
}
Command c;
c.code = TYPESET;
c.priority = (s=="default") ? 100: 110;
- c.args.add("BAR");
+ c.args.push("BAR");
if(s=="default")
s = "|";
if (s == ":|:") {
no_break_com=post_com=pre_com = c;
- pre_com.args.add( ":|");
- no_break_com.args.add( s);
- post_com.args.add( "|:");
+ pre_com.args.push( ":|");
+ no_break_com.args.push( s);
+ post_com.args.push( "|:");
}else if (s=="|:") {
- c.args.add(s);
+ c.args.push(s);
no_break_com=post_com=c;
} else {
- c.args.add(s);
+ c.args.push(s);
pre_com= no_break_com= c;
}
}
MInterval i(interval());
MInterval r1(i), r2(i);
r1.right = r2.left = i.center();
- r.add(r1); r.add(r2);
+ r.push(r1); r.push(r2);
} else {
for (int i=0; i < children.size(); i++)
- r.add(children[i]->interval());
+ r.push(children[i]->interval());
}
return r;
}
} else {
if (i == starti) {
- ch.add(children[i]);
+ ch.push(children[i]);
} else {
Rhythmic_grouping *newchild=new Rhythmic_grouping(
children.subvec(starti, i+1));
- ch.add(newchild);
+ ch.push(newchild);
}
i ++;
j++;
Moment dt = t.length()/n;
MInterval basic = MInterval(t.left, t.left+dt);
for (int i= 0; i < n; i++)
- children.add(new Rhythmic_grouping( dt*i + basic ));
+ children.push(new Rhythmic_grouping( dt*i + basic ));
}
{
interval_ = (s.interval_)? new MInterval(*s.interval_) : 0;
for (int i=0; i < s.children.size(); i++)
- children.add(new Rhythmic_grouping(*s.children[i]));
+ children.push(new Rhythmic_grouping(*s.children[i]));
}
void
#endif
}
+bool
+Rhythmic_grouping::child_fit_query(Moment start)
+{
+ if (children.size())
+ return ( children.last()->interval().right== start);
+
+ return true;
+}
+
void
Rhythmic_grouping::add_child(Moment start, Moment len)
{
Moment stop = start+len;
- for (int i=0; i < children.size(); i ++) {
- MInterval j=children[i]->interval();
- if (j.left == start && j.right==stop) {
- return;
- }
- }
-
- if (children.size())
- assert ( children.last()->interval().right== start);
- children.add(new Rhythmic_grouping(MInterval(start, stop)));
+ assert(child_fit_query(start));
+ children.push(new Rhythmic_grouping(MInterval(start, stop)));
}
Rhythmic_grouping::Rhythmic_grouping()
Array<int> child_beams;
if (children[i]->interval_) {
int f = flags[flagidx++];
- child_beams.add(f);
+ child_beams.push(f);
} else {
child_beams = children[i]->
generate_beams(flags, flagidx);
}
- children_beams.add(child_beams);
+ children_beams.push(child_beams);
}
Array<int> beams;
int lastm, m, nextm;
if (children_beams[i].size() == 1) {
if (add_right)
- beams.add(m);
+ beams.push(m);
if (add_left)
- beams.add(m);
+ beams.push(m);
} else {
if (add_left)
- beams.add(lastm <? m);
+ beams.push(lastm <? m);
beams.concat(children_beams[i]);
if (add_right)
- beams.add(m <? nextm);
+ beams.push(m <? nextm);
}
lastm = m;
m = nextm;
--- /dev/null
+#include "request.hh"
+#include "beam.hh"
+#include "stem.hh"
+#include "register.hh"
+#include "grouping.hh"
+#include "complexwalker.hh"
+#include "debug.hh"
+#include "complexstaff.hh"
+#include "textspanner.hh"
+
+Stem_beam_register::Stem_beam_register(Complex_walker*w)
+ :Request_register(w)
+{
+ do_post_move_process();
+ current_grouping = 0;
+ beam_p_ = 0;
+}
+
+bool
+Stem_beam_register::try_request(Request*req_l)
+{
+ if ( req_l->beam() ) {
+ if (bool(beam_p_ ) == bool(req_l->beam()->spantype == Span_req::START))
+ return false;
+
+ if (beam_req_l_ && Beam_req::compare(*beam_req_l_ , *req_l->beam()))
+ return false;
+
+ beam_req_l_ = req_l->beam();
+ return true;
+ }
+
+ if ( req_l->stem() ) {
+ if (current_grouping && !current_grouping->child_fit_query(
+ walk_l_->col()->tdescription_->whole_in_measure))
+ return false;
+
+ if (stem_req_l_ && Stem_req::compare(*stem_req_l_, *req_l->stem()))
+ return false;
+
+ stem_req_l_ = req_l->stem();
+ return true;
+ }
+ return false;
+}
+
+void
+Stem_beam_register::process_request()
+{
+ if (beam_req_l_) {
+ if (beam_req_l_->spantype == Span_req::STOP)
+ end_beam_b_ = true;
+ else {
+ beam_p_ = new Beam;
+// walk_l_->announce_element(Staff_elem_info(beam_p_, ))
+ current_grouping = new Rhythmic_grouping;
+ if (beam_req_l_->nplet) {
+ Text_spanner* t = new Text_spanner();
+ t->set_support(beam_p_);
+ t->spec.align_i_ = 0;
+ t->spec.text_str_ = beam_req_l_->nplet;
+ walk_l_->typeset_element(t);
+ }
+
+ }
+ }
+
+ if (stem_req_l_) {
+ stem_p_ = new Stem(4);
+ if (current_grouping)
+ current_grouping->add_child(
+ walk_l_->col()->tdescription_->whole_in_measure,
+ stem_req_l_->duration());
+
+ stem_p_->flag = stem_req_l_->balltype;
+
+ if (beam_p_) {
+ beam_p_->add(stem_p_);
+ stem_p_->print_flag = false;
+ } else {
+ stem_p_->print_flag = true;
+ }
+
+ walk_l_->announce_element(Staff_elem_info(stem_p_,
+ stem_req_l_, this));
+ }
+}
+
+void
+Stem_beam_register::acknowledge_element(Staff_elem_info info)
+{
+ if (!stem_p_)
+ return;
+
+ if (info.elem_p_->name() == String("Notehead") &&
+ stem_req_l_->duration() == info.req_l_->rhythmic()->duration())
+
+ stem_p_->add((Notehead*)info.elem_p_);
+}
+
+void
+Stem_beam_register::do_pre_move_process()
+{
+ if (stem_p_) {
+ walk_l_->typeset_element(stem_p_);
+ stem_p_ = 0;
+ }
+ if (beam_p_ && end_beam_b_) {
+ walk_l_->default_grouping.extend(current_grouping->interval());
+ beam_p_->set_grouping(walk_l_->default_grouping, *current_grouping);
+ walk_l_->typeset_element(beam_p_);
+ delete current_grouping;
+ current_grouping = 0;
+ beam_p_ = 0;
+ }
+ end_beam_b_ = false;
+}
+void
+Stem_beam_register::do_post_move_process()
+{
+ stem_p_ = 0;
+ beam_req_l_ = 0;
+ stem_req_l_ = 0;
+ end_beam_b_ = false;
+}
+
+Stem_beam_register::~Stem_beam_register()
+{
+ if (beam_p_)
+ error("unterminated beam");
+}
get_partial_command(Moment u)
{
Input_command*c = new Input_command;
- c->args.add("PARTIAL");
- c->args.add(u);
+ c->args.push("PARTIAL");
+ c->args.push(u);
return c;
}
get_goto_command(String s)
{
Input_command*c = new Input_command;
- c->args.add("GOTO");
- c->args.add(s);
+ c->args.push("GOTO");
+ c->args.push(s);
return c;
}
{
Input_command*c = new Input_command;
- c->args.add("CADENZA");
- c->args.add(i);
+ c->args.push("CADENZA");
+ c->args.push(i);
return c;
}
Input_command*
get_grouping_command(Array<int>a )
{
Input_command*c = new Input_command;
- c->args.add("GROUPING");
+ c->args.push("GROUPING");
for (int i=0; i < a.size(); i ++)
- c->args.add(a[i]);
+ c->args.push(a[i]);
return c;
}
get_key_interpret_command(Array<int >a )
{
Input_command*c = new Input_command;
- c->args.add("KEY");
+ c->args.push("KEY");
for (int i=0; i < a.size(); i ++) {
- c->args.add(a[i]);
+ c->args.push(a[i]);
}
return c;
}
get_reset_command()
{
Input_command*c = new Input_command;
- c->args.add("RESET");
+ c->args.push("RESET");
return c;
}
{
Input_command*c = new Input_command;
- c->args.add( "METER");
- c->args.add( n );
- c->args.add( m );
+ c->args.push( "METER");
+ c->args.push( n );
+ c->args.push( m );
return c;
}
get_newmeasure_command()
{
Input_command*c = new Input_command;
- c->args.add( "NEWMEASURE");
+ c->args.push( "NEWMEASURE");
return c;
}
{
Input_command*c = new Input_command;
- c->args.add( "SKIP");
- c->args.add( n );
- c->args.add( m );
+ c->args.push( "SKIP");
+ c->args.push( n );
+ c->args.push( m );
return c;
}
get_clef_interpret_command(String w)
{
Input_command*c = new Input_command;
- c->args.add("CLEF");
- c->args.add(w);
+ c->args.push("CLEF");
+ c->args.push(w);
return c;
}
get_bar_command(String w)
{
Input_command*c = new Input_command;
- c->args.add("BAR");
- c->args.add(w);
+ c->args.push("BAR");
+ c->args.push(w);
return c;
}
Array<int> s;
if (!(count % 3 )) {
for (int i=0; i < count/3; i++)
- s.add(3);
+ s.push(3);
} else if (!(count %2)) {
for (int i=0; i < count/2; i++)
- s.add(2);
+ s.push(2);
}else {
- s.add(2);
+ s.push(2);
s.concat(get_default_grouping(count-2));
}
return s;
Array<Staff*> parsed_staffs;
for (iter_top(staffs_,i); i.ok(); i++) {
Staff* staf_p=i->parse(s_p);
- parsed_staffs.add(staf_p);
+ parsed_staffs.push(staf_p);
s_p->add(staf_p);
}
int j = 0;
#include "melodicstaff.hh"
#include "rhythmstaff.hh"
#include "lyricstaff.hh"
+#include "complexmelodicstaff.hh"
#include "staff.hh"
void
Input_staff::parse(Score*score_l)
{
Staff *p=0;
-
- if (type == "melodic")
+
+ if (type == "complex")
+ p = new Complex_melodic_staff;
+ else if (type == "melodic")
p = new Melodic_staff;
else if (type == "rhythmic")
p = new Rhythmic_staff;
else if (type == "lyric")
p = new Lyric_staff;
+ else
+ error("Unknown staff-type `" + type +"\'");
+
p->score_l_ = score_l;
p->define_spot_str_ = define_spot_str_;
#include "debug.hh"
#include "item.hh"
+NAME_METHOD(Item);
+
Item::Item()
{
pcol_l_ = 0;
}
void
-Item::print() const
+Item::do_print() const
{
#ifndef NPRINT
- mtor << "item " ;
- Staff_elem::print();
+ mtor << "(unknown)";
#endif
-
}
int small = s[i++];
accidentals[large]=small;
- newkey.add(large);
- newkey.add(small);
+ newkey.push(large);
+ newkey.push(small);
}
return newkey;
}
}
for (int i=0; i < newkey.size(); i++)
if (accidentals[i] && accidentals[i] != newkey[i]) {
- oldkey.add(i);
- oldkey.add(0);
+ oldkey.push(i);
+ oldkey.push(0);
}
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
-
+NAME_METHOD(Keyitem);
Keyitem::Keyitem(int c)
{
c_position = c;
(a>0 && p>SHARP_TOP_PITCH)) {
p=p-7; /* Typeset below c_position */
}
- pitch.add(p);
- acc.add(a);
+ pitch.push(p);
+ acc.push(a);
}
%option yylineno
%option debug
%option yyclass="My_flex_lexer"
+%option stack
+
%x notes
%x incl
%x quote
AN {AA}|{N}
PUNCT [?!,.:;]
ACCENT [\\'"^]
-TEX {AA}|-|{PUNCT}|{ACCENT}
+NATIONAL [\241-\377]
+TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
WORD {A}{AN}*
ALPHAWORD {A}+
%%
\$ {
- BEGIN(notes);
+ yy_push_state(notes);
}
\@ {
- BEGIN(lyrics);
+ yy_push_state(lyrics);
}
<notes>{RESTNAME} {
return IDENTIFIER;
}
String *sp = new String( c);
-
yylval.string=sp;
- return NEWIDENTIFIER;
+ return STRING;
}
<notes>{PITCHMOD} {
}
<notes>\$ {
- BEGIN(INITIAL);
+ yy_pop_state();
}
-<notes>[{}] {
- return YYText()[0];
-
-}
-<notes>\"[^\"]*\" {
+<notes>\"[^"]*\" {
String s (YYText()+1);
s = s.left(s.len()-1);
yylval.string = new String(s);
}
\" {
- BEGIN(quote);
+ yy_push_state(quote);
}
-<quote>[^\"]* {
+<quote>[^"]* {
yylval.string = new String (YYText());
}
<quote>\" {
mtor << "quoted string\n";
- BEGIN(INITIAL);
+ yy_pop_state();
return STRING;
}
return l;
/* let's try passing tex's typesetting macros like \ss \alpha \c */
- String* str_p = new String(YYText());
+ String* str_p = new String(YYText());//huh?
return STRING;
/* and skip identifiers...
String *sp = new String( c);
yylval.string=sp;
- return NEWIDENTIFIER;
+ return STRING;
*/
}
-<lyrics>\"[^\"]*\" {
+<lyrics>\"[^"]*\" {
String s (YYText()+1);
s = s.left(s.len()-1);
yylval.string = new String(s);
<lyrics>[ \t\n]+ {
}
<lyrics>@ {
- BEGIN(INITIAL);
+ yy_pop_state();
}
<<EOF>> {
}
-include { BEGIN(incl); }
+include {
+ yy_push_state(incl);
+}
<incl>[ \t]* { /* eat the whitespace */ }
<incl>\"[^"]*\"+ { /* got the include file name */
String s (YYText()+1);
s = s.left(s.len()-1);
new_input(s);
- BEGIN(INITIAL);
+ yy_pop_state();
}
String *sp = new String( c);
mtor << "new id: " << *sp << eol;
yylval.string=sp;
- return NEWIDENTIFIER;
+ return STRING;
}
{REAL} {
return lexer;
}
-void
-kill_lexer()
-{
- delete lexer;
- lexer = 0;
-}
-
-void
-set_lexer()
-{
- if (!lexer) {
- lexer = new My_flex_lexer;
- lexer->set_debug( !monitor.silence("Lexer") && check_debug);
- }
-}
-
Input_file::Input_file(String s)
{
name = s;
}
for (int i = 0; i < cols.size(); i++)
if (cols[i].fixed())
- fixed.add(i);
+ fixed.push(i);
for (int i = 0; i < cols.size(); i++) {
bool c=false;
for (int j =0; j<fixed.size(); j++)
Array<Real> posns(sol);
- posns.add(lp.eval(sol));
+ posns.push(lp.eval(sol));
return posns;
}
Spacing_problem::add_column(const PCol *col, bool fixed, Real fixpos)
{
Colinfo c(col,(fixed)? &fixpos : 0);
- cols.add(c);
+ cols.push(c);
}
void
if (!contains(l) || !contains(r)) {
return;
}
- ideals.add(i);
+ ideals.push(i);
}
void
#include "scalar.hh"
#include "lookup.hh"
#include "paper.hh"
+#include "request.hh"
#include "notehead.hh"
+
+NAME_METHOD(Local_key_item);
Local_key_item::Local_key_item(int i)
{
c0_position = i;
}
-
void
-Local_key_item::add (int o, int p , int a,Notehead*head_p)
+Local_key_item::add(Item*head_l)
+{
+ group.push(head_l);
+ dependencies.push(head_l);
+}
+void
+Local_key_item::add(Melodic_req*m_l)
+{
+ add(m_l->octave, m_l->notename, m_l->accidental);
+}
+void
+Local_key_item::add (int o, int p , int a)
{
Local_acc l;
l.octave = o;
l.name = p;
l.acc = a;
- accs.add(l);
- group.add(head_p);
- dependencies.add(head_p);
+ accs.push(l);
}
void
{
accs.sort(Local_acc::compare);
}
+
Molecule*
Local_key_item::brew_molecule_p()const
{
-
- Molecule* output = new Molecule;
+ Molecule* output = new Molecule;
Molecule*octmol = 0;
int lastoct = -100;
for (int i = 0; i < accs.size(); i++) {
output->add(*octmol);
delete octmol;
}
+
+ Interval head_width;
+ for (int i = 0; i < group.size(); i++) {
+ head_width.unite(group[i]->width());
+ }
+ output->translate(Offset(-output->extent().x.right + head_width.left ,0));
+
return output;
}
{
Array<String> a;
- a.add(text);
+ a.push(text);
Symbol tsym = (*symtables_)("style")->lookup(style);
a[0] = substitute_args(tsym.tex,a);
Symbol ret = (*symtables_)("streepjes")->lookup(idx);
Array<String> a;
- a.add(arg);
+ a.push(arg);
ret.tex = substitute_args(ret.tex, a);
return ret;
s.dim.y = Interval(0,dy);
Array<String> a;
- a.add(lines);
- a.add(print_dimen(wid));
+ a.push(lines);
+ a.push(print_dimen(wid));
s.tex = (*symtables_)("param")->lookup("linestaf").tex;
s.tex = substitute_args(s.tex, a);
s.dim.y = Interval(y1,y2);
Array<String> a;
- a.add(print_dimen(y1));
- a.add(print_dimen(y2));
+ a.push(print_dimen(y1));
+ a.push(print_dimen(y2));
String src = (*symtables_)("param")->lookup("stem").tex;
s.tex = substitute_args(src,a);
#include "staffwalker.hh"
#include "debug.hh"
#include "staff.hh"
-#include "command.hh"
-//#include "simplestaff.hh"
+//#include "command.hh"
#include "lyricstaff.hh"
#include "lyriccolumn.hh"
#include "sccol.hh"
-//#include "simplewalker.hh"
#include "pscore.hh"
-#include "paper.hh"
+//#include "paper.hh"
Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
}
void
-Lyric_column::process_requests()
+Lyric_column::setup_requests()
{
for (int i = 0 ; i < v_elts.size(); i ++) {
for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
error("Barcheck failed, " + tdescription_->str());
}
}
-#if 0
- if (req_l->rhythmic()){
- notes.add(rq->rhythmic());
- }
-#endif
if (req_l->lreq_l()) {
- winfo_array_.add(req_l->lreq_l());
+ winfo_array_.push(req_l->lreq_l());
}
}
}
Lyric_staff::walk()
{
for (Lyric_walker lcols(this); lcols.ok(); lcols++) {
- lcols.lcol_l()->process_requests();// TODO
+ lcols.lcol_l()->setup_requests();// TODO
lcols.process();
}
}
-Staff *
-get_new_lyricstaff()
-{
- return new Lyric_staff;
-}
// or should we first devide lily/src up ?
// HWN: huh?
-#include "textspanner.hh"
-#include "script.hh"
#include "request.hh"
#include "voice.hh"
#include "pscore.hh"
Lyric_staff*
Lyric_walker::lstaff_l()
{
- return (Lyric_staff*)staff_;
+ return (Lyric_staff*)staff_l_;
}
Lyric_column*
"LilyPond, a music typesetter.\n"
"Copyright (C) 1996,97 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
+ "Contributors\n"
" Jan-Nieuwenhuizen <jan@digicash.com>\n"
+ " Mats Bengtsson <matsb@s3.kth.se>\n"
"\n"
" This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License version 2\n"
struct Main_init {
Main_init() {
path = new File_path(LIBDIR);
- path->add(String(LIBDIR)+"init/");
+ path->push(String(LIBDIR)+"init/");
debug_init();
}
~Main_init() {
exit(0);
break;
case 'I':
- path->add(oparser.optarg);
+ path->push(oparser.optarg);
break;
case 'h':
help();
#include "paper.hh"
#include "molecule.hh"
#include "linepstaff.hh"
-#include "rhythmstaff.hh"
+//#include "rhythmstaff.hh"
#include "sccol.hh"
#include "localkeyitem.hh"
#include "request.hh"
Notehead*
Melodic_staff::get_notehead(Note_req *rq, int bottom)
{
- int b = rq->rhythmic()->balltype;
- int d = rq->rhythmic()->dots;
-
Notehead *n =new Notehead((NO_LINES-1)*2);
- n->balltype =b;
- n->dots = d;
+ n->set_rhythmic(rq->rhythmic());
n->position = rq->note()->height() + bottom;
return n;
}
}
Stem *
-Melodic_staff::get_stem(Stem_req*rq, Moment dur)
+Melodic_staff::get_stem(Stem_req*rq)
{
- Stem * s = new Stem(NO_LINES-1, dur);
- s->flag = rq->stem_number;
+ Stem * s = new Stem(NO_LINES-1);
+ s->flag = rq->balltype;
return s;
}
-/*
- creation
- */
-Staff *
-get_new_melodicstaff()
-{
- return new Melodic_staff;
-}
-
Rest*
Melodic_staff::get_rest(Rest_req*rq)
{
#include "meter.hh"
#include "paper.hh"
#include "lookup.hh"
-
+NAME_METHOD(Meter);
Meter::Meter(Array<Scalar>a)
:args(a)
{
// whugh.. Hard coded...
String s("\\placebox{%}{%}{%}");
Array<String> a;
- a.add(print_dimen(off.y));
- a.add(print_dimen(off.x));
- a.add(sym.tex);
+ a.push(print_dimen(off.y));
+ a.push(print_dimen(off.x));
+ a.push(sym.tex);
return substitute_args(s, a);
}
"goto", GOTO,
"in", IN,
"key", KEY,
- "lyric", LYRIC,
"mark", MARK,
- "melodic", MELODIC,
"meter", METER,
"mm", MM,
"octave", OCTAVECOMMAND,
"paper", PAPER,
"plet", PLET,
"pt", PT,
- "rhythmic", RHYTHMIC,
"score", SCORE,
"script", SCRIPT,
"skip", SKIP,
int dur = duration[0];
int dots=duration[1];
-
- Note_req * rq = new Note_req;
if (dur >= 2) {
- Stem_req * st = new Stem_req(dur);
+ Stem_req * st = new Stem_req(dur,dots);
+ st->plet_factor = Moment(default_plet_dur, default_plet_type);
v->add(st);
}
+ Note_req * rq = new Note_req;
+
int oct;
bool forceacc;
parse_pitchmod(pitch, i, oct, forceacc);
- rq->name =notename[0];
+ rq->notename =notename[0];
rq->accidental = notename[1];
rq->octave = oct;
rq->forceacc = forceacc;
case '|':
ret = new Barcheck_req;
break;
+
case '[':
case ']':
{
}
break;
+
case ')':
case '(':
ret = new Slur_req;
break;
default:
-
break;
}
#include "paper.hh"
#include "lookup.hh"
#include "molecule.hh"
+#include "request.hh"
+NAME_METHOD(Notehead);
Notehead::Notehead(int ss)
{
dots = 0;
extremal = 0;
}
-
void
-Notehead::print()const
+Notehead::set_rhythmic(Rhythmic_req*r_req_l)
+{
+ balltype = r_req_l->balltype;
+ dots = r_req_l->dots;
+}
+
+void
+Notehead::do_print()const
{
#ifndef NPRINT
- mtor << "Head "<< balltype << ", position = "<< position
+ mtor << "balltype "<< balltype << ", position = "<< position
<< "dots " << dots;
- Item::print();
#endif
}
out->add(sm);
}
-
out->translate(Offset(0,dy*position));
}
Array<Request*> pre_reqs, post_reqs;
sstack<String> define_spots;
-
+extern bool want_beam;
Paperdef*default_paper();
+
%}
%token VOICE STAFF SCORE TITLE BAR NOTENAME OUTPUT
%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
%token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
-o%token KEY CLEF MULTI TABLE CHORD VOICES
-%token PARTIAL RHYTHMIC MELODIC MUSIC LYRIC GROUPING CADENZA
+%token KEY CLEF MULTI TABLE CHORD VOICES
+%token PARTIAL MUSIC GROUPING CADENZA
%token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
%token MARK GOTO
%token <id> IDENTIFIER
-%token <string> NEWIDENTIFIER
%token <string> PITCHMOD DURATION RESTNAME
%token <ii> NOTENAME
%token <real> REAL
;
declarable_identifier:
- NEWIDENTIFIER { $$ = $1; }
+ STRING { $$ = $1; }
| IDENTIFIER { $$ = new String($1->name); }
;
score_commands_body: { $$ = new Array<Input_command*>; }
| score_commands_body score_command {
- $$->add($2);
+ $$->push($2);
}
| score_commands_body position_command {
- $$->add($2);
+ $$->push($2);
}
;
staff_commands_body:
/* empty */ { $$ = new Array<Input_command*>; }
| staff_commands_body staff_command {
- $$->add($2);
+ $$->push($2);
}
| staff_commands_body position_command {
- $$->add($2);
+ $$->push($2);
}
;
staff_init:
IDENTIFIER { $$ = $1->staff(true); }
- | RHYTHMIC {
- $$ = new Input_staff("rhythmic");
- }
- | MELODIC {
- $$ = new Input_staff( "melodic");
- }
- | LYRIC {
- $$ = new Input_staff( "lyric");
+ | STRING {
+ $$ = new Input_staff(*$1);
+ delete $1;
}
;
assert(post_reqs.empty());
}
| post_requests post_request {
- post_reqs.add($2);
+ post_reqs.push($2);
}
;
| script_req
| textscript_req
;
+
close_request_parens:
'(' { $$='('; }
- |']' { $$ = ']' }
+ |']' { $$=']'; }
;
open_request_parens:
- ')' {$$=')'}
- |'[' {$$='['}
+ ')' { $$=')'; }
+ |'[' { $$='['; }
;
script_definition:
pre_requests:
| pre_requests pre_request {
- pre_reqs.add($2);
+ pre_reqs.push($2);
}
;
$$ = new Array<int>;
}
| pitch_list NOTENAME {
- $$->add($2[0]);
- $$->add($2[1]);
+ $$->push($2[0]);
+ $$->push($2[1]);
}
;
$$ = new Array<int>;
}
| int_list int {
- $$->add($2);
+ $$->push($2);
}
;
parse_file(String s)
{
*mlog << "Parsing ... ";
+ lexer = new My_flex_lexer;
#ifdef YYDEBUG
yydebug = !monitor.silence("InitParser") && check_debug;
+ lexer->set_debug( !monitor.silence("InitLexer") && check_debug);
#endif
- set_lexer();
lexer->new_input("symbol.ini");
yyparse();
#ifdef YYDEBUG
yydebug = !monitor.silence("Parser") && check_debug;
+ lexer->set_debug( !monitor.silence("Lexer") && check_debug);
#endif
lexer->new_input(s);
yyparse();
- kill_lexer();
+ delete lexer;
+ lexer = 0;
+
assert(define_spots.empty());
}
assert(ps && pc);
for (iter_top(pc->its,i); i.ok(); i++){
if (i->pstaff_l_ == ps)
- ret.add((Item*)(const Item*)i);
+ ret.push((Item*)(const Item*)i);
}
return ret;
}
void
Mixed_qp::add_fixed_var(int i, Real r)
{
- eq_cons.add(i);
- eq_consrhs.add(r);
+ eq_cons.push(i);
+ eq_consrhs.push(r);
}
void
Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
{
- cons.add(c);
- consrhs.add(r);
+ cons.push(c);
+ consrhs.push(r);
}
Ineq_constrained_qp::Ineq_constrained_qp(int novars):
Real R=cons[i] * sol- consrhs[i];
assert(R> -EPS);
if (R < EPS)
- binding.add(i);
+ binding.push(i);
}
// KKT check...
// todo
Array<int> allcons;
for (int i=0; i < opt->cons.size(); i++)
- allcons.add(0);
+ allcons.push(0);
for (int i=0; i < active.size(); i++) {
int j = active[i];
allcons[j]++;
{
// add indices
int cidx=inactive[k];
- active.add(cidx);
+ active.push(cidx);
inactive.swap(k,inactive.size()-1);
inactive.pop();
int q=active.size()-1;
// drop indices
- inactive.add(active[k]);
+ inactive.push(active[k]);
active.swap(k,q);
A.swap_rows(k,q);
active.pop();
opt(op)
{
for (int i=0; i < op->cons.size(); i++)
- inactive.add(i);
+ inactive.push(i);
Choleski_decomposition chol(op->quad);
H=chol.inverse();
}
--- /dev/null
+#include "voice.hh"
+#include "request.hh"
+#include "register.hh"
+#include "notehead.hh"
+#include "complexwalker.hh"
+#include "localkeyitem.hh"
+
+Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l,
+ Request_register *reg_l)
+{
+ elem_p_ = s_l;
+ voice_l_ = r_l->elt_l_->voice_l_;
+ req_l_ = r_l;
+ group = 0;
+ origin_reg_l_ = reg_l;
+}
+Staff_elem_info::Staff_elem_info()
+{
+ elem_p_ = 0;
+ voice_l_ = 0;
+ group = 0;
+ origin_reg_l_ = 0;
+ req_l_ = 0;
+}
+/****************/
+
+Request_register::Request_register()
+{
+ walk_l_=0;
+}
+
+Request_register::Request_register(Complex_walker*w_l)
+{
+ walk_l_=w_l;
+}
+
+void
+Request_register::pre_move_processing()
+{
+ do_pre_move_process();
+ accepted_req_arr_.set_size(0);
+}
+void
+Request_register::post_move_processing()
+{
+ do_post_move_process();
+}
+
+
+/****************/
+
+Local_key_register::Local_key_register(Complex_walker*w)
+ : Request_register(w)
+{
+ key_item_p_ = 0;
+}
+bool
+Local_key_register::try_request(Request*)
+
+{
+ return false;
+}
+
+void
+Local_key_register::process_request()
+{
+}
+void
+Local_key_register::do_pre_move_process()
+{
+ if (key_item_p_) {
+ walk_l_->typeset_element(key_item_p_);
+ key_item_p_ = 0;
+ }
+}
+void
+Local_key_register::acknowledge_element(Staff_elem_info info)
+{
+ if (info.req_l_->melodic()) {
+ Melodic_req * melodic_l_ = info.req_l_->melodic();
+
+ if( melodic_l_->forceacc ||
+ walk_l_->local_key_.oct(melodic_l_->octave).acc(melodic_l_->notename)
+ != melodic_l_->accidental) {
+ Item * support_l_ = info.elem_p_->item();
+
+
+ if (!key_item_p_) {
+ key_item_p_ = new Local_key_item(-2);
+ key_item_p_->c0_position = walk_l_->clef_.c0_pos;
+ }
+
+ key_item_p_->add(melodic_l_);
+ key_item_p_->add(support_l_);
+ walk_l_->local_key_.oct(melodic_l_->octave)
+ .set(melodic_l_->notename, melodic_l_->accidental);
+ }
+ }
+}
#include "inputcommand.hh"
-#define VIRTUALCONS(T,R) R *T::clone() const { return new T(*this); } struct T
-#define RCONS(T) VIRTUALCONS(T, Request)
-
-RCONS(Rest_req);
-RCONS(Barcheck_req);
-RCONS(Text_req);
-RCONS(Rhythmic_req);
-RCONS(Lyric_req);
-RCONS(Mark_req);
-RCONS(Stem_req);
-RCONS(Script_req);
-RCONS(Note_req);
-RCONS(Melodic_req);
-RCONS(Span_req);
-RCONS(Slur_req);
-RCONS(Beam_req);
-RCONS(Staff_command_req);
-
void
-Stem_req::print() const
+Stem_req::do_print() const
+{
+ Rhythmic_req::do_print();
+}
+
+Stem_req::Stem_req(int s, int d)
+ : Rhythmic_req(s,d)
{
- mtor << "Stem\n";
}
+
/****************/
void
-Barcheck_req::print() const
+Barcheck_req::do_print() const
{
#ifndef NPRINT
- mtor << "Barcheck\n";
+
#endif
}
+
/****************/
+
void
-Request::print() const
+Request::print() const
+
+{
+ mtor << name() << " {";
+ do_print();
+ mtor << "}\n";
+}
+
+
+void
+Request::do_print() const
{
#ifndef NPRINT
- mtor << "Req{ unknown }\n";
#endif
}
void
-Span_req::print() const
+Span_req::do_print() const
{
#ifndef NPRINT
- mtor << "Span_req {" << spantype << "}\n";
+ mtor << spantype ;
#endif
}
/****************/
Melodic_req::Melodic_req()
{
- name = 0;
+ notename = 0;
octave = 0;
accidental = 0;
forceacc = false;
}
void
-Melodic_req::print() const
+Melodic_req::do_print() const
{
- mtor << "note: " << name << " oct: "<< octave;
+ mtor << "notename: " << notename << " oct: "<< octave;
}
int
Melodic_req::height() const
{
- return name + octave*7;
+ return notename + octave*7;
}
/****************/
+int
+Rhythmic_req::compare(const Rhythmic_req &r1, const Rhythmic_req &r2)
+{
+ return r1.duration() - r2.duration();
+}
+Rhythmic_req::Rhythmic_req(int b, int d)
+{
+ plet_factor = 1;
+ balltype = b;
+ dots = d;
+}
+
Rhythmic_req::Rhythmic_req()
{
plet_factor = 1;
}
void
-Rhythmic_req::print() const
+Rhythmic_req::do_print() const
{
- mtor << "rhythmic: " << balltype ;
+ mtor << "ball: " << balltype ;
int d =dots;
while (d--)
mtor << '.';
}
void
-Lyric_req::print() const
-{
- mtor << "lyric: ";
- Rhythmic_req::print();
- Text_req::print();
+Lyric_req::do_print() const
+{
+ Rhythmic_req::do_print();
+ Text_req::do_print();
}
/****************/
void
-Note_req::print() const
+Note_req::do_print() const
{
- Melodic_req::print();
- Rhythmic_req::print();
+ Melodic_req::do_print();
+ Rhythmic_req::do_print();
}
/****************/
void
-Rest_req::print() const
+Rest_req::do_print() const
{
- mtor << "rest, " ;
- Rhythmic_req::print();
+ Rhythmic_req::do_print();
}
+
/****************/
Beam_req::Beam_req()
{
nplet = 0;
}
+
+void Beam_req::do_print()const{}
/****************/
+void Slur_req::do_print()const{}
+/****************/
+int
+Span_req:: compare(const Span_req &r1, const Span_req &r2)
+{
+ return r1.spantype - r2.spantype;
+}
+
Span_req::Span_req()
{
spantype = NOSPAN;
}
void
-Script_req::print() const
+Script_req::do_print() const
{
mtor << " dir " << dir ;
scriptdef->print();
}
void
-Text_req::print() const
+Text_req::do_print() const
{
mtor << " dir " << dir_i_ ;
tdef_p_->print();
}
void
-Mark_req::print()const
+Mark_req::do_print()const
{
#ifndef NDEBUG
- mtor<< "Mark `" << mark_str_ << "\'\n";
+ mtor<< " `" << mark_str_ << "\'\n";
#endif
}
/****************/
com_p_ = new Input_command(*src.com_p_);
}
void
-Staff_command_req::print()const
+Staff_command_req::do_print()const
{
- mtor << "Command request: " ;
com_p_->print();
}
balltype = t;
dots = d;
}
+NAME_METHOD(Rest);
void
-Rest::print()const
+Rest::do_print()const
{
+#ifndef NPRINT
mtor << "Rest "<<balltype<< "dots " << dots;
Item::print();
+#endif
}
Molecule*
Notehead*
Rhythmic_staff::get_notehead(Note_req *rq, int)
{
- int b = rq->rhythmic()->balltype;
- int d = rq->rhythmic()->dots;
-
Notehead *n =new Notehead(1);
- n->balltype = b;
- n->dots =d;
+ n->set_rhythmic(rq->rhythmic());
n->position = 0;
return n;
}
Stem *
-Rhythmic_staff::get_stem(Stem_req*rq, Moment l)
+Rhythmic_staff::get_stem(Stem_req*rq)
{
- Stem * s = new Stem(0,l);
- s->flag = rq->stem_number;
+ Stem * s = new Stem(0);
+ s->flag = rq->balltype;
return s;
}
-
-/*
- creation
- */
-Staff *
-get_new_rhythmstaff()
-{
- return new Rhythmic_staff;
-}
-
if (d == durations[i])
return ;
}
- durations.add(d);
+ durations.push(d);
}
void
add_score(Input_score * s)
{
- score_array_global.add(s);
+ score_array_global.push(s);
}
#include "molecule.hh"
#include "lookup.hh"
-Script::Script(Script_req* rq, Item*i , int staflen, Stem*st_l)
+NAME_METHOD(Script);
+
+void
+Script::set_stem(Stem*st_l)
{
- dependencies.add(st_l);
- dependencies.add(i);
-
+ stem_l_ = st_l;
+ dependencies.push(st_l);
+}
+
+void
+Script::set_support(Item*i)
+{
+ support.push(i);
+ dependencies.push(i);
+}
+
+Script::Script(Script_req* rq, int staflen)
+{
staffsize =staflen;
specs_l_ = rq->scriptdef;
- support= i;
- stem_l_ = st_l;
+ stem_l_ = 0;
pos = 0;
symdir=1;
dir =rq->dir;
}
}
+Interval
+Script::support_height() const return r;
+{
+ for (int i=0; i < support.size(); i++)
+ r.unite(support[i]->height());
+}
+
void
Script::set_default_pos()
{
int d = specs_l_->staffdir;
Real y ;
if (!d) {
- Interval v= support->height();
+ Interval v= support_height();
y = v[dir] -dy[-dir] + 2*dir*inter_f;
} else {
Real y = (d > 0) ? staffsize + 2: -2; // ug
y *=inter_f;
- Interval v= support->height();
+ Interval v= support_height();
if (d > 0) {
y = y >? v.max();
staff_l_ = rs;
beam_ = 0;
text_=0;
- lreq_p_ = 0;
+
}
Simple_staff::Simple_staff()
theline_l_ = 0;
}
-/**
- accept:
-
- BREAK: all
- TYPESET: bar, meter,
-Scalar
- */
-
void
-Simple_column::process_requests()
+Simple_column::setup_requests()
{
for (int i = 0 ; i < v_elts.size(); i ++)
for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
}
}
if (rq->rhythmic()){
- notes.add(rq->rhythmic());
+ notes.push(rq->rhythmic());
}
if (rq->script()) {
- notes.last().scripts.add(rq->script());
+ notes.last().scripts.push(rq->script());
}
if (rq->stem()) {
stem_ = rq->stem();
if (rq->text()) {
text_ = rq->text();
}
-#if 0
- if (rq->lreq_l()) {
- lreq_p_ = rq->lreq_l();
- }
-#endif
if (rq->beam()) {
beam_ = rq->beam();
}
if (rq->slur()) {
- slurs.add(rq->slur());
+ slurs.push(rq->slur());
}
}
}
Simple_staff::walk()
{
for (Simple_walker sc(this); sc.ok(); sc++) {
- sc.col()->process_requests();// TODO
+ sc.col()->setup_requests();// TODO
sc.process();
}
}
#include "slur.hh"
#include "localkeyitem.hh"
#include "textitem.hh"
-#include "lyricitem.hh"
+
Rhythmic_grouping
parse_grouping(Array<Scalar> a, Moment one_beat)
{
Array<int> r;
for (int i= 0 ; i < a.size(); i++)
- r.add(a[i]);
+ r.push(a[i]);
Moment here =0.0;
Array<Rhythmic_grouping*> children;
Moment last = here;
here += one_beat * r[i];
- children.add(
+ children.push(
new Rhythmic_grouping(MInterval(last, here), r[i] )
);
}
void
Simple_walker::do_local_key(Note_req*n,Notehead* head_p)
{
- if ( local_key_.oct(n->octave).acc(n->name) != n->accidental) {
+ if ( local_key_.oct(n->octave).acc(n->notename) != n->accidental) {
if (!local_key_item_) {
local_key_item_ = staff()->get_local_key_item();
local_key_item_->c0_position = clef_.c0_pos;
}
-
- local_key_item_->add(n->octave, n->name, n->accidental, head_p);
- local_key_.oct(n->octave).set(n->name, n->accidental);
+ local_key_item_->add(head_p);
+ local_key_item_->add(n->octave, n->notename, n->accidental);
+ local_key_.oct(n->octave).set(n->notename, n->accidental);
}
}
{
Simple_column*c = col();
Simple_staff *s = staff();
- Item*rhythmic=0;
+ Item*rhythmic=0;
if (n.rq->note()) {
Note_req * req = n.rq->note() ;
- const Voice *v = req->elt_l_->voice_;
+ const Voice *v = req->elt_l_->voice_l_;
Notehead*n = s->get_notehead(req, clef_.c0_pos);
rhythmic=n;
current_grouping->add_child(
c->tdescription_->whole_in_measure, req->duration());
}
- noteheads.add(n);
+ noteheads.push(n);
int sidx =find_slur(v);
if (sidx >= 0) {
pending_slurs[sidx]->add(n);
if (wantkey)
do_local_key(req,n);
- }else if (n.rq->rest()) {
+ } else if (n.rq->rest()) {
rhythmic = s->get_rest(n.rq->rest());
c->typeset_item(rhythmic);
}
- for (int i= 0; i < n.scripts.size(); i ++)
- c->typeset_item(new Script(n.scripts[i], rhythmic, 10, stem_)); // UGR
+ for (int i= 0; i < n.scripts.size(); i ++) {
+ Script * s_p =new Script(n.scripts[i], 10);
+ s_p->set_support(rhythmic);
+ s_p->set_stem(stem_);
+ c->typeset_item(s_p); // UGR
+ }
}
void
Simple_column*c = col();
Simple_staff *s = staff();
- if (c->beam_&& c->beam_->spantype == Span_req::START) {
+ if (c->beam_ && c->beam_->spantype == Span_req::START) {
if (beam_)
error("Too many beams (t = "
+String(c->when())+")");
Slur_req*sl = c->slurs[i];
if (sl->spantype == Span_req::START) {
- if (find_slur(sl->elt_l_->voice_ )>=0)
+ if (find_slur(sl->elt_l_->voice_l_)>=0)
error_t("Too many slurs in voice", *col()->tdescription_);
- pending_slur_reqs.add(sl);
- pending_slurs.add(new Slur);
+ pending_slur_reqs.push(sl);
+ pending_slurs.push(new Slur);
}
}
c->typeset_item(new Text_item(c->text_, 10)); // UGR
}
-// if (c->lreq_p_) {
-// c->typeset_item(new Lyric_item(c->lreq_p_, 10)); // UGR
-// }
-
if (c->stem_) {
- stem_ = s->get_stem(c->stem_->stem(), c->stem_requester_len);
+ stem_ = s->get_stem(c->stem_->stem());
}
for (int i = 0; i < c->notes.size(); i ++) {
}
if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
+ if (!beam_) {
+ error_t("No beam to end", *col()->tdescription_);
+ }
default_grouping.extend(current_grouping->interval());
beam_->set_grouping(default_grouping, *current_grouping);
- pscore_->typeset_spanner(beam_, s->theline_l_);
+ pscore_l_->typeset_spanner(beam_, s->theline_l_);
if (c->beam_->nplet) {
- Text_spanner* t = new Text_spanner(beam_);
+ Text_spanner* t = new Text_spanner;
+ t->set_support(beam_);
t->spec.align_i_ = 0;
t->spec.text_str_ = c->beam_->nplet;
- pscore_->typeset_spanner(t, s->theline_l_);
+ pscore_l_->typeset_spanner(t, s->theline_l_);
}
beam_ = 0;
noteheads.set_size(0);
if (local_key_item_) {
- c->typeset_item_directional(local_key_item_, -1);
+ c->typeset_item(local_key_item_);
local_key_item_ = 0;
}
if (stem_) {
Slur_req *sl = c->slurs[i];
if (sl->spantype == Span_req::STOP) {
- int idx = find_slur(sl->elt_l_->voice_);
+ int idx = find_slur(sl->elt_l_->voice_l_);
if (idx < 0)
error_t("can't find slur to end; ", *c->tdescription_);
- pscore_->typeset_spanner(pending_slurs[idx],
+ pscore_l_->typeset_spanner(pending_slurs[idx],
s->theline_l_);
pending_slurs.del(idx);
pending_slur_reqs.del(idx);
}
}
+Simple_walker::Simple_walker(Simple_walker const&)
+ : Staff_walker(0, 0)
+{
+ assert(false);
+}
+Simple_walker::~Simple_walker()
+{
+ if (pending_slurs.size())
+ WARN << "destructing " << pending_slurs.size() << " Pending slurs ";
+ if (beam_)
+ WARN << "destructing Beam\n";
+ if (local_key_item_)
+ WARN<<"destructing Local_key_item\n";
+ if (stem_)
+ WARN<< "destructing Stem\n";
+ delete local_key_item_;
+ delete stem_;
+ delete beam_;
+
+}
+
Simple_walker::Simple_walker(Simple_staff*s)
: Staff_walker(s, s->theline_l_->pscore_l_)
{
wantkey =i;
delete i;
local_key_item_ = 0;
- reset();
+ do_post_move();
}
Simple_staff*
Simple_walker::staff()
{
- return (Simple_staff*) staff_;
+ return (Simple_staff*) staff_l_;
}
Simple_column*
}
void
-Simple_walker::reset()
+Simple_walker::do_post_move()
{
processed_clef =false;
processed_key = false;
Simple_walker::find_slur(const Voice *v)
{
for (int i=0; i < pending_slur_reqs.size(); i++) {
- if (pending_slur_reqs[i]->elt_l_->voice_ == v)
+ if (pending_slur_reqs[i]->elt_l_->voice_l_== v)
return i;
}
return -1;
#include "molecule.hh"
#include "debug.hh"
#include "boxes.hh"
-
+NAME_METHOD(Slur);
Slur::Slur()
{
dir = 0;
void
Slur::add(Notehead*n)
{
- encompass.add(n);
- dependencies.add(n);
+ encompass.push(n);
+ dependencies.push(n);
}
void
dir = 1;
}
-void
-Slur::print()const
-{
- mtor << "Slur.\n";
-}
-
void
Slur::do_pre_processing()
{
ret->encompass.set_size(0);
for (int i =0; i < encompass.size(); i++) {
if (encompass[i]->pcol_l_->line_l_==l->line_l_)
- ret->encompass.add(encompass[i]);
+ ret->encompass.push(encompass[i]);
}
if (right != r)
ret->open_right = true;
#include "spanner.hh"
#include "pcol.hh"
+NAME_METHOD(Spanner);
+void
+Spanner::do_print()const
+{
+ mtor << " (unknown) ";
+}
Spanner*
Spanner::broken_at(PCol*c1, PCol *c2)const
{
Spanner *span_p = do_break_at(c1,c2);
me_p->calc_children = true;
- me_p->dependencies.add(span_p);
+ me_p->dependencies.push(span_p);
span_p->calc_children = false; // should handle in ctor
Interval
Spanner::width()const
{
- Real r =right->hpos,
- l= left->hpos;
+ Real r = right->hpos;
+ Real l = left->hpos;
+ assert(*left < *right);
assert(r>=l);
return Interval(0, r-l);
}
-
-void
-Spanner::print() const
-{
-#ifndef NPRINT
- mtor << "Spanner { ";
- Staff_elem::print();
- mtor << "}\n";
-#endif
-}
-
Staff_column *
Staff::get_col(Moment w, bool mus)
{
- Score_column* sc = score_l_->find_col(w,mus);
+ Score_column* sccol_l = score_l_->find_col(w,mus);
iter_top(cols,i);
for (; i.ok(); i++) {
- if (*i->score_column_l_ > *sc) // too far
+ if (*i->score_column_l_ > *sccol_l) // too far
break;
- if (sc == i->score_column_l_)
+ if (sccol_l == i->score_column_l_)
return i;
}
/* post: *sc > *->score_column_l_ || !i.ok() */
- Staff_column* newst = create_col(sc);
+ Staff_column* newst = create_col(sccol_l);
if (!i.ok()) {
cols.bottom().add(newst);
for (iter_top(i->elts,j); j.ok(); j++) {
for (iter_top(j->reqs, k); k.ok(); k++) {
if (k->mark()) { // ugh. 4 levels
- s_arr.add(k->mark()->mark_str_);
- m_arr.add(now);
+ s_arr.push(k->mark()->mark_str_);
+ m_arr.push(now);
}
}
now += j->duration;
#ifndef NDEBUG
cols.OK();
voices.OK();
+ iter_top(cols, i);
+ iter_top(cols, j);
+ i++;
+ for (; i.ok(); j++,i++) {
+ if ( j->when() == i->when())
+ assert(!j->mus() && i->mus());
+ else
+ assert(j->when () < i->when() );
+ }
assert(score_l_);
#endif
}
{ /* every line a currentkey. */
Command kc;
kc.code =TYPESET;
- kc.args.add( "CURRENTKEY");
+ kc.args.push( "CURRENTKEY");
kc.priority = 60;
add(kc);
}
{ /* every line a currentclef. */
Command kc;
kc.code =TYPESET;
- kc.args.add( "CURRENTCLEF");
+ kc.args.push( "CURRENTCLEF");
kc.priority = 80;
add(kc);
}
#include "pstaff.hh"
#include "molecule.hh"
#include "staffelem.hh"
+#include "debug.hh"
String
Staff_elem::TeXstring() const
Staff_elem::print()const
{
#ifndef NPRINT
+ mtor << name() << "{\n";
+ do_print();
if (output)
output->print();
+
+ mtor << "}\n";
#endif
}
+NAME_METHOD(Staff_elem);
+
Staff_elem::Staff_elem()
{
calc_children = false;
Staff_walker::Staff_walker(Staff * s, PScore*ps )
: PCursor<Staff_column*> (s->cols)
{
- staff_ = s;
- pscore_ = ps;
+ staff_l_ = s;
+ pscore_l_ = ps;
break_status = BREAK_END - BREAK_PRE;
}
Staff_walker::process()
{
break_status = BREAK_END - BREAK_PRE;
- if (ptr()->staff_commands_p_)
+
+ if (ptr()->mus()) {
+ process_requests();
+ } else if (ptr()->staff_commands_p_)
for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
process_command(i);
}
-
- process_requests();
}
void
Staff_walker::operator++(int i)
{
+ do_pre_move();
PCursor<Staff_column*>::operator++(i);
- reset();
+ do_post_move();
}
score_column_l_->add_duration(d);
}
- v_elts.add(ve);
+ v_elts.push(ve);
}
Staff_column::Staff_column(Score_column *s_l)
#include "misc.hh"
const int STEMLEN=7;
-
-Stem::Stem(int c, Moment len)
+NAME_METHOD(Stem);
+Stem::Stem(int c) //, Moment len)
{
- note_length = len;
+// note_length = len;
beams_left = 0;
beams_right = 0;
minnote = 1000; // invalid values
}
void
-Stem::print() const
+Stem::do_print() const
{
#ifndef NPRINT
- mtor << "{\n";
mtor << "flag "<< flag << " print_flag " << print_flag
<< "min,max [" << minnote << ", " << maxnote << "]";
-
-
- Item::print();
- mtor << "}\n";
#endif
}
void
minnote = p;
if ( p> maxnote)
maxnote = p;
- heads.add(n);
- n->dependencies.add(this);
+ heads.push(n);
+ n->dependencies.push(this);
}
--- /dev/null
+#include "register.hh"
+#include "voicegroup.hh"
+
+#include "pcursor.tcc"
+#include "plist.tcc"
+
+IPL_instantiate(Voice_registers);
{
Array<String> sv;
for (int i = 0 ; i < args.size(); i++)
- sv.add(args[i]);
+ sv.push(args[i]);
return substitute_args(source, sv);
}
Symbol bs=(*symtables_)("beamslopes")->lookup("slope");
Array<String> args;
- args.add(sidx);
- args.add(widx);
+ args.push(sidx);
+ args.push(widx);
bs.tex = substitute_args(bs.tex,args);
int w = 2 << widx;
Real width = convert_dimen(w,"pt");
{
Symbol bs=(*symtables_)("beamslopes")->lookup("horizontal");
Array<String> args;
- args.add(print_dimen(height));
- args.add(print_dimen(width));
+ args.push(print_dimen(height));
+ args.push(print_dimen(width));
bs.tex = substitute_args(bs.tex,args);
bs.dim.x = Interval(0,width);
bs.dim.y = Interval(0,height);
#include "molecule.hh"
#include "lookup.hh"
+NAME_METHOD(Text_item);
+
Text_item::Text_item(Text_req* treq_l, int staffsize_i)
{
staffsize_i_ = staffsize_i;
#include "textdef.hh"
#include "debug.hh"
-Text_spanner::Text_spanner(Directional_spanner*d)
+NAME_METHOD(Text_spanner);
+
+void
+Text_spanner::set_support(Directional_spanner*d)
{
support = d;
- dependencies.add(d);
+ dependencies.push(d);
+}
+Text_spanner::Text_spanner()
+{
+ support = 0;
+}
+
+void
+Text_spanner::do_print() const
+{
+ spec.print();
}
void
return output;
}
-void
-Text_spanner::print() const // todo
-{
-#ifndef NDEBUG
- mtor << "Text_spanner\n";
-#endif
-}
-
void
Text_spanner::do_pre_processing()
{
Spanner*
Text_spanner::do_break_at(PCol*c1, PCol*c2)const
{
- return new Text_spanner(*this);
+ return new Text_spanner(*this); // todo
}
void
Voice::add(Voice_element*v)
{
- v->voice_ = this;
+ v->voice_l_ = this;
elts.bottom().add(v);
}
Voice_element::add(Request*r)
{
if (r->rhythmic()) {
- assert (!duration);
+ assert (!duration || duration == r->duration());
duration = r->duration();
}
+
r->elt_l_ = this;
reqs.bottom().add(r);
}
Voice_element::Voice_element()
{
- voice_ = 0;
- group = 0;
+ voice_l_ = 0;
+// group = 0;
duration = 0.0;
}
Voice_element::Voice_element(Voice_element const&src)
{
- voice_=src.voice_;
+ voice_l_=0;
for (iter_top(src.reqs, i); i.ok(); i++)
add(i->clone());
- group=src.group;
+// group=src.group;
}
--- /dev/null
+#include "request.hh"
+#include "complexwalker.hh"
+#include "complexstaff.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Voice_group_registers::Voice_group_registers(Complex_walker*w_l)
+ : //text_reg_(w_l),
+ stem_beam_reg_(w_l)
+//, script_reg_(w_l),
+ // stem_reg_(w_l)
+{
+ walk_l_ = w_l;
+}
+
+void
+Voice_group_registers::pre_move_processing()
+{
+ stem_beam_reg_.pre_move_processing();
+// script_reg_.pre_move_processing();
+// text_reg_.pre_move_processing();
+}
+void
+Voice_group_registers::post_move_processing()
+{
+ stem_beam_reg_.post_move_processing();
+}
+bool
+Voice_group_registers::try_request(Request*r_l)
+{
+ bool b = stem_beam_reg_.try_request(r_l);
+/* if (!b)
+ b|= beam_reg_.try_request(r_l);
+ if (!b)
+ b|= script_reg_.try_request(r_l);
+ if (!b)
+ b|= text_reg_.try_request(r_l);
+ */
+ return b;
+}
+
+void
+Voice_group_registers::announce_element(Staff_elem_info i)
+{
+/*
+ if (i.group_regs_l_!= this)
+ return;
+ */
+ stem_beam_reg_.acknowledge_element(i);
+// text_reg_.announce_element(i);
+ // script_reg_.announce_element(i);
+}
+
+
+void
+Voice_group_registers::process_requests()
+{
+ stem_beam_reg_.process_request();
+}
+
--- /dev/null
+#include "rest.hh"
+#include "notehead.hh"
+#include "paper.hh"
+#include "debug.hh"
+#include "slur.hh"
+#include "request.hh"
+#include "complexwalker.hh"
+#include "complexstaff.hh"
+#include "voicegroup.hh"
+#include "register.hh"
+
+Voice_registers::Voice_registers(Complex_walker*c_l, Voice *v_p)
+ : head_reg_(c_l), slur_reg_(c_l)
+{
+ voice_l_ = v_p;
+}
+
+bool
+Voice_registers::try_request(Request * r_l)
+{
+ bool b = head_reg_.try_request(r_l);
+ if (!b)
+ b = slur_reg_.try_request(r_l);
+ return b;
+}
+
+void
+Voice_registers::announce_element(Staff_elem_info i)
+{
+ if (i.voice_l_ != voice_l_)
+ return;
+ if (i.origin_reg_l_ != &slur_reg_)
+ slur_reg_.acknowledge_element(i);
+}
+
+void
+Voice_registers::pre_move_processing()
+{
+ head_reg_.pre_move_processing();
+ slur_reg_.pre_move_processing();
+}
+void
+Voice_registers::post_move_processing()
+{
+ head_reg_.post_move_processing();
+ slur_reg_.post_move_processing();
+}
+
+void
+Voice_registers::process_requests()
+{
+ head_reg_.process_request();
+ slur_reg_.process_request();
+}
+
+/****************/
+
+Notehead_register::Notehead_register(Complex_walker*w_l)
+ :Request_register(w_l)
+{
+ note_l_ = 0;
+}
+
+bool
+Notehead_register::try_request(Request *req_l)
+{
+ if (req_l->note() || req_l->rest())
+ accepted_req_arr_.push(req_l);
+ else
+ return false;
+
+ return true;
+}
+
+void
+Notehead_register::process_request()
+{
+ Request* req_l = accepted_req_arr_.last();
+ if (req_l->note()) {
+ Notehead*n_p = new Notehead(8); // ugh
+ note_l_ = n_p;
+ n_p->set_rhythmic(req_l->rhythmic());
+ n_p->position = req_l->note()->height() + -2;
+ } else {
+ note_l_ = new Rest ( req_l->rhythmic()->balltype,
+ req_l->rhythmic()->dots);
+ if (req_l->rhythmic()->balltype <= 2)
+ note_l_->translate(
+ Offset(0,
+ 5 * walk_l_->staff()->paper()->internote()));
+ }
+ Staff_elem_info itinf(note_l_,req_l,this);
+ walk_l_->announce_element(itinf);
+}
+
+void
+Notehead_register::do_pre_move_process()
+{
+ if (note_l_) {
+ walk_l_->typeset_element(note_l_);
+ note_l_ = 0;
+ }
+}
+
+/****************/
+/****************/
+
+Slur_register::Slur_register(Complex_walker* w)
+ : Request_register(w)
+{
+}
+
+bool
+Slur_register::try_request(Request *req_l)
+{
+ if(!req_l->slur())
+ return false;
+
+ accepted_req_arr_.push(req_l);
+ return true;
+}
+
+void
+Slur_register::acknowledge_element(Staff_elem_info info)
+{
+ if (info.elem_p_->name() == String("Notehead")) {
+ Notehead *head_p =(Notehead*) info.elem_p_ ;// ugh
+ for (int i = 0; i < slur_l_stack_.size(); i++)
+ slur_l_stack_[i]->add(head_p );
+ for (int i = 0; i < end_slur_l_arr_.size(); i++)
+ end_slur_l_arr_[i]->add(head_p);
+ }
+}
+
+void
+Slur_register::process_request()
+{
+ Array<Slur*> start_slur_l_arr_;
+ for (int i=0; i< accepted_req_arr_.size(); i++) {
+ Slur_req* slur_req_l = accepted_req_arr_[i]->slur();
+ if (slur_req_l->spantype == Span_req::STOP) {
+ if (slur_l_stack_.empty())
+ error_t("can't find slur to end; ",
+ *walk_l_->col()->tdescription_);
+ end_slur_l_arr_.push(slur_l_stack_.pop());
+
+ } else if (slur_req_l->spantype == Span_req::START) {
+ Slur * s_p =new Slur;
+ start_slur_l_arr_.push(s_p);
+ walk_l_->announce_element(Staff_elem_info(s_p, slur_req_l, this));
+ }
+ }
+ for (int i=0; i < start_slur_l_arr_.size(); i++)
+ slur_l_stack_.push(start_slur_l_arr_[i]);
+}
+
+void
+Slur_register::do_pre_move_process()
+{
+ for (int i = 0; i < end_slur_l_arr_.size(); i++)
+ walk_l_->typeset_element(end_slur_l_arr_[i]);
+ end_slur_l_arr_.set_size(0);
+}
+
+Slur_register::~Slur_register()
+{
+ if (slur_l_stack_.size())
+ error("unterminated slur");
+}
ostream &warnout (cerr);
ostream *mlog(&cerr);
-
+/*
void
warning(String s)
{
WARN << s;
}
-
+*/
void
error(String s)
i++;
}
mtor << "Adding cols~, next breakpoint " << i << '\n';
- breaking.add(minimum);
+ breaking.push(minimum);
}
return breaking;