# class name silence?
-My_flex_lexer 1
+My_flex_lexer 0
yyFlexLexer 1
PCol 1
Score_column 1
+++ /dev/null
--*-text-*-
-
-CODING STANDARDS:
-
-Functions and methods do not return errorcodes, but use assert for
-checking status.
-
-INDENTATION, in emacs:
-
-
-(add-hook 'c-mode-hook
- '(lambda ()(setq c-basic-offset 4)))
-
-
-(add-hook 'c++-mode-hook
- '(lambda() (c-set-style "Stroustrup")
- )
- )
-
-
-CLASSES and TYPES:
-
- This_is_a_class
- AClass_name (for Abbreviation_class_name)
-
-DATA MEMBERS
-
- Class::member
-
-if the member's name resembles its type, then I use
-
- class Fubular { ..}
-
- Class::fubular_
-
-COMMENTS
-
-/// short description
-class Class {
- ///
- Data data_member_;
- /**
- ..
- */
-
- /****************/
-
- /// short memo
- member();
- /**
- long doco of member()
- */
-};
-/**
- Class documentation.
-*/
-
-Unfortunately most of the code isn't really documented that good.
-
-CLASSNAMES (2)
-
-A lot of classes in LilyPond start with 'P', this is to distinguish
-certain parts of LilyPond: the P stands for Printer, and the P-classes
-are supposed to be more lowlevel than the others. Example:
-
- Staff uses PStaff, PScore and PCol to do the typesetting of
-symbols. Staff is the "brains" for PStaff
-
-NB: in PCursor (which is part of the library) P stands for PointerCursor
-
-
-MEMBERS(2)
-
-Standard methods:
-
- ///check that *this satisfies its invariants, abort if not.
- void OK() const
-
- /// print *this (and substructures) to debugging log
- void print() const
-
- /// add some data to *this;
- add( .. )
- /**
- Presence of these methods usually imply that it is not feasible to this
- via a constructor
- */
-
- /// replace some data of *this
- set( .. )
-
--- /dev/null
+=head1 NAME
+
+CodingStyle - standards while programming for LilyPond
+
+=head1 DESCRIPTION
+
+Please use these standards while doing programming for LilyPond
+
+
+
+Functions and methods do not return errorcodes, but use assert for
+checking status.
+
+=head2 INDENTATION
+
+in emacs:
+
+
+ (add-hook 'c-mode-hook
+ '(lambda ()(setq c-basic-offset 4)))
+
+
+ (add-hook 'c++-mode-hook
+ '(lambda() (c-set-style "Stroustrup")
+ )
+ )
+
+
+=head2 CLASSES and TYPES:
+
+ This_is_a_class
+ AClass_name (for Abbreviation_class_name)
+
+=head2 DATA MEMBERS
+
+ Class::member
+
+if the member's name resembles its type, then I use
+
+ class Fubular { ..}
+
+ Class::fubular_
+
+=head2 COMMENTS
+
+ /// short description
+ class Class {
+ ///
+ Data data_member_;
+ /**
+ ..
+ */
+
+ /****************/
+
+ /// short memo
+ member();
+ /**
+ long doco of member()
+ */
+ };
+ /**
+ Class documentation.
+ */
+
+Unfortunately most of the code isn't really documented that good.
+
+=head2 CLASSNAMES (2)
+
+A lot of classes in LilyPond start with 'P', this is to distinguish
+certain parts of LilyPond: the P stands for Printer, and the P-classes
+are supposed to be more lowlevel than the others. Example:
+
+Staff uses PStaff, PScore and PCol to do the typesetting of
+symbols. Staff is the "brains" for PStaff
+
+NB: in PCursor (which is part of the library) P stands for PointerCursor
+
+
+=head2 MEMBERS(2)
+
+Standard methods:
+
+ ///check that *this satisfies its invariants, abort if not.
+ void OK() const
+
+ /// print *this (and substructures) to debugging log
+ void print() const
+
+ /// add some data to *this;
+ add( .. )
+ /**
+ Presence of these methods usually imply that it is not feasible to this
+ via a constructor
+ */
+
+ /// replace some data of *this
+ set( .. )
+
+PODS=README.pod CodingStyle.pod lilygut.pod lilyinput.pod
+TXTS=$(PODS:.pod=.txt)
+MANS=$(PODS:.pod=.1)
+DOCFILES=$(PODS) Makefile
-DOCFILES=commands CodingStyle algorithms Makefile breaking\
- slurfont pointers design literature inputformat
+
+default:
+ $(MAKE) -C .. doc
+
+doc: $(TXTS)
dist:
- ln $(DOCFILES) $(DDIR)/Documentation/
\ No newline at end of file
+ ln $(DOCFILES) $(DDIR)/Documentation/
+clean:
+ rm -f $(TXTS) $(MANS)
+
+%.txt: %.1
+ groff -man -Tascii $< > $@
+
+%.1: %.pod
+ pod2man --center="LilyPond documentation" --section="0"\
+ --release="LilyPond $(MAJVER).$(MINVER).$(PATCHLEVEL)" $< > $@
+
--- /dev/null
+=head1 NAME
+
+Lilypond - a music typesetter
+
+=head1 SYNOPSIS
+
+ lilypond [options] [inputfiles]
+
+=head1 DESCRIPTION
+
+LilyPond typesets music. It translates script files (mudela files or
+F<.ly>'s) into TeX input.
+
+=head1 OPTIONS
+
+=item B<-d,--debug>
+debugging
+
+=item B<-w,--warranty>
+warranty
+
+=item B<-o,--output>
+default output file
+
+=item B<-h,--help>
+help
+
+=head1 LICENSE
+
+GNU GPL. See file COPYING
+
+=head1 PREREQUISITES
+
+Compilation:
+
+=over 5
+
+=item - Unix (any decent Linux distribution is fine)
+
+=item - GNU C++ v2.7 or better (with libg++ )
+
+=item - GNU make.
+
+=item - flex (2.5.1 or better)
+
+=item - bison/yacc
+
+=item - The "flower" library, which should be available from the
+ same source you got this from.
+
+=item - perl
+
+=back
+
+Operation:
+
+=over 5
+
+=item - TeX
+
+=item - the MusixTeX fonts
+
+=back
+
+The Makefile uses perl for trivial operations, and you could tinker
+with it to use sed or awk.
+
+=head1 COMPILING
+
+Do:
+
+ tar zxf flower-1.11.9.tar.gz
+ mv flower-1.11.9 flower
+ cd flower; make; cd ..
+ tar zxf lilypond-1.2.13.tar.gz
+ cd lilypond-1.2.13
+ make
+
+why G++ >= 2.7? LilyPond & flower lib uses:
+
+ builtin bool
+ typeof
+ operator <?, operator >?
+ the new for-scope
+ class Rational (libg++)
+
+=head1 AUTHOR
+
+Han-Wen Nienhuys <hanwen@stack.nl>, <jan@digicash.com>
+
+=head1 EXAMPLES
+
+At this time, LilyPond is only suited for Quick & Dirty jobs (the
+output quality still is too low). If you're not discouraged; this is
+what I type in my xterm:
+
+ lilypond someinput.ly
+ tex test
+ xdvi test&
+
+This is what the output looks like over here:
+
+ hw:~/musix/spacer$ lilypond maartje.ly
+ LilyPond 0.0.17/FlowerLib 1.0.14. Compile: Dec 17 1996, 11:33:54 (g++ 2.7.2)
+ Parsing ... [symbol.ini][maartje.ly]
+ Processing ... Calculating ... Postprocessing ...
+ output to lelie.uit...
+
+ hw:~/musix/spacer$ tex test
+ This is TeX, Version 3.14159 (C version 6.1)
+ (test.tex
+ Hyphenation patterns for english, dutch, loaded.
+ (lilyponddefs.tex) (lelie.uit) [1] [2] )
+ Output written on test.dvi (2 pages, 8072 bytes).
+ Transcript written on test.log.
+
+ hw:~/musix/spacer$ xdvi test&
+ [1] 1468
+
+Check out kortjakje.ly, it has some comments
+
+
+=head1 PROBLEMS
+
+If LilyPond bombs out, then please recompile using B<-g>, and send a gdb
+stacktrace of the crash. It also helps if you can print the values of the objects. So if you trace is
+
+ (gdb) backtrace 12
+ #0 Interval::operator+= (this=0x11fffec60..)
+ at ../flower/interval.hh:50
+ #1 0x12005195c in Item::width (this=0x14008a680) at src/item.cc:39
+ #2 0x12008fdbc in itemlist_width (its=0x11fffed58 ..
+ :
+ :
+
+Than it would help if you send a dump of the Interval and the Item
+(use: 'print *this' or use LilyPond print() methods).
+
+This is a beta version of LilyPond. Please send your helpful comments
+and patches to me,
+
+LilyPond is updated very frequently, the latest version is always available at:
+
+F<ftp://pcnov095.win.tue.nl/pub/lilypond>
+
+
+=head1 FILES
+
+F<symbol.ini> The initialisation file with symbol tables etc.
+
+=head1 HOW DOES IT WORK
+
+=over 5
+
+Use The Source, Luke. If you don't know C++, you can try editing
+the file F<.dstreamrc> for copious debugging output. (use B<-d>)
+
+the subdir Documentation/ contains some more-in-depth matter on LilyPond
+
+The source is commented in the DOC++ style.
+Check out doc++ at
+
+ http://www.ZIB-Berlin.DE/VisPar/doc++/doc++.html
+
+=back
+++ /dev/null
-Date: Tue, 5 Nov 1996 00:01:32 +0100
-From: Werner Icking <Werner.Icking@gmd.de>
-To: hanwen@stack.urc.tue.nl
-Cc: dsimons@logicon.com
-Subject: Re: font sizes.
-
-> Date: Mon, 4 Nov 1996 22:37:54 +0100 (MET)
-> From: Han-Wen Nienhuys <hanwen@stack.urc.tue.nl>
-> >
-> >There were different schemes when music was typeset by hand. If I remember
-> >right Harder uses another scheme that Gomberg. Both scheme may be used
->
-> Who are Harder and Gomberg? Do you have references?
-
-Both are mentioned in the master thesis by Steinbach & Schofer who
-invented M(u)TeX, the grandmother of all M...TeXs. The Musiclibrary
-in Bonn has the harder (printed in 1948?) and there are not many books
-I liked more to own.
-
-The master thesis should be available at the CTAN archives under MuTeX
-or MTEX maybe subdirectory DIPL (for Diplom). I have the TEX-source
-and I may pack it to ftp.gmd.de if you are interested and can't find it
-on CTAN.
-================================================================
-
-[breaking lines]
->
->Incidentally, I use a different approach in PMX, starting with the
->total number of systems for the piece instead of assuming a starting
->physical value for \elemskip. That's equivalent to setting the
->physical length of the whole piece if laid out in one long line.
->Knowing the total amount of scalable and fixed space I compute a
->starting physical value for \elemskip. I use that to get how many
->bars go in the first line. Then I force a line break there, remove
->those bars and their scalable and fixed space from the accounting, and
->start over with the second line, etc.
-
-
-Since you are getting into technical details, I will show mine too: I
-think my way is the most elegant algorithm i've seen so far. Some
-terminology: I call a vertical group of symbols (notes) which start at
-the same time a "column". Each line of a score has notes in it,
-grouped in columns. The difference in starting time between those
-columns makes it possible to determine ideal distances between those
-columns.
-
-Example:
-
- time ----->
-
- col1 col2 col3 col4
-
-
-voice1 1 1
-
-voice2 2 2 2 2
-
-
-(1 is a whole note, 2 a half note.)
-
-time_difference (col1 , col2) = 0.5 wholes,
-time_difference (col1 , col3) = 1 wholes,
-time_difference (col2 , col3) = 0.5 wholes,
-etc.
-
-these differences are translated into ideal distances (these translations
-have been the subject of discussion in this thread).
-
- distance (col1,col2) = 10 pt
- distance (col1,col3) = 14.1 pt
- distance (col2,col3) = 10 pt
- etc.
-
-as you can see, these distance are conflicting. So instead of
-satisfying all those ideals simultaneously, a compromise is sought.
-
-This is Columbus' egg: LilyPond attaches "springs" to each
-column-pair. each spring has an equilibrium-position which is equal to
-the above mentioned distance, so
-
- spring (col1, col2) and spring(col2,col3) try to push column 1
-and 3 away (to a distance of 20pt) from each other, whereas the spring
-between col 1 and col 3 tries to pull those two together (to a
-distance of 14.1 pt). The net result of this pushing and pulling is an
-equilibrium situation (the pushing cancels the pulling), which can be
-calculated as the solution of Quadratic program: it is the solution
-with minimum potential energy, for you physicists out there.
-
-This algorithm for doing one line, gives a "badness" parameter for
-each line (the potential energy). Now one can use TeX's algorithm for
-making paragraphs (using this new version of "badness"): one should
-try to minimise the overall badness of a paragraph. LilyPond also uses the
-concept of pre- and post-breaks.
-
-(actually, it is a bit more complicated: each column also has a
-minimum distance to other columns, to prevent symbols from running
-into symbols of other columns.)
-
+++ /dev/null
-[Source files: command.hh, scommands.cc]
-
-BREAKING, PREBREAK POSTBREAK, etc.
-
-So what's the deal with PREBREAK and POSTBREAK and all this
-stuff?
-
-Let's take text as an example. In German some compound
-words change their spelling if they are broken: "backen" becomes
-"bak-ken". TeX has a mechanism to deal with this, you would define
-the spelling of "backen" in TeX in this way
-
- \discretionary{bak-}{ken}{backen}
-
-These 3 arguments are called "prebreak", "postbreak" and "nobreak"
-text.
-
-The same problem exists when typesetting music. If a line of music is
-broken, the next line usually gets a clef. So in TeX terms, the clef
-is a postbreak. The same thing happens with meter signs: Normally the
-meter follows the bar. If a line is broken at that bar, the bar along
-with the meter stays on the "last" line, but the next line also gets a
-meter sign after the clef. Using the previous notation,
-
- \discretionary{bar meter}{clef meter}{ bar meter }
-
-In Lilypond, we have the same concepts (and the same
-terminology). Each (nonrhythmic) symbol is typeset using a Command
-(code: TYPESET). At a breakpoint, TYPESET commands can be grouped
-using separators (in lower case):
-
- BREAK_PRE, typeset(bar), typeset(meter),
- BREAK_MID, typeset(bar), typeset(meter),
- BREAK_POST, typeset(clef), typeset(meter), BREAK_END
-
-The BREAK command sequence is terminated with BREAK_END, so other
-commands (like INTERPRET) may follow this sequence.
-
+++ /dev/null
-This table decribes the proper order for the different commands:
-
-
-interpret
- which priority
- ========================
-
- key 200
- clef 190
- meter 180
- bar 170
-
-typeset
-
- which priority
- ========================
-
- bar 100
- clef 90
- currentclef 80
- key 70
- currentkey 60
- meter 40
-
\ No newline at end of file
+++ /dev/null
-LilyPond is a "5-pass" system:
-
-1. Parsing:
-
-No difficult algorithms. Associated datastructures have prefix Input
-(eg Input_score, Input_command)
-
-2. Processing:
-
-Requests are processed and granted. In this step data-structures for
-3. are created and filled with data: PScore, PCol, PStaff
-
-3. Calculation:
-
-This step uses structures which have names starting with 'P'.
-linebreaks and horizontal positions of PCols are determined. Line_of_*
-generated.
-
-4. Postprocesing:
-
-Some items and all spanners need computation after the PCol positions
-are determined.
-
-5. Output
-
-Very simple, just walk all Line_of_* and follow the links over there
\ No newline at end of file
+++ /dev/null
-General format of a construct:
-
- BLOCKNAME { <info to go with this block> }
-
-Some types allow declarations:
-
- IDENTIFIER = BLOCKNAME {
- <info to go with this block>
- }
-
- ..
-
- BLOCKNAME {
- IDENTIFIER
- ...
- }
-
-
-In musicmode, eg,
-
- ''!c8.-"text"_v
-
-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.
-
-* musicmode: The brace still is used to group grammatical groups.
-* musicmode: "word" are preceded by a '\' (backslash)
-
-This means you can write some stuff in a zillion ways:
-
-1. $\var = \blockname { ... } $
-
-2. var = blockname { $ ... $ }
-
-3. var = $ $ $\blockname { ... $ }
-
-COMMENTS
-
-not really crystallized; you can use '#' or '%' as line comment
-
-OTHER
-
-A correctly parsed .ly does not guarantuee output. A lot (most) of the
-checking is done *after* parsing (some checks even are done after the
-break calc!); I'm sorry.
-
-The parser's job is to construct appropriate objects. It will *only*
-detect parse errors.
-
-LilyPond first reads 'symbol.ini', which contains declarations crucial
-to proper operation of LilyPond (symbol tables, note names)
-
-This language looks a lot like Rayce's which in turn owes a lot to the
-POVRay raytracer. Now, I know, musictypesetting and Raytracing do not
-necessarily require the same input format, but I was just to lazy to
-make up a new/better input format. Suggestions welcome.
--- /dev/null
+=head1 NAME
+
+LilyGuts - doco to the internals of LilyPond
+
+=head1 DESCRIPTION
+
+This page documents some aspects of the internals of LilyPond
+
+=head1 OVERVIEW
+
+LilyPond is a "5-pass" system:
+
+=over 5
+
+=item 1. Parsing:
+
+No difficult algorithms. Associated datastructures have prefix Input
+(eg Input_score, Input_command)
+
+=item 2. Processing:
+
+Requests are processed and granted. In this step data-structures for
+3. are created and filled with data: PScore, PCol, PStaff
+
+=item 3. Calculation:
+
+This step uses structures which have names starting with 'P'.
+linebreaks and horizontal positions of PCols are determined. Line_of_*
+generated.
+
+=item 4. Postprocesing:
+
+Some items and all spanners need computation after the PCol positions
+are determined.
+
+=item 5. Output
+
+Very simple, just walk all Line_of_* and follow the links over there
+
+=back
+
+=head1 COMMANDS
+
+This table decribes the proper order for the different commands:
+
+
+=head2 interpret
+
+ which priority
+ ========================
+
+ key 200
+ clef 190
+ meter 180
+ bar 170
+
+=head2 typeset
+
+ which priority
+ ========================
+
+ bar 100
+ clef 90
+ currentclef 80
+ key 70
+ currentkey 60
+ meter 40
+
+
+
+=head1 BREAKING
+
+[Source files: command.hh, scommands.cc]
+
+BREAKING, PREBREAK POSTBREAK, etc.
+
+So what's the deal with PREBREAK and POSTBREAK and all this
+stuff?
+
+Let's take text as an example. In German some compound
+words change their spelling if they are broken: "backen" becomes
+"bak-ken". TeX has a mechanism to deal with this, you would define
+the spelling of "backen" in TeX in this way
+
+ \discretionary{bak-}{ken}{backen}
+
+These 3 arguments are called "prebreak", "postbreak" and "nobreak"
+text.
+
+The same problem exists when typesetting music. If a line of music is
+broken, the next line usually gets a clef. So in TeX terms, the clef
+is a postbreak. The same thing happens with meter signs: Normally the
+meter follows the bar. If a line is broken at that bar, the bar along
+with the meter stays on the "last" line, but the next line also gets a
+meter sign after the clef. Using the previous notation,
+
+ \discretionary{bar meter}{clef meter}{ bar meter }
+
+In Lilypond, we have the same concepts (and the same
+terminology). Each (nonrhythmic) symbol is typeset using a Command
+(code: TYPESET). At a breakpoint, TYPESET commands can be grouped
+using separators (in lower case):
+
+ BREAK_PRE, typeset(bar), typeset(meter),
+ BREAK_MID, typeset(bar), typeset(meter),
+ BREAK_POST, typeset(clef), typeset(meter), BREAK_END
+
+The BREAK command sequence is terminated with BREAK_END, so other
+commands (like INTERPRET) may follow this sequence.
+
+=head1 SPACING
+
+I think my way is the most elegant algorithm i've seen so far. Some
+terminology: I call a vertical group of symbols (notes) which start at
+the same time a "column". Each line of a score has notes in it,
+grouped in columns. The difference in starting time between those
+columns makes it possible to determine ideal distances between those
+columns.
+
+Example:
+
+ time ----->
+
+ col1 col2 col3 col4
+
+
+ voice1 1 1
+
+ voice2 2 2 2 2
+
+
+ (1 is a whole note, 2 a half note.)
+
+ time_difference (col1 , col2) = 0.5 wholes,
+ time_difference (col1 , col3) = 1 wholes,
+ time_difference (col2 , col3) = 0.5 wholes,
+ etc.
+
+these differences are translated into ideal distances (these translations
+have been the subject of discussion in this thread).
+
+ distance (col1,col2) = 10 pt
+ distance (col1,col3) = 14.1 pt
+ distance (col2,col3) = 10 pt
+ etc.
+
+as you can see, these distance are conflicting. So instead of
+satisfying all those ideals simultaneously, a compromise is sought.
+
+This is Columbus' egg: LilyPond attaches "springs" to each
+column-pair. each spring has an equilibrium-position which is equal to
+the above mentioned distance, so
+
+ spring (col1, col2) and spring(col2,col3) try to push column 1
+and 3 away (to a distance of 20pt) from each other, whereas the spring
+between col 1 and col 3 tries to pull those two together (to a
+distance of 14.1 pt). The net result of this pushing and pulling is an
+equilibrium situation (the pushing cancels the pulling), which can be
+calculated as the solution of Quadratic program: it is the solution
+with minimum potential energy, for you physicists out there.
+
+This algorithm for doing one line, gives a "badness" parameter for
+each line (the potential energy). Now one can use TeX's algorithm for
+making paragraphs (using this new version of "badness"): one should
+try to minimise the overall badness of a paragraph. LilyPond also uses the
+concept of pre- and post-breaks.
+
+(actually, it is a bit more complicated: each column also has a
+minimum distance to other columns, to prevent symbols from running
+into symbols of other columns.)
+
+=head1 POINTERS
+
+This describes the ownership of certain classes in LilyPond. +
+signifies a "list of". (This is not complete)
+
+ Score:
+ Paperdef
+ Staff+
+ Score_commands
+ Score_columns+
+ PScore
+
+ Staff:
+ Voice
+ Staff_column+
+ Command+
+
+
+ Voice:
+ Voice_element
+
+ Voice_element:
+ Request+
+
+
+ PScore:
+ PStaff+
+ PCol+
+ Idealspacing+
+ Item+
+ Spanner+
+ Spanner+ (broken)
+
+=head1 SEE ALSO
+
+=head2 References
+
+Herbert Chlapik,
+
+W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
+``Document Manipulation and Typography'', J.C. van Vliet (ed) 1988.
+
+Ross, Ted. ``Teach yourself the art of music engraving and processing''
+(3rd edition). 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]
+
+Read, Gardner. ``Modern Rhythmic Notation.'' Indiana University Press, 1978.
+
+Read, Gardner. ``Music Notation'' (2nd edition). Taplinger Publishing,
+New York.
+
+[This is as close to the ``standard'' reference work for music notation issues
+as one is likely to get.]
+
+
+=head2 Further reading
+
+(of varying usefulness):
+
+Donato, Anthony. Preparing Music Manuscript. Englewood Cliffs:
+Prentice-Hall, 1963.
+
+Donemus. "Uitgeven van muziek". Donemus Amsterdam, 1900
+
+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.
+
+Roelofs, Ren\'e. ``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.)
+
+C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks (CA), 1973.
+
+Rosecrans, Glen. Music Notation Primer. New York: Passantino, 1979.
+
+Stone, Kurt. Music Notation in the Twentieth Century. New York: Norton, 1980.
+
+
--- /dev/null
+=head1 NAME
+
+LilyInput - LilyPond input format
+
+=head1 DESCRIPTION
+
+This page documents the the LilyPond input format, mudela.
+
+=head2 Overview
+
+General format of a construct:
+
+ BLOCKNAME { <info to go with this block> }
+
+Some types allow declarations:
+
+ IDENTIFIER = BLOCKNAME {
+ <info to go with this block>
+ }
+
+ ..
+
+ BLOCKNAME {
+ IDENTIFIER
+ ...
+ }
+
+
+In musicmode, eg,
+
+ ''!c8.-"text"_v
+
+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.
+
+=item *
+musicmode: The brace still is used to group grammatical groups.
+
+=item *
+musicmode: "word" are preceded by a '\' (backslash)
+
+This means you can write some stuff in a zillion ways:
+
+=item 1.
+ $\var = \blockname { ... } $
+
+=item 2.
+ var = blockname { $ ... $ }
+
+=item 3.
+ var = $ $ $\blockname { ... $ }
+
+=head2 Comments
+
+Not really crystallized; you can use '#' or '%' as line comment
+
+=head2 other
+
+A correctly parsed .ly does not guarantuee output. A lot (most) of the
+checking is done B<after> parsing (some checks even are done after the
+break calc!); I'm sorry.
+
+The parser's job is to construct appropriate objects. It will *only*
+detect parse errors.
+
+LilyPond first reads 'symbol.ini', which contains declarations crucial
+to proper operation of LilyPond (symbol tables, note names).
+
+This language looks a lot like Rayce's which in turn owes a lot to the
+POVRay raytracer. Now, I know, musictypesetting and Raytracing do not
+necessarily require the same input format, but I was just to lazy to
+make up a new and/or better input format. Suggestions welcome.
+++ /dev/null
-\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}
-
+++ /dev/null
-This describes the ownership of certain classes in LilyPond. +
-signifies a "list of". (This is not complete)
-
-Score:
- Paperdef
- Staff+
- Score_commands
- Score_columns+
- PScore
-
-Staff:
- Voice
- Staff_column+
- Command+
-
-
-Voice:
- Voice_element
-
-Voice_element:
- Request+
-
-
-PScore:
- PStaff+
- PCol+
- Idealspacing+
- Item+
- Spanner+
- Spanner+ (broken)
-
+++ /dev/null
-How are slur fonts organised?
-
-xhslu20: see xslhu20
-
-xslhu20: half slurs, pointing up
- right
- width in steps of 12pt (12pt-96pt)
- height in 16 steps
- left
- idem
-
-xslhd20: half slurs, pointing down, idem
-
-xslu20: whole slurs, ascending
- pointing up
- height (dy) in 8 steps
- width in 16 steps of 4pt (8 pt - 64pt)
- pointing down
- height (dy) in 8 steps
- width in steps of 4pt (8 pt - 64pt)
-
-xsld20: whole slurs, descending
- pointing up
- height (dy) in 8 steps
- width in steps of 4pt (8 pt - 60pt)
- pointing down
- height (dy) in 8 steps
- width in steps of 4pt (8 pt - 60pt)
-
-
-xslhz: middlepieces for half-slurs
- pointing up
- width in 100 steps of 4 pt (4 pt to 400pt)
- pointing down
- idem
-
-xslz: horizontal slurs
- pointing up
- width in 54 steps of 4pt
- pointing down
- idem
-
-xtie: same as xslhz.
include Variables.make
.SUFFIXES:
-.SUFFIXES: .cc .o .hh .y .l
+.SUFFIXES: .cc .o .hh .y .l .pod .txt .1
$(exe): $(obs)
$(CXX) -o $@ $^ $(LOADLIBES)
all: kompijl doc
# doc++ documentation of classes
-doc: $(progdocs)
+doc:
+ $(MAKE) -C Documentation doc
+
+docpp: $(progdocs)
-mkdir $(DOCDIR)
doc++ -p -I -d $(DOCDIR) $^
+pl 20:
+ - Rational for time measurement
+ - updated doco to .pod
+ - directionalspanner/textspanner
+ - include files
+
pl 19:
- struct Moment
- grouping code: LilyPond can set advanced multibeams.
--*-text-*-
+Please refer to the directory Documentation/.
-last update: 96/17/12, 0.0.17
+To generate the pretty-printed docs, do a:
-LICENSE
+ make doc
-See file COPYING
-
-INTRODUCTION
-
-This is a beta version of LilyPond (a music typesetter). Please send
-your helpful comments and patches to me,
-
- hanwen@stack.nl
-
-LilyPond is updated very frequently, the latest version is always available at:
-
- ftp://pcnov095.win.tue.nl/pub/lilypond
-
-PREREQUISITES
-
-Compilation:
-
- - Unix (any decent Linux distribution is fine)
- - GNU C++ v2.7 or better
- - GNU make.
- - flex (2.5.1 or better)
- - bison/yacc
- - The "flower" library, which should be available from the
- same source you got this from.
- - perl
-
-Operation:
-
- - TeX
- - the MusixTeX fonts
-
-The Makefile uses perl for trivial operations, and you could tinker
-with it to use sed or awk.
-
-COMPILING
-
-Do:
-
- tar zxf flower-1.11.9.tar.gz
- mv flower-1.11.9 flower
- cd flower; make; cd ..
- tar zxf lilypond-1.2.13.tar.gz
- cd lilypond-1.2.13
- make
-
-why G++ >= 2.7? LilyPond & flower lib uses:
-
- builtin bool
- typeof
- operator <?, operator >?
- new for-scope
-
-USING
-
-At this time, LilyPond is only suited for Quick & Dirty jobs (the
-output quality still is too low). If you're not discouraged; this is
-what I type in my xterm:
-
- lilypond someinput.ly
- tex test
- xdvi test&
-
-This is what the output looks like over here:
-
- hw:~/musix/spacer$ lilypond maartje.ly
- LilyPond 0.0.17/FlowerLib 1.0.14. Compile: Dec 17 1996, 11:33:54 (g++ 2.7.2)
- Parsing ... [symbol.ini][maartje.ly]
- Processing ... Calculating ... Postprocessing ...
- output to lelie.uit...
-
- hw:~/musix/spacer$ tex test
- This is TeX, Version 3.14159 (C version 6.1)
- (test.tex
- Hyphenation patterns for english, dutch, loaded.
- (lilyponddefs.tex) (lelie.uit) [1] [2] )
- Output written on test.dvi (2 pages, 8072 bytes).
- Transcript written on test.log.
-
- hw:~/musix/spacer$ xdvi test&
- [1] 1468
-
-Check out kortjakje.ly, it has some comments
-
-
-PROBLEMS
-
-If LilyPond bombs out, then please recompile using -g, and send a gdb
-stacktrace of the crash. It also helps if you can print the values of the objects. So if you trace is
-
-(gdb) backtrace 12
-#0 Interval::operator+= (this=0x11fffec60, r=-1.7976931348623157e+308)
- at ../flower/interval.hh:50
-#1 0x12005195c in Item::width (this=0x14008a680) at src/item.cc:39
-#2 0x12008fdbc in itemlist_width (its=0x11fffed58) at src/simpleprint.cc:40
- :
- :
-
-Than it would help if you send a dump of the Interval and the Item (use: 'print *this' or use LilyPond print() methods)
-
-HOW DOES IT WORK
-
-* Use The Source, Luke. If you don't know C++, you can try editing
-.dstreamrc for copious debugging output. (use -d)
-
-* the subdir Documentation/ contains some more-in-depth matter on LilyPond
-
-* The source is commented in the DOC++ style.
-Check out doc++ at
-
- http://www.ZIB-Berlin.DE/VisPar/doc++/doc++.html
+in the top-level dir
\ No newline at end of file
parseconstruct.hh debug.hh globvars.hh keyword.hh\
misc.hh score.hh notename.hh lexer.hh symtable.hh\
symbol.hh main.hh dimen.hh paper.hh lookup.hh\
+ spanner.hh beam.hh directionalspanner.hh slur.hh textspanner.hh\
sccol.hh stcol.hh staffcommands.hh melodicstaff.hh\
- identifier.hh simplestaff.hh spanner.hh stem.hh\
- notehead.hh leastsquares.hh beam.hh rest.hh\
+ identifier.hh simplestaff.hh stem.hh\
+ notehead.hh leastsquares.hh rest.hh\
swalker.hh bar.hh meter.hh accidental.hh\
key.hh keyitem.hh localkeyitem.hh simplewalker.hh\
- clef.hh clefitem.hh slur.hh inputcommands.hh\
- getcommand.hh inputmusic.hh \
+ clef.hh clefitem.hh inputcommands.hh\
+ getcommand.hh inputmusic.hh timedescription.hh\
inputscore.hh inputstaff.hh identparent.hh\
- inputcommand.hh grouping.hh moment.hh
+ inputcommand.hh grouping.hh moment.hh offset.hh
+
mycc= qlp.cc qlpsolve.cc leastsquares.cc\
inputcommands.cc inputmusic.cc \
- inputscore.cc inputstaff.cc\
- moment.cc\
+ inputscore.cc inputstaff.cc inputcommand.cc\
+ timedescription.cc\
break.cc linespace.cc molecule.cc staffline.cc\
pscore.cc tex.cc item.cc pcol.cc staff.cc \
rhythmstaff.cc score.cc note.cc main.cc misc.cc\
dimen.cc paper.cc lookup.cc staffcommands.cc\
sccol.cc stcol.cc getcommands.cc simplestaff.cc\
melodicstaff.cc simpleprint.cc\
- spanner.cc \
+ spanner.cc textspanner.cc directionalspanner.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 identifier.cc\
+ idealspacing.cc grouping.cc identifier.cc\
lexerinit.cc mylexer.cc\
template1.cc template2.cc template3.cc template4.cc\
+ template5.cc\
version.cc
#PROFILEFLAG=-pg
OPTIFLAG=-DNDEBUG -DNPRINT -O2
DEBUGFLAG=-g
+
# turn off -pipe if linker doesn't support it
EXTRACXXFLAGS=-pipe -Wall -W -Wmissing-prototypes
-# -Woverloaded-virtual
#
# -lefence = ElectricFence.
#
-# ElectricFence is memory debugger which uses the
+# ElectricFence is a memory debugger which uses the
# VM hardware to trap malloc/free errors.
#
#EXTRALIB+=-lefence
# version info
MAJVER=0
MINVER=0
-PATCHLEVEL=19
+PATCHLEVEL=20
VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
CXXVER=`$(CXX) --version`
OBJECTDIR=objects
HEADERDIR=hdr
CCDIR=src
-
+INITDIR=init
vpath %.cc $(CCDIR)
vpath %.hh $(HEADERDIR)
vpath %.y $(CCDIR)
othersrc=lexer.l parser.y
SCRIPTS=make_version make_patch genheader
IFILES=dimen.tex symbol.ini kortjakje.ly pavane.ly maartje.ly\
- lilyponddefs.tex test.tex .dstreamrc
+ lilyponddefs.tex test.tex .dstreamrc cadenza.ly
OFILES=Makefile Variables.make Sources.make COPYING README NEWS
DFILES=$(OFILES) $(IFILES) $(SCRIPTS)
exe=$(PACKAGENAME)
OUTPUT_OPTION=$< -o $@
DDIR=$(TOPDIR)/$(DNAME)
-SUBDIRS=Documentation $(OBJECTDIR) $(CCDIR) $(HEADERDIR)
+SUBDIRS=Documentation $(OBJECTDIR) $(CCDIR) $(HEADERDIR) $(INITDIR)
--- /dev/null
+%
+% Cadenza to Mozart Horn/3
+%
+
+cad = music { $
+ \duration { 8}
+ 'c4. g8 ['e()'d 'c b]
+ [b()c] g c [c e g 'c]
+ \octave{'}
+ e4. e [g ()f e d]
+
+ \duration{16}
+ dis4()e4 r8 [c d] [e f g gis]
+ \duration{4}
+ a `f()`e g
+ f `d()`cis e
+ \duration{8}
+ d4 r8 `a [`b cis]
+ \duration{16}
+ [d cis d e]
+ f4()[f e d c] `b4
+ \octave{} ['c8 b8] % triplet!
+ g2 [g c e g] ['c e g 'c]\octave{'}
+ [e `g c e] g4 %()% BUG!
+ [g8.( e g8. )e]
+ a4. g8 [f8 e8 d8 c8]
+ `g2 d2
+ c4 $}
+
+score {
+ staff { melodic
+ music { cad }
+ }
+ commands { meter 4 4 skip 13:0 }
+}
\ No newline at end of file
cc=lgetopt.cc string.cc dataf.cc textdb.cc unionfind.cc \
smat.cc matrix.cc choleski.cc vector.cc dstream.cc\
- matdebug.cc scalar.cc
+ matdebug.cc scalar.cc path.cc
templatecc=cursor.tcc list.tcc tsmat.tcc plist.tcc interval.tcc\
pcursor.tcc
smat.hh vsmat.hh vector.hh real.hh choleski.hh\
tsmat.hh tvsmat.hh plist.hh associter.hh fproto.hh\
interval.hh scalar.hh sstack.hh rational.hh iterate.hh\
+ path.hh
MAJVER=1
MINVER=0
-PATCHLEVEL=19
+PATCHLEVEL=20
PACKAGENAME=flower
#PROFILEFLAG=-pg
r.message("not enough fields in Dstream init.");
continue;
}
- (*silent)[r[0]] = Scalar(r[1]).to_bool();
+ (*silent)[r[0]] = bool(Scalar(r[1]));
}
}
#include "string.hh"
-
template<class T>
int
-Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
+_Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
{
if (a.left == b.left && a.right == b.right)
return 0;
if (a.left >= b.left && a.right <= b.right)
return -1;
- assert(false); // not comparable
+ return -2;
+}
+
- return 0;
+template<class T>
+int
+Interval__compare(const Interval_t<T>&a,Interval_t<T> const&b)
+{
+ int i = _Interval__compare(a,b);
+ if (i < -1)
+ assert(false);
+ return i;
}
+#ifdef AIX
+const Real INFTY = 1e8; // ARGh. AIX sucks
+#else
const Real INFTY = HUGE;
+#endif
template<class T>
void
-Interval_t<T>::set_empty() {
+Interval_t<T>::set_empty()
+{
left = INFTY;
right = -INFTY;
}
--- /dev/null
+/*
+ path.cc - manipulation of paths and filenames.
+*/
+#include <stdio.h>
+#include "path.hh"
+
+#ifndef PATHSEP
+#define PATHSEP '/'
+#endif
+
+
+void
+split_path(String path,
+ String &drive, String &dirs, String &filebase, String &extension)
+{
+ // peel off components, one by one.
+ int di = path.pos(':');
+ if (di)
+ {
+ drive = path.left(di);
+ path = path.right(path.len() - di);
+ }
+ else
+ drive = "";
+
+ di = path.lastPos(PATHSEP);
+ if (di)
+ {
+ dirs = path.left(di);
+ path = path.right(path.len()-di);
+ }
+ else
+ dirs = "";
+
+ di = path.lastPos('.');
+ if (di)
+ {
+ di --; // don't forget '.'
+ filebase = path.left(di);
+ extension =path.right(path.len()-di);
+ }
+ else
+ {
+ extension = "";
+ filebase = path;
+ }
+}
+/**
+ INPUT: path the original full filename
+ OUTPUT: 4 components of the path. They can be empty
+*/
+
+
+File_path::File_path(String pref)
+{
+ add(".");
+ add(pref);
+}
+
+
+///
+String
+File_path::find(String nm)
+{
+ for (int i=0; i < size(); i++) {
+ String path = (*this)[i];
+ path+= "/"+nm;
+
+
+ FILE *f = fopen(path, "r"); // ugh!
+ if (f) {
+ fclose(f);
+ return path;
+ }
+ }
+ return "";
+}
+/**
+ It will search in the current dir, in the construction-arg, and
+ in any other added path, in this order.
+ */
--- /dev/null
+#ifndef PATH_HH
+#define PATH_HH
+#include "string.hh"
+#include "varray.hh"
+
+
+/// searching directory for file.
+class File_path : private Array<String>
+{
+public:
+ /// locate a file in the search path
+ String find(String nm);
+
+ /// construct using prefix. Normally argv[0].
+ File_path(String);
+
+ /// add to end of path.
+ Array<String>:: add;
+};
+/**
+
+ Abstraction of PATH variable. An interface for searching input files.
+ Search a number of dirs for a file.
+
+ Should use kpathsea?
+
+*/
+
+/// split path into its components
+void split_path(String path, String &drive, String &dirs, String &filebase, String &extension);
+
+#endif
void junk();
public:
Cursor<void*>::ok;
- void del() { junk(); Cursor<void*>::del(); }
- void backspace() { junk(); Cursor<void*>::backspace(); }
+ Cursor<void*>::del;
+ Cursor<void*>::backspace;
T get() {
T p = ptr();
Cursor<void*>::del();
void concatenate(PointerList<T> const &s) { List<void*>::concatenate(s); }
PointerList() {}
};
-/** This class does no deletion of the pointers, but it knows how to
+/**
+ This class does no deletion of the pointers, but it knows how to
copy itself (shallow copy). We could have derived it from List<T>,
but this design saves a lot of code dup; for all PointerLists in the
program only one parent List<void*> is instantiated. */
You have to copy this yourself, or use the macro PointerList__copy
*/
+
#define IPointerList__copy(T, to, from, op) \
for (PCursor<T> _pc_(from); _pc_.ok(); _pc_++)\
to.bottom().add(_pc_->op)\
void PL_copy(IPointerList<T*> &dst,IPointerList<T*> const&src);
-#define PL_instantiate(a) template class PointerList<a*>
-#define IPL_instantiate(a) PL_instantiate(a); template class IPointerList<a*>
+#define PL_instantiate(a) template class PointerList<a*>; \
+ template class PCursor<a*>;
+#define IPL_instantiate(a) PL_instantiate(a); \
+ template class IPointerList<a*>
#include "plist.inl"
{
PCursor<T> c( *this );
while (c.ok()) {
- c.del();
+ delete c.get();
}
}
return value();
}
-bool
-Scalar::to_bool() const
+
+Scalar::operator bool() const
{
if (!len())
return false;
operator Real();
operator int();
///
- bool to_bool() const;
+ operator bool() const;
/** perl -like string to bool conversion
*/
void
Full_storage::OK() const
{
- #ifndef NDEBUG
+#ifndef NDEBUG
// static Real dummy;
assert(maxh >= h && maxw >= w);
assert(h >= 0 && w >= 0);
}
#endif
}
- #endif
+#endif
}
void
Full_storage::resize_cols(int newh)
/// A simple stack based on Array.
template<class T>
struct sstack : Array<T> {
- T top() { return last(); }
+ T top()const { return last(); }
T pop() {
assert(!empty());
T l = last();
#ifndef BEAM_HH
#define BEAM_HH
#include "proto.hh"
-#include "spanner.hh"
+#include "directionalspanner.hh"
#include "plist.hh"
/// a beam connects multiple stems
-struct Beam: public Spanner {
+struct Beam: public Directional_spanner {
PointerList<Stem*> stems;
Real slope;
Real left_pos;
- /// -1 below heads, +1 above heads.
- int dir;
+ /// dir: -1 below heads, +1 above heads.
+
Rhythmic_grouping *group;
/****************/
virtual Interval width()const;
-
+ Offset center() const;
Spanner *broken_at(PCol *, PCol *) const;
Beam();
void add(Stem*);
#include "fproto.hh"
#include "real.hh"
#include "interval.hh"
-
-
-/// 2d vector
-struct Offset {
- Real x,y;
-
- Offset operator+(Offset o)const {
- Offset r(*this);
- r+=o;
- return r;
- }
-
- Offset operator+=(Offset o) {
- x+=o.x;
- y+=o.y;
- return *this;
- }
- Offset(Real ix , Real iy) {
- x=ix;
- y=iy;
- }
- Offset() {
- x=0.0;
- y=0.0;
- }
-};
-
-
-/// a 4-tuple of #Real#s
+#include "offset.hh"
+/// a square subset of Real^2
struct Box {
Interval x, y;
x.unite(b.x);
y.unite(b.y);
}
- Box(svec<Real> &);
Box();
Box(Interval ix, Interval iy);
};
struct Command {
Commandcode code;
-// Real when;
/// analogous to argv[]
svec<Scalar> args;
/****************/
Command();
-// Command(Real w);
+// Command(Moment w);
bool isbreak()const;
void print() const;
};
--- /dev/null
+/*
+ directionalspanner.hh -- part of LilyPond
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef DIRECTIONALSPANNER_HH
+#define DIRECTIONALSPANNER_HH
+
+#include "spanner.hh"
+
+struct Directional_spanner : Spanner{
+
+ /// -1 below heads, +1 above heads.
+ int dir;
+
+ /// offset of "center" relative to left-column/0-pos of staff
+ virtual Offset center() const=0;
+ virtual void set_default_dir()=0;
+ Directional_spanner();
+
+};
+
+#endif // DIRECTIONALSPANNER_HH
+
#ifndef GROUPING_HH
#define GROUPING_HH
+#include "moment.hh"
#include "interval.hh"
#include "vray.hh"
+typedef Interval_t<Moment> MInterval;
/// data structure which represents rhythmic units
struct Rhythmic_grouping {
svec<Rhythmic_grouping*> children;
- Interval *interval_;
+ MInterval *interval_;
/****************/
- svec<Interval> intervals();
- Interval interval()const;
- Real length() const;
- void intersect(Interval);
+ svec<MInterval> intervals();
+ MInterval interval()const;
+ Moment length() const;
+ void intersect(MInterval);
void operator=(Rhythmic_grouping const&);
Rhythmic_grouping(Rhythmic_grouping const&);
- Rhythmic_grouping(Interval, int n=1);
+ Rhythmic_grouping(MInterval, int n=1);
Rhythmic_grouping();
Rhythmic_grouping(svec<Rhythmic_grouping*>);
~Rhythmic_grouping();
- void add_child(Real start, Real len);
+ void add_child(Moment start, Moment len);
void split(Rhythmic_grouping r);
- void split(svec<Interval>);
+ void split(svec<MInterval>);
void split(int n);
void print() const;
#include "proto.hh"
#include "scalar.hh"
#include "vray.hh"
+#include "moment.hh"
struct Input_command {
/// analogous to argv[]
svec<Scalar> args;
void print()const;
Input_command();
- Input_command(Real);
+
operator Command();
};
Input_command* get_key_interpret_command(svec<int >);
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(Real,svec<int>);
+Input_command *get_partial_command(Moment u);
+Input_command *get_skip_command(int,Moment);
Input_command *get_grouping_command(svec<int>);
Input_command *get_bar_command( );
#include "proto.hh"
#include "plist.hh"
#include "real.hh"
-#include "moment.hh"
+#include "timedescription.hh"
struct Commands_at : public IPointerList<Input_command*> {
- Moment moment_;
+ Time_description tdescription_;
/****************/
- Real when();
+ Moment when();
void parse(Staff_commands_at*);
void print() const;
- Real barleft();
+ Moment barleft();
void add(Input_command*);
- void setpartial(Real);
+ void setpartial(Moment);
Commands_at(const Commands_at&);
- Commands_at(Real, Commands_at*prev);
+ Commands_at(Moment, Commands_at*prev);
};
struct Input_cursor : public PCursor<Commands_at*>
{
/****************/
Input_cursor(PCursor<Commands_at*>);
- Real when()const;
- void find_moment(Real w);
+ Moment when()const;
+ void find_moment(Moment w);
void prev() { operator --(0); }
void next() { operator ++(0); }
};
/****************/
- void find_moment(Real);
+ void find_moment(Moment);
void add(Input_command c);
- void do_skip(int bars, Real wholes);
+ void do_skip(int bars, Moment wholes);
Input_commands();
Input_commands(Input_commands const&);
Staff_commands *parse() const;
};
-
-
-void
-interpret_meter(Input_command *c, int &beats_per_meas, int& one_beat,
- Real& whole_per_measure);
#endif // INPUTCOMMANDS_HH
#include "plist.hh"
#include "proto.hh"
#include "voice.hh"
+#include "moment.hh"
struct Voice_list : public PointerList<Voice*> {
- void translate_time(Real dt);
+ void translate_time(Moment dt);
};
/// ABC for input structures
struct Input_music {
virtual Voice_list convert()=0;
- virtual Real length()=0;
- virtual void translate_time(Real dt)=0;
+ virtual Moment length()=0;
+ virtual void translate_time(Moment dt)=0;
virtual ~Input_music(){}
virtual void print() const =0;
// virtual void transpose(...) const =0;
/****/
virtual Simple_music*simple() { return this; }
void add(Voice_element*);
- virtual Real length();
+ virtual Moment length();
virtual Voice_list convert();
- virtual void translate_time(Real dt);
+ virtual void translate_time(Moment dt);
virtual void print() const;
virtual Input_music *clone() const {
return new Simple_music(*this);
/****************/
- Real length();
- virtual void translate_time(Real dt);
+ Moment length();
+ virtual void translate_time(Moment dt);
virtual Voice_list convert();
void add_elt(Voice_element*);
virtual Input_music *clone() const {
/****************/
- virtual Real length();
+ virtual Moment length();
virtual Voice_list convert();
- virtual void translate_time(Real dt);
+ virtual void translate_time(Moment dt);
void add_elt(Voice_element*);
virtual Input_music *clone() const {
return new Music_general_chord(*this);
#ifndef LEASTSQUARE_HH
#define LEASTSQUARE_HH
#include "vray.hh"
-#include "boxes.hh"
+#include "offset.hh"
struct Least_squares {
svec<Offset> input;
Real fixpos;
Colinfo();
void print() const;
- Real minright() const { return pcol_->width().max; }
- Real minleft() const { return -pcol_->width().min; }
+ Real minright() const { return pcol_->width().right; }
+ Real minleft() const { return -pcol_->width().left; }
};
Symbol half_slur(int dy, Real &dx, int dir, int xpart);
Symbol half_slur_middlepart(Real &dx, int dir);
Symbol big_slur(int dy, Real &dx, int dir);
-
+ Symbol text(String style, String text, int align = 1);
+
Lookup();
virtual void set_output(PScore *);
virtual Item* get_TYPESET_item(Command*);
- virtual Stem * get_stem(Stem_req *rq,Real);
+ virtual Stem * get_stem(Stem_req *rq,Moment);
virtual Notehead * get_notehead(Note_req *rq, int bot);
virtual Local_key_item* get_local_key_item();
};
#define MISC_HH
#include "real.hh"
+#include "moment.hh"
-Real wholes(int dur, int dots);
+Moment wholes(int dur, int dots);
double log_2(double x) ;
int intlog2(int d);
inline int
-ABS(int i)
-{
+abs(int i){
return (i < 0)?-i:i;
}
+inline int
+sign(int i) {
+ if (i<0) return -1;
+ else if (i) return 1;
+ else return 0;
+}
#endif
/*
- moment.hh -- part of LilyPond
-
(c) 1996 Han-Wen Nienhuys
*/
#ifndef MOMENT_HH
#define MOMENT_HH
-#include "real.hh"
-
-
-struct Moment {
- Real when;
- /// current measure info
- Real whole_per_measure;
-
- /// where am i
- Real whole_in_measure;
-
- /// how long is one beat?
- Real one_beat;
+#include "rational.hh"
- /// idem
- int bars;
- /****************/
- void OK() const;
- Moment(Real, const Moment*);
- void print() const;
- void setpartial(Real p);
- Real barleft();
- void set_meter(int,int);
-};
+typedef Rational Moment;
-#endif // MOMENT_HH
+#endif //
--- /dev/null
+/*
+ offset.hh -- part of LilyPond
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef OFFSET_HH
+#define OFFSET_HH
+#include "real.hh"
+
+/// 2d vector
+struct Offset {
+ Real x,y;
+
+ Offset operator+(Offset o)const {
+ Offset r(*this);
+ r+=o;
+ return r;
+ }
+
+ Offset operator+=(Offset o) {
+ x+=o.x;
+ y+=o.y;
+ return *this;
+ }
+ Offset(Real ix , Real iy) {
+ x=ix;
+ y=iy;
+ }
+ Offset() {
+ x=0.0;
+ y=0.0;
+ }
+};
+
+#endif // OFFSET_HH
+
+
#include "proto.hh"
#include "real.hh"
#include "string.hh"
+#include "moment.hh"
/// symbols, dimensions and constants
struct Paperdef {
Real standard_height()const;
Real note_width() const;
void print() const;
- Real duration_to_dist(Real);
+ Real duration_to_dist(Moment);
};
/** This struct takes care of all kinds of symbols, dimensions and
constants. Most of them are related to the point-size of the fonts,
struct Idealspacing;
struct Identifier;
struct Input_commands;
-struct Interval;
struct Item;
struct Key;
struct Keyitem;
struct Rhythmic_grouping;
struct Staff_commands_at ;
struct Commands_at ;
-struct Moment;
+struct Time_description;
+
#endif // PROTO_HH
#include "glob.hh"
#include "string.hh"
+#include "moment.hh"
/// a voice element wants something printed
struct Request {
virtual Beam_req *beam() { return 0 ; }
virtual Slur_req *slur() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0;}
- virtual Real duration() const { return 0.0; }
+ virtual Moment duration() const { return 0.0; }
virtual Request* clone() const =0;
};
/****************/
- Real duration() const;
+ Moment duration() const;
Rhythmic_req();
Rhythmic_req*rhythmic() { return this;}
void print ()const;
/// helper in the hierarchy
struct Dynamic {
- Real subtime;
+ Moment subtime;
};
/** Each dynamic is bound to one note ( a crescendo spanning multiple
notes is thought to be made of two "dynamics": a start and a stop).
/****************/
virtual Item *get_TYPESET_item(Command*);
- virtual Stem *get_stem(Stem_req *rq,Real);
+ virtual Stem *get_stem(Stem_req *rq,Moment);
virtual Notehead * get_notehead(Note_req *rq, int b);
virtual void set_output(PScore *);
};
#ifndef SCCOL_HH
#define SCCOL_HH
-#include "pcol.hh"
+#include "proto.hh"
#include "vray.hh"
+#include "moment.hh"
struct Score_column {
PCol * pcol_;
/// length of notes/rests in this column
- svec<Real> durations;
+ svec<Moment> durations;
- Real when;
+ Moment when;
///
bool musical;
/****************/
- Score_column(Real when);
- static int compare(Score_column & c1, Score_column &c2) {
- return sgn(c1.when - c2.when);
- }
- void add_duration(Real );
+ Score_column(Moment when);
+ static int compare(Score_column & c1, Score_column &c2);
+ void add_duration(Moment );
void preprocess();
- void set_breakable() {
- pcol_->set_breakable();
- }
+ void set_breakable();
bool used();
void print() const;
};
#include "vray.hh"
#include "proto.hh"
#include "plist.hh"
-
+#include "moment.hh"
/// the total music def of one movement
struct Score {
void OK() const;
- PCursor<Score_column *> find_col(Real,bool);
+ PCursor<Score_column *> find_col(Moment,bool);
void process();
void output(String fn);
- PCursor<Score_column*> create_cols(Real);
+ PCursor<Score_column*> create_cols(Moment);
void print() const;
- Real last() const;
+ Moment last() const;
private:
void do_pcols();
svec<Rhythmic_req *> notes;
svec<Slur_req *> slurs;
Stem_req *stem_;
- Real stem_requester_len;
+ Moment stem_requester_len;
Beam_req *beam_;
Simple_staff* staff_;
Staff_column*create_col(Score_column*);
virtual Item *get_TYPESET_item(Command*);
- virtual Stem *get_stem(Stem_req *rq, Real)=0;
+ virtual Stem *get_stem(Stem_req *rq, Moment)=0;
virtual Notehead *get_notehead(Note_req *rq, int b)=0;
virtual Rest *get_rest(Rest_req *rq);
virtual void set_output(PScore *);
Clef clef_;
Rhythmic_grouping default_grouping;
Rhythmic_grouping *current_grouping;
- Real inbar;
+// Real inbar; // whuh?
svec<Slur_req*> pending_slur_reqs;
svec<Slur*> pending_slurs;
#ifndef SLUR_HH
#define SLUR_HH
-#include "spanner.hh"
+#include "directionalspanner.hh"
#include "fproto.hh"
#include "vray.hh"
-struct Slur : Spanner {
+struct Slur : Directional_spanner {
svec<Notehead*> encompass;
- int dir;
+ //int dir;
bool open_left,open_right;
/****************/
-
+ Offset center() const;
+ void calculate();
void print()const;
void preprocess();
void add(Notehead*);
#ifndef SPANNER_HH
#define SPANNER_HH
+
#include "proto.hh"
+#include "interval.hh"
/// a symbol which is attached between two columns.
struct Spanner {
String TeXstring () const ;
Spanner();
- Paperdef*paper() const;
+ Paperdef *paper() const;
virtual ~Spanner();
virtual Interval height()const=0;
/**
PRE:
processed
*/
- virtual Interval width()const;
+ /// do calcs
+ virtual void calculate();
+ /**
+ It is safe to call calculate multiple times on one object
+ */
+ virtual Interval width()const;
virtual void process();
virtual void preprocess();
/****************************************************************/
void add(PointerList<Voice*> &s);
- void process_commands(Real l);
+ void process_commands(Moment l);
Staff(const Staff&src);
void add_voice(Voice *v);
void OK() const;
void print() const;
- Real last() const;
+ Moment last() const;
void clean_cols() ;
- Staff_column * get_col(Real,bool);
+ Staff_column * get_col(Moment,bool);
Staff();
#include "command.hh"
#include "vray.hh"
#include "plist.hh"
-#include "moment.hh"
+#include "timedescription.hh"
struct Staff_commands_at : public IPointerList<Command*> {
- Moment moment_;
+ Time_description tdescription_;
/****************/
bool is_breakable();
- Real when();
- Staff_commands_at(Moment);
+ Moment when();
+ Staff_commands_at(Time_description);
void set_breakable();
void add_command_to_break(Command pre, Command mid,Command post);
void print() const;
/// the list of commands in Score
struct Staff_commands : public IPointerList<Staff_commands_at*>
{
- Staff_commands_at*find(Real);
+ Staff_commands_at*find(Moment);
void add(Staff_commands_at*);
- void clean(Real last);
+ void clean(Moment last);
void OK() const;
void print() const;
- Real last() const;
+ Moment last() const;
};
/** the list of commands in Score. Put in a separate class, since it
otherwise clutters the methods of Score.
#define STCOL_HH
#include "proto.hh"
#include "vray.hh"
+#include "moment.hh"
/// store simultaneous requests
struct Staff_column {
/// idem
Staff_commands_at *s_commands;
- Moment *moment_;
+ Time_description *tdescription_;
/****************/
Staff_column(Score_column*s);
bool mus() const;
- Real when() const;
+ Moment when() const;
void add(Voice_element*ve);
/****************************************************************
#define STEM_HH
#include "item.hh"
#include "vray.hh"
+#include "moment.hh"
/// the rule attached to the ball
struct Stem : public Item {
/// rhythmical length
- Real note_length;
+ Moment note_length;
// heads the stem encompasses (positions)
int minnote, maxnote;
void set_noteheads();
void postprocess();
void preprocess();
- Stem(int center, Real duration);
+ Stem(int center, Moment duration);
Interval width() const;
private:
/****************/
int priority() const; // Command
- Real when() const;
+ Moment when() const;
virtual ~Staff_walker();
Staff_walker(Staff*, PScore*);
void process() ;
--- /dev/null
+/*
+ textspanner.hh -- part of LilyPond
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef TEXTSPANNER_HH
+#define TEXTSPANNER_HH
+
+#include "string.hh"
+#include "directionalspanner.hh"
+
+/// a spanner which puts texts on top of other spanners.
+struct Text_spanner : Spanner {
+ int align;
+ String text;
+ String style;
+ Directional_spanner*support;
+ /****************/
+ virtual void process();
+ virtual void preprocess();
+ virtual Interval height() const;
+ virtual Spanner* broken_at(PCol*,PCol*)const;
+ Text_spanner(Directional_spanner*);
+};
+/**
+ Use for triplets, eentweetjes, ottava, etc.
+ */
+
+#endif // TEXTSPANNER_HH
+
--- /dev/null
+/*
+ moment.hh -- part of LilyPond
+
+ (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef tdes_HH
+#define tdes_HH
+
+#include "real.hh"
+#include "moment.hh"
+
+struct Time_description {
+ Rational when;
+ /// current measure info
+ Rational whole_per_measure;
+
+ /// where am i
+ Rational whole_in_measure;
+
+ /// how long is one beat?
+ Rational one_beat;
+
+ /// idem
+ int bars;
+ /****************/
+ void OK() const;
+ Time_description(Rational, const Time_description*);
+ void print() const;
+ void setpartial(Rational p);
+ Rational barleft();
+ void set_meter(int,int);
+};
+
+#endif // Time_description_HH
+
#include "proto.hh"
#include "plist.hh"
+#include "moment.hh"
/// class for horizontal stuff.
struct Voice {
IPointerList<Voice_element *> elts;
- Real start;
+ Moment start;
/****************/
- Real when(const Voice_element*)const;
- Real last() const;
+ Moment when(const Voice_element*)const;
+ Moment last() const;
Voice();
Voice(Voice const&);
void add(Voice_element*);
/// one horizontal bit.
struct Voice_element {
- Real duration;
+ Moment duration;
const Voicegroup *group;
const Voice *voice_;
IPointerList<Request*> reqs;
--- /dev/null
+DFILES=dutch.ini table_sixteen.ini table_twenty.ini\
+ english.ini
+
+dist:
+ ln Makefile $(DFILES) $(DDIR)/$(INITDIR)
--- /dev/null
+dutch_names =
+notenames {
+ "ceses" 0 -2 "ces" 0 -1 "c" 0 0 "cis" 0 1 "cisis" 0 2
+ "deses" 1 -2 "des" 1 -1 "d" 1 0 "dis" 1 1 "disis" 1 2
+ "eses" 2 -2 "es" 2 -1 "e" 2 0 "eis" 2 1 "eisis" 2 2
+ "feses" 3 -2 "fes" 3 -1 "f" 3 0 "fis" 3 1 "fisis" 3 2
+ "geses" 4 -2 "ges" 4 -1 "g" 4 0 "gis" 4 1 "gisis" 4 2
+ "ases" 5 -2 "as" 5 -1 "a" 5 0 "ais" 5 1 "aisis" 5 2
+ "beses" 6 -2 "bes" 6 -1 "b" 6 0 "bis" 6 1 "bisis" 6 2
+}
+
--- /dev/null
+
+%
+% f = flat, s = sharp.
+%
+english_names = notenames {
+ "cff" 0 -2 "cf" 0 -1 "c" 0 0 "cs" 0 1 "css" 0 2
+ "dff" 1 -2 "df" 1 -1 "d" 1 0 "ds" 1 1 "dss" 1 2
+ "eff" 2 -2 "ef" 2 -1 "e" 2 0 "es" 2 1 "ess" 2 2
+ "fff" 3 -2 "ff" 3 -1 "f" 3 0 "fs" 3 1 "fss" 3 2
+ "gff" 4 -2 "gf" 4 -1 "g" 4 0 "gs" 4 1 "gss" 4 2
+ "aff" 5 -2 "af" 5 -1 "a" 5 0 "as" 5 1 "ass" 5 2
+ "bff" 6 -2 "bf" 6 -1 "b" 6 0 "bs" 6 1 "bss" 6 2
+}
--- /dev/null
+table_sixteen=
+symboltables {
+
+ texid "\musixsixteendefs"
+
+ % index TeXstring, xmin xmax ymin ymax
+
+
+ "style" = table {
+ "roman" "\settext{%}" 0pt 0pt 0pt 0pt
+ "italic" "\setitalic{%}" 0pt 0pt 0pt 0pt
+ }
+ "align" = table {
+ "-1" "\leftalign{%}" 0pt 0pt 0pt 0pt
+ "0" "\centeralign{%}" 0pt 0pt 0pt 0pt
+ "1" "\rightalign{%}" 0pt 0pt 0pt 0pt
+ }
+
+ "clefs" = table {
+ "violin" "\violinclef" 0pt 12.8pt -10pt 18pt
+ "bass" "\bassclef" 0pt 11.2pt 0pt 16pt
+ "viola" "\violaclef" 0pt 12.8pt 0pt 16pt
+ "violin_change" "\cviolinclef" 0pt 11.2pt -12pt 12pt
+ "bass_change" "\cbassclef" 0pt 12.8pt 0pt 16pt
+ "viola_change" "\cviolaclef" 0pt 11.2pt 0pt 16pt
+ }
+
+ "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{%}{%}"
+ "stem" "\stem{%}{%}"
+ "fill" "\hbox{}"
+ }
+
+ "dots" = table {
+ "1" "\lsingledot" 0pt 2pt -1pt 1pt
+ "2" "\ldoubledot" 0pt 5pt -1pt 1pt
+ "3" "\ltripledot" 0pt 8pt -1pt 1pt
+ }
+
+ "flags" = table {
+ "8" "\eigthflag" 0pt 4pt 0pt 0pt
+ "16" "\sixteenthflag" 0pt 4pt 0pt 0pt
+ "32" "\thirtysecondflag" 0pt 4pt 0pt 0pt
+ "-8" "\deigthflag" 0pt 4pt 0pt 0pt
+ "-16" "\dsixteenthflag" 0pt 4pt 0pt 0pt
+ "-32" "\dthirtysecondflag" 0pt 4pt 0pt 0pt
+ }
+
+ "beamslopes" = table {
+ "slope" "\beamslope{%}{%}"
+ "horizontal" "\rulesym{%}{%}"
+ }
+
+}
--- /dev/null
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+table_twenty = symboltables {
+
+ texid "\musixtwentydefs"
+
+ "style" = table {
+ "roman" "\settext{%}" 0pt 0pt 0pt 0pt
+ "italic" "\setitalic{%}" 0pt 0pt 0pt 0pt
+ }
+ "align" = table {
+ "-1" "\leftalign{%}" 0pt 0pt 0pt 0pt
+ "0" "\centeralign{%}" 0pt 0pt 0pt 0pt
+ "1" "\rightalign{%}" 0pt 0pt 0pt 0pt
+ }
+
+
+ % 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{%}{%}"
+ "stem" "\stem{%}{%}"
+ "fill" "\hbox{}"
+ }
+
+ "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{%}{%}"
+ "horizontal" "\rulesym{%}{%}"
+ }
+
+}
\font\hslurdfont=xslhd20
\font\hslurhfont=xslhz20
\font\musicfnt=musix20
+ \font\italicfont=cmti10
\balkhoog=20pt
\notewidth=6pt
\staffrulethickness=0.4pt
}
\def\musixsixteendefs{
\font\textfont=cmr8
+ \font\italicfont=cmti8
\font\slurufont=xslu16
\font\slurdfont=xsld16
\font\slurhfont=xslz20 % sigh
\vskip 10pt
}
\def\ugly{\nointerlineskip\par
-\vskip 40pt\par\vbox{\hbox to 0pt{\vrule width30pt height1pt\hss}}\par\vskip 40pt
+\vskip 40pt\par\vbox{\leftalign{\vrule width30pt height1pt}}\par\vskip 40pt
}
\def\interscoreline{\beauty}
%
% a staffsymbol with #1 lines, width #2
% bottom at baseline
-\def\linestafsym#1#2{\hbox to 0pt{\vbox to 0pt{\vss\lines{#1}{#2}}\hss}}
+\def\linestafsym#1#2{\leftalign{\vbox to 0pt{\vss\lines{#1}{#2}}}}
\def\vcenter#1{\vbox to 0pt{\vss #1\vss}}
\def\topalign#1{\vbox to 0pt{#1\vss}}
\def\stem#1#2{\vrule height#2 depth-#1}
\def\placebox#1#2#3{%
- \vbox to 0pt{\vss\hbox{\raise #1\hbox to 0pt{\kern #2{}#3\hss}}}%
+ \vbox to 0pt{\vss\hbox{\raise #1\leftalign{\kern #2{}#3}}}%
}
\def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}}
-\def\rulesym#1#2{\vrule height #1 width #2}
\ No newline at end of file
+\def\rulesym#1#2{\vrule height #1 width #2}
+
+\def\settext#1{\textfont #1}
+\def\setitalic#1{\italicfont #1}
+
+\def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
+\def\leftalign#1{\hbox to 0pt{#1\hss}}
ritme = staff {rhythmic
music {$
c8
- [a8 a8. a8 a16 a16 a16] c4.
+ [a8() a8. a8 a16 a16 a16] c4.
- %[c8( )'a8 c8 c8]
+ %[c8( )'a8() c8 c8]% BUG!
c2 c2
[fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16]
paper {
geometric 1.4
unitspace 3.0 cm
-% symboltables { table_sixteen}
}
staff { ritme }
staff { melody }
-% staff { melody }
commands {
meter 4 4
partial 8
{
x = s->hpos();
int dir = s->dir;
- idealy = MAX(dir*s->top, dir*s->bot);
- miny = MAX(dir*s->minnote, dir*s-> maxnote);
+ idealy = max(dir*s->top, dir*s->bot);
+ miny = max(dir*s->minnote, dir*s-> maxnote);
assert(miny <= idealy);
no_beams = s->flag;
}
/****************/
+Offset
+Beam::center()const
+{
+ if(!dir)
+ ((Beam*)this)->calculate();
+ Real w=width().length()/2;
+ return Offset(w,
+ (left_pos + w* slope)*paper()->interline());
+}
+
Beam::Beam()
{
PCursor<Stem*> s(stems);
svec<int> flags;
for (; s.ok(); s++) {
- int f = intlog2(ABS(s->flag))-2;
+ int f = intlog2(abs(s->flag))-2;
assert(f>0);
flags.add(f);
}
#include "const.hh"
#include "vray.hh"
-Box::Box(svec<Real> &s)
-{
- assert(s.sz() == 4);
- x.min = s[0];
- x.max = s[1];
- y.min = s[2];
- y.max = s[3];
-}
Box::Box()
{
if (i->musical) {
assert(j.ok());
for (int n=0; n < i->durations.sz(); n++) {
- Real d = i->durations[n];
+ Moment d = i->durations[n];
Real dist = paper_->duration_to_dist(d);
while (j->when < d + i->when)
j++;
- assert( distance(j->when, d+i->when) < 1e-8);
+ assert( j->when== d+i->when);
connect(i->pcol_, j->pcol_, dist);
if (!j->musical && (j+1).ok()
the last col is breakable, and therefore in use
*/
- Real d = j->when - i->when;
+ Moment d = j->when - i->when;
Real dist = (d) ? paper_->duration_to_dist(d) :
convert_dimen(2,"pt"); // todo
--- /dev/null
+#include "directionalspanner.hh"
+
+Directional_spanner::Directional_spanner()
+{
+ dir = 0;
+}
for (int i= 0; i < children.sz(); i++) {
children[i]->OK();
if (i>0)
- assert(children[i-1]->interval().max ==
- children[i]->interval().min);
+ assert(children[i-1]->interval().right ==
+ children[i]->interval().left);
}
}
-Real
+Moment
Rhythmic_grouping::length() const
{
return interval().length();
}
-Interval
+MInterval
Rhythmic_grouping::interval()const
{
if (interval_)
return *interval_;
else
return
- Interval(children[0]->interval().min,
- children.last()->interval().max);
+ MInterval(children[0]->interval().left,
+ children.last()->interval().right);
}
void
}
-svec<Interval>
+svec<MInterval>
Rhythmic_grouping::intervals()
{
- svec<Interval> r;
+ svec<MInterval> r;
if (interval_ || children.sz() == 1) {
- Interval i(interval());
- Interval r1(i), r2(i);
- r1.max = r2.min = i.center();
+ MInterval i(interval());
+ MInterval r1(i), r2(i);
+ r1.right = r2.left = i.center();
r.add(r1); r.add(r2);
} else {
for (int i=0; i < children.sz(); i++)
return r;
}
-Rhythmic_grouping::Rhythmic_grouping(Interval t, int n)
+Rhythmic_grouping::Rhythmic_grouping(MInterval t, int n)
{
if (n == 1 || !n) {
- interval_ = new Interval(t);
+ interval_ = new MInterval(t);
return;
}
- Real dt = t.length()/n;
- Interval basic = Interval(t.min, t.min+dt);
+ Moment dt = t.length()/n;
+ MInterval basic = MInterval(t.left, t.left+dt);
for (int i= 0; i < n; i++)
children.add(new Rhythmic_grouping( dt*i + basic ));
}
void
-Rhythmic_grouping::intersect(Interval t)
+Rhythmic_grouping::intersect(MInterval t)
{
if (interval_) {
interval_->intersect(t);
}
for (int i=0; i < children.sz(); i++) {
- Interval inter = intersection(t, children[i]->interval());
- if (inter.empty() || inter.length() < 1e-8) {
+ MInterval inter = intersection(t, children[i]->interval());
+ if (inter.empty() || inter.length() <= 0) {
delete children[i];
children[i] =0;
} else {
}
void
-Rhythmic_grouping::split(svec<Interval> splitpoints)
+Rhythmic_grouping::split(svec<MInterval> splitpoints)
{
//check on splitpoints..
int j = 0, i=0, starti = 0, startj = 0;
if ( i >= children.sz() || j >= splitpoints.sz())
break;
- assert( distance(
- children[starti]->interval().min, splitpoints[startj].min)<1e-8);
- if (children[i]->interval().max < splitpoints[j].max - 1e-8) {
+ assert(
+ children[starti]->interval().left== splitpoints[startj].left);
+ if (children[i]->interval().right < splitpoints[j].right) {
i ++;
- } else if (children[i]->interval().max > splitpoints[j].max + 1e-8) {
+ } else if (children[i]->interval().right > splitpoints[j].right ) {
j ++;
} else {
void
Rhythmic_grouping::copy(Rhythmic_grouping const&s)
{
- interval_ = (s.interval_)? new Interval(*s.interval_) : 0;
+ interval_ = (s.interval_)? new MInterval(*s.interval_) : 0;
for (int i=0; i < s.children.sz(); i++)
children.add(new Rhythmic_grouping(*s.children[i]));
}
}
void
-Rhythmic_grouping::add_child(Real start, Real len)
+Rhythmic_grouping::add_child(Moment start, Moment len)
{
- Real stop = start+len;
+ Moment stop = start+len;
for (int i=0; i < children.sz(); i ++) {
- Interval j=children[i]->interval();
- if (distance (j.min, start)<1e-8 && distance (j.max, stop)<1e-8) {
+ MInterval j=children[i]->interval();
+ if (j.left == start && j.right==stop) {
return;
}
}
if (children.sz())
- assert ( distance(children.last()->interval().max , start) < 1e-8);
+ assert ( children.last()->interval().right== start);
- children.add(new Rhythmic_grouping(Interval(start, stop)));
+ children.add(new Rhythmic_grouping(MInterval(start, stop)));
}
Rhythmic_grouping::Rhythmic_grouping()
{
}
-Input_command::Input_command(Real )
-{
-}
Input_command::operator Command()
{
Input_command*
-get_partial_command(Real u)
+get_partial_command(Moment u)
{
Input_command*c = new Input_command;
c->args.add("PARTIAL");
return c;
}
-Input_command*
-get_grouping_command(Real r,svec<int>a )
-{
- Input_command*c = get_grouping_command(a);
- c->args.insert(r,1);
- return c;
-}
-
Input_command*
get_grouping_command(svec<int>a )
{
}
Input_command *
-get_skip_command(int n, Real m)
+get_skip_command(int n, Moment m)
{
Input_command*c = new Input_command;
{
#ifndef NPRINT
mtor << "Commands_at {";
- moment_.print();
+ tdescription_.print();
for (PCursor<Input_command *> cc(*this); cc.ok(); cc++)
cc->print();
mtor << "}\n";
#endif
}
-Real
+Moment
Commands_at::when()
{
- return moment_.when;
+ return tdescription_.when;
}
-Commands_at::Commands_at(Real dt, Commands_at* prev)
- : moment_(dt, (prev)? &prev->moment_ : 0)
+Commands_at::Commands_at(Moment dt, Commands_at* prev)
+ : tdescription_(dt, (prev)? &prev->tdescription_ : 0)
{
- if (prev&& !moment_.whole_in_measure) {
+ if (prev&& !tdescription_.whole_in_measure) {
bottom().add(get_bar_command());
}
}
if (i->args[0] == "METER") {
int l = i->args[1];
int o = i->args[2];
- moment_.set_meter(l,o);
- bottom().add(get_grouping_command( moment_.one_beat,
- get_default_grouping(l)));
+ tdescription_.set_meter(l,o);
+ bottom().add(get_grouping_command( get_default_grouping(l)));
}
}
Commands_at::Commands_at(Commands_at const&src) :
- moment_(src.moment_)
+ tdescription_(src.tdescription_)
{
IPointerList<Input_command*> &me(*this);
const IPointerList<Input_command*> &that(src);
}
void
-Commands_at::setpartial(Real p)
+Commands_at::setpartial(Moment p)
{
- moment_.setpartial(p);
+ tdescription_.setpartial(p);
}
-Real
+Moment
Commands_at::barleft()
{
- return moment_.barleft();
+ return tdescription_.barleft();
}
void
Commands_at::parse(Staff_commands_at*s)
{
- s->moment_ = moment_;
+ s->tdescription_ = tdescription_;
for (PCursor<Input_command *> cc(*this); cc.ok(); cc++) {
if (cc->args.sz() && cc->args[0] !="") {
Command c = **cc;
/****************/
void
-Input_cursor::find_moment(Real w)
+Input_cursor::find_moment(Moment w)
{
- Real last = when();
+ Moment last = when();
while (1) {
if (! ok() ) {
*this = list().bottom();
- Real dt = (w - when()) <? ptr()->barleft();
+ Moment dt = (w - when()) <? ptr()->barleft();
Commands_at * c = new Commands_at(dt, *this);
assert(c->when() <= w);
}
prev();
- Real dt = (w - when());
+ Moment dt = (w - when());
Commands_at * c = new Commands_at(dt, *this);
add(c);
next();
}
void
-Input_commands::do_skip(int bars, Real wholes)
+Input_commands::do_skip(int bars, Moment wholes)
{
while (bars > 0) {
- Real b = ptr->barleft();
+ Moment b = ptr->barleft();
ptr.find_moment(ptr->when() + b);
bars --;
}
ptr->setpartial(c.args[1]);
} else if (c.args[0] == "GROUPING") {
Input_command *ic = new Input_command(c);
- ic->args.insert(ptr->moment_.one_beat, 1);
+ ic->args.insert(ptr->tdescription_.one_beat, 1);
ptr->add(ic);
} else if (c.args[0] == "METER") {
int beats_per_meas = c.args[1];
ptr->add(ch);
} else if (c.args[0] == "SKIP") {
int bars = c.args[1] ;
- Real wholes= c.args[2];
+ Moment wholes= c.args[2];
do_skip(bars, wholes);
} else if (c.args[0] == "RESET") {
ptr= top();
Staff_commands_at* s= nc->find(i->when());
if (!s){
- s = new Staff_commands_at(i->moment_);
+ s = new Staff_commands_at(i->tdescription_);
nc->add(s);
}
if (!i->when()) { /* all pieces should start with a breakable. */
}
/****************/
-Real
+Moment
Input_cursor::when()const
{
return (*this)->when();
voice_.add(v);
}
-Real
+Moment
Simple_music::length()
{
return voice_.last();
}
void
-Simple_music::translate_time(Real t)
+Simple_music::translate_time(Moment t)
{
voice_.start += t;
}
s->add(v);
}
-Real
+Moment
Music_voice::length()
{
- Real l = 0.0;
+ Moment l = 0.0;
for (PCursor<Input_music*> i(elts); i.ok(); i++)
l += i->length();
Music_voice::convert()
{
Voice_list l;
- Real here = 0.0;
+ Moment here = 0.0;
for (PCursor<Input_music*> i(elts); i.ok(); i++) {
- Real len = i->length();
+ Moment len = i->length();
Voice_list k(i->convert());
k.translate_time(here);
l.concatenate(k);
}
void
-Music_voice::translate_time(Real t)
+Music_voice::translate_time(Moment t)
{
elts.bottom()->translate_time(t);
}
}
void
-Music_general_chord::translate_time(Real t)
+Music_general_chord::translate_time(Moment t)
{
for (PCursor<Input_music*> i(elts); i.ok(); i++)
i->translate_time(t);
}
-Real
+Moment
Music_general_chord::length()
{
- Real l =0.0;
+ Moment l =0.0;
for (PCursor<Input_music*> i(elts); i.ok(); i++)
l = l >? i->length();
/****************/
void
-Voice_list::translate_time(Real x)
+Voice_list::translate_time(Moment x)
{
for (PCursor<Voice*> i(*this); i.ok(); i++)
i->start += x;
yyterminate(); // can't move this, since it actually rets a YY_NULL
}
+
+include { BEGIN(incl); }
+<incl>[ \t]* { /* eat the whitespace */ }
+<incl>\"[^"]*\"+ { /* got the include file name */
+ String s (YYText()+1);
+ s = s.left(s.len()-1);
+ new_input(s);
+ BEGIN(INITIAL);
+}
+
+
{WORD} {
mtor << "word: " << YYText()<<eol;
String c = YYText();
// mtor << "checking solution " << v << '\n';
for (int i=0; i < dim; i++) {
- if (cols[i].fixed&& ABS(cols[i].fixpos - v(i)) > COLFUDGE) {
+ if (cols[i].fixed&& abs(cols[i].fixpos - v(i)) > COLFUDGE) {
return false;
}
if (!i)
symtables_->add(s, p);
}
+Symbol
+Lookup::text( String style, String text , int dir)
+{
+ svec<String> a;
+
+ a.add((*symtables_)("style")->lookup(style).tex);
+ Symbol s = (*symtables_)("align")->lookup(dir);
+ a[0] = substitute_args( text,a);
+
+ s.tex = substitute_args(s.tex,a);
+ return s;
+}
+
/****************/
Real
}
Stem *
-Melodic_staff::get_stem(Stem_req*rq, Real dur)
+Melodic_staff::get_stem(Stem_req*rq, Moment dur)
{
Stem * s = new Stem(NO_LINES-1, dur);
s->flag = rq->stem_number;
#include "misc.hh"
#include "glob.hh"
+#include "moment.hh"
#include <math.h>
-Real
+Moment
wholes(int dur, int dots)
{
if (!dur)
return 0.0;
// stupid Intel: doesn't crash if !dur
- Real f = 1.0/Real(dur);
- Real delta = f;
+ Moment f = 1/Moment(dur);
+ Moment delta = f;
while (dots--) {
delta /= 2.0;
add(m);
return;
}
- Real xof=extent().x.max - m.extent().x.min;
+ Real xof=extent().x.right - m.extent().x.left;
Molecule toadd(m);
toadd.translate(Offset(xof, 0.0));
add(toadd);
add(m);
return;
}
- Real xof=extent().x.min - m.extent().x.max;
+ Real xof=extent().x.left - m.extent().x.right;
Molecule toadd(m);
toadd.translate(Offset(xof, 0.0));
add(toadd);
add(m);
return;
}
- Real yof=extent().y.max - m.extent().y.min;
+ Real yof=extent().y.right - m.extent().y.left;
Molecule toadd(m);
toadd.translate(Offset(0,yof));
add(toadd);
add(m);
return;
}
- Real yof=extent().y.min- m.extent().y.max;
+ Real yof=extent().y.left- m.extent().y.right;
Molecule toadd(m);
toadd.translate(Offset(0,yof));
add(toadd);
+++ /dev/null
-#include "moment.hh"
-#include "debug.hh"
-
-void
-Moment::print() const
-{
- mtor << " at "<<when<<'\n';
- mtor << "meeter " << whole_per_measure << "/" << 1/one_beat
- << "\nposition "<< bars << ":" << whole_in_measure <<'\n';
-}
-void
-Moment::OK() const
-{
- assert(whole_in_measure < whole_per_measure && 0 <= whole_in_measure);
- assert(one_beat);
-}
-Moment::Moment(Real dt, Moment const *prev)
-{
- if (prev) {
- assert(dt >0);
- *this = *prev;
- when += + dt;
- whole_in_measure += dt;
- while ( whole_in_measure >= whole_per_measure ) {
- whole_in_measure -= whole_per_measure;
- bars ++;
- }
- } else { // default 4/4
- whole_per_measure = 1;
- whole_in_measure =0;
- one_beat = 0.25;
- when = 0.0;
- bars = 0;
- }
-}
-
-void
-Moment::set_meter(int l, int o)
-{
- assert(o);
- one_beat = 1/Real(o);
- whole_per_measure = Real(l) * one_beat;
-}
-
-void
-Moment::setpartial(Real p)
-{
- if (when)
- error_t ("Partial measure only allowed at beginning.", when);
- if (p<0||p > whole_per_measure)
- error_t ("Partial measure has incorrect size", when);
- whole_in_measure = whole_per_measure - p;
-}
-Real
-Moment::barleft()
-{
-return whole_per_measure-whole_in_measure;
-}
+#include "interval.hh"
#include "identparent.hh"
#include "associter.hh"
#include "lexer.hh"
+#include "misc.hh"
+
#include "notehead.hh"
#include "dimen.hh"
#include "debug.hh"
output->translate(Offset(x_dir * p->note_width(),0));
bool streepjes = (position<-1)||(position > staff_size+1);
if (streepjes) {
- int dir = sgn(position);
+ int dir = sign(position);
int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
Symbol str = p->lookup_->streepjes(s);
Molecule sm;
// see Roelofs, p. 57
Real
-Paperdef::duration_to_dist(Real d)
+Paperdef::duration_to_dist(Moment d)
{
return whole_width * pow(geometric_, log_2(d));
}
int:
REAL {
$$ = int($1);
- if (ABS($1-Real(int($$))) > 1e-8)
+ if ( distance($1,Real(int($$)) ) > 1e-8)
error("expecting integer number");
}
| INT
} else if (daddy) {
mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak");
}
- mtor << "extent: " << width().min << ", " << width().max << "\n";
+ mtor << "extent: " << width().str() << "\n";
mtor << "}\n";
#endif
}
svec<Item*> col_its (select_items(s, c));
for (int j =0; j < col_its.sz(); j++)
col_its[j]->translate(Offset(-iv.length(),0));
- i->translate (Offset(-iv.max, 0));
+ i->translate (Offset(-iv.right, 0));
}
}
Vector Ha = H*a;
Real aHa = a*Ha;
Vector addrow(Ha.dim());
- if (ABS(aHa) > EPS) {
+ if (abs(aHa) > EPS) {
/*
a != 0, so if Ha = O(EPS), then
Ha * aH / aHa = O(EPS^2/EPS)
}
}
Real unbounded_alfa = 1.0;
- Real optimal_step = MIN(minalf, unbounded_alfa);
+ Real optimal_step = min(minalf, unbounded_alfa);
Vector deltax=direction * optimal_step;
x += deltax;
}
-Real
+Moment
Rhythmic_req::duration() const {
return wholes( balltype,dots);
}
}
Stem *
-Rhythmic_staff::get_stem(Stem_req*rq, Real l)
+Rhythmic_staff::get_stem(Stem_req*rq, Moment l)
{
Stem * s = new Stem(0,l);
s->flag = rq->stem_number;
-#include "sccol.hh"
#include "debug.hh"
+#include "pcol.hh"
+#include "sccol.hh"
+
+int
+Score_column::compare(Score_column & c1, Score_column &c2)
+{
+ return sign(c1.when - c2.when);
+}
-Score_column::Score_column(Real w)
+void
+Score_column::set_breakable() {
+ pcol_->set_breakable();
+}
+Score_column::Score_column(Moment w)
{
when = w;
pcol_ = new PCol(0);
}
int
-Real_compare(Real &a , Real& b)
+Tdescription_compare(Moment &a , Moment& b)
{
- return sgn(a-b);
+ return sign(a-b);
}
void
Score_column::preprocess()
{
- durations.sort(Real_compare);
+ durations.sort(Tdescription_compare);
}
void
-Score_column::add_duration(Real d)
+Score_column::add_duration(Moment d)
{
for (int i = 0; i< durations.sz(); i++) {
if (d == durations[i])
*/
// todo
PCursor<Score_column*>
-Score::create_cols(Real w)
+Score::create_cols(Moment w)
{
Score_column* c1 = new Score_column(w);
Score_column* c2 = new Score_column(w);
}
PCursor<Score_column*>
-Score::find_col(Real w,bool mus)
+Score::find_col(Moment w,bool mus)
{
PCursor<Score_column*> i(cols_);
for (; i.ok(); i++) {
pscore_->add(i->pcol_);
}
}
-Real
+Moment
Score::last() const
{
- Real l = 0;
+ Moment l = 0;
for (PCursor<Staff*> i(staffs_); i.ok(); i++) {
- l = MAX(l, i->last());
+ l = l>? i->last();
}
return l;
}
c->change = (type == "CLEF");
}else{
WARN << "ignoring TYPESET command for " << type << '\n';
-
}
return s;
}
Interval
itemlist_width(const svec<Item*> &its)
{
- Interval iv;
- for (int j =0; j < its.sz(); j++)
- iv.unite(its[j]->width());
+ Interval iv ;
+ iv.set_empty();
+
+ for (int j =0; j < its.sz(); j++){
+ iv.unite (its[j]->width());
+
+ }
return iv;
}
assert(!column_wid.empty());
for (int j=0; j < to_move.sz(); j++) {
- to_move[j]->translate(Offset(-column_wid.max, 0));
+ to_move[j]->translate(Offset(-column_wid.right, 0));
}
}
}
Local_key_item*
Simple_staff::get_local_key_item()
{
- return 0;
+ return 0;
}
#include "localkeyitem.hh"
Rhythmic_grouping
-parse_grouping(svec<Scalar> a)
+parse_grouping(svec<Scalar> a, Moment one_beat)
{
- Real one_beat =a[0];
- a.del(0);
+
svec<int> r;
for (int i= 0 ; i < a.sz(); i++)
r.add(a[i]);
- Real here =0.0;
+ Moment here =0.0;
svec<Rhythmic_grouping*> children;
for (int i=0; i < r.sz(); i++) {
- Real last = here;
+ Moment last = here;
here += one_beat * r[i];
children.add(
- new Rhythmic_grouping(Interval(last, here), r[i] )
+ new Rhythmic_grouping(MInterval(last, here), r[i] )
);
}
return Rhythmic_grouping(children);
svec<Scalar> args(com->args);
args.del(0);
if (com->args[0] == "GROUPING") {
- default_grouping = parse_grouping(args);
+ default_grouping = parse_grouping(args, col()->tdescription_->one_beat);
}else if (com->args[0] == "BAR") {
local_key_.reset(key_);
stem_->add(n);
if (current_grouping) {
current_grouping->add_child(
- c->moment_->whole_in_measure, rq->duration());
+ c->tdescription_->whole_in_measure, rq->duration());
}
noteheads.add(n);
int sidx =find_slur(v);
if (sl->spantype == Span_req::START) {
if (find_slur(sl->elt->voice_ )>=0)
- error("Too many slurs in voice");
+ error_t("Too many slurs in voice", col()->when());
pending_slur_reqs.add(sl);
pending_slurs.add(new Slur);
}
#include "molecule.hh"
#include "debug.hh"
#include "boxes.hh"
+void
+Slur::calculate()
+{
+ set_default_dir();
+}
+
+Offset
+Slur::center() const
+{
+ int pos1 = encompass.last()->position;
+ int pos2 = encompass[0]->position;
+
+ int dy = pos1-pos2;
+
+ Real w = width().length();
+
+ return Offset(w/2,dy * paper()->internote());
+}
void
Slur::add(Notehead*n)
#include "symbol.hh"
#include "molecule.hh"
#include "pcol.hh"
-
+void
+Spanner::calculate()
+{
+}
String
Spanner::TeXstring() const
{
}
void
-Staff::process_commands(Real l)
+Staff::process_commands(Moment l)
{
if (staff_commands_)
staff_commands_->clean(l);
}
Staff_column *
-Staff::get_col(Real w, bool mus)
+Staff::get_col(Moment w, bool mus)
{
Score_column* sc = score_->find_col(w,mus);
assert(sc->when == w);
Staff::setup_staffcols()
{
for (PCursor<Voice*> i(voices); i.ok(); i++) {
- Real now = i->start;
+ Moment now = i->start;
for (PCursor<Voice_element *> ve(i->elts); ve.ok(); ve++) {
Staff_column *sc=get_col(now,true);
}
for (PCursor<Staff_commands_at*> cc(*staff_commands_); cc.ok(); cc++) {
- Staff_column *sc=get_col(cc->moment_.when,false);
+ Staff_column *sc=get_col(cc->tdescription_.when,false);
sc->s_commands = cc;
- sc->moment_ = new Moment(cc->moment_);
+ sc->tdescription_ = new Time_description(cc->tdescription_);
}
PCursor<Staff_commands_at*> cc(*staff_commands_);
for (PCursor<Staff_column*> i(cols); i.ok(); i++) {
while ((cc+1).ok() && (cc+1)->when() < i->when())
cc++;
-
- if(!i->moment_) {
- if (cc->moment_.when == i->when())
- i->moment_ = new Moment(cc->moment_);
+
+ if(!i->tdescription_) {
+ if (cc->tdescription_.when == i->when())
+ i->tdescription_ = new Time_description(cc->tdescription_);
else
- i->moment_ = new Moment(
- i->when() - cc->when() ,&cc->moment_);
+ i->tdescription_ = new Time_description(
+ i->when() - cc->when() ,&cc->tdescription_);
}
}
}
}
-Real
+Moment
Staff::last() const
{
- Real l = 0.0;
+ Moment l = 0.0;
for (PCursor<Voice*> i(voices); i.ok(); i++) {
- l = MAX(l, i->last());
+ l = l >? i->last();
}
return l;
}
#include "debug.hh"
#include "parseconstruct.hh"
-Real
+Moment
Staff_commands_at::when()
{
- return moment_.when;
+ return tdescription_.when;
}
void
Staff_commands_at::print() const
#ifndef NPRINT
PCursor<Command*> i (*this);
mtor << "Commands at: " ;
- moment_.print();
+ tdescription_.print();
for (; i.ok(); i++)
i->print();
assert(i->priority >= (i+1)->priority);
}
-Staff_commands_at::Staff_commands_at(Moment m)
- :moment_(m)
+Staff_commands_at::Staff_commands_at(Time_description m)
+ :tdescription_(m)
{
}
insert_between(post, f, l);
}
-
+
+
+/*
+ should move this stuff into inputlanguage.
+ */
void
Staff_commands_at::add(Command c)
{
{
#ifndef NDEBUG
for (PCursor<Staff_commands_at*> i(*this); i.ok() && (i+1).ok(); i++) {
- assert(i->moment_.when <= (i+1)->moment_.when);
+ assert(i->tdescription_.when <= (i+1)->tdescription_.when);
i->OK();
}
#endif
}
Staff_commands_at*
-Staff_commands::find(Real w)
+Staff_commands::find(Moment w)
{
PCursor<Staff_commands_at*> i(bottom());
for (; i.ok() ; i--) {
- if (i->moment_.when == w)
+ if (i->tdescription_.when == w)
return i;
- if (i->moment_.when < w)
+ if (i->tdescription_.when < w)
break;
}
return 0;
{
PCursor<Staff_commands_at*> i(bottom());
for (; i.ok() ; i--) {
- if (i->moment_.when < p->moment_.when)
+ if (i->tdescription_.when < p->tdescription_.when)
break;
}
if (!i.ok())
}
void
-Staff_commands::clean(Real l)
+Staff_commands::clean(Moment l)
{
PCursor<Staff_commands_at*> i(bottom());
- for (; i->moment_.when > l; i=bottom()) {
+ for (; i->tdescription_.when > l; i=bottom()) {
remove(i);
}
Staff_commands_at*p = find(l);
if (!p) {
- p = new Staff_commands_at(Moment(l - i->when(), &i->moment_));
+ p = new Staff_commands_at(Time_description(l - i->when(), &i->tdescription_));
add(p);
}
if (!p->is_breakable()) {
{
String s("\\vbox to ");
s += print_dimen(i.length());
- s += "{\\vskip "+print_dimen(i.max)+" ";
+ s += "{\\vskip "+print_dimen(i.right)+" ";
return s;
}
for (PCursor<const Spanner*> sp(pstaff_->spans); sp.ok(); sp++) {
- PCol *brokenstart = &MAX(*linestart, *sp->left);
- PCol *brokenstop = &MIN(*linestop, *sp->right);
+ PCol *brokenstart = &max(*linestart, *sp->left);
+ PCol *brokenstop = &min(*linestop, *sp->right);
if ( *brokenstart < *brokenstop) {
line_of_score_->pscore_-> // higghl
add_broken(sp->broken_at(brokenstart,brokenstop));
-#include "stcol.hh"
-#include "sccol.hh"
#include "voice.hh"
-#include "moment.hh"
+#include "timedescription.hh"
+#include "sccol.hh"
+#include "stcol.hh"
bool
Staff_column::mus() const
return score_column->musical;
}
-Real
+Moment
Staff_column::when() const
{
return score_column->when;
void
Staff_column::add(Voice_element*ve)
{
- Real d= ve->duration;
+ Moment d= ve->duration;
if (d){
score_column->add_duration(d);
}
{
score_column = s;
s_commands = 0;
- moment_ = 0;
+ tdescription_ = 0;
}
Staff_column::~Staff_column()
{
- delete moment_;
+ delete tdescription_;
}
const int STEMLEN=7;
-Stem::Stem(int c, Real len)
+Stem::Stem(int c, Moment len)
{
note_length = len;
beams_left = 0;
top = (dir < 0) ? maxnote : se;
bot = (dir < 0) ? se : minnote;
- flag = dir*ABS(flag);
+ flag = dir*abs(flag);
}
void
int parity=0;
int lastpos = heads[0]->position;
for (int i=1; i < heads.sz(); i ++) {
- if (ABS(lastpos- heads[i]->position) == 1) {
+ if (abs(lastpos- heads[i]->position) == 1) {
if (parity)
heads[i]->x_dir = (stem_xoffset>0) ? 1:-1;
parity = !parity;
Interval
Stem::width()const
{
- if (!print_flag || ABS(flag) <= 4)
+ if (!print_flag || abs(flag) <= 4)
return Interval(0,0); // TODO!
Paperdef*p= paper();
Interval r(p->lookup_->flag(flag).dim.x);
output = new Molecule(Atom(ss));
- if (print_flag&&ABS(flag) > 4){
+ if (print_flag&&abs(flag) > 4){
Symbol fl = p->lookup_->flag(flag);
Molecule m(fl);
if (flag < -4){
break_status = BREAK_END - BREAK_PRE;
}
-Real
+Moment
Staff_walker::when() const
{
return (* (PCursor<Staff_column*> *) this)->when();
--- /dev/null
+#include "proto.hh"
+#include "string.hh"
+#include "moment.hh"
+#include "real.hh"
+#include "interval.cc"
+
+Interval__instantiate(Real);
+Interval__instantiate(Rational);
static int
slope_index(Real &s)
{
- if (ABS(s) > 0.5) {
+ if (abs(s) > 0.5) {
WARN << "beam steeper than 0.5";
- s = sgn(s) * 0.5;
+ s = sign(s) * 0.5;
}
int i = int(rint(s * 20.0));
#include <math.h>
-
+#include "misc.hh"
#include "lookup.hh"
#include "molecule.hh"
#include "dimen.hh"
Symbol s;
- s.dim.y = Interval(MIN(0,0), MAX(0,0));
+ s.dim.y = Interval(min(0,0), max(0,0));
s.dim.x = Interval(0,dx);
String f = String("\\hslurchar");
Symbol s;
s.dim.x = Interval(0,dx);
- s.dim.y = Interval(MIN(0,dy), MAX(0,dy));
+ s.dim.y = Interval(min(0,dy), max(0,dy));
String f = String("\\hslurchar");
Lookup::slur (int dy , Real &dx, int dir)
{ // ugh. assuming pt here.
assert(dx >=0);
- int y_sign = sgn(dy);
+ int y_sign = sign(dy);
bool large = dy > 16;
Symbol s;
s.dim.x = Interval(0,dx);
- s.dim.y = Interval(MIN(0,dy), MAX(0,dy));
+ s.dim.y = Interval(min(0,dy), max(0,dy));
String f = String("\\slurchar") + direction_char(y_sign);
Lookup::big_slur(int dy , Real &dx, int dir)
{
assert(dx >= convert_dimen(24,"pt"));
- Real slur_extra =ABS(dy) /2.0 + 2;
+ Real slur_extra =abs(dy) /2.0 + 2;
int l_dy = int(Real (dy)/2 + slur_extra*dir);
int r_dy = dy - l_dy;
--- /dev/null
+#include "paper.hh"
+#include "molecule.hh"
+#include "lookup.hh"
+#include "boxes.hh"
+#include "textspanner.hh"
+
+Text_spanner::Text_spanner(Directional_spanner*d)
+{
+ support = d;
+ align = 0;
+ style = "roman";
+}
+
+void
+Text_spanner::process()
+{
+ Offset tpos;
+
+ switch(align) {
+ case 0:
+ tpos = support->center();
+ break;
+ default:
+ assert(false);
+ break;
+ }
+
+ Paperdef *pap_p = paper();
+
+ Atom tsym (pap_p->lookup_->text(style, text, -align));
+ tsym.translate(tpos);
+ output = new Molecule;
+ output->add( tsym );
+}
+
+void
+Text_spanner::preprocess()
+{
+ right = support->right;
+ left = support->left;
+ assert(left && right);
+}
+
+Interval
+Text_spanner::height()const
+{
+ return output->extent().y;
+}
+
+Spanner*
+Text_spanner::broken_at(PCol*c1, PCol*c2)const
+{
+ Text_spanner *n=new Text_spanner(*this);
+ n->left = c1;
+ n->right = c2;
+ return n;
+}
--- /dev/null
+#include "timedescription.hh"
+#include "debug.hh"
+
+void
+Time_description::print() const
+{
+ mtor << "Time_description { at "<<when<<'\n';
+ mtor << "meter " << whole_per_measure << ":" << 1/one_beat
+ << "\nposition "<< bars << ":" << whole_in_measure <<"\n}\n";
+}
+void
+Time_description::OK() const
+{
+ assert(whole_in_measure < whole_per_measure && 0 <= whole_in_measure);
+ assert(one_beat);
+}
+Time_description::Time_description(Moment dt, Time_description const *prev)
+{
+ if (prev) {
+ assert(dt >0);
+ *this = *prev;
+ when += + dt;
+ whole_in_measure += dt;
+ while ( whole_in_measure >= whole_per_measure ) {
+ whole_in_measure -= whole_per_measure;
+ bars ++;
+ }
+ } else { // default 4/4
+ whole_per_measure = 1;
+ whole_in_measure =0;
+ one_beat = 0.25;
+ when = 0.0;
+ bars = 0;
+ }
+}
+
+void
+Time_description::set_meter(int l, int o)
+{
+ assert(o);
+ one_beat = 1/Moment(o);
+ whole_per_measure = Moment(l) * one_beat;
+}
+
+void
+Time_description::setpartial(Moment p)
+{
+ if (when)
+ error_t ("Partial measure only allowed at beginning.", when);
+ if (p<0||p > whole_per_measure)
+ error_t ("Partial measure has incorrect size", when);
+ whole_in_measure = whole_per_measure - p;
+}
+Moment
+Time_description::barleft()
+{
+return whole_per_measure-whole_in_measure;
+}
#endif
}
-Real
+Moment
Voice::last() const
{
- Real l =start;
+ Moment l =start;
for (PCursor<Voice_element*> vec(elts); vec.ok(); vec++)
l += vec->duration;
return l;
% It has a lot of hard-wired stringconstants
%
-table_sixteen = symboltables {
-
- texid "\musixsixteendefs"
+include "init/dutch.ini"
+include "init/table_sixteen.ini"
- % index TeXstring, xmin xmax ymin ymax
-
-
- "clefs" = table {
- "violin" "\violinclef" 0pt 12.8pt -10pt 18pt
- "bass" "\bassclef" 0pt 11.2pt 0pt 16pt
- "viola" "\violaclef" 0pt 12.8pt 0pt 16pt
- "violin_change" "\cviolinclef" 0pt 11.2pt -12pt 12pt
- "bass_change" "\cbassclef" 0pt 12.8pt 0pt 16pt
- "viola_change" "\cviolaclef" 0pt 11.2pt 0pt 16pt
- }
-
- "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{%}{%}"
- "stem" "\stem{%}{%}"
- "fill" "\hbox{}"
- }
-
- "dots" = table {
- "1" "\lsingledot" 0pt 2pt -1pt 1pt
- "2" "\ldoubledot" 0pt 5pt -1pt 1pt
- "3" "\ltripledot" 0pt 8pt -1pt 1pt
- }
-
- "flags" = table {
- "8" "\eigthflag" 0pt 4pt 0pt 0pt
- "16" "\sixteenthflag" 0pt 4pt 0pt 0pt
- "32" "\thirtysecondflag" 0pt 4pt 0pt 0pt
- "-8" "\deigthflag" 0pt 4pt 0pt 0pt
- "-16" "\dsixteenthflag" 0pt 4pt 0pt 0pt
- "-32" "\dthirtysecondflag" 0pt 4pt 0pt 0pt
- }
-
- "beamslopes" = table {
- "slope" "\beamslope{%}{%}"
- "horizontal" "\rulesym{%}{%}"
- }
-
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-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{%}{%}"
- "stem" "\stem{%}{%}"
- "fill" "\hbox{}"
- }
-
- "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{%}{%}"
- "horizontal" "\rulesym{%}{%}"
- }
-
-}
%
% common dutch names for notes. "es" means flat, "is" means sharp
%
-dutch_names = notenames {
- "ceses" 0 -2 "ces" 0 -1 "c" 0 0 "cis" 0 1 "cisis" 0 2
- "deses" 1 -2 "des" 1 -1 "d" 1 0 "dis" 1 1 "disis" 1 2
- "eses" 2 -2 "es" 2 -1 "e" 2 0 "eis" 2 1 "eisis" 2 2
- "feses" 3 -2 "fes" 3 -1 "f" 3 0 "fis" 3 1 "fisis" 3 2
- "geses" 4 -2 "ges" 4 -1 "g" 4 0 "gis" 4 1 "gisis" 4 2
- "ases" 5 -2 "as" 5 -1 "a" 5 0 "ais" 5 1 "aisis" 5 2
- "beses" 6 -2 "bes" 6 -1 "b" 6 0 "bis" 6 1 "bisis" 6 2
-}
-
-%
-% f = flat, s = sharp.
-%
-english_names = notenames {
- "cff" 0 -2 "cf" 0 -1 "c" 0 0 "cs" 0 1 "css" 0 2
- "dff" 1 -2 "df" 1 -1 "d" 1 0 "ds" 1 1 "dss" 1 2
- "eff" 2 -2 "ef" 2 -1 "e" 2 0 "es" 2 1 "ess" 2 2
- "fff" 3 -2 "ff" 3 -1 "f" 3 0 "fs" 3 1 "fss" 3 2
- "gff" 4 -2 "gf" 4 -1 "g" 4 0 "gs" 4 1 "gss" 4 2
- "aff" 5 -2 "af" 5 -1 "a" 5 0 "as" 5 1 "ass" 5 2
- "bff" 6 -2 "bf" 6 -1 "b" 6 0 "bs" 6 1 "bss" 6 2
-}
-
default_table = symboltables { table_sixteen }
notenames { dutch_names }