Idealspacing 1
# yydebug
-Parser 0
+InitParser 1
+Parser 1
+
# FlexLexer debug
-Lexer 0
+Lexer 1
parse_duration 1
parse_pitchmod 1
faq.pod
TXTS=$(PODS:.pod=.txt)
MANS=$(PODS:.pod=.1)
+HTMLS=$(PODS:.pod=.html)
DISTFILES=$(PODS) Makefile
pod2man --center="LilyPond documentation" --section="0"\
--release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
+html:
+ pod2html
\ No newline at end of file
=over 5
-=item * ASCII script input, with identifiers (for music reuse),
+=item *
+ASCII script input, with identifiers (for music reuse),
customizable notenames, customizable fontset
=item *
=item *
beams, slurs, chords, super/subscripts (accents and text),
-triplets, clef changes, meter changes, general n-plet (triplet,
+triplets, general n-plet (triplet,
quadruplets, etc.)
=item *
multiple scores within one input file. Each score is output to
a different file.
+=item *
+clef changes, meter changes, cadenza-mode, declaring markings
+in the music, repeat bars
+
+
=back
=head1 DESIGN CONSIDERATIONS
=item *
Bison or YACC.
-=item * The "Flower" library, which should be available from the same
+=item *
+The "Flower" library, which should be available from the same
source you got this from.
-=item * perl. The Makefile uses perl for trivial operations, and you
+=item *
+perl. The Makefile uses perl for trivial operations, and you
could tinker with it to use sed or awk.
=back
Han-Wen Nienhuys <hanwen@stack.nl>, Main author
=item *
-Jan Nieuwenhuizen <jan@digicash.com>, bits of FlowerLib, general comments.
+Jan Nieuwenhuizen <jan@digicash.com>, Lyrics, bits of
+FlowerLib, general comments.
=item *
Mats Bengtsson <matsb@s3.kth.se>, bugfixes, testing, general comments.
and patches to me (see AUTHORS section)
LilyPond is updated very frequently, the latest version is always available at:
-
-F<ftp://pcnov095.win.tue.nl/pub/lilypond>
+ftp://pcnov095.win.tue.nl/pub/lilypond.
=head1 FILES
-F<symbol.ini> The initialisation file with symbol tables etc. It
+=over 5
+
+=item F<symbol.ini>
+The initialisation file with symbol tables etc. It
includes files from the directory F<init/>.
+=back
+
=head1 SEE ALSO
There are some documentation files in the subdirectory F<Documentation/>,
''!c8.-"text"_v
+and in lyricmode, eg,
+
+ Twink- le, twink- le litt- le star,2
+
a lot of characters parse differently
than in "command" mode, eg,
identifier = score { .. }
So you have to signal that to the tokenizer. This is done with
-'$'. '$' is a delimiter, which used by the tokenizer only.
+'$'. '$' is a delimiter, which used by the tokenizer only. The same
+goes for lyrics, it has a '@' delimiter.
=item *
musicmode: The brace still is used to group grammatical groups.
.SUFFIXES:
.SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep
+
$(exe): $(obs)
$(CXX) -o $@ $^ $(LOADLIBES)
-depend: ; # automatically by gnu make.
clean:
- rm -f $(exe) objects/*.o $(DOCDIR)/* core
- $(MAKE) -C $(CCDIR) clean
- $(MAKE) -C $(HEADERDIR) clean
+ rm -f $(exe) $(DOCDIR)/* core $(obs)
+ for SUBDIR in $(SUBDIRS); \
+ do \
+ $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR clean;\
+ done
distclean: clean
rm -f version.hh $(gencc) .GENERATE *~ deps/*.dep
all: kompijl doc
-# doc++ documentation of classes
doc:
$(MAKE) -C Documentation doc
+# doc++ documentation of classes
docpp: $(progdocs)
-mkdir $(DOCDIR)
doc++ -p -I -d $(DOCDIR) $^
-%.o: $(CCDIR)/%.cc
- $(DODEP)\
- $(CXX) -c $(CXXFLAGS) $^ -o $(OBJECTDIR)/$@
-
-
$(OBJECTDIR)/%.o: $(CCDIR)/%.cc
$(DODEP)\
$(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION)
+pl 24:
+ - Lyrics
+ - Commands in music-mode (an input feature) (there you are, Mats)
pl 23:
- TODO file inc'd
- error.pod,faq.pod
- Markers
- configure script
- - scrapped VPATH
- inputfile name in output.
Internal changes:
+ - scrapped VPATH
+ - Make dependencies per .o
- Split Input_* parsing steps to enable marking
Bugfixes:
- unconnected columns
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\
- keyword.hh leastsquares.hh lexer.hh linespace.hh linestaff.hh\
- localkeyitem.hh lookup.hh main.hh melodicstaff.hh meter.hh misc.hh\
+ keyword.hh leastsquares.hh lexer.hh linespace.hh linepstaff.hh\
+ localkeyitem.hh lookup.hh \
+ lyriccolumn.hh lyricitem.hh lyricstaff.hh lyricwalker.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\
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 swalker.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\
getcommands.cc grouping.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 linestaff.cc\
- localkeyitem.cc lookup.cc main.cc melodicstaff.cc meter.cc\
+ leastsquares.cc lexerinit.cc linespace.cc linepstaff.cc\
+ localkeyitem.cc lookup.cc\
+ lyriccolumn.cc lyricitem.cc lyricstaff.cc lyricwalker.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\
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\
- swalker.cc symbol.cc symtable.cc table.cc tex.cc texbeam.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\
template1.cc template2.cc template3.cc template4.cc\
+
BUGS
* first clef
INPUTLANGUAGE
+ * lexer condition stack
+
+ * lose the $ and @?
+
* figured bass?
* transposition
SMALLISH PROJECTS
+ * make spanner for staffsym
+
+ * Lyric_req : Text_req, Rhythmic_req
+
* Lookup::tex_glissando, Lookup::tex_bracket,
Lookup::tex_cresc, Lookup::tex_decresc (use texbeam.cc as an
example.)
* fix symbols in parser.o: `Warning: size of symbol'
- * Viola clef (->jan?!)
+ * Viola clef
DOC
* all errors
FUTURE
+ * Command_req
+
+ * scrap stem_request?
* Text_pstaff/Lyric_staff
* Implement all requests
+ * merge key{item} & localkey{item}
+
* QLP for beams?
* stacked slurs.
DEBUGFLAG=-g
# turn off -pipe if linker doesn't support it
-#EXTRACXXFLAGS=-pipe -Wall -W -Wmissing-prototypes
+EXTRACXXFLAGS=-pipe -Wall -W -Wmissing-prototypes
#
# -lefence = ElectricFence.
# version info
MAJVER=0
MINVER=0
-PATCHLEVEL=23
+PATCHLEVEL=24
VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
CXXVER=`$(CXX) --version`
# distribution files.
othersrc=lexer.l parser.y
-SCRIPTS=make_version make_patch genheader clean
+SCRIPTS=make_version make_patch genheader clearlily
MAKFILES=Makefile Variables.make Sources.make Initial.make Generate.make \
configure
OFILES=COPYING README NEWS TODO
+++ /dev/null
-#!/bin/sh
-
-# unclobber current dir.
-rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+# unclobber current dir.
+rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
\ No newline at end of file
#!/bin/sh
+
+NEEDFLOWERVER=1.0.21
+flowertar=flower-$NEEDFLOWERVER
+here=`pwd`
+if [ -x ../flower ]
+then
+ echo Found flowerdir
+else
+ cd ../
+ if [ ! -f $flowertar ]
+ then
+ echo can't find $flowertar
+ exit 1;
+ fi
+ rm flower
+ ln -s $flowertar flower
+
+fi
+echo Compiling Library
+cd flower; make
+cd $here
+
PREFIX="."
echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
touch depend
-make -f Initial.make
\ No newline at end of file
+make -f Initial.make
DISTFILES=Makefile
dist:
ln $(DISTFILES) $(DDIR)/$(SUBDIR)
-
\ No newline at end of file
+
+clean:
+ rm *.dep
Bar(String type);
- Molecule*brew_molecule()const;
+ Molecule*brew_molecule_p()const;
};
#endif // BAR_HH
private:
Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
void solve_slope();
- Molecule*brew_molecule()const;
+ Molecule*brew_molecule_p()const;
};
/** Beam adjusts the stems its owns to make sure that they reach the
beam and that point in the correct direction */
Clef_item();
void read(Clef);
void read(String);
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
};
#endif // CLEFITEM_HH
void preprocess();
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
};
/**
An item which places accidentals at the start of the line
--- /dev/null
+#include "pstaff.hh"
+
+struct Linestaff : PStaff {
+
+ int nolines;
+
+/****************/
+
+ void brew_molecule_p(Real width);
+ Linestaff(int, PScore*);
+};
+++ /dev/null
-#include "pstaff.hh"
-
-struct Linestaff : PStaff {
-
- int nolines;
-
-/****************/
-
- void brew_molecule(Real width);
- Linestaff(int, PScore*);
-};
void add(int oct, int pitch, int acc, Notehead*);
void do_pre_processing();
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
};
#endif // LOCALKEYITEM_HH
/****************/
Meter(Array<Scalar> args) ;
- Molecule*brew_molecule() const;
+ Molecule*brew_molecule_p() const;
};
#endif // METER_HH
void print()const;
static int compare(Notehead*&a, Notehead*&b) ;
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
};
/**
takes care of:
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);
Text_def*get_text(String s);
Request*get_script_req(int d , Script_def*def);
Request*get_text_req(int d , Text_def*def);
-
-
+Voice_element*get_command_element(Input_command*);
+Voice_element*get_barcheck_element();
#endif // PARSECONSTRUCT_HH
*/
#include "compare.hh"
-instantiate_compare(const PCol &, PCol::compare);
+instantiate_compare(PCol &, PCol::compare);
#endif
#include "fproto.hh"
#include "real.hh"
-
struct Absdynamic_req;
struct Accidental;
struct Atom;
struct Span_req;
struct Spanner;
struct Staff;
+struct Staff_command_req;
struct Col_configuration;
struct Staff_column;
struct Stem;
struct Script_def;
struct Text_def;
struct Text_req;
+struct Lyric_req;
struct Melodic_req;
#endif // PROTO_HH
PointerList<Item*> its;
/****************/
- virtual void brew_molecule(Real width)=0; // maybe overkill
+ virtual void brew_molecule_p(Real width)=0; // maybe overkill
void add(Item*i);
PStaff(PScore*);
virtual ~PStaff();
#include "string.hh"
#include "moment.hh"
-/// a voice element wants something printed
+/// Hungarian postfix: req
struct Request {
Voice_element*elt_l_;
virtual Beam_req *beam() { return 0 ; }
virtual Slur_req *slur() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0; }
+ virtual Lyric_req* lreq_l() { return 0; }
virtual Melodic_req *melodic() { return 0; }
virtual Mark_req * mark() { return 0; }
+ virtual Staff_command_req* command() { return 0;}
};
/**
+ a voice element wants something printed.
see lilygut page
*/
};
+///Put a text above or below (?) this staff.
+struct Text_req : virtual Request {
+ 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&);
+};
+
+
+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;
+};
+
+
struct Melodic_req :virtual Request
{
/// 0 is c
slurs and brackets, so this also a request */
-///Put a text above or below (?) this staff.
-struct Text_req : Request {
- int dir;
- Text_def *spec;
- /****************/
- 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&);
-};
-
/// designate this spot with a name.
struct Mark_req : Request {
String mark_str_;
Request *clone() const;
};
+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;
+};
#if 0
struct Glissando_req : Span_req {
};
-
+struct Stemdir_req : Request {
+ int which;
+};
+struct Group_change_req : Request {
+};
#endif
#endif
Rest(int dur,int dots);
void print()const;
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
};
/**
takes care of:
void set_default_dir();
void set_default_pos();
Symbol symbol()const;
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
virtual void do_post_processing();
virtual void do_pre_processing();
Script(Script_req*, Item*,int,Stem*p=0);
#include "key.hh"
#include "stcol.hh"
#include "staff.hh"
-#include "swalker.hh"
+#include "staffwalker.hh"
/*
mega-stupido staffs and cols: they do notes one at each moment.
Beam_req *beam_;
Simple_staff* staff_l_;
Text_req *text_;
+ Lyric_req* lreq_p_;
/****************/
Slur_req * find_slur(Voice *);
/// Simple staff: one voicegroup at a time
struct Simple_staff : Staff {
/// indirection to the PStaff.
- PStaff *theline;
+ PStaff *theline_l_;
/****************/
Staff_column*create_col(Score_column*);
Spanner* do_break_at( PCol*, PCol*) const;
void process();
private:
-Molecule*brew_molecule()const;
+Molecule*brew_molecule_p()const;
};
#endif // SLUR_HH
protected:
/// generate the molecule
- virtual Molecule* brew_molecule()const=0;
+ virtual Molecule* brew_molecule_p()const=0;
///executed directly after the item is added to the PScore
virtual void do_add_processing();
/// do calculations before determining horizontal spacing
--- /dev/null
+
+/*
+ staffwalker.hh -- part of LilyPond
+
+ (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef STAFFWALKER_HH
+#define STAFFWALKER_HH
+
+#include "staff.hh"
+
+struct Staff_walker : public PCursor<Staff_column*> {
+ Staff * staff_;
+ PScore * pscore_;
+
+ int break_status;
+
+ /****************/
+
+ int priority() const; // Command
+ Moment when() const;
+ virtual ~Staff_walker();
+ Staff_walker(Staff*, PScore*);
+ void process() ;
+ void process_command(Command *);
+ void operator++(int);
+
+ /****************
+ VIRTUAL
+ ****************/
+
+ /// every time ++ is called
+ virtual void reset(){}
+ virtual void process_requests()=0;
+ virtual void do_TYPESET_command(Command*)=0;
+ virtual void do_INTERPRET_command(Command*)=0 ;
+private:
+ Staff_walker(Staff_walker const&);
+};
+/**
+ manage run-time info when walking staffcolumns such as: key,
+ meter, pending beams & slurs
+ */
+
+#endif // STAFFWALKER_HH
+
Interval width() const;
- Molecule* brew_molecule() const;
+ Molecule* brew_molecule_p() const;
};
/**
takes care of:
+++ /dev/null
-
-/*
- swalker.hh -- part of LilyPond
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef SWALKER_HH
-#define SWALKER_HH
-
-#include "staff.hh"
-
-struct Staff_walker : public PCursor<Staff_column*> {
- Staff * staff_;
- PScore * pscore_;
-
- int break_status;
-
- /****************/
-
- int priority() const; // Command
- Moment when() const;
- virtual ~Staff_walker();
- Staff_walker(Staff*, PScore*);
- void process() ;
- void process_command(Command *);
- void operator++(int);
- /// every time ++ is called
- virtual void reset()=0;
- virtual void process_requests()=0;
- virtual void do_TYPESET_command(Command*)=0;
- virtual void do_INTERPRET_command(Command*)=0 ;
-private:
- Staff_walker(Staff_walker const&);
-};
-/**
- manage run-time info when walking staffcolumns such as: key,
- meter, pending beams & slurs
- */
-
-#endif // SWALKER_HH
-
#define TEXTDEF_HH
#include "string.hh"
+#include "proto.hh"
+
+struct Text_def {
+ int align_i_;
+ String text_str_;
+ String style_str_;
-struct Text_def {
- int align;
- String text;
- String style;
/*****************/
Text_def();
- void print()const;
- Atom create(Paperdef*)const;
+ virtual void print() const;
+ virtual Atom create_atom(Paperdef*) const;
};
+
#endif // TEXTDEF_HH
#include "textdef.hh"
#include "item.hh"
-struct Text_item : Item{
- int pos;
- int staffsize;
- int dir;
- Text_def*specs;
+struct Text_item : Item {
+ int pos_i_;
+ int staffsize_i_;
+ int dir_i_;
+ Text_def* tdef_l_;
/****************/
- void set_default_pos();
- Molecule* brew_molecule()const;
+ virtual void set_default_pos();
+ Molecule* brew_molecule_p() const;
void do_pre_processing();
Text_item(Text_req*,int);
/****************/
virtual void do_pre_processing();
virtual void do_post_processing();
- Molecule* brew_molecule()const;
+ Molecule* brew_molecule_p()const;
virtual Interval height() const ;
void print() const;
virtual Spanner* do_break_at(PCol*,PCol*)const;
default: ;
DISTFILES=Makefile kortjakje.ly pavane.ly maartje.ly\
- cadenza.ly scales.ly standchen.lily
+ cadenza.ly scales.ly standchen.lily twinkle.ly
dist:
ln $(DISTFILES) $(DDIR)/$(SUBDIR)
-% "Ah, je vous dirai, maman" (Mozart)
+% "Ah, vous dirais-je, maman" (Mozart, KV 265)
%
% bare bones version. (written down from memory :-)
+% for lyrics, see twinkle.ly
% the % is a comment.
e4 fis4 () [fis e fis gis] |
cis4 `b4()`b8 r8 r4^"tr\`es soutenu" |
- r4 r4 | %2/4 meter
-
+ \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] |
| [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->] |
'e4._"sf" 'e8()'c4 r4 |
r1 |
- r4 r4-\fermata
+ \command { \meter 2 *4 } r4 r4-\fermata
+ \command { \meter 4 *4 }
+
\octave { ' }
|d2( [)d e cis `b] |
`a4 [`b cis] [cis `b] `b4 |
commands {
meter 4 *4
skip 18:0
- meter 2 *4
skip 1:0
- meter 4 *4
skip 20:0
bar "|:"
skip 9:0
- meter 2* 4
skip 1:0
bar ":|"
meter 4* 4
%%1
melodie = music { $
\duration{ 8 }
- r_"pp" { [ d `a-^ } f-^ { d `a-^ } f-^ { d `a-^ ] }
+ r_"pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] }
%%2
- r { [ d `bes-^ } f-^ { d `bes-^ } f-^ { d `bes-^ ] }
+ r { [ d `bes-| } f-| { d `bes-| } f-| { d `bes-| ] }
%%3
r_"simile" { [ d `bes } e { d `bes } e { d `bes ] }
%%4
}
}
commands {
- meter 3 4
+ meter 3*4
skip 4:0
bar ":|"
skip 32:0
--- /dev/null
+% "Ah, vous dirais-je, maman"
+% "Altijd is Kortjakje ziek"
+% "Twinkle twinkle little star"
+%
+
+
+melodie = music {
+ $
+ c c | g g | a a | g g |
+ f f | e e | d d8.( e16 | )c2 | % :|
+
+ g g | f f | e e | d d |
+% g g | f f | e( [f0*32 e0*32 d0*32] e8. f16 | e )d | c c |
+ g g | f f | e( e8. f16 | e )d |
+
+ c c | g g | a a | g g |
+ f f | e e | d d8.( e16 | )c2 % :|
+ $
+}
+
+begeleiding = music {
+ $
+ \octave{`}
+ c 'c | 'e 'c | 'f 'c | 'e 'c |
+ 'd b | 'c a | f g | c2 |
+
+ 'e g | d g | 'c g | b g |
+% 'e g | 'd g | 'c 'c8.( 'd16 | \voice{ 'c )b } \voice{ g2 } |
+ 'e g | 'd g | 'c 'c8.( 'd16 | 'c )b |
+
+ c 'c | 'e 'c | 'f 'c | 'e 'c |
+ 'd b | 'c a | f g | c2
+ $
+}
+
+tekst = music {
+ @
+ Al- tijd is Kort- jak- je ziek,2
+ midden in_de week maar 's_zon- dags niet.2
+ 's_Zon- dags gaat ze naar de kerk,2
+ met een boek vol zil- ver werk.2
+ Al- tijd is Kort- jak- je ziek,2
+ midden in_de week maar 's_zon- dags niet.2
+ @
+}
+
+he_gedraagje_tekst = music {
+ @
+ Al- tijd zuigt Bill Gates mijn piek,2
+ "\TeX" is slecht- ser dan mu- ziek.2
+ 's_Zon- dags gaat het door een raam,2
+ Weet dat ik me er- voor schaam.2
+ Al- tijd zuigt Bill Gates mijn piek,2
+ "\TeX" is slecht- ser dan mu- ziek.2
+ @
+}
+
+texte = music {
+ @
+ \textstyle "italic"
+ Ah! vous dir- ai_- je ma man2
+ Ce qui cau- se mon tour- ment2
+ Pa- pa veut que je rai- sonne2
+ Comme un- e grand- e per- sonne2
+ Moi je dis que les bon- bons2
+ Val- ent mieux que la rai- son2
+ @
+}
+
+text1 = music {
+ @
+ \textstyle "roman"
+ Twin- kle, twin- kle, lit- tle star,2
+ How I won- der what you are.2
+ Up a- bove the world so high,2
+ Like a dia- mond in the sky.2
+ Twin- kle, twin- kle, lit- tle star,2
+ How I won- der what you are!2
+ @
+}
+
+text2 = music {
+ @
+ \textstyle "roman"
+ When the bla- zing sun is gone,2
+ When he no- thing shine- s upon,2
+ Then you show your lit- tle light,2
+ Twin- kle, twin- kle, all the night.2
+ Twin- kle, twin- kle, lit- tle star,2
+ How I won- der what you are!2
+ @
+}
+
+text3 = music {
+ @
+ \textstyle "roman"
+ Then the tra- veler in the dark2
+ Thanks you for your ti- ny spark;2
+ He could not see which way to_go,2
+ If you did not twin- kle so.2
+ Twin- kle, twin- kle, lit- tle star,2
+ How I won- der what you are!2
+ @
+}
+
+mstaf = staff {
+ melodic
+ music { melodie }
+ commands { clef violin }
+}
+
+bass_staf = staff {
+ melodic
+ music { begeleiding }
+ commands { clef bass }
+}
+
+
+dutch_staf = staff {
+ lyric
+ music { tekst }
+ music {he_gedraagje_tekst}
+}
+
+french_staf = staff {
+ lyric
+ music { texte }
+}
+
+english_staf = staff {
+ lyric
+ music { text1 }
+ music { text2 }
+ music { text3 }
+}
+
+tstaf = staff {
+ lyric
+ music { tekst }
+ music { texte }
+}
+
+
+score {
+ staff { mstaf }
+ staff { dutch_staf }
+ staff { french_staf }
+ staff { english_staf }
+ staff { bass_staf }
+ paper {
+ unitspace 2.5cm % a whole note takes 2.5 cm ideally.
+ }
+ commands {
+ meter 2 * 4
+ skip 24:0
+ bar "||"
+ }
+}
+
DISTFILES=Makefile
dist:
- ln $(DISTFILES) $(DDIR)/$(SUBDIR)
\ No newline at end of file
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
+
+clean:
+ rm *.o
\ No newline at end of file
type = t;
}
Molecule*
-Bar::brew_molecule()const
+Bar::brew_molecule_p()const
{
Symbol s = paper()->lookup_p_->bar(type);
Molecule* output = new Molecule(Atom(s));
Molecule*
-Beam::brew_molecule() const return out;
+Beam::brew_molecule_p() const return out;
{
Real inter=paper()->internote();
out = new Molecule;
}
Molecule*
-Clef_item::brew_molecule()const
+Clef_item::brew_molecule_p()const
{
String t = type;
if (change)
/****************/
+void
+Input_commands::find_moment(Moment m)
+{
+ ptr.find_moment(m);
+}
Input_commands::Input_commands(Input_commands const&src)
: ptr(src.ptr)
{
String s(c.args[0]);
if (s == "CADENZA") {
- ptr->tdescription_.set_cadenza(c.args[1]);
+ ptr->tdescription_.set_cadenza((int)c.args[1]);
} if (s == "PARTIAL") {
ptr->setpartial(c.args[1]);
} else if (s == "GROUPING") {
#include "staffcommands.hh"
#include "melodicstaff.hh"
#include "rhythmstaff.hh"
+#include "lyricstaff.hh"
#include "staff.hh"
void
p = new Melodic_staff;
else if (type == "rhythmic")
p = new Rhythmic_staff;
+ else if (type == "lyric")
+ p = new Lyric_staff;
p->score_l_ = score_l;
p->define_spot_str_ = define_spot_str_;
Molecule*
-Keyitem::brew_molecule()const
+Keyitem::brew_molecule_p()const
{
Molecule*output = new Molecule;
Real inter = paper()->interline()/2;
%x notes
%x incl
%x quote
+%x lyrics
AA {A}|_
N [0-9]
AN {AA}|{N}
+PUNCT [?!,.:;]
+ACCENT [\\'"^]
+TEX {AA}|-|{PUNCT}|{ACCENT}
WORD {A}{AN}*
ALPHAWORD {A}+
NOTECOMMAND \\{WORD}
NOTENAME {ALPHAWORD}
DOTS \.+
+LYRICS {TEX}+
+COMMENT [%#].*\n
%%
BEGIN(notes);
}
+\@ {
+ BEGIN(lyrics);
+}
+
<notes>{RESTNAME} {
const char *s = YYText();
yylval.string = new String (s);
yylval.i = String(YYText()).value();
return INT;
}
-<notes>[%#].*\n {
-
+<notes>{COMMENT} {
}
<notes>[ \t\n]+ {
yylval.string = new String(s);
return STRING;
}
-<notes>[()\[\]|/.^>_-] {
- return yylval.c = YYText()[0];
-
-}
<notes>. {
- String s("lexer error: illegal character found: " + String(YYText()));
- yyerror(s);
+ return yylval.c = YYText()[0];
}
\" {
return STRING;
}
+<lyrics>{DOTS} {
+ yylval.i = strlen(YYText());
+ return DOTS;
+}
+<lyrics>{INT} {
+ yylval.i = String(YYText()).value();
+ return INT;
+}
+<lyrics>{NOTECOMMAND} {
+ String c = YYText() +1;
+ mtor << "\\word: " << YYText()+1<<eol;
+ int l = lookup_keyword(c);
+ if (l != -1)
+ return l;
+ Identifier * id = lookup_identifier(c);
+ if (id) {
+ yylval.id = id;
+ return IDENTIFIER;
+ }
+ String *sp = new String( c);
+
+ yylval.string=sp;
+ return NEWIDENTIFIER;
+}
+<lyrics>\"[^\"]*\" {
+ String s (YYText()+1);
+ s = s.left(s.len()-1);
+ yylval.string = new String(s);
+ return STRING;
+}
+<lyrics>{LYRICS} {
+ String s (YYText());
+ int i = 0;
+ while ((i=s.pos("_")) != 0)// ugh. Whats this.
+ *((char*)s.cptr() + i - 1) = ' ';
+ if ((i=s.pos("\\,")) !=0)
+ {
+ *((char*)s.cptr() + i) = 'c';
+ s = s.left(i+1) + " " + s.right(s.len()-i-1);
+ }
+ yylval.string = new String(s);
+ return STRING;
+}
+<lyrics>\| {
+ return YYText()[0];
+}
+<lyrics>{COMMENT} {
+
+}
+<lyrics>[ \t\n]+ {
+}
+<lyrics>@ {
+ BEGIN(INITIAL);
+}
+
<<EOF>> {
mtor << "<<EOF>>";
}
-%.* {
+{COMMENT} {
//ignore
}
. {
--- /dev/null
+#include "linepstaff.hh"
+#include "molecule.hh"
+#include "symbol.hh"
+#include "lookup.hh"
+#include "dimen.hh"
+#include "paper.hh"
+#include "pscore.hh"
+
+Linestaff::Linestaff(int l, PScore *s)
+ : PStaff(s)
+{
+ nolines = l;
+}
+
+void
+Linestaff::brew_molecule_p(Real width)
+{
+ Atom a = pscore_l_->paper_l_->lookup_p_->linestaff(nolines,width);
+ stafsym_p_ = new Molecule(a);
+}
+
+
+
+
+
+
+
+++ /dev/null
-#include "linestaff.hh"
-#include "molecule.hh"
-#include "symbol.hh"
-#include "lookup.hh"
-#include "dimen.hh"
-#include "paper.hh"
-#include "pscore.hh"
-
-Linestaff::Linestaff(int l, PScore *s)
- : PStaff(s)
-{
- nolines = l;
-}
-
-void
-Linestaff::brew_molecule(Real width)
-{
- Atom a = pscore_l_->paper_l_->lookup_p_->linestaff(nolines,width);
- stafsym_p_ = new Molecule(a);
-}
-
-
-
-
-
-
-
accs.sort(Local_acc::compare);
}
Molecule*
-Local_key_item::brew_molecule()const
+Local_key_item::brew_molecule_p()const
{
Molecule* output = new Molecule;
}
Symbol
-Lookup::text( String style, String text , int dir)
+Lookup::text(String style, String text, int dir)
{
Array<String> a;
{
return (*symtables_)("rests")->lookup(String(j));
}
+
Symbol
Lookup::fill(Box b)
{
s.dim = b;
return s;
}
+
Symbol
Lookup::accidental(int j)
{
{
Symbol s;
s.dim.x = Interval(0,wid);
- Real dy=(lines-1)*internote()*2;
+ Real dy = (lines >0) ? (lines-1)*internote()*2 : 0;
s.dim.y = Interval(0,dy);
Array<String> a;
s.tex = (*symtables_)("param")->lookup("linestaf").tex;
s.tex = substitute_args(s.tex, a);
-
+
return s;
}
--- /dev/null
+#include "request.hh"
+#include "voice.hh"
+#include "staffwalker.hh"
+#include "debug.hh"
+#include "staff.hh"
+#include "command.hh"
+//#include "simplestaff.hh"
+#include "lyricstaff.hh"
+#include "lyriccolumn.hh"
+#include "sccol.hh"
+//#include "simplewalker.hh"
+#include "pscore.hh"
+#include "paper.hh"
+
+
+Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
+ : Staff_column(s)
+{
+ lstaff_l_ = lstaff_l;
+}
+
+void
+Lyric_column::process_requests()
+{
+ for (int i = 0 ; i < v_elts.size(); i ++) {
+ for (iter_top(v_elts[i]->reqs,j); j.ok(); j++) {
+ Request* req_l = j;
+ if (req_l->barcheck()) {
+ if (tdescription_->whole_in_measure) {
+ 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());
+ }
+ }
+ }
+}
+
+Interval itemlist_width(const Array<Item*> &its);
+
+void
+Lyric_column::typeset_item(Item *i, int breakst)
+{
+ assert(i);
+
+ lstaff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
+ lstaff_l_->line_pstaff_p_,breakst);
+
+ if (breakst == BREAK_PRE - BREAK_PRE) {
+
+ Array<Item*> to_move(
+ lstaff_l_->pscore_l_->select_items(lstaff_l_->line_pstaff_p_,
+ score_column_l_->pcol_l_->prebreak_p_));
+ Interval column_wid = itemlist_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));
+ }
+ }
+}
+
+Word_info::Word_info()
+{
+ lreq_l_ = 0;
+}
+
+Word_info::Word_info(Lyric_req* lreq_l)
+{
+ lreq_l_ = lreq_l;
+}
--- /dev/null
+#include "request.hh"
+#include "paper.hh"
+#include "lyricitem.hh"
+#include "stem.hh"
+#include "molecule.hh"
+#include "lookup.hh"
+#include "textdef.hh"
+
+Lyric_item::Lyric_item(Lyric_req* lreq_l, int voice_count_i)
+ : Text_item(lreq_l,0)
+{
+ pos_i_ = voice_count_i * -4 ; // fontsize dependant. TODO
+ dir_i_ = -1;
+}
+
+void
+Lyric_item::do_pre_processing()
+{
+ // override Text_item
+}
--- /dev/null
+#include "request.hh"
+#include "voice.hh"
+#include "staffwalker.hh"
+#include "debug.hh"
+#include "staff.hh"
+#include "command.hh"
+#include "lyricstaff.hh"
+#include "lyriccolumn.hh"
+#include "linepstaff.hh"
+#include "sccol.hh"
+#include "lyricwalker.hh"
+#include "pscore.hh"
+
+
+
+Lyric_staff::Lyric_staff()
+{
+ line_pstaff_p_ = 0;
+}
+
+Staff_column*
+Lyric_staff::create_col(Score_column*s)
+{
+ return new Lyric_column(s,this);
+}
+
+void
+Lyric_staff::set_output(PScore*ps)
+{
+ line_pstaff_p_ = new Linestaff(0,ps);
+ pscore_l_ = ps;
+ pscore_l_->add(line_pstaff_p_);
+}
+
+void
+Lyric_staff::walk()
+{
+ for (Lyric_walker lcols(this); lcols.ok(); lcols++) {
+ lcols.lcol_l()->process_requests();// TODO
+ lcols.process();
+ }
+}
+Staff *
+get_new_lyricstaff()
+{
+ return new Lyric_staff;
+}
--- /dev/null
+//
+// what about
+// #include "flower.hh"
+// #include "lily.hh"
+//
+// 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"
+#include "lyricstaff.hh"
+#include "lyricwalker.hh"
+#include "sccol.hh"
+#include "debug.hh"
+#include "lyricitem.hh"
+
+void
+Lyric_walker::do_word(Word_info)
+{
+}
+
+void
+Lyric_walker::do_INTERPRET_command(Command* )
+{
+// WARN << "command for Lyrics found\n";
+}
+
+void
+Lyric_walker::do_TYPESET_command(Command* )
+{
+// WARN << "command for Lyrics found\n";
+}
+
+void
+Lyric_walker::process_requests()
+{
+ Lyric_column* lcol_l = Lyric_walker::lcol_l();
+
+ for (int i = 0; i < lcol_l->winfo_array_.size(); i++) {
+ lcol_l->typeset_item(new Lyric_item(lcol_l->winfo_array_[i].lreq_l_, i));
+ }
+
+}
+
+Lyric_walker::Lyric_walker(Lyric_staff* lstaff_l)
+ : Staff_walker(lstaff_l, lstaff_l->line_pstaff_p_->pscore_l_)
+{
+ reset();
+}
+
+
+
+Lyric_staff*
+Lyric_walker::lstaff_l()
+{
+ return (Lyric_staff*)staff_;
+}
+
+Lyric_column*
+Lyric_walker::lcol_l()
+{
+ return (Lyric_column*) *(*this);
+}
+
+void
+Lyric_walker::reset()
+{
+}
+
#include "notehead.hh"
#include "paper.hh"
#include "molecule.hh"
-#include "linestaff.hh"
+#include "linepstaff.hh"
#include "rhythmstaff.hh"
#include "sccol.hh"
#include "localkeyitem.hh"
void
Melodic_staff::set_output(PScore*ps)
{
- theline = new Linestaff(NO_LINES,ps);
+ theline_l_ = new Linestaff(NO_LINES,ps); // theline_l_ is added to pscore later.
Simple_staff::set_output(ps);
}
}
Molecule*
-Meter::brew_molecule()const
+Meter::brew_molecule_p()const
{
Symbol s = paper()->lookup_p_->meter(args);
return new Molecule(Atom(s));
"cadenza", CADENZA,
"clef", CLEF,
"cm", CM,
+ "command", COMMAND,
"commands", COMMANDS,
"duration", DURATIONCOMMAND,
"geometric", GEOMETRIC,
"goto", GOTO,
"in", IN,
"key", KEY,
+ "lyric", LYRIC,
"mark", MARK,
"melodic", MELODIC,
"meter", METER,
#include "varray.hh"
#include "textdef.hh"
+
int default_duration = 4, default_dots=0, default_octave=0;
int default_plet_type = 1, default_plet_dur = 1;
String textstyle="roman"; // in lexer?
get_text(String s) return t;
{
t= new Text_def;
- t->text= s;
- t->style = textstyle;
+ t->text_str_= s;
+ t->style_str_ = textstyle;
return t;
}
return v;
}
+Voice_element*
+get_word_element(Text_def* tdef_p, int* duration)
+{
+ Voice_element* velt_p = new Voice_element;
+
+
+ int dur = duration[0];
+ int dots=duration[1];
+
+ Lyric_req* lreq_p = new Lyric_req(tdef_p);
+
+ lreq_p->balltype = dur;
+ lreq_p->dots = dots;
+ lreq_p->plet_factor = Moment(default_plet_dur, default_plet_type);
+ lreq_p->print();
+
+ velt_p->add(lreq_p);
+
+ return velt_p;
+}
+
Voice_element *
get_rest_element(String, int * duration )
{
return new Script_req(d, def);
}
-
Request*
get_text_req(int d , Text_def*def)
{
return v_p;
}
+Voice_element*
+get_command_element(Input_command*com_p)
+{
+ Voice_element *v_p = new Voice_element;
+ v_p->add(new Staff_command_req(com_p));
+ return v_p;
+}
+Voice_element*
+get_barcheck_element()
+{
+ Voice_element*v_p = new Voice_element;
+ v_p->add( new Barcheck_req);
+
+ return v_p;
+}
}
Molecule*
-Notehead::brew_molecule() const return out;
+Notehead::brew_molecule_p() const return out;
{
Paperdef *p = paper();
}
%token VOICE STAFF SCORE TITLE BAR NOTENAME OUTPUT
-%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS
+%token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS COMMAND
%token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
%token KEY CLEF VIOLIN BASS MULTI TABLE CHORD VOICES
-%token PARTIAL RHYTHMIC MELODIC MUSIC GROUPING CADENZA
+%token PARTIAL RHYTHMIC MELODIC MUSIC LYRIC GROUPING CADENZA
%token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET
%token MARK GOTO
%type <real> dim
%type <ii> duration
%type <moment> duration_length
-%type <el> voice_elt full_element
-%type <command> score_command staff_command skipcommand
+%type <el> voice_elt full_element lyrics_elt
+%type <command> score_command staff_command position_command
%type <score> score_block score_body
%type <staff> staff_block staff_init staff_body
%type <i> int
%type <music> music
%type <chord> music_chord music_chord_body
-%type <mvoice> music_voice_body music_voice
+%type <mvoice> music_voice_body music_voice
%type <interval> dinterval
%type <box> box
| score_commands_body score_command {
$$->add($2);
}
+ | score_commands_body position_command {
+ $$->add($2);
+ }
;
staff_commands_block: COMMANDS '{' staff_commands_body '}' {
| staff_commands_body staff_command {
$$->add($2);
}
+ | staff_commands_body position_command {
+ $$->add($2);
+ }
;
staff_command:
- skipcommand
- | KEY pitch_list {/*UGH*/
+ KEY pitch_list {/*UGH*/
$$ = get_key_interpret_command(*$2);
delete $2;
}
}
;
-skipcommand:
+position_command:
SKIP int ':' duration_length {
$$ = get_skip_command($2, *$4);
delete $4;
$$ = get_goto_command(*$2);
delete $2;
}
+ ;
score_command:
- skipcommand
- | BAR STRING {
+ BAR STRING {
$$ = get_bar_command(*$2);
delete $2;
}
| MELODIC {
$$ = new Input_staff( "melodic");
}
+ | LYRIC {
+ $$ = new Input_staff( "lyric");
+ }
;
staff_body:
}
;
-
music_chord: '{' music_chord_body '}' { $$ = $2; }
;
add_requests($2, post_reqs);
$$ = $2;
}
+ | MARK STRING {
+ $$ = get_mark_element(*$2);
+ delete $2;
+ }
+ | COMMAND '{' staff_command '}' { $$=get_command_element($3); }
+ | COMMAND '{' score_command '}' { $$=get_command_element($3); }
+ | '|' { $$ = get_barcheck_element(); }
+ | lyrics_elt
;
-
+
post_requests:
{
assert(post_reqs.empty());
;
open_request_parens:
- '|' {$$='|'}
- |')' {$$=')'}
+ ')' {$$=')'}
|'[' {$$='['}
;
delete $1;
}
- | MARK STRING {
- $$ = get_mark_element(*$2);
- delete $2;
- }
;
+lyrics_elt:
+ mudela_text duration {
+ $$ = get_word_element($1, $2);
+ };
+
/*
UTILITIES
*/
*mlog << "Parsing ... ";
#ifdef YYDEBUG
- yydebug = !monitor.silence("Parser") && check_debug;
+ yydebug = !monitor.silence("InitParser") && check_debug;
#endif
set_lexer();
lexer->new_input("symbol.ini");
yyparse();
+
+#ifdef YYDEBUG
+ yydebug = !monitor.silence("Parser") && check_debug;
+#endif
+
lexer->new_input(s);
yyparse();
kill_lexer();
return new Paperdef(
lexer->lookup_identifier("default_table")->lookup(true));
}
+
+
#include "scriptdef.hh"
#include "textdef.hh"
+#include "inputcommand.hh"
+
#define VIRTUALCONS(T,R) R *T::clone() const { return new T(*this); } struct T
#define RCONS(T) VIRTUALCONS(T, Request)
RCONS(Barcheck_req);
RCONS(Text_req);
RCONS(Rhythmic_req);
+RCONS(Lyric_req);
RCONS(Mark_req);
RCONS(Stem_req);
RCONS(Script_req);
RCONS(Span_req);
RCONS(Slur_req);
RCONS(Beam_req);
+RCONS(Staff_command_req);
+
void
Stem_req::print() const
{
mtor << "Stem\n";
}
+/****************/
void
Barcheck_req::print() const
{
mtor << "Barcheck\n";
#endif
}
-
+/****************/
void
Request::print() const
{
{
elt_l_ = 0;
}
+/****************/
Melodic_req::Melodic_req()
{
name = 0;
forceacc = false;
}
+void
+Melodic_req::print() const
+{
+ mtor << "note: " << name << " oct: "<< octave;
+}
+
int
Melodic_req::height() const
{
return name + octave*7;
}
+/****************/
Rhythmic_req::Rhythmic_req()
{
plet_factor = 1;
mtor<<", plet factor"<<plet_factor<<"\n";
}
-void
-Melodic_req::print() const
+
+Moment
+Rhythmic_req::duration() const {
+ return wholes(balltype,dots)*plet_factor;
+}
+/****************/
+
+Lyric_req::Lyric_req(Text_def* def_p)
+ :Text_req(0, def_p)
{
- mtor << "note: " << name << " oct: "<< octave;
+ def_p->align_i_ = 1; // raggedright
+ dir_i_ = -1; // lyrics below (invisible) staff
}
+void
+Lyric_req::print() const
+{
+ mtor << "lyric: ";
+ Rhythmic_req::print();
+ Text_req::print();
+}
+/****************/
void
Note_req::print() const
{
Melodic_req::print();
Rhythmic_req::print();
}
-
+/****************/
void
Rest_req::print() const
{
mtor << "rest, " ;
Rhythmic_req::print();
}
-
-
-Moment
-Rhythmic_req::duration() const {
- return wholes(balltype,dots)*plet_factor;
-}
-
+/****************/
Beam_req::Beam_req()
{
nplet = 0;
}
-
+/****************/
Span_req::Span_req()
{
spantype = NOSPAN;
}
-
+/****************/
Script_req::Script_req(int d , Script_def*def)
{
dir = d;
{
delete scriptdef;
}
+/****************/
-Text_req::Text_req(Text_req const& s)
+Text_req::~Text_req()
{
- spec = new Text_def(*s.spec);
- dir = s.dir;
+ delete tdef_p_;
+ tdef_p_ = 0;
+}
+
+Text_req::Text_req(Text_req const& src)
+{
+ tdef_p_ = new Text_def(*src.tdef_p_);
+ dir_i_ = src.dir_i_;
}
-Text_req::Text_req(int d , Text_def*def)
+
+Text_req::Text_req(int dir_i, Text_def* tdef_p)
{
- dir = d;
- spec = def;
+ dir_i_ = dir_i;
+ tdef_p_ = tdef_p;
}
void
Text_req::print() const
{
- mtor << " dir " << dir ;
- spec->print();
+ mtor << " dir " << dir_i_ ;
+ tdef_p_->print();
}
-Text_req::~Text_req()
-{
- delete spec;
-}
+
+/****************/
Mark_req::Mark_req(String s)
{
mtor<< "Mark `" << mark_str_ << "\'\n";
#endif
}
+/****************/
+Staff_command_req::Staff_command_req(Input_command * p)
+{
+ com_p_ = p;
+}
+Staff_command_req::~Staff_command_req()
+{
+ delete com_p_;
+}
+Staff_command_req::Staff_command_req(Staff_command_req const&src)
+{
+ com_p_ = new Input_command(*src.com_p_);
+}
+void
+Staff_command_req::print()const
+{
+ mtor << "Command request: " ;
+ com_p_->print();
+}
+
+
}
Molecule*
-Rest::brew_molecule()const
+Rest::brew_molecule_p()const
{
Paperdef *p =paper();
#include "request.hh"
#include "notehead.hh"
#include "stem.hh"
-#include "linestaff.hh"
+#include "linepstaff.hh"
#include "rhythmstaff.hh"
#include "paper.hh"
#include "sccol.hh"
void
Rhythmic_staff::set_output(PScore*ps)
{
- theline = new Linestaff(1,ps);
+ theline_l_ = new Linestaff(1,ps);
Simple_staff::set_output(ps);
}
}
Molecule*
-Script::brew_molecule() const
+Script::brew_molecule_p() const
{
Real dy = paper()->internote();
assert(i);
staff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_,
- staff_l_->theline,breakst);
+ staff_l_->theline_l_,breakst);
if (breakst == BREAK_PRE - BREAK_PRE) {
Array<Item*> to_move(
- staff_l_->pscore_l_->select_items(staff_l_->theline,
+ staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
score_column_l_->pcol_l_->prebreak_p_));
Interval column_wid = itemlist_width(to_move);
assert(!column_wid.empty());
else if (breakst == 2)
c = c->postbreak_p_;
- Array<Item*> to_move(staff_l_->pscore_l_->select_items(staff_l_->theline,
+ Array<Item*> to_move(staff_l_->pscore_l_->select_items(staff_l_->theline_l_,
c));
typeset_item(i, breakst);
Simple_staff::set_output(PScore* ps )
{
pscore_l_ = ps;
- pscore_l_->add(theline);
+ pscore_l_->add(theline_l_);
}
#include "request.hh"
#include "voice.hh"
-#include "swalker.hh"
+#include "staffwalker.hh"
#include "debug.hh"
#include "clef.hh"
#include "staff.hh"
staff_l_ = rs;
beam_ = 0;
text_=0;
+ lreq_p_ = 0;
}
Simple_staff::Simple_staff()
{
- theline = 0;
+ theline_l_ = 0;
}
/**
if (rq->text()) {
text_ = rq->text();
}
+#if 0
+ if (rq->lreq_l()) {
+ lreq_p_ = rq->lreq_l();
+ }
+#endif
if (rq->beam()) {
beam_ = rq->beam();
}
#include "slur.hh"
#include "localkeyitem.hh"
#include "textitem.hh"
+#include "lyricitem.hh"
Rhythmic_grouping
parse_grouping(Array<Scalar> a, Moment one_beat)
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);
}
if (c->beam_&& c->beam_->spantype == Span_req::STOP) {
default_grouping.extend(current_grouping->interval());
beam_->set_grouping(default_grouping, *current_grouping);
- pscore_->typeset_spanner(beam_, s->theline);
+ pscore_->typeset_spanner(beam_, s->theline_l_);
if (c->beam_->nplet) {
Text_spanner* t = new Text_spanner(beam_);
- t->spec.align = 0;
- t->spec.text = c->beam_->nplet;
- pscore_->typeset_spanner(t, s->theline);
+ t->spec.align_i_ = 0;
+ t->spec.text_str_ = c->beam_->nplet;
+ pscore_->typeset_spanner(t, s->theline_l_);
}
beam_ = 0;
error_t("can't find slur to end; ", *c->tdescription_);
pscore_->typeset_spanner(pending_slurs[idx],
- s->theline);
+ s->theline_l_);
pending_slurs.del(idx);
pending_slur_reqs.del(idx);
}
}
Simple_walker::Simple_walker(Simple_staff*s)
- : Staff_walker(s, s->theline->pscore_l_)
+ : Staff_walker(s, s->theline_l_->pscore_l_)
{
stem_ = 0;
beam_ =0;
}
Molecule*
-Slur::brew_molecule() const
+Slur::brew_molecule_p() const
{
Molecule*output = new Molecule;
if (!rnote_p->extremal)
right_off+= Offset(-0.5, -dir);
- int dy = right_off.y - left_off.y;
+ int dy = int(right_off.y - left_off.y);
Real nw_f = paper()->note_width();
Real nh_f = paper()->internote();
#include "staff.hh"
#include "score.hh"
#include "voice.hh"
-#include "swalker.hh"
+#include "staffwalker.hh"
#include "stcol.hh"
#include "sccol.hh"
#include "staffcommands.hh"
PointerList<Input_command*> staff_wide)
{
Input_commands commands;
+
+ // bring in commands from voices.
+ for (iter_top(voices, i); i.ok(); i++) {
+ Moment here = i->start;
+ for (iter_top(i->elts, j); j.ok(); j++) {
+ for (iter_top(j->reqs, k); k.ok(); k++) {
+ if (k->command()){
+ commands.find_moment(here);
+ commands.add(*k->command()->com_p_,
+ score_l_->markers_assoc_);
+ }
+ }
+ here += j->duration;
+ }
+ }
for (iter_top(score_wide,i); i.ok(); i++)
commands.add(**i, score_l_->markers_assoc_);
for (iter_top(staff_wide,i); i.ok(); i++)
- commands.add(**i,score_l_->markers_assoc_);
+ commands.add(**i, score_l_->markers_assoc_);
commands.parse(this);
}
Interval
Staff_elem::width() const
{
- Molecule*m= brew_molecule();
Interval r;
if (!output){
- Molecule*m = brew_molecule();
+ Molecule*m = brew_molecule_p();
r = m->extent().x;
delete m;
} else
Interval r;
if (!output){
- Molecule*m = brew_molecule();
+ Molecule*m = brew_molecule_p();
r = m->extent().y;
delete m;
} else
if (dependencies[i])
dependencies[i]->molecule_processing();
if (!calc_children)
- output= brew_molecule();
+ output= brew_molecule_p();
status = OUTPUT;
}
static String
make_vbox(Interval i)
-{
+{
+ Real r = (i.empty()) ? 0.0 : i.length();
String s("\\vbox to ");
- s += print_dimen(i.length());
+ s += print_dimen(r);
s += "{\\vskip "+print_dimen(i.right)+" ";
return s;
}
s += "\\hbox{";
{
((PStaff*)pstaff_l_)->
- brew_molecule(line_of_score_l_->pscore_l_->paper_l_->linewidth);
+ brew_molecule_p(line_of_score_l_->pscore_l_->paper_l_->linewidth);
s+=pstaff_l_->stafsym_p_->TeXstring();
iter_top(line_of_score_l_->cols,cc);
s +=String( "\\kern ") + print_dimen(delta);
// now output the items.
-
for (iter_top(cc->its,i); i.ok(); i++) {
if (i->pstaff_l_ == pstaff_l_)
s += i->TeXstring();
Line_of_staff::process()
{
if (!pstaff_l_->stafsym_p_)
- pstaff_l_->brew_molecule(line_of_score_l_->pscore_l_->
- paper_l_->linewidth);
+ pstaff_l_->brew_molecule_p(line_of_score_l_->pscore_l_->
+ paper_l_->linewidth);
}
--- /dev/null
+#include "request.hh"
+#include "staffwalker.hh"
+#include "stcol.hh"
+#include "sccol.hh"
+
+Staff_walker::~Staff_walker() {}
+Staff_walker::Staff_walker(Staff_walker const &s)
+ :PCursor<Staff_column*> (s)
+{
+ assert(false);
+}
+
+Staff_walker::Staff_walker(Staff * s, PScore*ps )
+ : PCursor<Staff_column*> (s->cols)
+{
+ staff_ = s;
+ pscore_ = ps;
+ break_status = BREAK_END - BREAK_PRE;
+}
+
+Moment
+Staff_walker::when() const
+{
+ return (* (PCursor<Staff_column*> *) this)->when();
+}
+
+void
+Staff_walker::process()
+{
+ break_status = BREAK_END - BREAK_PRE;
+ if (ptr()->staff_commands_p_)
+ for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
+ process_command(i);
+ }
+
+ process_requests();
+}
+
+
+void
+Staff_walker::process_command(Command*com)
+{
+ switch (com->code){
+ case BREAK_PRE:
+ case BREAK_MIDDLE:
+ case BREAK_POST:
+ case BREAK_END:
+ (*this)->score_column_l_->set_breakable();
+ break_status = com->code- BREAK_PRE;
+ break;
+ case INTERPRET:
+ do_INTERPRET_command(com);
+ break;
+
+ case TYPESET:
+ do_TYPESET_command(com);
+ break;
+
+ default :
+ break;
+ }
+}
+
+void
+Staff_walker::operator++(int i)
+{
+ PCursor<Staff_column*>::operator++(i);
+ reset();
+}
}
Molecule*
-Stem::brew_molecule()const return out;
+Stem::brew_molecule_p()const return out;
{
assert(bot!=top);
+++ /dev/null
-#include "request.hh"
-#include "swalker.hh"
-#include "stcol.hh"
-#include "sccol.hh"
-
-Staff_walker::~Staff_walker() {}
-Staff_walker::Staff_walker(Staff_walker const &s)
- :PCursor<Staff_column*> (s)
-{
- assert(false);
-}
-
-Staff_walker::Staff_walker(Staff * s, PScore*ps )
- : PCursor<Staff_column*> (s->cols)
-{
- staff_ = s;
- pscore_ = ps;
- break_status = BREAK_END - BREAK_PRE;
-}
-
-Moment
-Staff_walker::when() const
-{
- return (* (PCursor<Staff_column*> *) this)->when();
-}
-
-void
-Staff_walker::process()
-{
- break_status = BREAK_END - BREAK_PRE;
- if (ptr()->staff_commands_p_)
- for (iter_top(*ptr()->staff_commands_p_,i); i.ok(); i++) {
- process_command(i);
- }
-
- process_requests();
-}
-
-
-void
-Staff_walker::process_command(Command*com)
-{
- switch (com->code){
- case BREAK_PRE:
- case BREAK_MIDDLE:
- case BREAK_POST:
- case BREAK_END:
- (*this)->score_column_l_->set_breakable();
- break_status = com->code- BREAK_PRE;
- break;
- case INTERPRET:
- do_INTERPRET_command(com);
- break;
-
- case TYPESET:
- do_TYPESET_command(com);
- break;
-
- default :
- break;
- }
-}
-
-void
-Staff_walker::operator++(int i)
-{
- PCursor<Staff_column*>::operator++(i);
- reset();
-}
Text_def::Text_def()
{
- align = 1; // right
- style = "roman";
+ align_i_ = 1; // right
+ style_str_ = "roman";
}
Atom
-Text_def::create(Paperdef*p) const
+Text_def::create_atom(Paperdef*p) const
{
- return p->lookup_p_->text(style, text, -align);
+ return p->lookup_p_->text(style_str_, text_str_, -align_i_);
}
void
Text_def::print() const
{
- mtor << "Text `" << text << "\', style " <<
- style << "align " <<align<<'\n';
+ mtor << "Text `" << text_str_ << "\', style " <<
+ style_str_ << "align " << align_i_ << '\n';
}
#include "molecule.hh"
#include "lookup.hh"
-Text_item::Text_item(Text_req * r, int s)
+Text_item::Text_item(Text_req* treq_l, int staffsize_i)
{
- dir = r->dir;
- if (!dir)
- dir = -1;
-
- specs = r->spec;
- staffsize = s;
- pos = 0;
+ staffsize_i_ = staffsize_i;
+ dir_i_ = treq_l->dir_i_;
+ if (!dir_i_)
+ dir_i_ = -1;
+ tdef_l_ = treq_l->tdef_p_;
}
void
Text_item::set_default_pos()
{
- pos = (dir > 0) ? staffsize + 2: -4;
+ pos_i_ = (dir_i_ > 0) ? staffsize_i_ + 2: -4;
}
+
void
Text_item::do_pre_processing()
{
Molecule*
-Text_item::brew_molecule() const
+Text_item::brew_molecule_p() const
{
- Molecule* output = new Molecule(specs->create(paper()));
- if(dir <0)
- output->translate(Offset(0, -output->extent().y.length() ));
+ Molecule* mol_p = new Molecule(tdef_l_->create_atom(paper()));
+ mol_p->translate(Offset(0, pos_i_ * paper()->internote()));
+
+ if(dir_i_<0)
+ mol_p->translate(Offset(0, -mol_p->extent().y.length() ));
- output->translate(Offset(0, pos * paper()->internote()));
- return output;
+ return mol_p;
}
void
Text_spanner::do_post_processing()
{
- switch(spec.align) {
+ switch(spec.align_i_) {
case 0:
tpos = support->center();
break;
}
Molecule*
-Text_spanner::brew_molecule() const
+Text_spanner::brew_molecule_p() const
{
- Atom tsym (spec.create(paper()));
+ Atom tsym (spec.create_atom(paper()));
tsym.translate(tpos);
Molecule*output = new Molecule;
Interval
Text_spanner::height()const
{
- return brew_molecule()->extent().y;
+ return brew_molecule_p()->extent().y;
}
Spanner*
one_beat = 1/Moment(o);
whole_per_measure = Moment(l) * one_beat;
if(whole_in_measure)
- error_t("Meterchange should be at start of measure", when);
+ error_t("Meterchange should be at start of measure", *this);
}
void
void
error_t(const String& s, const Moment& r)
{
- String t_mom = String(trunc(r)) + (r - Moment(trunc(r)));
- String e=s+ "(t = " + t_mom + ")";
+ String t_mom = String(trunc(r)) + String(r - Moment(trunc(r)));
+ String e=s+ " (t = " + t_mom + ")";
error(e);
}
void
error_t(const String& s, Time_description const &t_tdes)
{
- String e=s+ "(at " + t_tdes.bars + ": " + t_tdes.whole_in_measure + ")\n";
+ String e=s+ " (at t=" + t_tdes.bars + ": " + t_tdes.whole_in_measure + ")\n";
error(e);
}