]> git.donarmstrong.com Git - lilypond.git/commitdiff
release: 0.0.15 release/0.0.15
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Dec 1996 10:51:15 +0000 (11:51 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Dec 1996 10:51:15 +0000 (11:51 +0100)
59 files changed:
.dstreamrc
Documentation/Makefile
Documentation/literature [new file with mode: 0644]
Makefile
Sources.make
Variables.make
dimen.tex
flower/Variables.make
flower/compare.hh
flower/cursor.hh
flower/interval.cc
flower/interval.hh
flower/pcursor.hh
flower/real.hh
flower/vray.hh
hdr/beam.hh
hdr/grouping.hh [new file with mode: 0644]
hdr/identifier.hh
hdr/identparent.hh
hdr/inputcommand.hh
hdr/lookup.hh
hdr/melodicstaff.hh
hdr/misc.hh
hdr/paper.hh
hdr/rhythmstaff.hh
hdr/simplestaff.hh
hdr/stem.hh
hdr/symbol.hh
hdr/symtable.hh
lilyponddefs.tex
maartje.ly
objects/Makefile [deleted file]
pavane.ly
src/accidental.cc [deleted file]
src/beam.cc
src/getcommands.cc
src/grouping.cc [new file with mode: 0644]
src/inputcommand.cc
src/inputscore.cc
src/item.cc
src/lexer.l
src/linespace.cc
src/lookup.cc
src/melodicstaff.cc
src/misc.cc
src/notehead.cc
src/paper.cc
src/parser.y
src/pscore.cc
src/rhythmstaff.cc
src/score.cc
src/simplestaff.cc
src/simplewalker.cc
src/spanner.cc
src/stem.cc
src/symtable.cc
src/table.cc
src/texslur.cc
symbol.ini

index 64944330bc2350a1f3c36e0a863c10e34b54ecda..a449d3f57455b6768ddcc5660ba5e1206122f6c4 100644 (file)
@@ -17,8 +17,9 @@ Note_req              1
 Rhythmic_req           1
 Rest_req               1
 delete_identifiers     1
-Command                        0
+Command                        1
 Staff_commands         0
+Stem                   0
 Staff                  0
 Score                  0
 Voice                  0
index ea2f12ed55306bad573323265cef8a7297e6666e..577debd174a368b94659797341886db5ad7935a5 100644 (file)
@@ -1,6 +1,6 @@
 
 DOCFILES=commands CodingStyle algorithms Makefile breaking\
-       slurfont pointers design
+       slurfont pointers design literature
 
 dist:
        ln $(DOCFILES) $(DDIR)/Documentation/
\ No newline at end of file
diff --git a/Documentation/literature b/Documentation/literature
new file mode 100644 (file)
index 0000000..0085806
--- /dev/null
@@ -0,0 +1,76 @@
+\chapter{References \& Further reading}
+
+Herbert Chlapik, 
+
+Ren\'e Roelofs, ``Een Geautomatiseerd Systeem voor het Afdrukken van
+Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
+universiteit Rotterdam, 1991.  (``An automated system for printing
+music'' Master's Thesis Management and Computer Science.)
+
+G. Read, ``Modern Rhythmic Notation.'' Indiana University Press, 1978.
+
+C. Roemer,  The Art of Music Copying. Roerick music co., Sherman Oaks (CA), 1973.
+
+Donemus, Uitgeven van muziek. Donemus Amsterdam, 1900
+
+W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
+``Document Manipulation and Typography'',J.C. van Vliet (ed) 1988.
+
+\begin{verbatim}
+Date: Thu, 03 Aug 1995 22:55:48 -0700
+From: Mark Basinski <basinski@arizona.edu>
+To: Han-Wen Nienhuys <hanwen@stack.urc.tue.nl>
+Newsgroups: comp.music, comp.text.tex
+Subject: Re: [WANTED] references on typesetting music
+(A copy of this message has also been posted to the following newsgroups:
+comp.music, comp.text.tex)
+In article <3vqr50$den@turtle.stack.urc.tue.nl>, hanwen@stack.urc.tue.nl
+(Han-Wen Nienhuys) wrote:
+> I am currently typesetting music with a preprocessor to the TeX package
+> MusiXTeX, and I want to enhance this preprocessor with an some sort of
+> algorithm to do spacing. Currently the output looks nice, but there are some
+> flaws in the spacing when I combine accidentals, slurs, triplets and strange
+> pitchjumps and so on. Therefore I am interested in all literature on
+> typesetting music.  The FAQS for comp.music did not have any references.
+> 
+Probably the best 2 reference books are:
+1) ``Teach yourself the art of music engraving and processing'' by Ted Ross   
+(3rd edition), published by Hansen House, Miami Beach, FL.
+Hansen House
+1820 West Ave.
+Miami, FL  33139
+(305) 532-5461
+This is about *engraving* i.e. professional music typesetting, and includes 
+some good spacing tables
+2) ``Music Notation'' by Gardner Read (2nd edition), published by Taplinger
+Publishing, New York.
+This is as close to the ``standard'' reference work for music notation issues
+as one is likely to get.
+Some others (of varying usefulness):
+Donato, Anthony. Preparing Music Manuscript. Englewood Cliffs:
+Prentice-Hall, 1963.
+Heussenstamm, George. The Norton Manual of Music Notation. New York:
+Norton, 1987.
+Karkoshka, Erdhard. Notation in New Music. Trans. Ruth Koenig. New York:
+Praeger    Publishers, 1972.  Out of print.
+Roemer, Clinton. The Art of Music Copying. Roerick Music. Sherman Oaks, 1973.
+Rosecrans, Glen. Music Notation Primer. New York: Passantino, 1979.
+Stone, Kurt. Music Notation in the Twentieth Century. New York: Norton, 1980.
+\end{verbatim}
index 9b1b762a3adb4e06b138d2a4bc21c0d634396223..219147706d905373374bd097e6cb383ee4a5df7d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@ $(exe): $(obs)
        $(CXX) -o $@ $^ $(LOADLIBES)
 
 clean:
-       $(MAKE) -C objects clean
-       rm -f $(exe) *.o $(DOCDIR)/* core  
+#      $(MAKE) -C objects clean
+       rm -f $(exe) objects/*.o $(DOCDIR)/* core  
 
 distclean: clean
        rm -f  depend version.hh $(gencc) .GENERATE *~
@@ -37,9 +37,18 @@ realdepend: $(cc)
 
 include depend
 
+parsheadorig=$(CCDIR)/parser.tab.h
+parsheadnew=$(HEADERDIR)/parser.hh
+
+#
+# take some trouble to avoid overwriting the old y.tab.h
 $(CCDIR)/parser.cc: parser.y
        $(BISON) -d $<
-       mv $(CCDIR)/parser.tab.h $(HEADERDIR)/parser.hh
+       (if diff -q $(parsheadorig) $(parsheadnew); then \
+               echo leaving $(parsheadnew);  \
+       else \
+               mv $(parsheadorig) $(parsheadnew); \
+       fi )
        mv $(CCDIR)/parser.tab.c $@
 
 parser.hh: parser.cc
index 7aa12eb13bd61b77f88557ff54a184f7806008c3..7a648e169b270592ae1af233e8290c1b1d8b5617 100644 (file)
@@ -17,7 +17,7 @@ hdr=    qlp.hh linespace.hh qlpsolve.hh\
        clef.hh clefitem.hh slur.hh inputcommands.hh\
        getcommand.hh inputmusic.hh \
        inputscore.hh inputstaff.hh identparent.hh\
-       inputcommand.hh
+       inputcommand.hh grouping.hh
 
 mycc=   qlp.cc qlpsolve.cc leastsquares.cc\
        inputcommands.cc inputmusic.cc  inputcursor.cc\
@@ -32,13 +32,14 @@ mycc=   qlp.cc qlpsolve.cc leastsquares.cc\
        calcideal.cc scores.cc  \
        dimen.cc paper.cc lookup.cc staffcommands.cc\
        sccol.cc stcol.cc getcommands.cc simplestaff.cc\
-       melodicstaff.cc simpleprint.cc stem.cc\
-       spanner.cc notehead.cc  \
-       rest.cc swalker.cc scoreline.cc\
-       simplewalker.cc bar.cc meter.cc accidental.cc\
-       keyitem.cc localkeyitem.cc\
-       clefitem.cc texbeam.cc  texslur.cc clef.cc key.cc slur.cc beam.cc\
-        idealspacing.cc inputcommand.cc\
+       melodicstaff.cc simpleprint.cc\
+       spanner.cc \
+       notehead.cc  stem.cc \
+       rest.cc bar.cc meter.cc keyitem.cc localkeyitem.cc clefitem.cc\
+       swalker.cc scoreline.cc\
+       simplewalker.cc\
+       texbeam.cc texslur.cc clef.cc key.cc slur.cc beam.cc\
+       idealspacing.cc inputcommand.cc grouping.cc\
        template1.cc template2.cc template3.cc template4.cc\
        version.cc
 
index 886a59aa4b4a8fbba4fee47454a6a212a5f24a07..34bfb9fb6f8c83d777b88f772688511febf85dd3 100644 (file)
@@ -2,12 +2,9 @@
 #### USER CONFIGURABLE
 ####
 
-# speedy
-#DEFINES=-DNDEBUG -DNPRINT -O2
-
-# lots of debugging info
-DEFINES=-g
-
+#PROFILEFLAG=-pg
+OPTIFLAG=-DNDEBUG -DNPRINT -O2
+DEBUGFLAG=-g
 # turn off -pipe if linker doesn't support it
 EXTRACXXFLAGS=-pipe -Wall -W  -pedantic 
 
@@ -15,10 +12,23 @@ EXTRACXXFLAGS=-pipe -Wall -W  -pedantic
 #### EN USER CONFIGURABLE part.
 ####
 
+ifdef PROFILEFLAG
+       DEFINES+=$(OPTIFLAG) $(PROFILEFLAG)
+       EXTRALIB+=-pg
+endif
+
+ifndef DEBUGFLAG
+       DEFINES+=$(OPTIFLAG)
+else
+       DEFINES+=$(DEBUGFLAG)
+endif
+
+
+
 # version info
 MAJVER=0
 MINVER=0
-PATCHLEVEL=14
+PATCHLEVEL=15
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 
 # directories
@@ -59,7 +69,7 @@ OFILES=Makefile Variables.make Sources.make COPYING README
 DFILES=$(OFILES) $(IFILES) $(SCRIPTS)
 
 #compiling
-LOADLIBES=-L$(FLOWERDIR) -lflower
+LOADLIBES=-L$(FLOWERDIR) -lflower $(EXTRALIB)
 FLOWERDIR=../flower
 
 CXXFLAGS=$(DEFINES) -I$(HEADERDIR) -I$(FLOWERDIR) $(EXTRACXXFLAGS)
index f1c9bad68672f9b4c6569d3524cd9d1a0f838e6d..962ec5d5b7227b501164cb65d229b74d135dda41 100644 (file)
--- a/dimen.tex
+++ b/dimen.tex
@@ -1,4 +1,4 @@
-\font\musicfnt=musix20
+\font\musicfnt=musix16
 \font\slurfont=xslhu20
 \def\thefont{\musicfnt}
 
index e0f94d65553244bf59c549224fd6a4d1156cfc20..83a740ac4a24fb07ec52da8b350cdd3d35cf3ce9 100644 (file)
@@ -1,13 +1,13 @@
 MAJVER=1
 MINVER=0
-PATCHLEVEL=14
+PATCHLEVEL=15
 
 PACKAGENAME=flower
 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
 DNAME=$(PACKAGENAME)-$(VERSION)
 DEFINES=-DNDEBUG -O2
 #DEFINES=-g
-CXXFLAGS+=$(DEFINES)  -Wall -W -pedantic
+CXXFLAGS+=$(DEFINES)  -Wall -W 
 CXXVER=$(CXX) --version
 include Sources.make
 
index df278a2bfbc30b193b2cf0eec265729a4fb9061b..40bc9d29511e9b9e934ef7a985ee044988798c30 100644 (file)
@@ -19,7 +19,8 @@ operator op(type t1, type t2)\
      return (t1 opp t2) ? t1 :  t2;\
 }\
 
-#ifdef __GNUC__
+
+#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
 #define gpp_minmax(type, prefix)\
        prefix gpp_minmax_operator(type, <?, <)\
        prefix gpp_minmax_operator(type, >?, >)
index 6d40bb270d635d876bdb6fcc37fd3b0c23c49406..428a52748fb0b7ff196238adc2685ed59cc03fe4 100644 (file)
@@ -84,7 +84,7 @@ class Cursor
     /// access the list this came from
     List<T>& list() const ;
     Link<T>* pointer();
-
+    static   int compare(Cursor<T> a,Cursor<T>b) { return a-b; }
 private:
     List<T>& list_;
     Link<T>* pointer_;
@@ -104,13 +104,8 @@ private:
   */
 #include "compare.hh"
 
-template<class T>
-inline  int cursor_compare(Cursor<T> a,Cursor<T>b)
-{
-    return a-b;
-}
 
-template_instantiate_compare(Cursor<T>, cursor_compare, template<class T>);
+template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
 
 #include "pcursor.hh"
 #include "list.hh"
index 6cc2a7916e9d51e1e4e0758730de40c52ac87a1f..6fac1f55dca0d754382282d600e35d25aab5309a 100644 (file)
@@ -31,6 +31,29 @@ Interval::intersect(Interval h)
     min = MAX(h.min, min);
     max = MIN(h.max, max);
 }
+Interval
+intersection(Interval a, Interval const&b)
+{
+    a.intersect(b);
+    return a;
+    
+}
+int
+Interval::compare(const Interval&a,Interval const&b)
+{
+    if (a.min == b.min && a.max == b.max)
+       return 0;
+    
+    if (a.min <= b.min && a.max >= b.max)
+       return 1;
+
+    if (a.min >= b.min && a.max <= b.max)
+       return -1;
+
+    assert(false);             // not comparable
+
+    return 0;
+}
 
 Interval
 intersect(Interval x, Interval const &y)
@@ -48,3 +71,8 @@ Interval::operator String() const
  
     return s + min + "," + max +"]";
 }
+bool
+Interval::elt_q(Real r)
+{
+    return r >= min && r <= max;
+}
index 6f9fa63f672b6856ca6179a597a63de575b5fbc4..a7a269153bf42ba9e34502011909dd0358a27bd4 100644 (file)
@@ -48,13 +48,23 @@ struct Interval {
        max +=r;
        return *this;
     }
-
+    bool elt_q(Real r);
     operator String() const;
-};
 
+    /// partial ordering
+    static compare(const Interval&,Interval const&);
+};
+/**
+  this represents the closed interval [min,max]
+  */
 
 Interval intersection(Interval, Interval const&);
 
+#include "compare.hh"
+
+instantiate_compare(Interval&, Interval::compare);
+
 #endif // INTERVAL_HH
 
 
+
index c9cc53411f8d69135fbc19eb5425281023d33612..eeaa866ea8b4b95f199544c2ab46f2b9045f79f1 100644 (file)
 
 /// cursor to go with PointerList
 template<class T>
-struct PCursor : public Cursor<void *> {
-
-    /// make cursor with #no# items back
-    PCursor<T> operator -( int no) const {
-       return PCursor<T> (Cursor<void*>::operator-(no));
-    }
-    int operator -(PCursor<T> op) const {
-       return Cursor<void*>::operator-(op);
-    }
-    /// make cursor with #no# items further
-    PCursor<T> operator +( int no) const {
-       return PCursor<T> (Cursor<void*>::operator+(no));
-    }
+struct PCursor : private Cursor<void *> {
+    friend class IPointerList<T>;
+public:
+    Cursor<void*>::ok;
+    Cursor<void*>::del;
+    Cursor<void*>::backspace;
     
-    PCursor(const PointerList<T> & l) : Cursor<void*> (l) {}
+    PointerList<T> &list() { return (PointerList<T>&)Cursor<void*>::list(); }
+    PCursor<T> operator++(int) { return Cursor<void*>::operator++(0);}
+    PCursor<T> operator--(int) { return Cursor<void*>::operator--(0); }
+    PCursor<T> operator+=(int i) { return Cursor<void*>::operator+=(i);}
+    PCursor<T> operator-=(int i) { return Cursor<void*>::operator-=(i); }    
+    PCursor<T> operator -(int no) const { return Cursor<void*>::operator-(no);}
+    int operator -(PCursor<T> op) const { return Cursor<void*>::operator-(op);}
+    PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);}    PCursor(const PointerList<T> & l) : Cursor<void*> (l) {}
 
     PCursor( const Cursor<void*>& cursor ) : Cursor<void*>(cursor) { }
     void* vptr() const { return  * ((Cursor<void*> &) *this); }
@@ -36,11 +36,10 @@ struct PCursor : public Cursor<void *> {
     operator T() { return ptr(); }
     T operator *() { return ptr(); }
     void add(const T& p ) { Cursor<void*>::add((void*) p); }
-    void insert(const T& p ) { Cursor<void*>::insert((void*) p);}
-
-private:
-//    Cursor<void*>::operator void*;
-    // sigh
+    void insert(const T& p ) { Cursor<void*>::insert((void*) p);}    
+    static int compare(PCursor<T> a,PCursor<T>b) {
+       return Cursor<void*>::compare(a,b);
+    }
 };
 /**
   don't create PointerList<void*>'s.
@@ -49,13 +48,8 @@ private:
  */
 
 
-template<class T>
-inline  int pcursor_compare(PCursor<T> a,PCursor<T>b)
-{
-    return cursor_compare(Cursor<void*>(a),Cursor<void*> (b));
-}
 
 #include "compare.hh"
-template_instantiate_compare(PCursor<T>, pcursor_compare, template<class T>);
+template_instantiate_compare(PCursor<T>, PCursor<T>::compare, template<class T>);
 
 #endif
index 1f2187c8c1a528da7ea8d93988bdbde4bb3f6a8c..68e90f9b71b2b6fad9a5c2907674ebf0b74346e9 100644 (file)
@@ -21,5 +21,9 @@ int sgn(Real x) {
     if (!x)return 0;
     return (x > 0) ?1: -1;
 }
-
+inline Real
+distance(Real x,Real y)
+{
+    return ABS(x-y);
+}
 #endif
index 302499b2561616b85ca7464be203f9f6dff55acd..180008c4c6ea91e16ecc8b6ef30d5583f5e558ad 100644 (file)
@@ -105,13 +105,16 @@ public:
     T& last(int j=0) {
        return (*this)[size-j-1];
     }
+    T last(int j=0) const {
+       return (*this)[size-j-1];
+    }
     void swap (int i,int j) {
        T t((*this)[i]);
        (*this)[i]=(*this)[j];
        (*this)[j]=t;
     }
     bool empty() { return !size; }
-    void insert(T&k, int j) {
+    void insert(T k, int j) {
        assert(j >=0 && j<= size);
        set_size(size+1);
        for (int i=size-1; i > j; i--)
index 138175d8ec536bc33f006899a69fb1fb5e4a92a3..be2cb8f94c01e1d6e79a6a5f683b963258ce7e3a 100644 (file)
@@ -34,6 +34,7 @@ struct Beam: public Spanner {
     
     void set_stemlens();
 private:
+    Molecule stem_beams(Stem *here, Stem *next, Stem *prev);
     void solve_slope();
     void brew_molecule();
 };
diff --git a/hdr/grouping.hh b/hdr/grouping.hh
new file mode 100644 (file)
index 0000000..a6e93bf
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+  grouping.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef GROUPING_HH
+#define GROUPING_HH
+
+#include "interval.hh"
+#include "vray.hh"
+
+struct Rhythmic_grouping {
+    Interval t;
+
+    svec<Rhythmic_grouping*> children;
+    /****************/
+    
+    void split_half();
+    Real last();
+    Rhythmic_grouping* sub_grouping(Interval v);
+    void split_grouping(Rhythmic_grouping &initial_grouping);
+    void split_grouping(svec<Real> initial_grouping);
+    svec<Real> get_bounds();
+    Rhythmic_grouping(Interval);
+    Rhythmic_grouping(svec<Interval> notes,
+                     svec<Real> initial_grouping);
+
+    void print() const;
+    ~Rhythmic_grouping();
+};
+
+#endif // GROUPING_HH
index c5d7a5b5b729a858057181ba594a407f940e0245..3ac537f63e1b84914d7bd2bc7aa014964a60087e 100644 (file)
@@ -8,17 +8,24 @@
 #ifndef IDENTIFIER_HH
 #define IDENTIFIER_HH
 #include "identparent.hh"
+#include "symtable.hh"
 #include "inputstaff.hh"
 #include "inputmusic.hh"
 
 #define make_id_class(Idclass, Class, accessor)        \
 struct Idclass : Identifier {\
     Idclass(String s, Class*st):Identifier(s) { data = st; }\
-    virtual Class* accessor() { return (Class*) data; }\
+    virtual Class* accessor(bool copy=false) {\
+       if (copy)\
+           return new Class(* (Class*) data);\
+       else\
+           return (Class*) data;\
+    }\
     ~Idclass() { delete accessor(); }\
 }\
 
-
+make_id_class(Lookup_id, Lookup, lookup);
+make_id_class(Symtables_id, Symtables, symtables);
 make_id_class(Staff_id, Input_staff, staff);
 make_id_class(M_chord_id, Music_general_chord, mchord);
 make_id_class(M_voice_id, Music_voice, mvoice);
index d8d3cb17356463dec1bf160ac404e2d236f474ab..dafeed96fae0d3683fed6f5a129784bd877328fe 100644 (file)
@@ -17,12 +17,14 @@ struct Identifier
     
     Identifier(String n) : name(n) { }
     virtual ~Identifier() {}
-    virtual Input_staff * staff() { assert(false); }
-    virtual Voice_list * voices() { assert(false); }
-    virtual Horizontal_music*hmusic() { assert(false); }
-    virtual Vertical_music*vmusic() { assert(false); }
-    virtual Music_voice *mvoice() { assert(false); }
-    virtual Music_general_chord *mchord() { assert(false); }    
+    
+    virtual Input_staff * staff(bool = false) { assert(false); }
+    virtual Horizontal_music*hmusic(bool = false) { assert(false); }
+    virtual Vertical_music*vmusic(bool = false) { assert(false); }
+    virtual Music_voice *mvoice(bool = false) { assert(false); }
+    virtual Symtables *symtables(bool = false) { assert(false); }
+    virtual Music_general_chord *mchord(bool = false) { assert(false); }
+    virtual Lookup*lookup(bool = false) { assert(false); }
 };
 #endif // IDENTPARENT_HH
 
index aeec3b8ad395e90dd8cad290ceb5c17463e00743..21aeaeacb486309abd72ac58c9cff65afc042293 100644 (file)
@@ -10,7 +10,6 @@
 #include "scalar.hh"
 #include "vray.hh"
 
-
 struct Input_command {
     Real when;
     
@@ -28,6 +27,7 @@ Input_command* get_clef_interpret_command(String w);
 Input_command *get_reset_command();
 Input_command *get_partial_command(Real u);
 Input_command* get_skip_command( int,Real);
+Input_command* get_grouping_command( svec<int>);
 
 void
 interpret_meter(Input_command *c, int &beats_per_meas, int& one_beat,
index 90a27fd60fa3fd7156c45714f99b100aacc6ec7d..7e59dac0fa1fa7ee9fa07c7bb6aedce22e22da24 100644 (file)
 
 struct Lookup {
     Symtables *symtables_;
-    
+    String texsetting;
     /****************/
+    void add(String, Symtable*);
+
     Real internote();
-    void parse (Text_db&t);
+
     Symbol linestaff(int n, Real w);
 
     Symbol beam_element(int,int,Real=0);
@@ -44,6 +46,7 @@ struct Lookup {
 
 
     Lookup();
+    Lookup(Lookup const &);
     ~Lookup();
 };
 
index 733eae3fef8d9fd1ee6a18b380039bae44950abd..45785e4c020292c16b69b1f5865bd0e48c254d0c 100644 (file)
@@ -19,7 +19,7 @@ struct Melodic_staff : public Simple_staff
     virtual void set_output(PScore *);
 
     virtual Item* get_TYPESET_item(Command*);
-    virtual Stem * get_stem(Stem_req *rq);
+    virtual Stem * get_stem(Stem_req *rq,Real);
     virtual Notehead * get_notehead(Note_req *rq, int bot);
     virtual Local_key_item* get_local_key_item();
 };
index 64c8ca4102c1606fb91513938c895473bbbd9d08..763ebbc250a9a7ce5c2f30851c807f0cdb8041d6 100644 (file)
@@ -2,6 +2,13 @@
 #define MISC_HH
 
 
+double log2(double x) ;
+int intlog2(int d);
+inline int
+ABS(int i)
+{
+    return (i < 0)?-i:i;
+}
 
 
 #endif
index b2ba370b578ab497ab7aec64adf7b8a5e1856f7b..b03d1f76210abbacf90e9c1c184a261c7820ecb8 100644 (file)
@@ -6,6 +6,7 @@
 struct Paperdef {
     Lookup *lookup_;
     String outfile;
+
     Real linewidth;
 
     /// how much space does a whole note take (ideally?)
@@ -15,8 +16,9 @@ struct Paperdef {
     Real geometric_;
     
     /****************/
-    void parse();
-    Paperdef();
+    void reinit();
+    Paperdef(Lookup*);
+    void set(Lookup*);
     ~Paperdef();
     Real interline()const;
     Real internote()const;
index 2c099afa0bc329803181506889c520b24efd20c6..8591e3c1a0a53c14e3eff190844516bbf2503e48 100644 (file)
@@ -16,7 +16,7 @@ struct Rhythmic_staff : public Simple_staff
     /****************/
     
     virtual Item *get_TYPESET_item(Command*);    
-    virtual Stem *get_stem(Stem_req *rq);
+    virtual Stem *get_stem(Stem_req *rq,Real);
     virtual Notehead * get_notehead(Note_req *rq, int b);   
     virtual void set_output(PScore *);
 };
index 07fc9850471813fe48f89c0f6d37198efa160d6b..faf1002d53a01dc03874e2a0ad851ee95e35ddc0 100644 (file)
@@ -24,6 +24,7 @@ struct Simple_column : Staff_column {
     svec<Rhythmic_req *> notes;
     svec<Slur_req *> slurs;
     Stem_req *stem_;
+    Real stem_requester_len;
     Beam_req *beam_;
     Simple_staff* staff_;
 
@@ -51,7 +52,7 @@ struct Simple_staff : Staff {
     Staff_column*create_col(Score_column*);
     
     virtual Item *get_TYPESET_item(Command*);
-    virtual Stem *get_stem(Stem_req *rq)=0;
+    virtual Stem *get_stem(Stem_req *rq, Real)=0;
     virtual Notehead *get_notehead(Note_req *rq, int b)=0;
     virtual Rest *get_rest(Rest_req *rq);
     virtual void set_output(PScore *);
index adce936320c5bd2d1b4d20eb8f0ad397af9723d9..372011d1b1171d2ee4096da6b4fe510f55af8c93 100644 (file)
 
 /// the rule attached to the ball
 struct Stem : public Item {
+    Real note_length;
+    
     // heads the stem encompasses (positions)
     int minnote, maxnote;
 
     /// false if in beam
     bool print_flag;
     
+    int beams_left;
+    int beams_right;
+    
     /// needed for determining direction/length
     int staff_center;
 
@@ -26,7 +31,8 @@ struct Stem : public Item {
       */
 
     Real stemlen;
-    // flagtype? 4 none, 8 8th flag, 0 = beam.
+    
+    /// flagtype? 4 none, 8 8th flag, 0 = beam.
     int flag;
 
     ///geen gedonder, jij gaat onder
@@ -41,14 +47,15 @@ struct Stem : public Item {
     /// ensure that this Stem also encompasses the Notehead #n#
     void add(Notehead*n);
     Real hpos()const;
+    void print() const;
     void set_stemend(Real);
     void set_default_dir();
     void set_default_stemlen();
     void set_default_extents();
     void postprocess();
     void preprocess();
-    Stem(int center);
-    void print() const;
+    Stem(int center, Real duration);
+
     Interval width() const;
 private:
 
index 3c664dfbaa3a13b873a41a5f5197c97311578f1f..62de3be4960760a87138855ea0f1e65b17847810 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef SYMBOL_HH
 #define SYMBOL_HH
+
 #include "string.hh"
 #include "boxes.hh"
 #include "proto.hh"
index a1443a7d3b1b4b15a4edc0e7fa9dc2494ffebb58..b4217c12b8a59996dfe8aab96fb7d9490505ae84 100644 (file)
@@ -9,13 +9,17 @@
 
 struct  Symtable : public Assoc<String, Symbol> {
     Symbol lookup(String)const;
+    
 };
 
 
 struct Symtables : private Assoc<String, Symtable*> {
-    void read(Text_db&) ;
+    
     Symtable* operator()(String s);
-
+    ~Symtables();
+    Symtables();
+    Symtables(Symtables const&);
+    Assoc<String, Symtable*>::add;
 };
 
 
index 152d461d64f0555316feed0289c07e05ebf9db17..fe056efa23bb90f49ffc8810713929b7cb1d0fdb 100644 (file)
@@ -4,8 +4,8 @@
 \def\mdef#1#2{\def#1{{\musicfnt\char#2}}}
 
 %% musix defs
-       \parindent=0pt
-       \newdimen\interlinedist
+\parindent=0pt
+\newdimen\interlinedist
        \newcount\n
        \newdimen\balkhoog
        \newdimen\staffrulethickness
        \font\musicfnt=musix20
        \balkhoog=20pt
        \staffrulethickness=0.4pt
+
+       \musixcalc
+}
+\def\musixsixteendefs{
+       \font\slurufont=xslu16
+       \font\slurdfont=xsld16
+       \font\slurhfont=xslz20 % sigh
+       \font\hslurufont=xslhu16
+       \font\hslurdfont=xslhd16
+       \font\hslurhfont=xslhz20
+       \font\musicfnt=musix16
+       \balkhoog=16pt
+       \staffrulethickness=0.4pt
+
+       \musixcalc
 }
 
 \def\musixcalc{
@@ -31,8 +46,6 @@
 }
 
 
-\musixtwentydefs
-\musixcalc
 \def\slurcharh#1{{\slurhfont\char#1}}
 \def\slurcharu#1{{\slurufont\char#1}}
 \def\slurchard#1{{\slurdfont\char#1}}
 
 \def\interstaffline{%
        \vskip 10pt
-%      \nointerlineskip
-%      \vbox{\hbox to 0pt{\vrule width20pt height1pt\hss}}
 }
 \def\ugly{\nointerlineskip\par
 \vskip 40pt\par\vbox{\hbox to 0pt{\vrule width30pt height1pt\hss}}\par\vskip 40pt
index 5178885f0f8f9d9779b093e0cd46bb7c47981e75..d580b626ecf73f6b907c9b1dbaeef15083be7cf1 100644 (file)
@@ -5,7 +5,16 @@ ritme = staff {rhythmic
        c2 c2
        
        [fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16]
-       c2 r32 r32 r16 r8 r4 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 $}
+       c2 r32 r32 r16 r8 r4
+       [c8. c16]
+       [c16 c8.]
+       [c16 c16 c8]
+       [c16 c8 c16]
+
+       c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2
+
+
+       $}
 }
 
 melody=
@@ -29,6 +38,8 @@ staff { melodic
        ''fis2
        a8 b8 'c8 'd8 ''c8 ```c8 c4 c4  c4 c4
        \duration{ 16 } `b `a `g `f \duration{ 4}
+       
+
        c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c
        $}
 
@@ -47,6 +58,7 @@ score {
        paper {
                geometric 1.4
                unitspace 3.0 cm
+%              symboltables { table_sixteen}
        }
        staff { ritme }
        staff { melody }
diff --git a/objects/Makefile b/objects/Makefile
deleted file mode 100644 (file)
index 585e1df..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-dist:
-       ln Makefile $(DDIR)/objects/
-       
-clean:
-       rm -f *.o
index 529ffce9437d8a207f97278ae9ac63b39a636f33..c8fb84fcb1b679bc3d9d93f9b0f0475cf5661935 100644 (file)
--- a/pavane.ly
+++ b/pavane.ly
@@ -49,6 +49,7 @@ score {
                horn
        }
        paper {
+               symboltables { table_sixteen}
                unitspace 1.5 cm
                geometric 1.4
        }
diff --git a/src/accidental.cc b/src/accidental.cc
deleted file mode 100644 (file)
index eb3ca7c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "accidental.hh"
-#include "debug.hh"
-#include "molecule.hh"
-#include "paper.hh"
-#include "lookup.hh"
-
-Accidental::Accidental(int t, int p)
-{
-    type = t;
-    pos = p;
-}
-
-void
-Accidental::preprocess()
-{
-    brew_molecole();
-}
-
-void
-Accidental::brew_molecole()
-{    
-    Symbol s =paper()->lookup_->accidental(type);   
-    output = new Molecule(Atom(s));
-    output->translate(Offset(0, pos * paper()->interline()/2));
-}
-
-void
-Accidental::print()const
-{
-    mtor << "Accidental "<<type;
-    Item::print();
-}
index af61c10ad2dae203532bcdd7ad97d280171ebd6e..6c7e6599cf8e7780b495ae1f109b64aab01774ce 100644 (file)
@@ -1,4 +1,5 @@
 #include "beam.hh"
+#include "misc.hh"
 #include "debug.hh"
 #include "symbol.hh"
 #include "molecule.hh"
@@ -61,6 +62,7 @@ Beam::set_default_dir()
        sc->dir = dir;
     }
 }
+
 /*
   should use minimum energy formulation (cf linespacing)
   */
@@ -116,10 +118,18 @@ Beam::calculate()
     solve_slope();
 }
 
+
 void
 Beam::process()
 {
     calculate();
+
+    for (PCursor<Stem*> i(stems); i.ok(); i++)
+       i->beams_left = i->beams_right = intlog2(ABS(i->flag)) - 2;
+
+    stems.top()->beams_left = 0;
+    stems.bottom()->beams_right = 0;
+
     brew_molecule();
     set_stemlens();
 }
@@ -152,6 +162,61 @@ Beam::width() const
     return Interval( (*me->stems.top()) ->hpos(),
                     (*me->stems.bottom()) ->hpos() );
 }
+/*
+  beams to go with one stem.
+  */
+Molecule
+Beam::stem_beams(Stem *here, Stem *next, Stem *prev)
+{
+    assert( !next || next->hpos() > here->hpos()  );
+    assert( !prev || prev->hpos() < here->hpos()  );
+    Real dy=paper()->internote()*2;
+    Real stemdx = paper()->rule_thickness();
+    Real sl = slope*paper()->internote();
+    Molecule leftbeams;
+    Molecule rightbeams;
+
+    /* half beams extending to the left. */
+    if (prev) {
+       int lhalfs= lhalfs = here->beams_left - prev->beams_right ;
+       int lwholebeams= here->beams_left <? prev->beams_right ;
+       Real w = (here->hpos() - prev->hpos())/4;
+       Atom a =  paper()->lookup_->beam(sl, w);
+       a.translate(Offset (-w, -w * sl));
+       for (int j = 0; j  < lhalfs; j++) {
+           Atom b(a);
+           b.translate(Offset(0, -dir * dy * (lwholebeams+j)));
+           leftbeams.add( b );
+       }
+    }
+       
+    if (next){
+       int rhalfs = here->beams_right - next->beams_left;
+       int rwholebeams = here->beams_right <? next->beams_left; // g++
+
+       Real w = next->hpos() - here->hpos();
+       Atom a = paper()->lookup_->beam(sl, w + stemdx);
+       
+       int j = 0;
+       for (; j  < rwholebeams; j++) {
+           Atom b(a);
+           b.translate(Offset(0, -dir * dy * j));
+           rightbeams.add( b ); 
+       }
+       w /= 4;
+       a = paper()->lookup_->beam(sl, w);
+       
+       for (; j  < rwholebeams + rhalfs; j++) {
+           Atom b(a);
+           b.translate(Offset(0, -dir * dy * j));
+           rightbeams.add(b ); 
+       }
+       
+    }
+    leftbeams.add(rightbeams);
+    return leftbeams;
+}
+
 
 void
 Beam::brew_molecule()
@@ -159,20 +224,32 @@ Beam::brew_molecule()
     assert(left->line == right->line);
     Real inter=paper()->internote();
     Real sl = slope*inter;
-    Real w =  width().length() + paper()->rule_thickness();
-    Symbol s = paper()->lookup_->beam(sl,w);
+
+    output = new Molecule;
     slope = sl / inter;
+    Real x0 = stems.top()->hpos();
     
-    Atom a(s);
-    
-    Real dx = width().min -left->hpos;
-    a.translate(Offset(dx,left_pos*inter));
-    output = new Molecule(a);
+    for (PCursor<Stem*> i(stems); i.ok(); i++) {
+       PCursor<Stem*> p(i-1);
+       PCursor<Stem*> n(i+1);
+       Stem * prev = p.ok() ? p.ptr() : 0;
+       Stem * next = n.ok() ? n.ptr() : 0;
+
+       Molecule sb = stem_beams(i, next, prev);
+       Real  x = i->hpos()-x0;
+       sb.translate(Offset(x, (x * slope  + left_pos)* inter));
+       output->add(sb);
+    }
+    output->translate(Offset(x0 - left->hpos,0));
 }
 
 void
 Beam::print()const
 {
-    mtor << "Beam, slope " <<slope << "left ypos " << left_pos<<'\n';    
+#ifndef NPRINT
+    mtor << "{ slope " <<slope << "left ypos " << left_pos;
+    Spanner::print();
+    mtor << "}\n";
+#endif
 }
 
index 5b12009ff92fc791160547abd7797c4e76b7da6d..8a133bdd5c7ecf3a3ebb9084a21fadaffd12ac47 100644 (file)
@@ -40,18 +40,4 @@ get_meter_command(Real w, int n, int m)
     c->priority = 40;
     return c;
 }
-#if 0
-Command*
-get_bar_command(Real w)
-{
-    Command*c = new Command;
-    c->when = w;
-    c->code = INTERPRET;
-    c->args.add( "BAR");
-    c->args.add( "|");
-    c->priority = 170;
-    return c;
-}
-
 
-#endif
diff --git a/src/grouping.cc b/src/grouping.cc
new file mode 100644 (file)
index 0000000..e07de12
--- /dev/null
@@ -0,0 +1,148 @@
+#include "grouping.hh"
+#include "debug.hh"
+
+Interval
+vec_union(svec<Interval> notes)
+{
+    Interval u;
+    u.set_empty();
+    for (int i =0 ; i < notes.sz() ; i++) {
+       u.unite(notes[i]);
+    }
+    return u;
+}
+
+svec<Real>
+default_bounds(Interval t)
+{
+    svec<Real> bounds;
+    Real dt = t.length();
+    bounds.add(t.min);
+    bounds.add(t.min + dt/2);    
+    return bounds;
+}
+
+svec<Real>
+Rhythmic_grouping::get_bounds()
+{
+    svec<Real> bounds;
+    if (children.sz()) {
+       for (int i=0; i < children.sz(); i++) {
+           bounds.add(children[i]->t.min);
+       }
+    } else {
+       default_bounds(t);
+    }
+//     bounds.add(t.max );
+    return bounds;
+}
+
+Real
+Rhythmic_grouping::last()
+{
+    return t.max;
+}
+
+void
+Rhythmic_grouping::split_grouping(svec<Real> bounds)
+{
+    int lasti =0;
+    svec<Rhythmic_grouping*> newgrp;
+    for (int i=0, j = 1; i < children.sz() && j < bounds.sz(); ) {
+       if ( children[i]->t.max < bounds[j]) {
+           i ++;
+           continue;
+       } else if (children[i]->t.max > bounds[j]) {
+           j ++;
+           continue;
+       }
+
+        assert( children[lasti]->t.min == bounds[j-1] );
+       assert( children[i]->t.max == bounds[j] );
+
+       Rhythmic_grouping * n = new Rhythmic_grouping(Interval(
+           bounds[j-1], bounds[j]));
+       for (int k = lasti ; k < i; k++)
+           n->children.add(children[k]);
+       newgrp.add(n);
+
+       i = lasti = i+1;
+    }
+    if (newgrp.sz() <= 1) {
+       newgrp[0]->children.set_size(0);
+       delete newgrp[0];
+       return;
+    }
+    children = newgrp;    
+}
+
+void
+Rhythmic_grouping::split_half()
+{
+    svec<Real> bounds = default_bounds(t);
+    bounds.add(t.max);
+    split_grouping(bounds);
+    
+    for (int i=0; i < children.sz(); i++) {
+       if (children[i]->children.sz())
+           children[i]->split_half();
+    }
+}
+
+Rhythmic_grouping*
+Rhythmic_grouping::sub_grouping(Interval v)
+{
+    return 0;                  // todo!
+}
+void
+Rhythmic_grouping::split_grouping(Rhythmic_grouping &initial_grouping)
+{
+    svec<Rhythmic_grouping*> newgrp;
+    svec<Real> bounds = initial_grouping.get_bounds();
+    bounds.add(initial_grouping.last());
+    split_grouping(bounds);
+    for (int i=0; i < children.sz(); i++) {
+       Interval h = children[i]->t;
+       Rhythmic_grouping*r = initial_grouping.sub_grouping(h);
+       if (children[i]->children.sz()) {
+           if (r)
+               children[i]->split_grouping(*r);
+           else
+               children[i]->split_half();
+       }
+    }
+}
+
+Rhythmic_grouping::Rhythmic_grouping(Interval i)
+{
+    t=i;
+}
+
+Rhythmic_grouping::Rhythmic_grouping(svec<Interval> notes,
+                               svec<Real> initial_grouping)
+{
+    t = vec_union(notes);
+    for (int i=0; i < notes.sz(); i++) {
+       children.add(new Rhythmic_grouping(notes[i]));
+    }
+    split_grouping(initial_grouping);
+}
+
+Rhythmic_grouping::~Rhythmic_grouping()
+{
+    for (int i=0; i < children.sz(); i++) {
+       delete children[i];
+    }
+}
+
+void
+Rhythmic_grouping::print()const    
+{
+    mtor << "{ " << t << "\n";
+    for (int i=0; i < children.sz(); i++) {
+       children[i]->print();
+    }
+    mtor << "}";
+}
+
+
index c0bdb969196b1c76899b693c4566988e8e0c175d..121271e4f0daecaa56da60e5686b3a95e86dba77 100644 (file)
@@ -21,7 +21,7 @@ Input_command::operator Command()
     c.code = INTERPRET;
     String s = args[0];
         
-    int p;
+    int p=0;
     if (s == "KEY")
        p = 200;
     else if (s=="CLEF")
@@ -30,6 +30,8 @@ Input_command::operator Command()
        p = 180;
     else if (s == "BAR")
        p = 170;
+    else if (s == "GROUPING")
+       p = 160;
     
     c.priority = p;
     c.args = args;
@@ -47,6 +49,17 @@ get_partial_command(Real u)
     return c;
 }
 
+Input_command*
+get_grouping_command(svec<int>a ) 
+{
+    Input_command*c = new Input_command;
+    c->args.add("GROUPING");
+    for (int i=0; i < a.sz(); i ++)
+       c->args.add(a[i]);
+
+    return c;
+}
+
 Input_command*
 get_key_interpret_command(svec<String>a ) 
 {
index 89ec2bd4e9c47d9ef6094ec5b624d8d3b9ee9894..5043354f0c902955e78464cc389b15b556761503 100644 (file)
@@ -47,7 +47,7 @@ Input_score::~Input_score()
 
 Input_score::Input_score()
 {
-    paper_=new Paperdef;
+    paper_= 0;
 }
 
 void
index 914c924a99fca9cbe38cbcb3d9cc60896320ef55..4a8ea949d6c9a3c392e267f25639221f9b220886 100644 (file)
@@ -60,8 +60,10 @@ Item::Item()
 void
 Item::print() const
 {
-    assert(output);
-    output->print();
+#ifndef NPRINT
+    if (output)
+       output->print();
+#endif
 }
 
 Paperdef*
index aaacf06df5840b453e9dea491c6cf92e93a1da88..f83cf144df65ff5f045910cba000c2de60e2aefe 100644 (file)
@@ -39,7 +39,7 @@ DURNAME               1|2|4|8|16|32
 DURATION       {DURNAME}\.*
 FULLNOTE       {PITCH}{DURATION}?
 WORD           [a-zA-Z][a-zA-Z0-9_]+
-REAL           [0-9]+(\.[0-9]*)?
+REAL           -?[0-9]+(\.[0-9]*)?
 
 %%
 
@@ -86,7 +86,7 @@ REAL          [0-9]+(\.[0-9]*)?
 }
 <notes>[ \t\n]+                {
 }
-<notes>%.*$            {
+<notes>[%#].*$         { 
 
 }
 <notes>\$      {
index e8a767f9ee51fe59a15e261f14299fc2547cdc1b..fbab62449bba2758d41c90f238c3bf062eb49350 100644 (file)
@@ -22,6 +22,7 @@ Spacing_problem::col_id(const PCol *w)const
        if (cols[i].pcol_ == w)
            return i;
     assert(false);
+    return -1;
 }
 
 void
index c22e3aaf556d112d196c24173a560826ed909be3..7376f3c1d41265fdc7dba607ac7b3fa0cba9fdcf 100644 (file)
@@ -5,26 +5,35 @@
 #include "tex.hh"
 #include "scalar.hh"
 
-Real
-Lookup::internote()
+
+Lookup::Lookup()
 {
-    return ball(4).dim.y.length()/2;
+    texsetting = "\\unknowntexsetting";
+    symtables_ = new Symtables;
 }
 
-void
-Lookup::parse(Text_db&t)
+Lookup::Lookup(Lookup const &s)
+{
+    texsetting = s.texsetting;
+    symtables_ = new Symtables(*s.symtables_);
+}
+Lookup::~Lookup()
 {
-    symtables_->read(t) ;
+    delete symtables_;
 }
 
-Lookup::Lookup()
+void
+Lookup::add(String s, Symtable*p)
 {
-    symtables_ = new Symtables;
+    symtables_->add(s, p);
 }
 
-Lookup::~Lookup()
+/****************/
+
+Real
+Lookup::internote()
 {
-    delete symtables_;
+    return ball(4).dim.y.length()/2;
 }
 
 Symbol
@@ -100,8 +109,6 @@ Lookup::streepjes(int i)
     return ret;
 }
 
-/****************************************************************/
-// bare bones.
 
 
 Symbol
@@ -122,9 +129,6 @@ Lookup::linestaff(int lines, Real wid)
     return s;
 }
 
-/****************************************************************/
-
-
 
 Symbol
 Lookup::meter(svec<Scalar> a)
@@ -156,5 +160,3 @@ Lookup::stem(Real y1,Real y2)
     s.tex = substitute_args(src,a);
     return s;
 }
-
-
index b6d1ea59d7f23deb897046b240ace1686d9667fa..ed4383fced88a6cd90823c7a153795bf80a12236 100644 (file)
@@ -45,9 +45,9 @@ Melodic_staff::get_TYPESET_item(Command*com)
 }
 
 Stem *
-Melodic_staff::get_stem(Stem_req*rq)
+Melodic_staff::get_stem(Stem_req*rq, Real dur)
 {
-    Stem * s = new Stem(NO_LINES-1);
+    Stem * s = new Stem(NO_LINES-1, dur);
     s->flag = rq->stem_number;
     return s;
 }
index 54746fd836001b2d804e751b40a719ebeaf1e448..51baac1211f392936110b117a75185f037df9f46 100644 (file)
@@ -3,12 +3,19 @@
 
 #include <math.h>
 
-int intlog2(int d) {
+int
+intlog2(int d) {
     int i=0;
     while (!(d&1)) {
-       d/= 2; i++;
+       d/= 2;
+       i++;
     }
     assert(!(d/2));
     return i;
 }
 
+double
+log2(double x) {
+    return log(x)  /log(2.0);
+}
+
index 7abc0e6b8ec238f2a22700ea3e19487d0a52398b..fcbd6745ebaf48b96f7f644c6eda8bfa970195d4 100644 (file)
@@ -17,8 +17,10 @@ Notehead::Notehead(int ss)
 void
 Notehead::print()const
 {
+#ifndef NPRINT
     mtor << "Head "<<balltype<<", position = "<< position << "dots " << dots;
     Item::print();
+#endif
 }
 
 void
index 5f31611f8e86fa404116e7bc07ee859c1e23a715..29fcd240e43598cc25efb5fdbb665163465e0edc 100644 (file)
@@ -1,15 +1,11 @@
 #include <math.h>
-
+#include "misc.hh"
 #include "paper.hh"
 #include "debug.hh"
 #include "lookup.hh"
 #include "dimen.hh"
 #include "textdb.hh"
 
-double log2(double x) {
-    return log(x)  /log(2.0);
-}
-
 
 // golden ratio
 const Real PHI = (1+sqrt(5))/2;
@@ -20,38 +16,33 @@ Paperdef::duration_to_dist(Real d)
 {
     return whole_width * pow(geometric_, log2(d));
 }
+
 Real
 Paperdef::rule_thickness()const
 {
     return convert_dimen(0.4, "pt");
 }
-Paperdef::Paperdef()
+
+Paperdef::Paperdef(Lookup *l)
 {
-    lookup_ = new Lookup();
-    parse();
+    lookup_ = l;
+
     linewidth = convert_dimen(15,"cm");                // in cm for now
-    whole_width= 8*note_width();
-//    geometric_ = PHI;
-        geometric_ = sqrt(2);
+    whole_width = 8 * note_width();
+    geometric_ = sqrt(2);
 }
 
-void 
-Paperdef::parse()
+Paperdef::~Paperdef()
 {
-    Text_db symini("symbol.ini");
-
-    
-    while (!symini.eof()) {    
-        Text_record  r(  symini++);
-       
-        if  (r[0] == "symboltables")
-            lookup_->parse(symini);     
-    }
+    delete lookup_;
 }
 
-Paperdef::~Paperdef()
+void
+Paperdef::set(Lookup*l)
 {
+    assert(l != lookup_);
     delete lookup_;
+    lookup_ = l;
 }
 
 Real
index 23c779ed7da6a8ffb372a6658586be1a41f7d14c..87c685a4d977f5a9f0dc4d26575556c0e7623b47 100644 (file)
@@ -1,5 +1,6 @@
 %{ // -*-Fundamental-*-
 #include <iostream.h>
+#include "lookup.hh"
 
 #include "lexer.hh"
 #include "paper.hh"
 #endif
 
 svec<Request*> pre_reqs, post_reqs;
+
+Paperdef*default_paper();
 %}
 
 
-%union {    
+%union {
+    Request * request;
     Real real;
     Input_command *command;
     Identifier *id;    
@@ -32,7 +36,6 @@ svec<Request*> pre_reqs, post_reqs;
     String *string;
     const char *consstr;
     Paperdef *paper;
-    Request* request;
     Horizontal_music *horizontal;
     Vertical_music *vertical;
     Music_general_chord *chord;
@@ -42,16 +45,25 @@ svec<Request*> pre_reqs, post_reqs;
 
     svec<String> * strvec;
     svec<Input_command*> *commandvec;
-    Voice_list *voicelist;
-       Input_staff *staff;    
-       Input_score *score;
+    svec<int> *intvec;
+
+    Input_staff *staff;    
+    Input_score *score;
+    Symtables * symtables;
+    Symtable * symtable;
+    Symbol * symbol;
+    Lookup*lookup;
+    Interval *interval;
+    Box *box;
 }
 
 %token VOICE STAFF SCORE TITLE  BAR NOTENAME OUTPUT
 %token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS
 %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND
 %token KEY CLEF VIOLIN BASS MULTI TABLE CHORD VOICES
-%token PARTIAL RHYTHMIC MELODIC MUSIC
+%token PARTIAL RHYTHMIC MELODIC MUSIC GROUPING
+
+%token END SYMBOLTABLES TEXID TABLE 
 
 %token <id>  IDENTIFIER
 %token <string> NEWIDENTIFIER 
@@ -60,7 +72,6 @@ svec<Request*> pre_reqs, post_reqs;
 %token <string> STRING
 %token <i> OPEN_REQUEST_PARENS CLOSE_REQUEST_PARENS
 
-
 %type <consstr> unit
 
 %type <id> declaration 
@@ -72,6 +83,7 @@ svec<Request*> pre_reqs, post_reqs;
 %type <score> score_block score_body
 %type <staff> staff_block staff_init staff_body
 %type <i> int
+%type <intvec> int_list
 %type <commandvec> score_commands_block score_commands_body
 %type <commandvec> staff_commands_block staff_commands_body
 %type <request> post_request pre_request
@@ -82,6 +94,12 @@ svec<Request*> pre_reqs, post_reqs;
 %type <horizontal>  horizontal_music
 %type <mvoice>  music_voice_body music_voice
 
+%type <interval> dinterval
+%type <box> box
+%type <symtable> symtable symtable_body
+%type <lookup> symtables symtables_body
+%type <symbol> symboldef
+
 
 %%
 
@@ -91,6 +109,7 @@ mudela:      /* empty */
        }
        | mudela add_declaration { }
        ;
+
 /*
        DECLARATIONS
 */
@@ -112,13 +131,20 @@ declaration:
                $$ = new M_chord_id(*$1, $3);
                delete $1;
        }
+       | NEWIDENTIFIER '=' symtables {
+               $$ = new Lookup_id(*$1, $3);
+               delete $1;
+       }
        ;
 
 
 /*
        SCORE
 */
-score_block: SCORE '{' score_body '}'  { $$ = $3; }
+score_block: SCORE '{' score_body '}'  { $$ = $3;
+               if (!$$->paper_)
+                       $$->paper_ = default_paper();
+       }
        ;
 
 score_body:            { $$ = new Input_score; }
@@ -178,8 +204,13 @@ score_command:
        | PARTIAL REAL                  {
                $$ = get_partial_command($2);
        }
+       | GROUPING int_list             {
+               $$ = get_grouping_command(*$2);
+               delete $2;
+       }
        ;
-       
+
+
 
 /*
        PAPER
@@ -189,25 +220,29 @@ paper_block:
        ;
 
 paper_body:
-       /* empty */                     { $$ = new Paperdef; }
+       /* empty */                     {
+               $$ = default_paper();
+       }
        | paper_body WIDTH dim          { $$->linewidth = $3;}
        | paper_body OUTPUT STRING      { $$->outfile = *$3;
                delete $3;
        }
+       | paper_body symtables          { $$->set($2); }
        | paper_body UNITSPACE dim      { $$->whole_width = $3; }
        | paper_body GEOMETRIC REAL     { $$->geometric_ = $3; }
        ;
+
 /*
        STAFFs
 */
 staff_block:
-        STAFF '{' staff_body '}'       { $$ = $3; }
+       STAFF '{' staff_body '}'        { $$ = $3; }
        ;
 
 
 
 staff_init:
-       IDENTIFIER              { $$ = new Input_staff(*$1->staff()); }
+       IDENTIFIER              { $$ = $1->staff(true); }
        | RHYTHMIC              {
                $$ = new Input_staff("rhythmic");
        }
@@ -355,7 +390,14 @@ int:
                
        }
        ;
-
+int_list:
+       /* */           {
+               $$ = new svec<int>;
+       }
+       | int           {
+               $$->add($1);
+       }
+       ;
 
 dim:
        REAL unit       { $$ = convert_dimen($1,$2); }
@@ -372,6 +414,64 @@ clef_id:
        VIOLIN          { $$ = new String("violin"); }
        | BASS          { $$ = new String("bass"); }
        ;
+/*
+       symbol tables
+*/
+symtables:
+       SYMBOLTABLES '{' symtables_body '}'     { $$ = $3; }
+       ;
+
+symtables_body:
+                       {
+               $$ = new Lookup;
+       }
+       | IDENTIFIER            {
+               $$ = new Lookup(*$1->lookup(true));
+       }
+       | symtables_body TEXID STRING           {
+               $$->texsetting = *$3;
+               delete $3;
+       }
+       | symtables_body STRING '=' symtable            {
+               $$->add(*$2, $4);
+               delete $2;
+       }
+       ;
+
+symtable:
+       TABLE '{' symtable_body '}' { $$ = $3; }
+       ;
+
+symtable_body:
+                               { $$ = new Symtable; }
+       | symtable_body STRING  symboldef {
+               $$->add(*$2, *$3);
+               delete $2;
+               delete $3;
+       }
+       ;
+
+symboldef:
+       STRING  box             {
+               $$ = new Symbol(*$1, *$2);
+               delete $1;
+               delete $2;
+       }
+       ;
+
+box:
+       dinterval dinterval     {
+               $$ = new Box(*$1, *$2);
+               delete $1;
+               delete $2;
+       }
+       ;
+
+dinterval: dim dim             {
+               $$ = new Interval($1, $2);      
+       }
+       ;
+
 %%
 
 void
@@ -380,13 +480,22 @@ parse_file(String s)
    *mlog << "Parsing ... ";
 
 #ifdef YYDEBUG
-   yydebug = !monitor.silence("Parser") & check_debug;
+   yydebug = !monitor.silence("Parser") && check_debug;
 #endif
 
+   new_input("symbol.ini");
+   yyparse();
    new_input(s);
    yyparse();
+
    delete_identifiers();
    kill_lexer();
    *mlog << "\n";
 }
 
+Paperdef*
+default_paper()
+{
+       return  new Paperdef(
+               lookup_identifier("default_table")->lookup(true));
+}
index 378ad37f0a9b980df7986c33968a1b73ac9103a2..fcd03ca55a18a0163f19e58f00b3e2f190bd6623 100644 (file)
@@ -1,5 +1,6 @@
 // utility functions for PScore
 #include "debug.hh"
+#include "lookup.hh"
 #include "spanner.hh"
 #include "paper.hh"
 #include "molecule.hh"
@@ -147,6 +148,7 @@ PScore::output(Tex_stream &ts)
 {
     int l=1;
 
+    ts << "\n "<<  paper_->lookup_->texsetting << "%(Tex id)\n";
     for (PCursor<Line_of_score*> lic(lines); lic.ok(); lic++) {
        ts << "% line of score no. " << l++ <<"\n";
        ts << lic->TeXstring();
index d5f26dcd4306ed055931dd3ee177f5709e2c72d4..a446bd33ecbe70846e2660236b39d3dcbcf8ffdc 100644 (file)
@@ -43,9 +43,9 @@ Rhythmic_staff::get_notehead(Note_req *rq, int)
 }
 
 Stem *
-Rhythmic_staff::get_stem(Stem_req*rq)
+Rhythmic_staff::get_stem(Stem_req*rq, Real l)
 {
-    Stem * s = new Stem(0);
+    Stem * s = new Stem(0,l);
     s->flag = rq->stem_number;
     return s;    
 }
index 57336936b5c2f0ec40c2308e020ad42cd9be531c..2be27345d30d4b38eddf7dfe0d331e059b4e2455 100644 (file)
@@ -12,8 +12,7 @@ Score::process()
 {
     *mlog << "Processing ... ";
     
-    if (!paper_)
-       paper_ = new Paperdef;
+    assert (paper_);
     
     /// distribute commands to disciples
     pscore_ = new PScore(paper_);
index 6437b65c3a0764f1c59748d02b53ebbc221654cb..9fe16b593727aca3dc292f4e47b0c0cba9e19d83 100644 (file)
@@ -14,6 +14,7 @@
 Simple_column::Simple_column(Score_column*s, Simple_staff *rs)
     : Staff_column(s)
 {
+    stem_requester_len = 0;
     stem_ = 0;    
     staff_ = rs;
     beam_ = 0;
@@ -45,6 +46,7 @@ Simple_column::process_requests()
            }
            if (rq->stem()) {
                stem_ = rq->stem();
+               stem_requester_len = v_elts[i]->duration;
            }
 
            if (rq->beam()) {
index 8d056e59ce8e1bec0a9509cb25f364d4a6c1784c..f275cd272e9b275f39964f10b02f95f25b18dc1e 100644 (file)
@@ -144,7 +144,7 @@ Simple_walker::process_requests()
     }
     
     if (c->stem_) {
-       stem_ = s->get_stem(c->stem_->stem());
+       stem_ = s->get_stem(c->stem_->stem(), c->stem_requester_len);
     }
     
     for (int i = 0; i <  c->notes.sz(); i ++)  {
index d38a604302f87e3f4b04a781a7aebcac750194b6..2d34f9e477aa409c86fd6a4bfb3b70b7cd10443d 100644 (file)
@@ -50,8 +50,11 @@ void
 Spanner::print()const
 {
 #ifndef NPRINT
-    mtor << "Spanner { Output ";
-    output->print();
+    mtor << "Spanner { ";
+    if (output) {
+       mtor << "Output ";
+       output->print();
+    }
     
     mtor << "}\n";
 #endif
index 5fa4d9ee30920260aeca1ed1efda3d4ef0589191..84e24c598639bb1e2b8ba33f43361086fdb51a1c 100644 (file)
@@ -6,16 +6,15 @@
 #include "lookup.hh"
 #include "molecule.hh"
 #include "pcol.hh"
+#include "misc.hh"
 
 const int STEMLEN=7;
-static int
-ABS(int i) {
-    return (i < 0)?-i:i;
-}
-
 
-Stem::Stem(int c)
+Stem::Stem(int c, Real len)
 {
+    note_length = len;
+    beams_left = 0;
+    beams_right = 0;
     minnote = 1000;            // invalid values
     maxnote = -1000;
     bot = top = 0;
@@ -27,7 +26,19 @@ Stem::Stem(int c)
     stem_xoffset=0;
 }
 
+void
+Stem::print() const
+{
+#ifndef NPRINT
+    mtor << "{\n";
+    mtor << "flag "<< flag << " print_flag " << print_flag
+        << "min,max [" << minnote << ", " << maxnote << "]";
+       
 
+    Item::print();
+    mtor << "}\n";
+#endif
+}
 void
 Stem::set_stemend(Real se)
 {
@@ -49,15 +60,10 @@ Stem::add(Notehead *n)
     if ( p < minnote)
        minnote = p;
     if ( p> maxnote)
-       maxnote = p;
-}
-void
-Stem::print()const
-{
-    mtor << "Stem minmax=["<< minnote<<","<<maxnote<<"], flag: "<<flag;
-    Item::print();
+       maxnote = p;    
 }
 
+
 void
 Stem::set_default_dir()
 {
index 39b6fdead0437943f07df05d00763b4a9b7b41bf..bc5d173869d79c60cbd074914581b56d784e7077 100644 (file)
@@ -5,8 +5,25 @@
 #include "real.hh"
 #include "symbol.hh"
 #include "assoc.hh"
+#include "associter.hh"
 #include "symtable.hh"
+Symtables::Symtables()
+{
+}
+
+Symtables::Symtables(Symtables const &s)
+{
+    for (Assoc_iter<String, Symtable*>  i(s); i.ok(); i++) {
+       add(i.key(), new Symtable(*i.val()));
+    }
+}
 
+Symtables::~Symtables()
+{
+    for (Assoc_iter<String, Symtable*>  i(*this); i.ok(); i++) {
+       delete i.val();
+    }
+}
 
 Symbol 
 Symtable::lookup(String s) const
@@ -25,36 +42,3 @@ Symtables::operator()(String s)
 {
     return Assoc<String, Symtable*>::operator[](s);
 } 
-
-void
-Symtables::read(Text_db &symini)
-{
-     while (!symini.eof()) {
-        Text_record  r(symini++);
-        if (r[0] == "end" )
-            return;
-        assert (r[0] == "table");
-        
-        String tabnam = r[1];
-        Symtable * sp = new Symtable;
-        while (!symini.eof()){
-            r = symini++;
-            if (r[0] == "end")
-                break;
-            
-            if (r.sz() != 6)
-                error("Not enough fields in symbol init");
-            
-            int i=0;
-            String id=r[i++];
-            String tex=r[i++];
-            svec<Real> dims;
-            for (int j=0; j < 4; j++)
-                dims.add( parse_dimen(r[i++]));
-            
-            Symbol s(tex, Box(dims));
-            (*sp)[id] = s;
-        }
-        (*this)[tabnam] = sp;           
-     }
-}
index cfb0db0cb9ab8cd6fce8acd2a52bcc274e3ba697..a61676159a7784f51991297abb6eaf39a67e42e9 100644 (file)
@@ -31,6 +31,8 @@ static Keyword_ent the_key_tab[]={
     "staff", STAFF,
     "start", START_T,
     "table", TABLE,
+    "symboltables", SYMBOLTABLES,
+    "texid", TEXID,
     "chord", CHORD,
     "multi", MULTI,
     "unitspace", UNITSPACE,
@@ -39,6 +41,7 @@ static Keyword_ent the_key_tab[]={
     "voices", VOICES,
     "width", WIDTH,
     "music", MUSIC,
+    "grouping", GROUPING,
     0,0
 };
 
@@ -69,8 +72,7 @@ add_identifier(Identifier*i)
 
 void
 delete_identifiers()
-{
-    
+{    
     for (Assoc_iter<String,Identifier*> ai(the_id_tab); ai.ok(); ai++) {
        mtor << "deleting: " << ai.key()<<'\n';
        delete ai.val();
index 799b9e7e6dd8cb490b24c8471b30b44200179083..4a7fe02bc29b97d2048375109edaf00c2adfbf6f 100644 (file)
@@ -8,7 +8,7 @@
 static
 char direction_char(int y_sign)
 {
-    char c;
+    char c='#';
     switch(y_sign){
     case -1:
        c = 'd';
index 5b1d6e303ebfd7f17493a3ef6ae332032adec18b..3e149c7a669040d6eaceb6cbb7e41ff883594cc4 100644 (file)
-
-
-
-symboltables
-# index TeXstring,     xmin xmax ymin ymax
-
-# be careful with editing this:
-# the "index" entry is hardwired into lilypond.
-
-table clefs
-       violin  \violinclef 0pt 16pt    -12.5pt 22.5pt
-       bass    \bassclef 0pt   16pt    0pt     20pt
-       viola   \violaclef 0pt  16pt    0pt     20pt
-       violin_change   \cviolinclef 0pt        16pt    -12.5pt 22.5pt
-       bass_change     \cbassclef 0pt  16pt    0pt     20pt
-       viola_change    \cviolaclef 0pt 16pt    0pt     20pt
-end
-
-table balls
-       1       \wholeball      0pt     7.5pt   -2.5pt  2.5pt
-       2       \halfball       0pt     6pt     -2.5pt  2.5pt
-       4       \quartball      0pt     6pt     -2.5pt  2.5pt
-end
-
-table slur
-       whole   \slurchar%{%}   0pt     0pt     0pt     0pt
-       half    \hslurchar%{%}  0pt     0pt     0pt     0pt
-end
-table accidentals
-       -2      \flatflat       0pt     10.2pt  -2.5pt 7.5pt
-       -1      \flat           0pt     6pt     -2.5pt 7.5pt
-       0       \natural        0pt     6pt     -7.5pt 7.5pt
-       1       \sharp          0pt     6pt     -7.5pt 7.5pt
-       2       \sharpsharp     0pt     6pt     -2.5pt 7.5pt
-end
-
-table streepjes
-       toplines        \toplines{%}    -3pt    9pt 0pt 0pt
-       botlines        \botlines{%}    -3pt    9pt 0pt 0pt
-end
-
-table bars
-       empty   \emptybar       0pt     0pt     0pt     0pt
-       |       \maatstreep     0pt     5pt     -12pt   12pt
-       ||      \finishbar      0pt     2pt     -12pt   12pt
-end
-
-table rests
-       1       \wholerest              -5pt    1pt     -1pt    1pt
-       2       \halfrest               -5pt    1pt     -1pt    1pt
-       4       \quartrest              -5pt    2pt     -5pt    5pt
-       8       \eighthrest             0pt     5pt     0pt     8pt
-       16      \sixteenthrest          0pt     6pt     0pt     12pt
-       32      \thirtysecondrest       0pt     6pt     0pt     16pt
-end
-
-table meters
-       C       \fourfourmeter          0pt     10pt    -5pt    5pt
-       C2      \allabreve              0pt     10pt    -5pt    5pt
-end
-
-# dims ignored for this table
-table param
-       meter   \generalmeter{%}{%}     -3pt    10pt    -5pt    5pt
-       linestaf \linestafsym{%}{%}     0pt     0pt     0pt     0pt
-       stem    \stem{%}{%}             0pt     0pt     0pt     0pt
-end
-
-table dots
-       1       \lsingledot             0pt     8pt     -1pt    1pt
-       2       \ldoubledot             0pt     12pt    -1pt    1pt
-       3       \ltripledot             0pt     16pt    -1pt    1pt
-end
-
-table flags
-       8       \eigthflag              0pt     5pt     0pt     0pt     
-       16      \sixteenthflag          0pt     5pt     0pt     0pt
-       32      \thirtysecondflag       0pt     5pt     0pt     0pt
-       -8      \deigthflag             0pt     5pt     0pt     0pt
-       -16     \dsixteenthflag         0pt     5pt     0pt     0pt
-       -32     \dthirtysecondflag      0pt     5pt     0pt     0pt
-end
-
-table beamslopes
-       slope   \beamslope{%}{%}        0pt     0pt     0pt     0pt
-       horizontal \rulesym{%}{%}       0pt     0pt     0pt     0pt
-end
-
-end # symboltables
\ No newline at end of file
+%
+% spacing info for LilyPond. Do not edit this. It has a lot of hard-wired stringconstants
+%
+%
+
+table_sixteen = symboltables {
+       
+   texid       "\musixsixteendefs"
+
+
+   % index TeXstring,  xmin xmax ymin ymax
+
+
+     "clefs" = table {
+            "violin"   "\violinclef"   0pt     16pt    -12.5pt 22.5pt
+            "bass"     "\bassclef"             0pt     16pt    0pt     20pt
+            "viola"    "\violaclef"            0pt     16pt    0pt     20pt
+            "violin_change"    "\cviolinclef"  0pt     16pt    -12.5pt 22.5pt
+            "bass_change"      "\cbassclef"    0pt     16pt    0pt     20pt
+            "viola_change"     "\cviolaclef"   0pt     16pt    0pt     20pt
+     }
+
+     "balls" = table {
+            "1"        "\wholeball"    0pt     6pt     -2 pt   2pt
+            "2"        "\halfball"     0pt     5pt     -2 pt   2pt
+            "4"        "\quartball"    0pt     5pt     -2 pt   2pt
+     }
+
+     "slur" = table {
+            "whole"    "\slurchar%{%}" 0pt     0pt     0pt     0pt
+            "half"     "\hslurchar%{%}"        0pt     0pt     0pt     0pt
+     }
+     "accidentals" = table {
+            "-2"       "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
+            "-1"       "\flat"         0pt     6pt     -2.5pt 7.5pt
+            "0"        "\natural"      0pt     6pt     -7.5pt 7.5pt
+            "1"        "\sharp"                0pt     6pt     -7.5pt 7.5pt
+            "2"        "\sharpsharp"   0pt     6pt     -2.5pt 7.5pt
+     }
+
+     "streepjes" = table {
+            "toplines" "\toplines{%}"  -3pt    9pt 0pt 0pt
+            "botlines" "\botlines{%}"  -3pt    9pt 0pt 0pt
+     }
+
+     "bars" = table {
+            "empty"    "\emptybar"     0pt     0pt     0pt     0pt
+            "|"        "\maatstreep"   0pt     5pt     -12pt   12pt
+            "||"       "\finishbar"    0pt     2pt     -12pt   12pt
+     }
+
+     "rests" = table {
+            "1"        "\wholerest"            -5pt    1pt     -1pt    1pt
+            "2"        "\halfrest"             -5pt    1pt     -1pt    1pt
+            "4"        "\quartrest"            -5pt    2pt     -5pt    5pt
+            "8"        "\eighthrest"           0pt     5pt     0pt     8pt
+            "16"       "\sixteenthrest"                0pt     6pt     0pt     12pt
+            "32"       "\thirtysecondrest"     0pt     6pt     0pt     16pt
+     }
+
+     "meters" = table {
+            "C"        "\fourfourmeter"                0pt     10pt    -5pt    5pt
+            "C2"       "\allabreve"            0pt     10pt    -5pt    5pt
+     }
+
+     % dims ignored for this table
+     "param" = table {
+            "meter"    "\generalmeter{%}{%}"   -3pt    10pt    -5pt    5pt
+            "linestaf" "\linestafsym{%}{%}"    0pt     0pt     0pt     0pt
+            "stem"     "\stem{%}{%}"           0pt     0pt     0pt     0pt
+     }
+
+     "dots" = table {
+            "1"        "\lsingledot"           0pt     8pt     -1pt    1pt
+            "2"        "\ldoubledot"           0pt     12pt    -1pt    1pt
+            "3"        "\ltripledot"           0pt     16pt    -1pt    1pt
+     }
+
+     "flags" = table {
+            "8"        "\eigthflag"            0pt     5pt     0pt     0pt     
+            "16"       "\sixteenthflag"                0pt     5pt     0pt     0pt
+            "32"       "\thirtysecondflag"     0pt     5pt     0pt     0pt
+            "-8"       "\deigthflag"           0pt     5pt     0pt     0pt
+            "-16"      "\dsixteenthflag"               0pt     5pt     0pt     0pt
+            "-32"      "\dthirtysecondflag"    0pt     5pt     0pt     0pt
+     }
+
+     "beamslopes" = table {
+            "slope"    "\beamslope{%}{%}"      0pt     0pt     0pt     0pt
+            "horizontal"       "\rulesym{%}{%}"        0pt     0pt     0pt     0pt
+     }
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+table_twenty = symboltables {
+       
+       texid   "\musixtwentydefs"
+
+
+    % index TeXstring,         xmin xmax ymin ymax
+    % be careful with editing this:
+    % the "index" entry is hardwired into lilypond.
+
+    "clefs" = table {
+           "violin"    "\violinclef"   0pt     16pt    -12.5pt 22.5pt
+           "bass"      "\bassclef"             0pt     16pt    0pt     20pt
+           "viola"     "\violaclef"            0pt     16pt    0pt     20pt
+           "violin_change"     "\cviolinclef"  0pt     16pt    -12.5pt 22.5pt
+           "bass_change"       "\cbassclef"    0pt     16pt    0pt     20pt
+           "viola_change"      "\cviolaclef"   0pt     16pt    0pt     20pt
+    }
+
+    "balls" = table {
+           "1" "\wholeball"    0pt     7.5pt   -2.5pt  2.5pt
+           "2" "\halfball"     0pt     6pt     -2.5pt  2.5pt
+           "4" "\quartball"    0pt     6pt     -2.5pt  2.5pt
+    }
+
+    "slur" = table {
+           "whole"     "\slurchar%{%}" 0pt     0pt     0pt     0pt
+           "half"      "\hslurchar%{%}"        0pt     0pt     0pt     0pt
+    }
+    "accidentals" = table {
+           "-2"        "\flatflat"     0pt     10.2pt  -2.5pt 7.5pt
+           "-1"        "\flat"         0pt     6pt     -2.5pt 7.5pt
+           "0" "\natural"      0pt     6pt     -7.5pt 7.5pt
+           "1" "\sharp"                0pt     6pt     -7.5pt 7.5pt
+           "2" "\sharpsharp"   0pt     6pt     -2.5pt 7.5pt
+    }
+
+    "streepjes" = table {
+           "toplines"  "\toplines{%}"  -3pt    9pt 0pt 0pt
+           "botlines"  "\botlines{%}"  -3pt    9pt 0pt 0pt
+    }
+
+    "bars" = table {
+           "empty"     "\emptybar"     0pt     0pt     0pt     0pt
+           "|" "\maatstreep"   0pt     5pt     -12pt   12pt
+           "||"        "\finishbar"    0pt     2pt     -12pt   12pt
+    }
+
+    "rests" = table {
+           "1" "\wholerest"            -5pt    1pt     -1pt    1pt
+           "2" "\halfrest"             -5pt    1pt     -1pt    1pt
+           "4" "\quartrest"            -5pt    2pt     -5pt    5pt
+           "8" "\eighthrest"           0pt     5pt     0pt     8pt
+           "16"        "\sixteenthrest"                0pt     6pt     0pt     12pt
+           "32"        "\thirtysecondrest"     0pt     6pt     0pt     16pt
+    }
+
+    "meters" = table {
+           "C" "\fourfourmeter"                0pt     10pt    -5pt    5pt
+           "C2"        "\allabreve"            0pt     10pt    -5pt    5pt
+    }
+
+    % dims ignored for this table
+    "param" = table {
+           "meter"     "\generalmeter{%}{%}"   -3pt    10pt    -5pt    5pt
+           "linestaf"  "\linestafsym{%}{%}"    0pt     0pt     0pt     0pt
+           "stem"      "\stem{%}{%}"           0pt     0pt     0pt     0pt
+    }
+
+    "dots" = table {
+           "1" "\lsingledot"           0pt     8pt     -1pt    1pt
+           "2" "\ldoubledot"           0pt     12pt    -1pt    1pt
+           "3" "\ltripledot"           0pt     16pt    -1pt    1pt
+    }
+
+    "flags" = table {
+           "8" "\eigthflag"            0pt     5pt     0pt     0pt     
+           "16"        "\sixteenthflag"                0pt     5pt     0pt     0pt
+           "32"        "\thirtysecondflag"     0pt     5pt     0pt     0pt
+           "-8"        "\deigthflag"           0pt     5pt     0pt     0pt
+           "-16"       "\dsixteenthflag"               0pt     5pt     0pt     0pt
+           "-32"       "\dthirtysecondflag"    0pt     5pt     0pt     0pt
+    }
+
+    "beamslopes" = table {
+           "slope"     "\beamslope{%}{%}"      0pt     0pt     0pt     0pt
+           "horizontal"        "\rulesym{%}{%}"        0pt     0pt     0pt     0pt
+    }
+
+}
+
+default_table = symboltables { table_sixteen }
\ No newline at end of file