]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.24 release/0.0.24
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Jan 1997 10:35:22 +0000 (11:35 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 24 Jan 1997 10:35:22 +0000 (11:35 +0100)
84 files changed:
.dstreamrc
Documentation/Makefile
Documentation/README.pod
Documentation/lilyinput.pod
Makefile
NEWS
Sources.make
TODO
Variables.make
clean [deleted file]
clearlily [new file with mode: 0755]
configure
deps/Makefile
hdr/bar.hh
hdr/beam.hh
hdr/clefitem.hh
hdr/keyitem.hh
hdr/linepstaff.hh [new file with mode: 0644]
hdr/linestaff.hh [deleted file]
hdr/localkeyitem.hh
hdr/meter.hh
hdr/notehead.hh
hdr/parseconstruct.hh
hdr/pcol.hh
hdr/proto.hh
hdr/pstaff.hh
hdr/request.hh
hdr/rest.hh
hdr/script.hh
hdr/simplestaff.hh
hdr/slur.hh
hdr/staffelem.hh
hdr/staffwalker.hh [new file with mode: 0644]
hdr/stem.hh
hdr/swalker.hh [deleted file]
hdr/textdef.hh
hdr/textitem.hh
hdr/textspanner.hh
input/Makefile
input/kortjakje.ly
input/pavane.ly
input/standchen.lily
input/twinkle.ly [new file with mode: 0644]
objects/Makefile
src/bar.cc
src/beam.cc
src/clefitem.cc
src/inputcommands.cc
src/inputstaff.cc
src/keyitem.cc
src/lexer.l
src/linepstaff.cc [new file with mode: 0644]
src/linestaff.cc [deleted file]
src/localkeyitem.cc
src/lookup.cc
src/lyriccolumn.cc [new file with mode: 0644]
src/lyricitem.cc [new file with mode: 0644]
src/lyricstaff.cc [new file with mode: 0644]
src/lyricwalker.cc [new file with mode: 0644]
src/melodicstaff.cc
src/meter.cc
src/mylexer.cc
src/note.cc
src/notehead.cc
src/parser.y
src/request.cc
src/rest.cc
src/rhythmstaff.cc
src/script.cc
src/simpleprint.cc
src/simplestaff.cc
src/simplewalker.cc
src/slur.cc
src/staff.cc
src/staffelem.cc
src/staffline.cc
src/staffwalker.cc [new file with mode: 0644]
src/stem.cc
src/swalker.cc [deleted file]
src/textdef.cc
src/textitem.cc
src/textspanner.cc
src/timedescription.cc
src/warn.cc

index 12afafc563eb9e1e39f55622c74250f63335d67c..85ab21bde2da9f9c7ec67ff9f6dbd224b9024ecb 100644 (file)
@@ -12,10 +12,12 @@ PScore                      1
 Idealspacing           1
 
 # yydebug
-Parser                 0
+InitParser             1
+Parser                 1
+
 
 # FlexLexer debug
-Lexer                  0
+Lexer                  1
 
 parse_duration         1
 parse_pitchmod         1
index 618bd6f111b234fbfd31c9e919e5820dd42cc0f8..ab7466ffe5b9f72bf5a70f0defdaebd68439d4f8 100644 (file)
@@ -2,6 +2,7 @@ PODS=README.pod CodingStyle.pod lilygut.pod lilyinput.pod error.pod\
        faq.pod
 TXTS=$(PODS:.pod=.txt)
 MANS=$(PODS:.pod=.1)
+HTMLS=$(PODS:.pod=.html)
 DISTFILES=$(PODS) Makefile
 
 
@@ -22,3 +23,5 @@ clean:
        pod2man --center="LilyPond documentation" --section="0"\
                --release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
 
+html: 
+       pod2html
\ No newline at end of file
index 491c18e06ab9653e69efc4de61c4bff3663805f1..cc82b196bb42da3759f6106278049a2a221b98de 100644 (file)
@@ -17,7 +17,8 @@ music. LilyPond has these features:
 
 =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 *
@@ -28,13 +29,18 @@ multiple stafftypes (melodic, rhythmic)
 
 =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
@@ -162,10 +168,12 @@ flex (2.5.1 or better)
 =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
@@ -227,7 +235,8 @@ named return values
 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.
@@ -293,15 +302,19 @@ This is a beta version of LilyPond. Please send your helpful 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/>,
index d359bb39bd7483a62e23586bab45a3ea82d47b75..4e8367d3d006818efad7c6228c1003acb6da350b 100644 (file)
@@ -30,13 +30,18 @@ In musicmode, eg,
 
        ''!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.
index 584d0dc60c2db92312a496c58d73839824b9094a..c2b59dc66ae50e9e333eb50419dab3227dd7d12c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,33 +3,30 @@ include Variables.make
 .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) 
diff --git a/NEWS b/NEWS
index 93baaa2807e1839743436aa14c94d6c93894134f..696755258eb9c08a1b82f486acefb2632da8217f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+pl 24:
+       - Lyrics
+       - Commands in music-mode (an input feature) (there you are, Mats)
 
 pl 23:
        - TODO file inc'd
@@ -6,9 +9,10 @@ pl 23:
        - 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
index afadfff786cdf877b1c85934ab4d022092784c29..573861e9b72e42fe8902cf32e186faad13a272c2 100644 (file)
@@ -6,14 +6,16 @@ hdr=   accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.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\
-       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\
@@ -21,15 +23,17 @@ 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\
diff --git a/TODO b/TODO
index 70e3590b8a5ffe78aaac8e6a40e6d88c647f890a..9b81ff8667b17fb4506faf4ed8b747c99fb5f527 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,4 @@
+
 BUGS
        * first clef
 
@@ -9,6 +10,10 @@ SEVERELY LACKING:
 
 INPUTLANGUAGE
 
+       * lexer condition stack
+
+       * lose the $ and @?
+
        * figured bass?
 
        * transposition
@@ -19,6 +24,10 @@ INPUTLANGUAGE
 
 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.)
@@ -45,7 +54,7 @@ SMALLISH PROJECTS
 
        * fix symbols in parser.o: `Warning: size of symbol'
 
-       * Viola clef (->jan?!)
+       * Viola clef
 
 DOC
 
@@ -54,6 +63,9 @@ DOC
        * all errors
 
 FUTURE
+       * Command_req
+       
+       * scrap stem_request?
 
        * Text_pstaff/Lyric_staff
 
@@ -71,6 +83,8 @@ FUTURE
 
        * Implement all requests
 
+       * merge key{item} & localkey{item}
+
        * QLP for beams?
 
        * stacked slurs.
index 768dcc5adb9e5e0d79aac375eb7d87ebbd6005b5..8d7ce55b66a9ea35980c63c3640328ccb714cf8f 100644 (file)
@@ -7,7 +7,7 @@ OPTIFLAG=-DNDEBUG -DNPRINT -O2
 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.
@@ -37,7 +37,7 @@ endif
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=23
+PATCHLEVEL=24
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 CXXVER=`$(CXX) --version`
 
@@ -80,7 +80,7 @@ DNAME=$(PACKAGENAME)-$(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
diff --git a/clean b/clean
deleted file mode 100755 (executable)
index 34eb6c9..0000000
--- a/clean
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# unclobber current dir.
-rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
\ No newline at end of file
diff --git a/clearlily b/clearlily
new file mode 100755 (executable)
index 0000000..34eb6c9
--- /dev/null
+++ b/clearlily
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# unclobber current dir.
+rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
\ No newline at end of file
index 37d5742e10440d97b17c574cdaaf3b2776f74db9..603a202fe6531523786d42b1352dd7ce2cca31a3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,7 +1,29 @@
 #!/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
index 0d303b3d38451b61b2f74e625dddf8efed8b37e0..00140e7826b79639dc4af1cc1f3d7ac494b6a1d5 100644 (file)
@@ -1,4 +1,6 @@
 DISTFILES=Makefile
 dist:
        ln $(DISTFILES) $(DDIR)/$(SUBDIR)
-       
\ No newline at end of file
+
+clean:
+       rm *.dep
index 2a360b0d73a7e5646713903f6e60d3f92b624b68..2df42d65030c88ca3f6b9613ba0336a8d498aba4 100644 (file)
@@ -13,7 +13,7 @@ struct Bar: Item {
     
     Bar(String type);
 
-    Molecule*brew_molecule()const;
+    Molecule*brew_molecule_p()const;
 };
 #endif // BAR_HH
 
index 96c65b12b0733f0d6ac4271b63d7df60679afcda..548641aecb5b82e0744a69c1dfbf8a3b3b604850 100644 (file)
@@ -38,7 +38,7 @@ struct Beam:  public Directional_spanner {
 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 */
index ccedc4e9a7684145544e8f2d529ad8d2a4fc6d67..9dbfffe5cd36249d3ff75bce34563e705a62cc5e 100644 (file)
@@ -21,7 +21,7 @@ struct Clef_item : Item {
     Clef_item();
     void read(Clef);
     void read(String);
-    Molecule* brew_molecule()const;
+    Molecule* brew_molecule_p()const;
 };
 
 #endif // CLEFITEM_HH
index 72f9680e1a6a3440a48a53a858dc2a519d1c841f..05a6cf79c2b26b8ed0f0e3198b7533e306dc5b0c 100644 (file)
@@ -25,7 +25,7 @@ struct Keyitem : Item {
 
     void preprocess();
 
-    Molecule* brew_molecule()const;
+    Molecule* brew_molecule_p()const;
 };
 /**
   An item which places accidentals at the start of the line
diff --git a/hdr/linepstaff.hh b/hdr/linepstaff.hh
new file mode 100644 (file)
index 0000000..3e88f8c
--- /dev/null
@@ -0,0 +1,11 @@
+#include "pstaff.hh"
+
+struct Linestaff : PStaff {
+    
+    int nolines;
+
+/****************/
+    
+    void brew_molecule_p(Real width);
+    Linestaff(int, PScore*);   
+};
diff --git a/hdr/linestaff.hh b/hdr/linestaff.hh
deleted file mode 100644 (file)
index c11d781..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "pstaff.hh"
-
-struct Linestaff : PStaff {
-    
-    int nolines;
-
-/****************/
-    
-    void brew_molecule(Real width);
-    Linestaff(int, PScore*);   
-};
index c8cca9d7c10e5b6e28164b02231b655782476c57..b4cf832c3e268df697091e4e863438c9add08abc 100644 (file)
@@ -25,7 +25,7 @@ struct Local_key_item : Item {
     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
 
index 11166232add4416834174ad2200ff04eae7717f8..1557ce4709464f189f4a6d9708a6db563a7ad401 100644 (file)
@@ -14,7 +14,7 @@ struct Meter: Item {
     /****************/
     
     Meter(Array<Scalar> args) ;
-    Molecule*brew_molecule() const;
+    Molecule*brew_molecule_p() const;
 };
 #endif // METER_HH
 
index 18612b06c666d33c07ad410dd13a303e126dfb08..a032ca1273087bc163b72ed3060ee413a198c328 100644 (file)
@@ -30,7 +30,7 @@ struct Notehead : public Item
 
     void print()const;
     static int compare(Notehead*&a, Notehead*&b) ;
-    Molecule* brew_molecule()const;
+    Molecule* brew_molecule_p()const;
 };
 /**
   takes care of:
index 6a22127a384035641ceea8ae14e0e7e39372208d..9bc9434ffc6f4c18cbb430fc6c13f55e1163a567 100644 (file)
@@ -17,7 +17,9 @@ 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);
@@ -25,7 +27,7 @@ Script_def* get_scriptdef(char);
 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
 
index a0f2a87624b76fb2008d7845ccb044f44477c0ac..1d3ff34ca849c02d56a8e58014df01abfebe0fc2 100644 (file)
@@ -79,7 +79,7 @@ private:
   */
 
 #include "compare.hh"
-instantiate_compare(const PCol &, PCol::compare);
+instantiate_compare(PCol &, PCol::compare);
      
 
 #endif
index 8be03e72f70e9ae0c615827ed8b6012f9be0c1ae..0d32486ed4c085718506897123e3b90aa769c885 100644 (file)
@@ -11,7 +11,6 @@
 #include "fproto.hh"
 #include "real.hh"
 
-
 struct Absdynamic_req;
 struct Accidental;
 struct Atom;
@@ -69,6 +68,7 @@ struct Slur_req;
 struct Span_req;
 struct Spanner;
 struct Staff;
+struct Staff_command_req;
 struct Col_configuration;
 struct Staff_column;
 struct Stem;
@@ -103,5 +103,6 @@ struct Time_description;
 struct Script_def;
 struct Text_def;
 struct Text_req;
+struct Lyric_req;
 struct Melodic_req;
 #endif // PROTO_HH
index 78a68fb306a29542d087be3574992b1f180f30a2..87bd919c67a7a60604eb5986b533eb2e7c231ceb 100644 (file)
@@ -15,7 +15,7 @@ struct PStaff {
     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();
index 12382d0bf7b317ea68f1283124a2f1d963c3a93f..c401fcdd9d7ba709950f6641e298ae9c002b7297 100644 (file)
@@ -6,7 +6,7 @@
 #include "string.hh"
 #include "moment.hh"
 
-/// a voice element wants something printed
+/// Hungarian postfix: req
 struct Request {
     Voice_element*elt_l_;
     
@@ -31,11 +31,14 @@ struct Request {
     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
  */
        
@@ -60,6 +63,30 @@ struct Rhythmic_req : virtual Request {
 };
 
 
+///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
@@ -167,19 +194,6 @@ struct Script_req : Request {
 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_;
@@ -190,6 +204,15 @@ struct Mark_req : Request {
     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
 
@@ -285,6 +308,10 @@ struct Spacing_req {
 struct Glissando_req : Span_req {
     
 };
-
+struct Stemdir_req : Request {
+    int which;
+};
+struct Group_change_req : Request {
+};
 #endif
 #endif
index e13c540212ae78e5f2cc385ce6d3b3715db26c00..d3f944f57ec86c99463068788527d4577b4ecf4c 100644 (file)
@@ -20,7 +20,7 @@ struct Rest : public Item
     Rest(int dur,int dots);
     void print()const;
 
-    Molecule* brew_molecule()const;
+    Molecule* brew_molecule_p()const;
 };
 /**
   takes care of:
index 7b6cf37b247a731520a2297ec1a02dc5cd6314e2..be21a60829cf08353e1fec6a92b5eadafa03cb70 100644 (file)
@@ -25,7 +25,7 @@ struct Script : Item{
     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);
index bdd1f061361e9793bb0a0c40a71009a5485f08d5..531f994d6e8594ca0b84a0ae111b2a45e1d085b8 100644 (file)
@@ -10,7 +10,7 @@
 #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.   
@@ -34,6 +34,7 @@ struct Simple_column : Staff_column {
     Beam_req *beam_;
     Simple_staff* staff_l_;
     Text_req *text_;
+    Lyric_req* lreq_p_;
     
     /****************/
     Slur_req  * find_slur(Voice *);
@@ -52,7 +53,7 @@ struct Simple_column : Staff_column {
 /// 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*);
index 8c0cbd4ebefdf44b1e6d2c10a6d6d0b19e509f46..26bb2ff36e33ca0711b204d2733402d7fc7778d0 100644 (file)
@@ -30,7 +30,7 @@ struct Slur : Directional_spanner {
     Spanner* do_break_at( PCol*, PCol*) const;
     void process();
 private:
-Molecule*brew_molecule()const;
+Molecule*brew_molecule_p()const;
 };
 
 #endif // SLUR_HH
index e48170d4d213c38f9171f05a767a8f923fcad704..3eed7dfba7e0a5775a48b2d8a15efb1ea5083d53 100644 (file)
@@ -43,7 +43,7 @@ struct Staff_elem {
     
 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
diff --git a/hdr/staffwalker.hh b/hdr/staffwalker.hh
new file mode 100644 (file)
index 0000000..d994522
--- /dev/null
@@ -0,0 +1,47 @@
+
+/*
+  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
+
index 977a719ae900c4f712f1cbe0994b98c1d80dcaff..8788d5a53dc1331d4337e6ffa457121b649b03bf 100644 (file)
@@ -67,7 +67,7 @@ struct Stem : public Item {
 
     Interval width() const;
 
-    Molecule* brew_molecule() const;
+    Molecule* brew_molecule_p() const;
 };
 /**
   takes care of:
diff --git a/hdr/swalker.hh b/hdr/swalker.hh
deleted file mode 100644 (file)
index d224477..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/*
-  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
-
index 2befb6bb4dbabb4a7a761ea2cca9b2b1f82bb8ae..6682221761d63d3cb1f4f7e658e795d06db649ff 100644 (file)
@@ -8,17 +8,20 @@
 #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
 
index ffeeafbb820fb305eae41538d31141d155486a07..bd4ea924d23134f2460f458eab556ee25e269ffe 100644 (file)
 #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);
index 4baf832a39ed892aedaa8d6bcf05b30a5eb248fb..81c8b87c328e35767d4222843d50b38c9b29b300 100644 (file)
@@ -19,7 +19,7 @@ struct Text_spanner : Spanner {
     /****************/
     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;
index 439a77eddce16a76cfc263287f5690066e03d81d..cf9a3c5d6a5d039005fb004ac5d62e412d9b6a5a 100644 (file)
@@ -1,7 +1,7 @@
 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)
index fa54120b50bebad63b1cc32f3c1f0bf6f36828ed..9b2054f83db8bce106f70374c779bf44966a74f9 100644 (file)
@@ -1,6 +1,7 @@
-% "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.
 
index ec31ea1aa05b9a35bc6ea69ce1472d62c305ed76..b820506b6069ad808139433aa28e35c38f2f75b4 100644 (file)
@@ -33,8 +33,8 @@ staff {melodic
        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]     |
@@ -70,7 +70,9 @@ staff {melodic
        | [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       |
@@ -104,13 +106,10 @@ score {
        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
index 9af02f0a5d3a06a78e61be358c3f577546cdf129..a7e4d370eb697aaeac394b1ab72d4be56f854c05 100644 (file)
@@ -30,9 +30,9 @@
 %%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
@@ -365,7 +365,7 @@ score {
                }
        }
        commands { 
-               meter 3 
+               meter 3*
                skip 4:0
                bar ":|"
                skip 32:0
diff --git a/input/twinkle.ly b/input/twinkle.ly
new file mode 100644 (file)
index 0000000..2cd786c
--- /dev/null
@@ -0,0 +1,159 @@
+%  "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 "||"
+       }
+}
+
index 228fde37edfb8c0cf76501e0a3d3931bdd5c4813..479dbfe1c220d47a7a7b171c984bd8556b2bc520 100644 (file)
@@ -1,3 +1,6 @@
 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
index edfd6a8e3c40d609ec294a6deea5efa916848224..b18c500e62d8504a2b0d8a2cc872dd5e4d6d23f7 100644 (file)
@@ -10,7 +10,7 @@ Bar::Bar( String t)
     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));
index c65dc5811590aded016e27db29f35cfb6fe2a94e..c36ca67436933b5083eefdf98907dd6fbed6fa0a 100644 (file)
@@ -255,7 +255,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
 
 
 Molecule*
-Beam::brew_molecule() const return out;
+Beam::brew_molecule_p() const return out;
 {
     Real inter=paper()->internote();
     out = new Molecule;
index c6b8f09d0bb98c61664407549205079c2fffcc65..d5237513a29a04f85f4977f8d57f22f2d231a628 100644 (file)
@@ -26,7 +26,7 @@ Clef_item::read(Clef k)
 }
 
 Molecule*
-Clef_item::brew_molecule()const
+Clef_item::brew_molecule_p()const
 {
     String t = type;
     if  (change)
index 968d29c9a9136cd09352f406dc3dbce876998f85..ef2014604c2a5a1f025189b580986f271c272077 100644 (file)
@@ -118,6 +118,11 @@ Input_cursor::find_moment(Moment w)
 
 
 /****************/
+void
+Input_commands::find_moment(Moment m)
+{
+    ptr.find_moment(m);
+}
 
 Input_commands::Input_commands(Input_commands const&src)
     : ptr(src.ptr)
@@ -155,7 +160,7 @@ Input_commands::add(Input_command c, Assoc<String,Moment> &marks_assoc_r)
 {
     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") {
index c121984cd08aba4feed722be521a2ba1c516ae06..70d91c669f8ce9d4d5f01f899b1cf6a23c6aff6f 100644 (file)
@@ -7,6 +7,7 @@
 #include "staffcommands.hh"
 #include "melodicstaff.hh"
 #include "rhythmstaff.hh"
+#include "lyricstaff.hh"
 #include "staff.hh"
 
 void
@@ -38,6 +39,8 @@ Input_staff::parse(Score*score_l)
        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_;
     
index 29b1f25e5c9fc91ad59e3622280ec6c85299bb3e..3a80c28e1f102e24440edcba33471188ca69ba88 100644 (file)
@@ -31,7 +31,7 @@ Keyitem::add(int p, int a)
 
 
 Molecule*
-Keyitem::brew_molecule()const
+Keyitem::brew_molecule_p()const
 {
     Molecule*output = new Molecule;
     Real inter = paper()->interline()/2;
index 2b15b352e866a14fd84438e2f8ee417cd43e4399..1d758796b2bd0b78a8e0a6834855f6fb72fca3f6 100644 (file)
@@ -20,6 +20,7 @@
 %x notes
 %x incl
 %x quote
+%x lyrics
 
 
 
@@ -27,6 +28,9 @@ A             [a-zA-Z]
 AA             {A}|_
 N              [0-9]
 AN             {AA}|{N}
+PUNCT          [?!,.:;]
+ACCENT         [\\'"^]
+TEX            {AA}|-|{PUNCT}|{ACCENT}
 
 WORD           {A}{AN}*
 ALPHAWORD      {A}+
@@ -39,6 +43,8 @@ RESTNAME      r|s|p
 NOTECOMMAND    \\{WORD}
 NOTENAME       {ALPHAWORD}
 DOTS           \.+
+LYRICS         {TEX}+
+COMMENT                [%#].*\n
 
 %%
 
@@ -46,6 +52,10 @@ DOTS         \.+
        BEGIN(notes); 
 }
 
+\@             {
+       BEGIN(lyrics); 
+}
+
 <notes>{RESTNAME}      {
        const char *s = YYText();
        yylval.string = new String (s); 
@@ -95,8 +105,7 @@ DOTS         \.+
        yylval.i = String(YYText()).value();
        return INT;
 }
-<notes>[%#].*\n                { 
-
+<notes>{COMMENT}       {
 }
 <notes>[ \t\n]+                {
 
@@ -114,13 +123,8 @@ DOTS               \.+
        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];
 }
 
 \"             {
@@ -135,6 +139,61 @@ DOTS               \.+
        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>>";
 
@@ -193,7 +252,7 @@ include           { BEGIN(incl); }
        
 }
 
-%.*            {
+{COMMENT}              {
        //ignore
 }
 .              {
diff --git a/src/linepstaff.cc b/src/linepstaff.cc
new file mode 100644 (file)
index 0000000..ef2c55d
--- /dev/null
@@ -0,0 +1,27 @@
+#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);
+}
+
+
+
+
+
+
+
diff --git a/src/linestaff.cc b/src/linestaff.cc
deleted file mode 100644 (file)
index f9430e9..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#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);
-}
-
-
-
-
-
-
-
index d23b26277f64884f95f94e16abb556be24effb3b..b210dbdac3ee2c5a0762fca35151c8f51fa516dc 100644 (file)
@@ -27,7 +27,7 @@ Local_key_item::do_pre_processing()
     accs.sort(Local_acc::compare);
 }
 Molecule*
-Local_key_item::brew_molecule()const
+Local_key_item::brew_molecule_p()const
 {
 
     Molecule*    output = new Molecule;
index 200ae0994b9693da588ee58b5d30cdb6277b86c3..befa5427065022d9ffd23d54e30de8549578a33e 100644 (file)
@@ -29,7 +29,7 @@ Lookup::add(String s, Symtable*p)
 }
 
 Symbol
-Lookup::text( String style, String text , int dir)
+Lookup::text(String style, String text, int dir)
 {
     Array<String> a;
  
@@ -66,6 +66,7 @@ Lookup::rest(int j)
 {
     return (*symtables_)("rests")->lookup(String(j));
 }
+
 Symbol
 Lookup::fill(Box b)
 {
@@ -73,6 +74,7 @@ Lookup::fill(Box b)
     s.dim = b;
     return s;
 }
+
 Symbol
 Lookup::accidental(int j)
 {
@@ -143,7 +145,7 @@ Lookup::linestaff(int lines, Real wid)
 {
     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;
@@ -152,7 +154,7 @@ Lookup::linestaff(int lines, Real wid)
 
     s.tex = (*symtables_)("param")->lookup("linestaf").tex;
     s.tex = substitute_args(s.tex, a);
-    
+
     return s;
 }
 
diff --git a/src/lyriccolumn.cc b/src/lyriccolumn.cc
new file mode 100644 (file)
index 0000000..6420c4b
--- /dev/null
@@ -0,0 +1,77 @@
+#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;
+}
diff --git a/src/lyricitem.cc b/src/lyricitem.cc
new file mode 100644 (file)
index 0000000..b0afc30
--- /dev/null
@@ -0,0 +1,20 @@
+#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
+}
diff --git a/src/lyricstaff.cc b/src/lyricstaff.cc
new file mode 100644 (file)
index 0000000..51b802e
--- /dev/null
@@ -0,0 +1,47 @@
+#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;
+}
diff --git a/src/lyricwalker.cc b/src/lyricwalker.cc
new file mode 100644 (file)
index 0000000..bd8ac0e
--- /dev/null
@@ -0,0 +1,72 @@
+//
+//  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()
+{
+}
+
index b20e3a6bf2375878d5a20cac4931f133da0556bc..e533fd3143b2b4431092f87bfb37f4d57374668a 100644 (file)
@@ -5,7 +5,7 @@
 #include "notehead.hh"
 #include "paper.hh"
 #include "molecule.hh"
-#include "linestaff.hh"
+#include "linepstaff.hh"
 #include "rhythmstaff.hh"
 #include "sccol.hh" 
 #include "localkeyitem.hh"
@@ -17,7 +17,7 @@ const int NO_LINES=5;
 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);
 }
 
index fb8224ec07ee23ef3411ef23bc62b2ced0fb00b2..ba653dae2a4bb6b33db313a1b8c7e6b778089895 100644 (file)
@@ -10,7 +10,7 @@ Meter::Meter(Array<Scalar>a)
 }
 
 Molecule*
-Meter::brew_molecule()const
+Meter::brew_molecule_p()const
 {
     Symbol s = paper()->lookup_p_->meter(args);
 return new Molecule(Atom(s));
index 824a1ac809e3f632a13f62c754020a41be0324e0..42da95740bddab06a26ee38b9d6f73534bdc879a 100644 (file)
@@ -16,12 +16,14 @@ static Keyword_ent the_key_tab[]={
     "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,
index 5c132038bcd529799aa437d7ab3932a7b3abbbc3..0cd2c478a60980d1367d5744988fe717a5b723bc 100644 (file)
@@ -10,6 +10,7 @@
 #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?
@@ -26,8 +27,8 @@ Text_def*
 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;
 }
 
@@ -106,6 +107,27 @@ get_note_element(String pitch, int * notename, int * duration )
     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 )
 {    
@@ -229,7 +251,6 @@ get_script_req(int d , Script_def*def)
     return new Script_req(d, def);
 }
 
-
 Request*
 get_text_req(int d , Text_def*def)
 {
@@ -244,3 +265,18 @@ get_mark_element(String s)
     
     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;
+}
index f6521a58fed326c2032ff5d17cdfd8b0b7b8cf52..859e41fad9fa76b1e1f1942dc11ffbd6741d50c6 100644 (file)
@@ -35,7 +35,7 @@ Notehead::compare(Notehead*&a, Notehead*&b)
 }
 
 Molecule*
-Notehead::brew_molecule() const return out;
+Notehead::brew_molecule_p() const return out;
 {
     Paperdef *p = paper();
 
index c11143f0d1d230cffe490ab4bb7e6363533ccaa0..771734025be4db62c1f02b82e4dcd13742138556 100644 (file)
@@ -61,10 +61,10 @@ Paperdef*default_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
 
@@ -85,8 +85,8 @@ Paperdef*default_paper();
 %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
@@ -98,7 +98,7 @@ Paperdef*default_paper();
 %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
@@ -214,6 +214,9 @@ score_commands_body:                        { $$ = new Array<Input_command*>; }
        | score_commands_body score_command             {
                $$->add($2);
        }
+       | score_commands_body position_command          {
+               $$->add($2);
+       }
        ;
 
 staff_commands_block: COMMANDS '{' staff_commands_body '}'     {       
@@ -225,11 +228,13 @@ 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;
        }
@@ -248,7 +253,7 @@ duration_length:
        }
        ;
 
-skipcommand:
+position_command:
        SKIP int ':' duration_length            {
                $$ = get_skip_command($2, *$4);
                delete $4;
@@ -257,10 +262,10 @@ skipcommand:
                $$ = get_goto_command(*$2);
                delete $2;
        }
+       ;
 
 score_command:
-       skipcommand
-       | BAR STRING                    {
+       BAR STRING                      {
                $$ = get_bar_command(*$2);
                delete $2;
        }
@@ -325,6 +330,9 @@ staff_init:
        | MELODIC               {
                $$ = new Input_staff( "melodic");
        }
+       | LYRIC                 {
+               $$ = new Input_staff( "lyric");
+       }
        ;
 
 staff_body:
@@ -365,7 +373,6 @@ music_voice_body:                   {
        }
        ;
 
-
 music_chord:  '{' music_chord_body '}' { $$ = $2; }
        ;
 
@@ -393,8 +400,16 @@ full_element:      pre_requests voice_elt post_requests {
                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());
@@ -415,8 +430,7 @@ close_request_parens:
        ;
 
 open_request_parens:
-       '|'     {$$='|'}
-       |')'    {$$=')'}
+       ')'     {$$=')'}
        |'['    {$$='['}
        ;
 
@@ -526,12 +540,13 @@ voice_elt:
                delete $1;
 
        }
-       | MARK STRING   {
-               $$ = get_mark_element(*$2);
-               delete $2;
-       }
        ;
 
+lyrics_elt:
+       mudela_text duration                    {
+               $$ = get_word_element($1, $2);
+       };
+
 /*
        UTILITIES
 */
@@ -648,12 +663,17 @@ parse_file(String s)
    *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();
@@ -666,3 +686,5 @@ default_paper()
     return new Paperdef(
        lexer->lookup_identifier("default_table")->lookup(true));
 }
+
+
index 8cc3bf149581700abd7b040e2ee03620b482d798..c6ff787c668fd172a72e925c39e89b59d2cf1436 100644 (file)
@@ -4,6 +4,8 @@
 #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)
 
@@ -11,6 +13,7 @@ RCONS(Rest_req);
 RCONS(Barcheck_req);
 RCONS(Text_req);
 RCONS(Rhythmic_req);
+RCONS(Lyric_req);
 RCONS(Mark_req);
 RCONS(Stem_req);
 RCONS(Script_req);
@@ -19,11 +22,14 @@ RCONS(Melodic_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    
 {
@@ -31,7 +37,7 @@ Barcheck_req::print() const
     mtor << "Barcheck\n";
 #endif
 }
-
+/****************/
 void
 Request::print() const    
 {
@@ -56,6 +62,7 @@ Request::Request(Request const&)
 {
     elt_l_ = 0;
 }
+/****************/
 Melodic_req::Melodic_req()
 {
     name = 0;
@@ -64,12 +71,19 @@ Melodic_req::Melodic_req()
     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;
@@ -88,42 +102,52 @@ Rhythmic_req::print() const
     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;
@@ -148,30 +172,36 @@ Script_req::~Script_req()
 {
     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)
 {
@@ -185,3 +215,24 @@ Mark_req::print()const
     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();
+}
+
+
index d06489507c4f72f7f0dfd15010073e3de3c9d670..215b102fed21a3cb4ec93601f9799b40032122dd 100644 (file)
@@ -20,7 +20,7 @@ Rest::print()const
 }
 
 Molecule*
-Rest::brew_molecule()const
+Rest::brew_molecule_p()const
 {
     Paperdef *p =paper();
 
index c78eedb256c7cf2abfafda1f2b61d7833d38dd14..5f5df7e361751a11f0008210da99dec3f4058c0b 100644 (file)
@@ -3,7 +3,7 @@
 #include "request.hh"
 #include "notehead.hh"
 #include "stem.hh"
-#include "linestaff.hh"
+#include "linepstaff.hh"
 #include "rhythmstaff.hh"
 #include "paper.hh"
 #include "sccol.hh" 
@@ -12,7 +12,7 @@
 void
 Rhythmic_staff::set_output(PScore*ps)
 {
-    theline = new Linestaff(1,ps);
+    theline_l_ = new Linestaff(1,ps);
     Simple_staff::set_output(ps);
 }
 
index 54e6d652fabb86cf5bbd5868b8ddb480822bae7c..eab30f9cbbf636557513da5968b727eb940abbf4 100644 (file)
@@ -99,7 +99,7 @@ Script::do_post_processing()
 }
 
 Molecule*
-Script::brew_molecule() const
+Script::brew_molecule_p() const
 {
     Real dy = paper()->internote();
     
index e5b992ec3fa1aaa4bee884388fe93a78eeb1b88f..7ded4a9c90b8d49dd5e67eb824169e933ae01e4c 100644 (file)
@@ -50,12 +50,12 @@ Simple_column::typeset_item(Item *i, int breakst)
     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());
@@ -76,7 +76,7 @@ Simple_column::typeset_item_directional(Item *i, int dir, int breakst) // UGH!
     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);
 
@@ -90,7 +90,7 @@ void
 Simple_staff::set_output(PScore* ps )
 {
     pscore_l_ = ps;
-    pscore_l_->add(theline);
+    pscore_l_->add(theline_l_);
 }
 
 
index 83bce6d7e4afb762500fbd545bad20e4f7d7c4db..e4e4986ef1ecd5dd8f970a2c7d35fdf96c3d0879 100644 (file)
@@ -1,6 +1,6 @@
 #include "request.hh"
 #include "voice.hh"
-#include "swalker.hh"
+#include "staffwalker.hh"
 #include "debug.hh"
 #include "clef.hh"
 #include "staff.hh"
@@ -19,11 +19,12 @@ Simple_column::Simple_column(Score_column*s, Simple_staff *rs)
     staff_l_ = rs;
     beam_ = 0;
     text_=0;
+    lreq_p_ = 0;
 }
 
 Simple_staff::Simple_staff()
 {
-    theline = 0;
+    theline_l_ = 0;
 }
 
 /**
@@ -60,6 +61,11 @@ Simple_column::process_requests()
            if (rq->text()) {
                text_ = rq->text();
            }
+#if 0
+           if (rq->lreq_l()) {
+               lreq_p_ = rq->lreq_l();
+           }
+#endif
            if (rq->beam()) {
                beam_ = rq->beam();
            }
index 33ddf1ea69ef1d00847e165e9027964e0299fe0f..78ec2b00da2302fcb4a11127d0263b67101f57bd 100644 (file)
@@ -21,6 +21,7 @@
 #include "slur.hh"
 #include "localkeyitem.hh"
 #include "textitem.hh"
+#include "lyricitem.hh"
 
 Rhythmic_grouping
 parse_grouping(Array<Scalar> a, Moment one_beat)
@@ -195,6 +196,10 @@ Simple_walker::process_requests()
        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);
     }
@@ -221,13 +226,13 @@ Simple_walker::process_requests()
     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;
@@ -255,7 +260,7 @@ Simple_walker::process_requests()
                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);
        }       
@@ -264,7 +269,7 @@ Simple_walker::process_requests()
 }
 
 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;
index e5dbf385ac739e8bf3e268f7c7ce4f7c9db6867d..d4a3d0d96df3b54a566b093bf175a31705e2eb7f 100644 (file)
@@ -90,7 +90,7 @@ Slur::do_post_processing()
 }
 
 Molecule*
-Slur::brew_molecule() const
+Slur::brew_molecule_p() const
 {
     Molecule*output = new Molecule;
 
@@ -112,7 +112,7 @@ Slur::brew_molecule() const
     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();
index c6a65e016e3ea33523b530579685139102a84aae..69fc3123b8864edf418afbd947215667ea6f60d1 100644 (file)
@@ -1,7 +1,7 @@
 #include "staff.hh"
 #include "score.hh"
 #include "voice.hh"
-#include "swalker.hh"
+#include "staffwalker.hh"
 #include "stcol.hh"
 #include "sccol.hh"
 #include "staffcommands.hh"
@@ -15,10 +15,25 @@ Staff::do_commands(PointerList<Input_command*> score_wide,
                   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);
 }
index e1b5e4228b3b91e16b5f7edccb23c9f34fde10cb..4be3cee0bf16f40e6a788db459f1febefdd7c64b 100644 (file)
@@ -36,11 +36,10 @@ Staff_elem::translate(Offset O)
 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
@@ -57,7 +56,7 @@ Staff_elem::height() const
     Interval r;
 
     if (!output){
-       Molecule*m      = brew_molecule();
+       Molecule*m      = brew_molecule_p();
        r = m->extent().y;
        delete m;
     } else
@@ -140,7 +139,7 @@ Staff_elem::molecule_processing()
        if (dependencies[i])
            dependencies[i]->molecule_processing();
     if (!calc_children)
-       output= brew_molecule();
+       output= brew_molecule_p();
     status = OUTPUT;    
 }
 
index 1eacf8cb6527b2d57fcf5ebba5c2a72af4ced6c6..429874410e5b5fa94d5daee6fc3ebf87bc1072a9 100644 (file)
 
 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;
 }
@@ -27,7 +28,7 @@ Line_of_staff::TeXstring() const
     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);
@@ -43,7 +44,6 @@ Line_of_staff::TeXstring() const
                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();
@@ -106,6 +106,6 @@ void
 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);
 }
diff --git a/src/staffwalker.cc b/src/staffwalker.cc
new file mode 100644 (file)
index 0000000..5967242
--- /dev/null
@@ -0,0 +1,69 @@
+#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();
+}
index 66b1aadb33501a338959a77a7386da1e1924bf44..85c4c15e2bd5511791a5c0012bf00db84b82cf24 100644 (file)
@@ -154,7 +154,7 @@ Stem::width()const
 }
 
 Molecule*
-Stem::brew_molecule()const return out;
+Stem::brew_molecule_p()const return out;
 {
     assert(bot!=top);
  
diff --git a/src/swalker.cc b/src/swalker.cc
deleted file mode 100644 (file)
index 34afa0e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#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();
-}
index 26dee59a712d9b161617082f32c9b5fba208688e..e3829c65db7f8079ad27510d249f401baf8ef40c 100644 (file)
@@ -6,19 +6,19 @@
 
 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';
 }
index d19b4b813218acdc4b267ecaa4a08285b0b6e650..8be0d378cce2144fc1bac569b2a8367922bdc2ed 100644 (file)
@@ -5,22 +5,21 @@
 #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()
 {
@@ -29,12 +28,13 @@ 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;
 }
index 43cfda3f3586bbc6eb1236be70fd409de6f5532e..86eac612cb08660b3c811d622d48385b0c15f47b 100644 (file)
@@ -13,7 +13,7 @@ Text_spanner::Text_spanner(Directional_spanner*d)
 void
 Text_spanner::do_post_processing()
 {
-    switch(spec.align) {
+    switch(spec.align_i_) {
     case 0:
        tpos = support->center();
        break;
@@ -25,9 +25,9 @@ Text_spanner::do_post_processing()
     
 }
 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;
@@ -54,7 +54,7 @@ Text_spanner::do_pre_processing()
 Interval
 Text_spanner::height()const
 {
-    return brew_molecule()->extent().y;
+    return brew_molecule_p()->extent().y;
 }
 
 Spanner*
index 9ffb981c852e4970812c5294771a63bf174eb7ca..275a47f0d9b57b1554b1f805435ed5012235b404 100644 (file)
@@ -68,7 +68,7 @@ Time_description::set_meter(int l, int o)
     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
index 82a004875aaa91b17cfed0f40c566c317aca6da1..87f7152e41f9b72543e31663c7a1d3ad66b3b3af 100644 (file)
@@ -27,8 +27,8 @@ error(String s)
 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);
 }
 
@@ -36,6 +36,6 @@ error_t(const String& s, const Moment& r)
 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);
 }