TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 64
+TOPLEVEL_PATCH_LEVEL = 65
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL =
N\bN\bN\bNA\bA\bA\bAM\bM\bM\bME\bE\bE\bE
- AUTHORS - who did what on LilyPond?
+ AUTHORS - who did what on GNU LilyPond?
D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
- This file lists authors of LilyPond, and what they wrote.
+ This file lists authors of GNU LilyPond, and what they
+ wrote.
+A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
+\bo Han-Wen Nienhuys <hanwen@stack.nl>
Main author, all files files except mentioned below
+\bo Jan Nieuwenhuizen <jan@digicash.com>
lily/midi-*, mi2mu/*, parts flower/string*.cc,
- make/*.make, parts of Documentation/mudela.pod,
- lib/*source-file*, lib/duration.cc, lib/source,
- flower/*{list,cursor}*,
+ make/*.make, */Makefile parts of
+ Documentation/mudela.pod, lib/*source-file*,
+ lib/duration.cc, lib/source, flower/*{list,cursor}*,
and corresponding header files.
+C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
+\bo Mats Bengtsson <matsb@s3.kth.se>, parts of clef-
reg.cc, clef-item.cc testing, general comments.
+ +\bo Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
+ bugfixes.
-
-
-
-
-
-6/May/97 LilyPond 0.0.62 1
+19/May/97 LilyPond 0.0.65 1
=head1 NAME
-AUTHORS - who did what on LilyPond?
+AUTHORS - who did what on GNU LilyPond?
=head1 DESCRIPTION
-This file lists authors of LilyPond, and what they wrote.
+This file lists authors of GNU LilyPond, and what they wrote.
+
+=head1 AUTHORS
=over 4
Jan Nieuwenhuizen <jan@digicash.com>
-lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make,
+lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile
parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc,
lib/source, flower/*{list,cursor}*,
and corresponding header files.
+=back
+
+=head1 CONTRIBUTORS
+
+=over 4
+
=item *
Mats Bengtsson <matsb@s3.kth.se>, parts of clef-reg.cc, clef-item.cc
testing, general comments.
+=item *
+
+Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc bugfixes.
+
=back
+
=back
+At this time, GNU LilyPond output looks nice, but is not of production
+quality. If you're not discouraged; this is what I type in my xterm:
+
+ lilypond someinput.ly
+ tex lelie.tex
+ xdvi test&
+
+This is what the output looks like over here:
+
+ hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
+ Parsing ... [./input/kortjakje.ly[lots of stuff]]
+ Setting up requests...Processing requests ...[8][16][24][25]
+ Preprocessing elements...
+ Calculating column positions ... [3][7][12][16][20][25]
+ Postprocessing elements...
+ TeX output to lelie.tex ...
+
+ hw:~/musix/spacer$ tex lelie
+ This is TeX, Version 3.14159 (C version 6.1)
+ (lelie.tex
+ Hyphenation patterns for english, dutch, german, loaded.
+ (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
+ Output written on lelie.dvi (1 page, 8944 bytes).
+ Transcript written on lelie.log.
+
+ hw:~/musix/spacer$ xdvi lelie&
+ [1] 855
+
+Check out the input files, some of them have comments
Please refer to the man page for more information.
=head1 REDHAT LINUX
Seriously, read, reread and reread lilygut and CodingStyle, and
just start anywhere.
+Anywhere? Well, most of the comment doco are in the header files, so
+your best bet would be C<less lily/include/*.hh>. Some of the most
+important data-structures are to be found in:
+
+ - p-col.hh
+ - *request.hh
+ - register.hh
+ - score-elem.hh
+ - input-music.hh
+ - linespace.hh
+ - item.hh
+ - spanner.hh
+ - voice.hh
+
+
Q: Why GPL?
A: Yes.
- arranging
- performing
-Music publishers make lots of money out of selling which sheet music
-essentially free (composed by people long dead). Publishers have two
-arguments for doing this: high prices are there to guarantee diversity
-(keeping lots of stock is expensive), and to encourage new work being
-composed.
+Music publishers make lots of money out of selling sheet music which
+is in the public domain (the composers died a long time ago). It is
+usually prohibited to xerox the sheet music. Publishers have two
+arguments for not allowing this: high prices are there to guarantee
+diversity (keeping lots of stock is expensive), and to encourage new
+work being composed.
LilyPond addresses the first issue: storing mudelas takes up almost no
space at all. Other systems should address the other issue:
encouraging laymen to take up composing, in the same way that GNU
tools have created a whole new generation of programmers.
+The public deserves to get public domain music for free (zero cents).
-The public deserves free non-copyrighted music.
-
-The public deserves free tools for composing and printing
+The public deserves free tools for composing and printing.
=head1 REQUIREMENTS
+Emacs and TeX serve as useful examples of what programs by the GMP
+should be.
+
=over 4
=item * high-quality
-(cf Emacs), from engraving point of view
+(cf TeX), from engraving point of view
=item * high-quality
-from software point of view: like all GNU software, it
+(cf Emacs) from software point of view: like all GNU software, it
should have no limits, be fast, etc.
-
=item * tweakable
Printed music has a lot of styles, and special symbols. It may be
=item * easy to use.
-That is, for technical users (that can read a
-manual). The learning curve should be as easy as possible but not at
-the expense of comfort of use.
+That is, for technical users (that can read a manual). The learning
+curve should be as easy as possible but not at the expense of comfort
+of use and power.
=back
=over 4
+=item A set of music fonts
+
+Preferably in Metafont, suited to both screen display and use on paper
+
+The copyright heritage of Musixtex is unclear.
+
+
=item A typesetting engine.
A system with rules on how to set properties of items to be printed
=item An ASCII language
-In development, LilyPond has a language. See over there for goals.
+In development, LilyPond has a language. (See over there for goals)
Having an ASCII format which enables urtext, and easy sharing (via
mail and news forums) encourages cooperation and exchange of music.
The natural way to enter composed music is singing or playing it. The
GMP should have module which can take keyboard input or microphone
-input and convert it to computer data. (the second one would be difficult)
+input and convert it to computer data. (microphone input would be
+difficult)
=item sequencing
=item *
-A noninteractive typesetter, suited for batch jobs, and
-typesetting existing music. This would couple the ASCII language, the
-printing engine and the typesetting engine
+A noninteractive typesetter, suited for batch jobs, and typesetting
+existing music. This would couple the ASCII language, the printing
+engine and the typesetting engine
LilyPond is currently representing this section.
=item *
-A GUI for composing. This would combine the display engine, the
-input system, the typesetting engine
+A GUI for composing. This would combine the display engine, the input
+system and the typesetting engine.
+
+=item *
+
+Libraries for reading, writing various audio/music/notation formats.
=back
=item *
-gather moderate number of test users and hackers
+Gather a moderate number of test users and hackers
=item *
-a website on GMP
+A website on GMP
=item *
=item Processing:
Requests are processed and used to create elements (like balls, stems,
-slurs etc). This is done by a hierarchy of brokers, which swallow
-requests, broadcast them and couple different elements.
+slurs etc). This is done by a hierarchy of "brokers" (called
+Register), which swallow requests, broadcast them and couple different
+elements.
In this step data-structures for the next steps are created and filled
-with data: PScore, PCol, PStaff
+with data: PScore, PCol.
=item Preprocessing
=item Calculation:
This step uses structures which have names starting with 'P'.
-linebreaks and horizontal positions of PCols are determined. Line_of_*
-generated.
+linebreaks and horizontal positions of PCols are determined.
+
+Through some magical interactions with Line_of_score and Super_elem
+(check out the source) the "lines" are produced.
+
+All other spanners can figure across which lines they are spread. If
+applicable, they break themselves into pieces. After this, each piece
+works (or, if there are no pieces) the spanner throws out any
+dependencies which are in the wrong line.
=item Postprocesing:
point in the same direction as the beam itself, so the stems of a beam
depend on the beam. In the same way do scripts depend on the direction
of the stem. To reflect this, LilyPond has the notion of dependency.
-It works in the same fashion that make uses to build programs: before
+It works in the same fashion that C<make> uses to build programs: before
a stem is calculated, its dependencies (the beam) should be
-calculated. Before a slur is calculated, its dependencies (stems)
+calculated. Before a slur is calculated, its dependencies (stems, noteheads)
should be calculated.
=head1 BREAKING
=head1 DESCRIPTION
A list of resources on music printing/writing and engraving.
+Please note that don't have access to most material (except a library
+copy of Chlapik)
=head2 References
[This is as close to the ``standard'' reference work for music notation issues
as one is likely to get.]
+The University of Colorado Music Engraving page.
+http://www.cc.colorado.edu/cgi-bin/mfs/01/Dept/Musicpress/Welcome.html
+
+More on GNU Music: http://www.u-bordeaux.fr/~strandh
=head2 Further reading
=head1 EXAMPLES
-At this time, GNU LilyPond output looks nice, but is not of production
-quality. If you're not discouraged; this is what I type in my xterm:
-
- lilypond someinput.ly
- tex lelie.tex
- xdvi test&
-
-This is what the output looks like over here:
-
- hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
- Parsing ... [./input/kortjakje.ly[lots of stuff]]
- Setting up requests...Processing requests ...[8][16][24][25]
- Preprocessing elements...
- Calculating column positions ... [3][7][12][16][20][25]
- Postprocessing elements...
- TeX output to lelie.tex ...
-
- hw:~/musix/spacer$ tex lelie
- This is TeX, Version 3.14159 (C version 6.1)
- (lelie.tex
- Hyphenation patterns for english, dutch, german, loaded.
- (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
- Output written on lelie.dvi (1 page, 8944 bytes).
- Transcript written on lelie.log.
-
- hw:~/musix/spacer$ xdvi lelie&
- [1] 855
-
-Check out the input files, some of them have comments
-
=head1 PROBLEMS
:
Than it would help if you send a dump of the Interval and the Item
-(use: C<print *this> or use GNU LilyPond C<print()> methods).
+(use: C<print *this> or use LilyPond C<print()> methods).
=back
-Bug reports should be directed to
+Bug reports should be directed to:
bug-gnu-music@vuse.vanderbilt.edu. In any case, they should contain a
-description of the problem, an small input file which reproduces it
-(if applicable), lilypond version and a description of the platform.
+description of the problem, a small input file which reproduces it (if
+applicable), the lilypond version and a description of the platform.
=head1 FILES
=item http://www.stack.nl/~hanwen/lilypond/index.html
-GNU LilyPond has her own webpage at
-This webpage contains
-the MIDI, GIF and PS files for some standard music files. It also has
-the complete LilyPond documentation
+GNU LilyPond has her own webpage. This webpage contains the MIDI, GIF
+and PS files for some standard music files. It also has the complete
+LilyPond documentation
=back
mail with subject "subscribe" to
gnu-music-discuss-request@vuse.vanderbilt.edu,
+
=back
+Announces of new versions will be sent to info-gnu-music and
+gnu-music-discuss.
+
=head1 REMARKS
GNU LilyPond has no connection with the music package Rosegarden, other
-16/May/97 LilyPond 0.0.64 1
+26/May/97 LilyPond 0.0.65 1
-16/May/97 LilyPond 0.0.64 2
+26/May/97 LilyPond 0.0.65 2
-16/May/97 LilyPond 0.0.64 3
+26/May/97 LilyPond 0.0.65 3
T.59). Beware, the clef symbol has changed position
in recent versions of MusixTeX)
+ At this time, GNU LilyPond output looks nice, but is not
+ of production quality. If you're not discouraged; this is
+ what I type in my xterm:
+
+ lilypond someinput.ly
+ tex lelie.tex
+ xdvi test&
+
+ This is what the output looks like over here:
+
+ hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2
+ Parsing ... [./input/kortjakje.ly[lots of stuff]]
+ Setting up requests...Processing requests ...[8][16][24][25]
+ Preprocessing elements...
+ Calculating column positions ... [3][7][12][16][20][25]
+ Postprocessing elements...
+ TeX output to lelie.tex ...
+
+ hw:~/musix/spacer$ tex lelie
+ This is TeX, Version 3.14159 (C version 6.1)
+ (lelie.tex
+ Hyphenation patterns for english, dutch, german, loaded.
+ (/home/hw/lib/texmf/tex/lilypond/lilyponddefs.tex) [1] )
+ Output written on lelie.dvi (1 page, 8944 bytes).
+ Transcript written on lelie.log.
+
+ hw:~/musix/spacer$ xdvi lelie&
+ [1] 855
+
+ Check out the input files, some of them have comments
Please refer to the man page for more information.
R\bR\bR\bRE\bE\bE\bED\bD\bD\bDH\bH\bH\bHA\bA\bA\bAT\bT\bT\bT L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOZ\bZ\bZ\bZE\bE\bE\bE
Windows NT:
+
+
+
+26/May/97 LilyPond 0.0.65 4
+
+
+
+
+
+INSTALL(1) LilyPond documentation INSTALL(1)
+
+
you need the cygnus win32 gnu port development stuff; have
a look at http://www.cygnus.com/gnu-win32.
-16/May/97 LilyPond 0.0.64 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+26/May/97 LilyPond 0.0.65 5
+pl 65
+ - bf pathfind /root/file
+ - massive Score_elem rewrite:
+ * group_element_i_ count
+ * support for removing an individual Score_elem cleanly.
+ * moved dep stuff into class Directed_graph_node
+ * Score_elems can be copied and deleted freely.
+ * junk PStaff
+ * Spanner_elem_group
+ * Line_of_{score,staff} now are Score_elems
+ * clean dep handling upon deletion
+ * delete unbroken spanners
+ * added a break_processing round.
+ * Super_elem
+ - junk Complex_staff,
+ - clean {lily}?proto.hh
+ - Element_group
+ - Score_elem now as virtual base class everywhere
+ - naming: Staff_elem -> Score_elem
+ - bf: make in toplevel dir
+ - bf: broken tie y-pos
+ - bf: sharing 4th, 8th and 16th noteheads
+ - bf: overlapping chords. <\multivoice c d >
+
+pl 64.wl
+ - new stem direction code
+ - bfs: wohltemperirt.ly (thanks, Werner)
+ - bf: stem direction
+
+pl 63.jcn2
+ - doze compile
+
+pl 63.jcn1
+ - bf: mi2mu mudela commands
+ - bf: mi2mu tracks
+ - mi2mu quantify tuning
+ - mi2mu TODO
+
+*********
+may 16
pl 64
- exe's now built in out/
- toplevel Makefile dep from make/Toplevel.make.in
- - make_website: add version fokoter
+ - make_website: add version footer
- make_website: bf dist *.txt
- bf: fix loose bars : \meter 4/4; c1.
- Staff_elem -> Score_elem
- bf <cis cis>
- vbrace lookup
- - stop if barchecks failed
- resync barcheck
*******
+
+may 15
pl 63
- bf: segfault during MIDI output with mi2mu output.
- kludge: parse error beyond eof
pl 61.jcn4
- mi2mu -p -s16 fugua2.midi getting better!
+ plus factor 2 mi2mu speedup (fugue2.midi 5.50user)
- bf: Duration_convert quantify threshold down
- bf: (on quantify): tcols quantified; no silly voices
- mi2mu parsing speedup: backup rules for midi-lexer.l
- bf: zero denominator
**********
+may 14
pl 62
- make clean bf: remove lex & yacc files too
- added kludge in case measure too long
**********
-may 14
pl 61
- scales.ly bugfix: dimensions default to ((0,0), (0,0))
- naming: PointerList->Pointer_list
the mailing lists
- info-gnu-music-request@vuse.vanderbilt.edu
- help-gnu-music-request@vuse.vanderbilt.edu
- bug-gnu-music-request@vuse.vanderbilt.edu
- gnu-music-discuss-request@vuse.vanderbilt.edu,
+ info-gnu-music@vuse.vanderbilt.edu
+ help-gnu-music@vuse.vanderbilt.edu
+ bug-gnu-music@vuse.vanderbilt.edu
+ gnu-music-discuss@vuse.vanderbilt.edu,
+
+See the man page on what to use for what. Or you can send it directly
+to us: hanwen@stack.nl, jan@digicash.com.
-(or directly to us: hanwen@stack.nl, jan@digicash.com)
IMPORTANT
+ * add mi2mu example output (.midi.ly and .gif) to website
- * faq about mi2mu midi t1.
+ * piano staff
- * update 20 pt table
+ * decent spacing
+
+ * implement better breaking algorithm
+ * update 20 pt table
+
* use Hungarian throughout code
* decent TeX page layout
* a Hands on tutorial [HKN]
PROJECTS
-
* Output class, handles : (smallish)
- help text /(c) notice?
- version line
- MusixTeX output possible? (would have to be done before break calc.)
- NIFF ?
- PostScript output (esp. Beams, Slurs, etc)
+ - Move PScore, Items, Spanners etc. into libmutype.a
+
+
+ * separate Score_elem settings in user-settable (properties
+ .. ) and non-user-settable part.
* TeX spanners , use texbeam.cc as an example (smallish)
- Glissando
- general shaving
- use plet grouping
- abbreviations [c2 c2]1/2
- - separate visual from rhythmic info
+ - separate visual from rhythmic info even more
+ - beams over bars
* Redo MIDI output to use Registers: (Difficult)
- remember more horizontal info than melodics:
- slurs
- dynamics etc.
+
* Redo font support
+ - use GSharp fonts?
- rename mf fonts to avoid conflicts with musixtex
- check (c) issues
- use own fonts/update musixtex fonts/find older (c)-less fonts
- hack up mf sources for decent spacing info (and then
read AFM/TFM directly, for text too)
+
+ * lines:
+ - Ledger lines, should be separate item: Ledger_lines, Ledger_lines_reg
+ - set different line sizes / thicknesses
+ - stem down too far right
+ - beam stem showthrough, inter beam sizes (french vs german style)
+
+ * Collisions
+ - bring Collision::do_pre_processing to haircutter
+ - left/right note balls should be handled by Collision:
+ < \multivoice { \stem 1; <b c> } { <f as b> } >
+
+ * Keys:
+ - merge key{item} & localkey{item}?
+ - do conventional keys (C G A, F B E, a e fis, d as des, etc ),
+ besides lists of flats/sharps, possibly via declaration
+ - key transposition.
+ - key undo: \key bes; .. . \key; should print natural
+ - special key: \key 'b bes bis';
+ - spacing, national styles?
+
PARSER
* Duration -> Musical_duration, typedef Rational Duration?
**********************
HKN buglist:
-\bar || ook dunne streepjes? Sluit de balk niet af! (soms met de
-ruimte van een hele maat erachter (bij unmatching staffs)
-
noten staan vaak te dicht aan de rechterkant van de maatstreep.
-optie om nummers/markers boven maatstrepen te zetten
-
tekst staat erg ver van notenbalken af
waarom geen ; achter dingen in \paper? (\textwidth 180\mm)
Onduidelijk wanneer wel en geen \ voor een woord. Maak liever
verplichte regels
-implementeren versieringen door duration *0 ofzo? (geeft nu assertion,
-zie duration0.ly)
-
-Triolen enzo: het zou handig zijn als je het cijfer "3" ook _tussen_
-twee noten kon plaatsen. Dat is bijvoorbeeld nodig in
-c4*2/3 c8*2/3
-
----------------\
-\bar "||" \meter 6/8; op het eind van de regel staat door elkaar
-gedrukt.
****************
BUGS
-
- * mi2mu nonexist.midi
+ * spurious Weird stem size warnings
* staccato dot positions.
* stacked scripts.
- * key transposition.
-
- * help-lines for rests
-
* lilypond - -> crash
* chlapik balk ruimte
* grace notes
+
FURTHER FOR ORCHESTRAL SCORE:
* multibar rests
INPUTLANGUAGE
+ * should have \require{package.ly} to read req'd packages.
+
* relative mode for pitch entering
+ * bracket (bracketplets)
+
* \duration 8; e*2/3
* configure pitch_byte
- * special key.
-
* figured bass?
* rest name configurable
* subtime with Subtle_reqs
+PROJECTS
+
+ * Do RTTI i.s.o. static_name(), name() and request-junk.
+
+ * add remove() methods to all items/spanners.
+
SMALLISH PROJECTS
- * Help_line, Help_line_reg
+ * handle do_substitute_dependency in more derived classes.
+
+ * replace member access by get()/set() methods, to enable
+ future embedded code.
* --fast/--draft: leave out constraints
* adaptive accidental spacing.
- * score_elem invible_b_ flag
+ * Score_elem invible_b_ flag
- * key undo
-
* unix style paths for LILYINCLUDE env
* indentable stream as baseclass for TeX stream, lily stream, Dstream.
* caching Item/spanner dimensions.
- * key transposition
-
* centered whole rest
* caching breakpoints / saving them.
* use dstream feature in mi2mu
* qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
- * use tors feature in lily
+ - use tors feature in lily (?)
- * declare notenametab?
+ * declare symtab
- * do conventional keys (C G A, F B E, a e fis, d as des, etc ),
- besides lists of flats/sharps
+ * declare notenametab?
* midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
* Decent TeX titledefs (\tempo, \metron, etc. )
- * C meter iso 4/4
+ * C meter iso 4/4, idem for alla breve, etc.
* textspanner: center position
DOC
+ * Score_elem structure.
+
* all errors
* config of TeX macros
* Reg_configure_request
- * bring Collision::do_pre_processing to haircutter
-
* slur parts as a script
* mixed fontsizes
* better beamslope calculation: QLP for beams?
- * implement better breaking algorithm
-
* Text_crescendo
* clean solution for staffsize in items.
- * merge key{item} & localkey{item}?
-
* revise calcideal
* volta
* vertical spanner
IDEAS
+ * derive PCol from Score_elem?
* scoping in Lexer: do general id- assignments in mudela.
* move MIDI stuff (including Quantization) to a ANSI C libmidi library.
* use an embedded language: Python
- for :
- - Items/Spanners
+ for:
+ - Score_elems
- Registers
- Complex mudela?
* merge Atom and Symbol?
* merge common code of Item, Atom/Molecule
+
* Spacing_request for manually adjusting spacing
* Staff_group, Score_request_register.
* Meters/bars should be aligned, which is difficult if
we get different keychanges in different staffs.
+ * Horizontal_align item for meter,bar etc.
+
* caching breakpoints
* #c <-> cis
#!/bin/sh
# unclobber current dir.
-rm -vf *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
-
+rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~
+rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
+rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
# docxx mess
+rm -vf *dvi
rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
aindex.html index.html
my $what="implement ";
$what = "declare " if ($hh_b);
my ($PROJECT, $cwd);
- $PROJECT = "the LilyPond music typesetter";
+ $PROJECT = "the GNU LilyPond music typesetter";
chop($cwd = `pwd`);
$PROJECT= "the Flower Library" if ($cwd =~ /flower/);
my $username=$pw[6];
$footstr =
- "\n<hr>
-<font size=-2>
+ "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
+<font size=-1>
This page was generated by <code>make_website</code> from lilypond-$lily_version by
<p>
<address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
<p>" . `date` . "
-<p></font>\n";
+<p></font>";
}
}
}
-sub set_hrefs
-{
- while (<HTMLIN>) {
- s#href=([A-Za-z.]+)#href=$base/$1#g;
- print HTMLOUT $_;
- }
-}
-
-sub all_refs
-{
- print "resetting refs.\n";
-
- foreach $a (<*.html>)
- {
- rename $a, "$a~";
- open HTMLIN, "$a~";
- open HTMLOUT, ">$a";
- set_hrefs;
- }
-}
local $base="lilypond/";
local @examples=("wohltemperirt" ,"standchen", "scsii-menuetto", "rhythm", "collisions");
}
close H;
-
-
- $file =~ s/$sep/$footstr$sep/g ;
+
+ my $subst = $footstr;
+ $subst .= $back if (! $a =~ /index.html/ );
+ $file =~ s/$sep/$subst$sep/g ;
open H, ">$a";
print H $mw_id;
(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
)
+$MAKE -f make/Toplevel.make.in Makefile
+
cat << END
Finished configuring. For making everything, do:
If you want to make site-wide extensions to the makefiles, please use
make/out/Site.make
+
+If you can't find a toplevel makefile, please execute
+
+ make -f make/Toplevel.make.in Makefile # GNU make, of course
END
(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh
)
+$MAKE -f make/Toplevel.make.in Makefile
+
cat << END
Finished configuring. For making everything, do:
If you want to make site-wide extensions to the makefiles, please use
make/out/Site.make
+
+If you can't find a toplevel makefile, please execute
+
+ make -f make/Toplevel.make.in Makefile # GNU make, of course
END
MAJOR_VERSION = 1
MINOR_VERSION = 1
-PATCH_LEVEL = 17
+PATCH_LEVEL = 18
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = # include separator: "-1" or ".a"
#
version 1.1:
+pl 18
+ - Path::find("/usr/..") fix
+ - Directed_graph_node
+ - some Link_array extensions
+ - Pointer_list::junk()
+
pl 17
- naming: Pointer->Link, IPointer->Pointer
pl 16
--- /dev/null
+/*
+ edge_out.cc -- implement Directed_graph_node
+
+ source file FlowerLib
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "directed-graph.hh"
+
+#ifdef PARANOID // these checks eat huge amounts of time.
+#define PARANOID_OK() OK()
+#else
+#define PARANOID_OK()
+#endif
+
+
+Link_array<Directed_graph_node> const &
+Directed_graph_node::get_in_edge_arr() const
+{
+ return edge_in_l_arr_;
+}
+
+Link_array<Directed_graph_node> const &
+Directed_graph_node::get_out_edge_arr()const
+{
+ return edge_out_l_arr_;
+}
+
+/**
+ Should not copy deps automatically
+ */
+Directed_graph_node::Directed_graph_node(Directed_graph_node const&)
+{
+}
+
+void
+Directed_graph_node::copy_edges_out(Directed_graph_node const &s)
+{
+ for(int i=0; i < s.edge_out_l_arr_.size(); i++)
+ add(s.edge_out_l_arr_[i]);
+}
+
+void
+Directed_graph_node::OK() const
+{
+#ifndef NDEBUG
+ for (int i=0; i < edge_out_l_arr_.size(); i++) {
+ assert(edge_out_l_arr_[i]->
+ edge_in_l_arr_.find_l(this));
+ }
+ for (int i=0; i < edge_in_l_arr_.size(); i++)
+ assert(edge_in_l_arr_[i]->contains_b( this));
+#endif
+}
+
+bool
+Directed_graph_node::contains_b(const Directed_graph_node *d)const
+{
+ return edge_out_l_arr_.find_l((Directed_graph_node*)d);
+}
+
+void
+Directed_graph_node::remove_edge_out_idx(int i)
+{
+ PARANOID_OK();
+ Directed_graph_node * d_l = edge_out_l_arr_.get(i);
+
+ int j = d_l->edge_in_l_arr_.find_i(this);
+ assert(j>=0);
+ d_l->edge_in_l_arr_.del(j);
+ PARANOID_OK();
+}
+
+void
+Directed_graph_node::remove_edge_in(Directed_graph_node *d_l)
+{
+ PARANOID_OK();
+ d_l->remove_edge_out(this);
+ PARANOID_OK();
+}
+
+void
+Directed_graph_node::remove_edge_out (Directed_graph_node *d_l)
+{
+ PARANOID_OK();
+ for (int i=0; i < edge_out_l_arr_.size(); ) {
+ if (edge_out_l_arr_[i]== d_l)
+ remove_edge_out_idx(i);
+ else
+ i++;
+ }
+ PARANOID_OK();
+}
+bool
+Directed_graph_node::linked_b()const
+{
+ return edge_out_l_arr_.size() || edge_in_l_arr_.size();
+}
+
+void
+Directed_graph_node::junk_links()
+{
+ edge_in_l_arr_.set_size(0);
+ edge_out_l_arr_.set_size(0);
+}
+
+
+void
+Directed_graph_node::unlink()
+{
+#ifdef PARANOID
+ PARANOID_OK();
+
+ Link_array<Directed_graph_node> t = edge_out_l_arr_;
+ t.concat(edge_in_l_arr_);
+#endif
+
+ while ( edge_out_l_arr_.size() )
+ remove_edge_out_idx(0);
+
+ while (edge_in_l_arr_.size() )
+ remove_edge_in(edge_in_l_arr_[0]);
+
+#ifdef PARANOID
+ for (int i =0; i < t.size(); i++)
+ t[i]->OK();
+#endif
+}
+
+Directed_graph_node::~Directed_graph_node()
+{
+ assert(!linked_b());
+}
+
+
+void
+Directed_graph_node::add(Directed_graph_node* dep_l)
+{
+ PARANOID_OK();
+ if (!dep_l)
+ return ;
+ dep_l->edge_in_l_arr_.push(this);
+ edge_out_l_arr_.push(dep_l);
+ PARANOID_OK();
+}
+
+
+Directed_graph_node::Directed_graph_node()
+{
+}
+
+++ /dev/null
-/*
- class-name.hh -- declare
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef CLASS_NAME_HH
-#define CLASS_NAME_HH
-
-/** a macro to declare the classes name as a static and virtual function.
- The static_name() can *not* be inlined (this might have the effect that
- s->name() != S::static_name(). Overlapping strings need not be merged in C++
- */
-#define NAME_MEMBERS(c) \
-static char const *static_name();\
-virtual char const *name() const{ return c::static_name(); } \
-int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
-
-#define IMPLEMENT_STATIC_NAME(c)\
- char const *c::static_name() { return #c; }
-
-#endif // CLASS-NAME_HH
--- /dev/null
+/*
+ edge_out.hh -- declare Directed_graph_node
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DEPENDENCY_HH
+#define DEPENDENCY_HH
+
+#include "parray.hh"
+
+/**
+ Class to handle two-sided connections between nodes (the Dependencies)
+ */
+class Directed_graph_node {
+ Link_array<Directed_graph_node>edge_out_l_arr_;
+ /// targets
+ Link_array<Directed_graph_node> edge_in_l_arr_;
+
+public:
+
+ /** remove i-th edge_out (and exactly one ref to me in the edge_out)
+ */
+ void remove_edge_out_idx(int i);
+ void copy_edges_out(Directed_graph_node const&);
+ bool linked_b() const;
+ void unlink();
+ void junk_links();
+ void add(Directed_graph_node*);
+ void remove_edge_in(Directed_graph_node *);
+ void remove_edge_out(Directed_graph_node*);
+ bool contains_b(Directed_graph_node const*) const;
+
+ Directed_graph_node(Directed_graph_node const &);
+ void OK()const;
+ Directed_graph_node();
+
+ ~Directed_graph_node();
+
+ /**
+ ensure that no edge_out exists doubly.
+ */
+ void uniq();
+ Link_array<Directed_graph_node> const& get_out_edge_arr() const;
+ Link_array<Directed_graph_node> const& get_in_edge_arr() const;
+};
+
+#endif // DEPENDENCY_HH
struct Choleski_decomposition;
struct Long_option_init;
+struct File_path;
+struct Directed_graph_node;
struct Getopt_long;
struct Matrix;
struct String_data;
Interval_t<T> &operator *=(T r) {
left *= r;
right *= r;
- if (r <0) {
+ if (r < T(0)) {
T t = left;
left = right;
right = t;
return "[empty]";
String s("[");
- return s + left + "," + right +"]";
+ return s + String( left ) + String( "," ) + String( right ) + String( "]" );
}
template<class T>
#include "varray.hh"
#include "real.hh"
-#include "class-name.hh"
+#include "virtual-methods.hh"
/**
+/*
+ matrix.hh -- declare Matrix
+
+ source file of the Flower Library
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
#ifndef MATRIX_HH
#define MATRIX_HH
-
#include "matrix-storage.hh"
#include "vector.hh"
an array of pointers.
TODO
- should init to 0.
+ should init to 0. Derive from Array<void*>?
*/
template<class T>
-class Link_array : public Array<T>
+class Link_array : public Array<T*>
{
+ static default_compare(T *const& p1, T *const&p2) {
+ /* can't do p1 -p2, since T might be an incomplete type */
+ if (p1 < p2)
+ return -1 ;
+ if (p2 < p1)
+ return 1;
+ return 0;
+ }
public:
- int find_i (T t) const{
+ void substitute(T *old, T*new_l)
+ {
+ int i;
+ while ((i = find_i(old)) >=0)
+ if (new_l)
+ elem(i) =new_l;
+ else
+ del(i);
+ }
+ void default_sort() {
+ sort(default_compare);
+ }
+ void uniq() {
+ Link_array<T> l_arr;
+ for (int i=0; i < size(); i++)
+ if (!i || elem(i-1) != elem(i))
+ l_arr.push(elem(i));
+ *this = l_arr;
+ }
+
+ int find_i (T const * t) const {
for (int i=0; i < size(); i++)
if (elem(i) == t)
return i;
return -1;
}
- T find_l(T t)const
+ T *find_l(T const *t)const
{
int i = find_i(t);
if (i >= 0)
/// locate a file in the search path
String find(String nm)const;
- /// construct using prefix. Normally argv[0].
- File_path(String);
-
/// add to end of path.
Array<String>::push;
void add(String str) { push(str); }
Link_list() {}
};
-/** Link_list which deletes pointers given to it.
+/**
+
+ Link_list which deletes pointers given to it.
+
NOTE:
The copy constructor doesn't do what you'd want:
Since T might have a virtual ctor, we don't try to do a
- new T(*cursor)
+ new T(**cursor)
You have to copy this yourself, or use the macro Link_list__copy
+ TODO
+ operator =()
*/
template<class T>
class Pointer_list : public Link_list<T> {
+
public:
+ void junk();
Pointer_list(Pointer_list const &) { set_empty(); }
Pointer_list() { }
- ~Pointer_list();
+ ~Pointer_list() { junk(); }
};
#define Pointer_list__copy(T, to, from, op) \
template class Pointer_list<a*>
template<class T>
-Pointer_list<T>::~Pointer_list()
+void
+Pointer_list<T>::junk()
{
PCursor<T> c( *this );
while (c.ok()) {
--- /dev/null
+/*
+ class-name.hh -- declare
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef CLASS_NAME_HH
+#define CLASS_NAME_HH
+
+/** a macro to declare the classes name as a static and virtual function.
+ The static_name() can *not* be inlined (this might have the effect that
+ s->name() != S::static_name(). Overlapping strings need not be merged in C++
+ */
+#define NAME_MEMBERS(c) \
+static char const *static_name();\
+virtual char const *name() const{ return c::static_name(); } \
+int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
+
+#define IMPLEMENT_STATIC_NAME(c)\
+ char const *c::static_name() { return #c; }
+
+#define VIRTUAL_COPY_CONS(T, R)\
+ virtual R *clone() const { return new T(*this); } \
+
+
+#endif // CLASS-NAME_HH
Real
Interval_t<Real>::infinity()
{
- return HUGE;
+ return HUGE_VAL;
}
}
}
-File_path::File_path(String pref)
-{
- add(".");
- add(pref);
-}
-
-
/** find a file.
It will search in the current dir, in the construction-arg, and
in any other added path, in this order.
File_path::find(String nm)const
{
- fdebug << "looking for " << nm ;
+ fdebug << "looking for " << nm << ": ";
if ( !nm.length_i() || ( nm == "-" ) )
return nm;
for (int i=0; i < size(); i++) {
String path = (*this)[i];
- path+= "/"+nm;
+ path+= String(path.length_i()? "/":"")+nm;
fdebug << path << "? ";
FILE *f = fopen(path, "r"); // ugh!
String
String_convert::pointer_str(void const *l)
{
- I64 i64 = (I64)l;
- return String_convert::i64_str(i64, "0x%0Lx");
+ char buffer[STRING_BUFFER_LEN];
+ snprintf(buffer, STRING_BUFFER_LEN, "%p", l ); // assume radix 10
+ return String(buffer);
}
\inputregister { Note_column_register }
\inputregister { Slur_register }
\inputregister { Voice_registers
- \inputregister { Notehead_register }
+ \inputregister { Note_head_register }
\inputregister { Tie_register }
}
}
}
"streepjes" = \table {
- "toplines" "\toplines{%}" -3\pt 9\pt 0\pt 0\pt
- "botlines" "\botlines{%}" -3\pt 9\pt 0\pt 0\pt
+ "toplines" "\toplines{%}" -1\pt 7\pt 0\pt 0\pt
+ "botlines" "\botlines{%}" -1\pt 7\pt 0\pt 0\pt
}
"bars" = \table {
\version "0.0.57";
-two_voice_steminvert = \melodic {
- < \multivoice
- { \octave c'; \stem 1;
- c d e f~ g2 g a }
- { \stem -1;
- g f e g ~ g2 g2 }
-
- >
-}
two_voice = \melodic {
< \multivoice
- { \octave c'; \stem -1;
- c d e f g2~ g a }
+ { \octave c'; \stem -1;\duration "last";
+ c4 d e f g2~ g4 a [c8 d e f] c2| }
{ \stem 1;
- g f e g ~ g2 g2 }
+ g4 f e g ~ g2 g2 c4 g4 g2 }
>
}
+two_voice_steminvert = \melodic {
+ < \multivoice
+ { \octave c'; \stem 1;
+% the f and g on 4th beat are exceptionally ugh.
+ c4 d e f g2 g4 a | }
+ { \stem -1;
+ g4 f e g g2 g2 }
+
+ >
+}
three_voice = \melodic {
< \multivoice
{ \stem 1;
- g f e f g a g2 }
+ g4 f e f g a g2 }
{ \hshift 1; \stem 1;
e2 e2 e2 e2 }
{ \stem -1;
- c d e d c d es }
+ c4 d e d c d es }
>
}
rests = \melodic {
< \multivoice
- { \stem 1;\duration "last";
- r8 r r r r r r r
+ { \stem 1;
+ | r8 r r r r r r r
[c' b a g] [f e d c]
}
{ \stem -1;
entered-by:
copyright:
- Tested Features: local key, key
+ Tested Features: local key, key, forced accidentals
EndMudelaHeader
%}
\version "0.0.57";
blah = \melodic{
- \duration 4;
+ \duration "last";
\meter 4/4;
\octave c';
- cis c cis cis |
+ \key bes es as;
+ [cis8 d e f] [e! a b cis'] |
+ es e f e a a' a a' |
+ \clef "bass"; \octave c; [es16 c' b a] [g f es d] [c d es d] [c Bes As G] |
+
+\clef "violin";
+ \key ;
+ cis4 c cis cis |
<cis dis eis fes ges> cis dis2 ~ |
\meter 2/4 ;
- dis dis ~ | c cis~ | c
+ dis4 dis ~ | c cis~ | c
}
\score{
melodicregs
\melodic{ %\octave ;
\partial 8;
+ \octave c';
\meter 4/4;
c8 |
%{
title: Das Wohltemperirte Clavier I, Fuga II (c-minor)
- description:
+ description: following Henle's Urtext
composer(s): JS Bach
entered-by: HWN
- copyright:Public Domain
+ corrected-by: Werner Lemberg (tested with pl 64; 1997-05-17)
+ copyright: Public Domain
+
+ Tested Features: stem direction, multivoice, forced accidentals.
+
+ Remarks: the stem direction algorithm is severely broken (look at the
+ bass dux) with pl64.
+
- Tested Features:stem direction, multivoice.
%}
\version "0.0.57";
-global = \melodic{
- \meter 4/4 ;
- \key bes es as;
-}
+ % should add \need{dutch.ini} for
+ % correct parsing of note names
+
+global =
+ \melodic {
+ \meter 4/4; % should be \meter C
+ \key bes es as;
+ }
-dux = \melodic {
- \clef "violin";
- \octave c' ;
- \duration \last ;
-
- \stem -1;
- r8
- [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
- [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
- [es c' b a] [ g f es d] [c8 es' d' c'] |
- [bes a bes c'] [fis g a fis] |
- g4 r16 [c d es] [f g as8~] [as16 d es f ]|
- [g a bes8(] [)bes16 es f g ] [as g f es] [d8 c'16 b]|
- c'4 r4 r8 [f' es' d']
- r8 [as g f] [g f16 es] [f8 d] |
- g4 r8 b [c' c'16 b] [c'8 g] |
-%% 10
- as4 r8 a [bes bes16 a] [bes8 f] |
- g4 r8 g [as as g f] | % should jump staff
- \octave c;
- r8 [as bes c'] r8 [as16 g] [as8 f8] |
- [bes8 c bes as ] [bes g f es] |
- [f des' c' bes ] [c' as g f] |
- [g8 %jump!
- \octave c';
- g16 fis] [g8 c] [es g16 fis] [g8 a] |
- [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
- 'bes8 r8 r16 [d e fis ] [g a bes8( ] [)bes16 e f g] |
- [a bes c'8(] [)c'16 fis16 g a ] [bes8 es16 d] [es8 'g] |
- ['as f16 e] [f8 'a8] ['bes g16 f] [g8 'b] |
-% 20
- [c16 f es d] [c Bes As G] [F8 as g f] |
- [es d es f] [B c d B] |
- c4 r8 e8 [f f16 e] [f8 c] |
- d4 r8 d8 [es8 es16 d] [es8 Bes] |
- c2 ~ [c8 d16 es][ f es f d] |
- B8 r8 r B c r r es |
- d r r f~ f r r f |
- [es as g f] [es d es f] |
- [B c d B] [B c] r c |
- [f16 d es c]~ [c8 B] c4 r8 e |
- f4 r8 <f8 as b> [f es16 d] [es8 <f a] > |
+dux =
+ \melodic {
+ \clef "violin";
+ \octave c';
+ \duration \last;
+ \stem -1;
+ r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
+ [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
+ [es c' b a] [g f! es d] [c8 es' d' c'] |
+ [bes a bes c'] [fis g a fis] |
+%% 5
+ g4 r16 [c d es] [f g as8~] [as16 d es f]|
+ [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b]|
+ c'4 r4 r8 [f' es' d']
+ r8 [as g f] [g f16 es] [f8 d] |
+ g4 r8 b [c' c'16 b] [c'8 g] |
+%% 10
+ as4 r8 a [bes bes16 a] [bes8 f] |
+ g4 r8 g [as as g f] |
+ \octave c; r8 [as bes c'] r8 [as16 g] [as8 f8] |
+ [bes8 c' bes as] [bes g f es] |
+ [f des' c' bes] [c' as g f] |
+%% 15
+ g8 \octave c'; [g16 fis] [g8 c] [es g16 fis] [g8 a] |
+% [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+ [d g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+ % wouldn't it be better if I can write
+ % `a' instead of `a!' here to get really
+ % an `a natural'? Processing this melody
+ % alone (only having `a') would yield a
+ % different result! (WL)
+%% I don't understand the complaint. The ! makes no difference in output. HWN
+
+ 'bes8 r8 r16 [d e fis] [g a bes8~] [bes16 e f g] |
+ [a bes c'8~] [c'16 fis16 g a] [bes8 es!16 d] [es8 'g] |
+ ['as f16 es] [f8 'a8] ['bes g16 f] [g8 'b] |
+%% 20
+ [c16 f es d] [c Bes! As G] [F8 as g f] |
+ [es d es f] [B c d B] |
+ c4 r8 e8 [f f16 e] [f8 c] |
+ d4 r8 d8 [es8 es16 d] [es8 Bes] |
+ c2 ~ [c8 d16 es][ f es f d] |
+%% 25
+ B8 r8 r B c r r es |
+ d r r f~ f r r f |
+ [es as g f] [es d es f] |
+ [B c d B] [B c] r c |
+ [f16 d es c]~ [c8 B] c4 r8 e |
+%% 30
+ f4 r8 f [f es16 d] [es8 <f as]> |
+% f4 r8 <f as b> [f es16 d] [es8 <f as]> |
+ % bug! if you say
+ % f4 r8 <f as b> ...
+ % the chord overlaps. WL
+%% confirmed. added to TODO. HWN
<B d> r <B d> r <G2 c> |
-}
+ }
+
-comes = \melodic {
- \octave c'' ;
- \stem 1;
- r1 |
- r1 |
- r8 [g16 fis] [g8 c] [es g16 f] [g8 a]|
- [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] |
- ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a]
- ['bes8 g16 f] [g8 'b] [c8 d16 es] f4( |
- [) f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f]
- [es d es f] ['b c d 'b] |
- [c g16 fis] [g8 d] es4 r8 e8 |
+comes =
+ \melodic {
+ \octave c'';
+ \stem 1;
+ r1 |
+ r1 |
+ r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] |
+ [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] |
+%% 5
+ ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a]
+ ['bes8 g16 f] [g8 'b] [c8 d16 es] f4~ |
+ [f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f]
+ [es d es f] ['b c d 'b] |
+ [c g16 fis] [g8 d] es4 r8 e8 |
%% 10
- [f f16 e] [f8 c8] d4 r8 d |
- [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] |
- ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] |
- [G16 Es F G] [As Bes c d] [es d c d] [es f g a] |
- [bes F G As] [Bes c d e] [f es d es] [ f g a b] |
- [c'8 b16 a] [g f e d] [c8 es d c] |
- [Bes A Bes c] [Fis G A Fis] |
- [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 |
- r [fis16 e] fis8 r r [G16 F] G8 r8 |
- r8 [A16 G] A8 r r [B16 A] B8 r |
+ [f f16 e] [f8 c8] d4 r8 d |
+ [es8 es16 d] [es8 'bes] [c es16 d] [es8 f] |
+ ['bes es16 d] [es8 f] ['as16 'bes] c4 ['bes16 'as] |
+ [G16 Es F G] [As Bes c d] [es d c d] [es f g a] |
+ [bes F G As] [Bes c d e] [f es d es] [ f g a b] |
+%% 15
+ [c'8 b16 a] [g f es d] [c8 es d c] |
+ [Bes A Bes c] [Fis! G A Fis] |
+ % see comment above about forced acc.
+ [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 |
+ r [fis16 e] fis8 r r [G16 F] G8 r8 |
+ r8 [A16 G] A8 r r [B16 A] B8 r |
%% 20
- r8 [c16 'b] [c8 'g] [As c16 'c] [c8 d] |
- [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
- [Es8 c16 B] [c8 G] As4 r8 A |
- [Bes8 Bes16 A] [Bes8 F8] g4 r8 G(|
- )[G As16 Bes] [c B c As] F2( |
- )[F8 d16 c] [d8 F] [Es es16 d] [es8 G] |
- [F f16 es] [f8 As] [G16 f es d] [c B A G] |
- [c8 f es d] r [As G f] |
- [G F16 Es] [F8 D] [As G] r A |
- [B c] [F16 Es D C] [C8 c16 B] [c8 G]|
- [As c16 B] [c8 d] [G8 c16 B] [c8 d] |
- [F16 G] As4 [G16 F] E2 |
-
-}
+ r8 [c16 'b] [c8 'g] [As c16 'b] [c8 d] |
+ [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
+ [Es8 c16 B] [c8 G] As4 r8 A |
+ [Bes8 Bes16 A] [Bes8 F8] 'g4 r8 G~ |
+ [G As16 Bes] [c B c As] F2~ |
+%% 25
+ [F8 d16 c] [d8 F] [Es es16 d] [es8 G] |
+ [F f16 es] [f8 As] [G16 f es d] [c B A G] |
+ [c8 f es d] r [As G F] |
+ [G F16 Es] [F8 D] [As G] r A |
+ [B c] [F16 Es D C] C8 [c16 B] [c8 G] |
+%% 30
+ [As c16 B] [c8 <d 'b! 'as!]> [G8 c16 B] [c8 d] |
+ [F16 G] As4 [G16 F] E2 |
+ }
+
+bassdux =
+ \melodic {
+ \clef "bass";
+
+ \octave c';
+ r1 |
+ r |
+ r |
+ r |
+%% 5
+ r |
+ r1 |
+ r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
+ [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
+ \octave c; [es c' b a] [g f es d] [c d es d] [c Bes! As! G] |
+ % I think we shouldn't need to force
+ % accidents here because they are in
+ % another octave range. WL
+
+%% I don't understand the complaint. Accidentals are valid for one octave range
+%% only. Without ! (and printed flat), this still is valid. HWN
-bassdux = \melodic {
- \clef "bass";
- \octave c' ;
- r1 |
- r |
- r |
- r |
- r |
- r1 |
- r8 [c16 B] [c8 G] [As c16 B] [c8 d] |
- [G c16 B] [c8 d] [F16 G] As4 [G16 F] |
- \octave c;
- [es c' b a] [g f es d] [c d es d] [c Bes As G] |
%% 10
- [F bes as g ] [f es d c] [Bes c d c ] [Bes As G F]|
- [Es as g f] [es des c Bes] [As8 c' bes as] |
- [g8 f g as] [d es f d] |
- [es as g f] [g es d c] |
- [d bes as g] [as f es d] |
- es8 r8 r4 r8 [c Bes A] |
- r [es d c] [d c16 Bes] [c8 d] |
- [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] |
- [f d'16 c'] [d'8 fis] g4 r16 [G A B] |
- [c16 d es8]~ [es16 A Bes c] [d es f8]~ [f16 'b c d]|
-%%20
- es8 r r e [f F Es D] |
- r [As G F] [G F16 Es] [F8 G] |
- [c16 d es d] [c Bes As G] [F bes as g] [f es d c] |
- [Bes c d c] [Bes As G F] [Es As g f ] [es d c Bes] |
- [As Bes c Bes] [As G F Es] [D g f es ] [d c B A] |
- g4 r4 r16 [G A B] [c d es f] |
- [g f as g] [f es d c] [B8 c16 B] [c8 G] |
- [As c16 B] [c8 d] [G c16 B] [c8 d] |
- [F16 G] As4 [G16 F] Es4 r8 es |
- [d c g G]
- < \multivoice
- { \stem 1; c2 ~ |c1~ | c1 }
- { \stem -1; C2~ |C1~ | C1 }
- >
+ [F bes as g] [f es d c] [Bes c d c] [Bes As G F] |
+ [Es as g f] [es des c Bes] [As8 c' bes as] |
+ [g8 f g as] [d es f d] |
+ [es as g f] [g es d c] |
+ [d bes as g] [as f es d!] |
+%% 15
+ es8 r8 r4 r8 [c Bes A] |
+ r [es d c] [d c16 Bes] [c8 d] |
+ [G8 bes16 a] [bes8 d] [es c'16 bes] [c'8 e] |
+ [f d'16 c'] [d'8 fis] g4 r16 [G A B] |
+ [c16 d es8~] [es16 A Bes c] [d es f8~] [f16 'b c d] |
+%% 20
+ es8 r r e [f F Es! D] | % see comment above about octave range
+ r [As G F] [G F16 Es] [F8 G] |
+ [c16 d es d] [c Bes As G] [F bes as g] [f es d c] |
+ [Bes c d c] [Bes As G F] [Es as g f] [es d c Bes] |
+ [As Bes c Bes] [As G F Es] [D g f es] [d c B A] |
+%% 25
+ g4 r4 r16 [G A B] [c d es f] |
+ [g f as g] [f es d c] [B8 c16 B] [c8 G] |
+ [As c16 B] [c8 d] [G c16 B] [c8 d] |
+ [F16 G] As4 [G16 F] Es4 r8 es |
+ [d c g G]
+%% 30
+ < \multivoice
+ { \stem 1; c2~ | c1~ | c1 }
+ { \stem -1; C2~ | C1~ | C1 }
+ >
+ }
-}
% every "melody" declared in a staff has its own "voicegroup"
-trebstaf = \staff{
- \inputregister{ melodicregs}
- global dux comes
-}
-
-\score{
- trebstaf
- \staff{ \inputregister{ melodicregs}
- bassdux global
- }
- \paper{}
- \midi{
- \tempo 4:84
- }
+trebstaf =
+ \staff {
+ \inputregister{melodicregs}
+ global dux comes
+ }
+
+
+\score {
+ trebstaf
+ \staff {
+ \inputregister{melodicregs}
+ global bassdux
+ }
+ \paper{}
+ \midi {
+ \tempo 4:84
+ }
}
+% EOF
+
+
for ( int i = 0; i < dur_array_s.size() - 1; i++ ) {
Moment lower_mom = dur2_mom( dur_array_s[ i ] );
if ( mom <= lower_mom ) {
- // all arbitrary, but 1/4 will get rid of the noise...
-// if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
-//kinda ok if ( i || ( mom / lower_mom > Moment( 2, 4 ) ) )
- if ( i || ( mom / lower_mom > Moment( 2, 6 ) ) )
+ // all arbitrary, but 3/4 will get rid of the noise...
+ // kinda ok
+ if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
return dur_array_s[ i ];
else
return Duration( 0 );
}
Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] );
+#if 0 // % deviation of upper/lower from mom, perhaps it's better to use
if ( ( mom < upper_mom )
&& ( ( mom - lower_mom ) / mom
< ( upper_mom - mom ) / mom ) )
+#else // % deviation of mom from lower/upper?
+ if ( ( mom < upper_mom )
+ && ( ( mom - lower_mom ) / lower_mom
+ < ( upper_mom - mom ) / upper_mom ) )
+#endif
return dur_array_s[ i ];
}
// return dur_array_s[ dur_array_s.length_i() ];
#include "fproto.hh"
#include "real.hh"
-
-struct Absolute_dynamic_req;
-struct Accidental;
-struct Atom;
-struct Bar;
-struct Bar_register;
-struct Barcheck_req;
-struct Bar_req;
-struct Beam;
-struct Beam_req;
-struct Blank_req;
-struct Box;
-struct Bracket_req;
-struct Cadenza_req;
-struct Chord;
-struct Clef_change_req;
-struct Clef_register;
-struct Clef_item;
-struct Col_hpositions;
-struct Colinfo;
-struct Complex_music;
-struct Complex_staff;
-struct Complex_walker;
-struct Crescendo ;
-struct Cresc_req;
-struct Directional_spanner;
-struct Decresc_req;
struct Duration;
struct Duration_iterator;
-struct Durational_req;
-struct Dynamic;
-struct Dynamic_req;
-struct Group_change_req;
-struct Group_feature_req;
-struct Idealspacing;
-struct Identifier;
-struct Input;
-struct Input_register;
-struct Input_file;
-struct Input_music;
-struct Input_score;
-struct Input_staff;
-struct Item;
-struct Key;
-struct Key_register;
-struct Key_change_req;
-struct Key_item;
-struct Keyword;
-struct Keyword_table;
-struct Lily_stream;
-struct Line_of_score;
-struct Line_of_staff;
-struct Linestaff;
-struct Local_key;
-struct Local_key_register;
-struct Local_key_item;
-struct Lookup;
-struct Lyric_item;
-struct Lyric_req;
-struct Melodic_req;
-struct Measure_grouping_req;
-struct Meter_change_req;
-struct Meter;
-struct Meter_register;
-struct Midi_def;
-struct Midi_duration;
-struct Midi_event;
-struct Midi_header;
-struct Midi_item;
-struct Midi_key;
-struct Midi_note;
-struct Midi_output;
-struct Midi_pitch;
-struct Midi_staff;
-struct Midi_stream;
-struct Midi_tempo;
-struct Midi_time;
-struct Midi_track;
-struct Midi_voice;
-struct Midi_walker;
-struct Mixed_qp;
-struct My_midi_lexer;
-struct My_midi_parser;
-struct Midi_event;
-struct Midi_score;
-struct Midi_track;
-struct Molecule;
-struct Musical_req;
-struct Music_general_chord;
-struct Music_voice;
-struct Command_req;
-struct Note_req;
-struct Notehead;
-struct Notehead_register;
-struct Offset;
-struct Output;
-struct PCol;
-struct Plet_req;
-struct Plet;
-struct PScore;
-struct PStaff;
-struct Paper_def;
-struct Partial_measure_req;
-struct Rational;
-struct Register_group_register;
-struct Request;
-struct Request_register;
-struct Rest;
-struct Rest_req;
-struct Rhythmic_grouping;
-struct Rhythmic_grouping_req;
-struct Rhythmic_req;
-struct Score;
-struct Score_column;
-struct Score_walker;
-struct Script_def;
-struct Script;
-struct Script_register;
-struct Script_req;
-struct Simple_music;
-struct Skip_req;
-struct Slur;
-struct Slur_register;
-struct Slur_req;
-struct Sources;
struct Source_file;
-struct Spacing_req ;
-struct Span_req;
-struct Span_dynamic_req;
-struct Spanner;
-struct Subtle_req;
-struct Staff;
-struct Staff_column;
-struct Staff_symbol;
-struct Staff_walker;
-struct Stem;
-struct Stem_req;
-struct Stem_beam_register;
-struct String;
-struct Symbol;
-struct Symtable;
-struct Symtables;
-struct Tex_stream;
-struct Terminate_voice_req;
-struct Text_item ;
-struct Text_def;
-struct Text_gob;
-struct Text_register;
-struct Text_req;
-struct Timing_req;
-struct Time_description;
-struct Track_column;
-struct Voice;
-struct Voice_element;
-struct Voice_group_registers;
-struct Voice_list;
-struct Voice_registers;
-struct Voicegroup;
-struct Walker_registers;
-typedef Rational Moment;
+struct Sources;
#endif // PROTO_HH
#ifndef SOURCE_HH
#define SOURCE_HH
-#include "source-file.hh"
#include "plist.hh"
-#include "path.hh"
class Sources
{
public:
Source_file * get_file_l( String &filename );
- Source_file* sourcefile_l( char const* ch_c_l );
+ Source_file* sourcefile_l( char const* ch_C );
void set_path(File_path*p_C);
Sources();
void set_binary(bool);
private:
const File_path * path_C_;
void add( Source_file* sourcefile_p );
- Pointer_list<Source_file*> sourcefile_p_iplist_;
+ Pointer_list<Source_file*> sourcefile_p_list_;
bool binary_b_ ;
};
/*
- source.cc -- implement Source
+ source.cc -- implement Sources
source file of the LilyPond music typesetter
#include "plist.hh"
#include "source-file.hh"
#include "source.hh"
+#include "path.hh"
void
Sources::set_path(File_path *f_C)
void
Sources::add( Source_file* sourcefile_p )
{
- sourcefile_p_iplist_.bottom().add( sourcefile_p );
+ sourcefile_p_list_.bottom().add( sourcefile_p );
}
/**
Source_file*
Sources::sourcefile_l( char const* ch_C )
{
- PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_iplist_.top() );
+ PCursor<Source_file*> sourcefile_l_pcur( sourcefile_p_list_.top() );
for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ )
if ( sourcefile_l_pcur->in_b( ch_C ) )
return *sourcefile_l_pcur;
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 64
+PATCH_LEVEL = 65
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
#
include Stable.make
include ./$(depth)/make/Variables.make
-include ./$(depth)/make/Files.make
include .version
#
#
default: $(EXECUTABLE)
#
+include ./$(depth)/make/Files.make
# generic targets and rules:
#
#
-# list of depend files:
-#
-DEPFILES = $(wildcard $(depdir)/*.dep)
-#
-
-# auto dependencies:
-#
--include /dev/null $(DEPFILES)
-#
-
localclean:
rm -f $(outdir)/parser.* $(outdir)/lexer.cc
stablecc=command-request.cc musical-request.cc bar.cc boxes.cc \
item.cc keyword.cc leastsquares.cc \
lookup.cc molecule.cc meter.cc\
- paper-def.cc parser.cc lexer.cc p-staff.cc qlp.cc qlpsolve.cc\
+ paper-def.cc parser.cc lexer.cc qlp.cc qlpsolve.cc\
template1.cc template2.cc template3.cc template4.cc\
template5.cc template6.cc version.cc tex-stream.cc tex.cc\
- voice.cc spanner.cc \
+ voice.cc \
voice-element.cc identifier.cc note.cc\
/*
bar-reg.cc -- implement Bar_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "bar-reg.hh"
#include "bar.hh"
#include "command-request.hh"
-//#include "score-column.hh"
#include "time-description.hh"
Bar_register::Bar_register()
/*
bar.cc -- implement Bar
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
beam.cc -- implement Beam
- source file of the LilyPond music typesetter
+ source file of the GNU GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
TODO
Less hairy code. Better slope calculations.
- knee ([\stem 1; c8 \stem -1; c8]
+ knee: ([\stem 1; c8 \stem -1; c8]
*/
assert(miny <= idealy);
}
+
/* *************** */
+void
+Beam::do_break_at(PCol*l, PCol*r)
+{
+ assert (l->line_l_ == r->line_l_);
+}
+
+
Offset
Beam::center()const
{
- assert(status >= POSTCALCED);
-
Real w=(paper()->note_width() + width().length())/2.0;
- return Offset(w, (left_pos + w* slope)*paper()->internote());
+ return Offset(w, (left_pos + w* slope)*paper()->internote_f());
}
void
Beam::add(Stem*s)
{
- stems.bottom().add(s);
+ stems.push(s);
s->add_dependency(this);
s->print_flag_b_ = false;
}
void
Beam::set_default_dir()
{
- int dirs[2];
- dirs[0]=0; dirs[1] =0;
- for (iter_top(stems,i); i.ok(); i++) {
- int d = i->get_default_dir();
- dirs[(d+1)/2] ++;
- }
- dir_i_ = (dirs[0] > dirs[1]) ? -1 : 1;
- for (iter_top(stems,i); i.ok(); i++) {
- i->dir_i_ = dir_i_;
+ int dirs_single = 0, dirs_chord = 0;
+ for (int i=0; i <stems.size(); i++) {
+ Stem *sl = stems[i];
+ if (sl->chord_b())
+ dirs_chord += sl->get_default_dir();
+ else
+ dirs_single += sl->get_center_distance();
}
+ dirs_single = -sign(dirs_single);
+ dir_i_ = (dirs_single + dirs_chord > 0) ? 1 : -1;
+
+ for (int i=0; i <stems.size(); i++) {
+ Stem *sl = stems[i];
+ sl->dir_i_ = dir_i_;
+ }
}
/*
Beam::solve_slope()
{
Array<Stem_info> sinfo;
- for (iter_top(stems,i); i.ok(); i++) {
+ for (int j=0; j <stems.size(); j++) {
+ Stem *i = stems[j];
+
i->set_default_extents();
if (i->invisible_b())
continue;
slope *= dir_i_;
// ugh
- Real sl = slope*paper()->internote();
+ Real sl = slope*paper()->internote_f();
paper()->lookup_l()->beam(sl, 20 PT);
- slope = sl /paper()->internote();
+ slope = sl /paper()->internote_f();
}
void
Beam::set_stemlens()
{
- iter_top(stems,s);
- Real x0 = s->hpos_f();
- for (; s.ok() ; s++) {
+ Real x0 = stems[0]->hpos_f();
+ for (int j=0; j <stems.size(); j++) {
+ Stem *s = stems[j];
+
Real x = s->hpos_f()-x0;
s->set_stemend(left_pos + slope * x);
}
Array<int> b;
{
- iter_top(stems,s);
Array<int> flags;
- for (; s.ok(); s++) {
+ for (int j=0; j <stems.size(); j++) {
+ Stem *s = stems[j];
+
int f = intlog2(abs(s->flag_i_))-2;
assert(f>0);
flags.push(f);
assert(stems.size() == b.size()/2);
}
- iter_top(stems,s);
- for (int i=0; i < b.size() && s.ok(); i+=2, s++) {
+ for (int j=0, i=0; i < b.size() && j <stems.size(); i+= 2, j++) {
+ Stem *s = stems[j];
s->beams_left_i_ = b[i];
s->beams_right_i_ = b[i+1];
}
}
-
-// todo.
-Spanner *
-Beam::do_break_at( PCol *, PCol *) const
-{
- Beam *beam_p= new Beam(*this);
-
- return beam_p;
-}
-
void
Beam::do_pre_processing()
{
- left_col_l_ = (*stems.top()) ->pcol_l_;
- right_col_l_ = (*stems.bottom())->pcol_l_;
+ left_col_l_ = stems[0] ->pcol_l_;
+ right_col_l_ = stems.top()->pcol_l_;
assert(stems.size()>1);
if (!dir_i_)
set_default_dir();
Interval
Beam::do_width() const
{
- Beam * me = (Beam*) this; // ugh
- return Interval( (*me->stems.top()) ->hpos_f(),
- (*me->stems.bottom()) ->hpos_f() );
+ return Interval( stems[0]->hpos_f(),
+ stems.top()->hpos_f() );
}
/*
{
assert( !next || next->hpos_f() > here->hpos_f() );
assert( !prev || prev->hpos_f() < here->hpos_f() );
- Real dy=paper()->internote()*2;
+ Real dy=paper()->internote_f()*2;
Real stemdx = paper()->rule_thickness();
- Real sl = slope*paper()->internote();
+ Real sl = slope*paper()->internote_f();
paper()->lookup_l()->beam(sl, 20 PT);
Molecule leftbeams;
Beam::brew_molecule_p() const
{
Molecule *out=0;
- Real inter=paper()->internote();
+ Real inter=paper()->internote_f();
out = new Molecule;
- Real x0 = stems.top()->hpos_f();
-
- for (iter_top(stems,i); i.ok(); i++) {
- PCursor<Stem*> p(i-1);
- PCursor<Stem*> n(i+1);
- Stem * prev = p.ok() ? p.ptr() : 0;
- Stem * next = n.ok() ? n.ptr() : 0;
+ Real x0 = stems[0]->hpos_f();
+ for (int j=0; j <stems.size(); j++) {
+ Stem *i = stems[j];
+ Stem * prev = (j > 0)? stems[j-1] : 0;
+ Stem * next = (j < stems.size()-1) ? stems[j+1] :0;
Molecule sb = stem_beams(i, next, prev);
Real x = i->hpos_f()-x0;
#endif
}
-Beam::~Beam()
+void
+Beam::do_substitute_dependency(Score_elem*o,Score_elem*n)
{
-
+ int i;
+ while ((i=stems.find_i((Stem*)o->item())) >=0)
+ if (n) stems[i] = (Stem*) n->item();
+ else stems.del(i);
}
/*
bow.cc -- implement Bow
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
Real w = width().length();
- return Offset(w/2,dy * paper()->internote());
+ return Offset(w/2,dy * paper()->internote_f());
}
+
Molecule*
Bow::brew_molecule_p() const
{
int dy = right_pos_i_ - left_pos_i_;
Real nw_f = paper()->note_width();
- Real nh_f = paper()->internote();
+ Real nh_f = paper()->internote_f();
w+= (right_dx_f_ - left_dx_f_) * nw_f ;
/*
break.cc -- implement Break_algorithm
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "debug.hh"
#include "scoreline.hh"
#include "p-score.hh"
-
+#include "p-col.hh"
/// return all breakable columns
Line_of_cols
/*
calcideal.cc -- implement Score::calc_idealspacing()
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
clef-item.cc -- implement Clef_item
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
t += "_change";
Symbol s = paper()->lookup_l()->clef(t);
Molecule*output = new Molecule(Atom(s));
- output->translate(Offset(0, paper()->internote() * y_off));
+ output->translate(Offset(0, paper()->internote_f() * y_off));
return output;
}
/*
clef.cc -- implement Clef_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>,
Mats Bengtsson <matsb@s3.kth.se>
/*
collision-reg.cc -- implement Collision_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
collision.cc -- implement Collision
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "debug.hh"
#include "collision.hh"
#include "note-column.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "paper-def.hh"
Collision::Collision()
clash_l_arr_.push(ncol_l);
add_dependency(ncol_l);
}
-
+/**
+ should derive of Array.
+ */
static
int idx(int dir, bool h_shift_b)
{
// y_extent: smallest y-pos noteball interval containing all balls
// 4 (0..3) groups: stem up/down; shift on/off;
- Interval_t<int> middle( y_extent[0].min(), y_extent[3].max());
- Interval_t<int> open_middle( y_extent[3].max()+1, y_extent[0].min()-1);
+ Interval_t<int> middle( y_extent[idx(-1,0)].max(),
+ y_extent[idx(1,0)].min() );
+ Interval_t<int> open_middle( y_extent[idx(-1,0)].max()+1, y_extent[idx(1,0)].min()-1);
do{
if (!open_middle.contains_b(y_extent[idx(d,true)]))
x_off[idx(d, true)] = d *1.0 ;
} while ((d *= -1) != 1);
- if (!middle.empty_b() &&
- middle.length() <= 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {
+ if (!middle.empty_b()
+ && middle.length() < 2 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {
// reproduction of bugfix at 3am ?
- Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
- Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
- if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_)) {
+ Note_head * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
+ Note_head * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
+ if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_ && middle.length() == 0 )) {
x_off[idx(1,0)] -= 0.5;
- x_off[1] -= 0.5;
- x_off[2] += 0.5;
+ x_off[idx(1,1)] -= 0.5;
+ x_off[idx(-1,1)] += 0.5;
x_off[idx(-1,0)] += 0.5;
}
+
}
- Real inter_f = paper()->internote();
+ Real inter_f = paper()->internote_f();
Real wid_f = paper()->note_width();
for (int j=0; j < 4; j++) {
if (col_l_a[j])
}
IMPLEMENT_STATIC_NAME(Collision);
+
+void
+Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l)
+{
+ clash_l_arr_.substitute((Note_column*)o_l->item(),
+ (Note_column*)(n_l?n_l->item():0));
+}
/*
commandrequest.cc -- implement Nonmusical reqs
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+++ /dev/null
-#include "complex-staff.hh"
-#include "complex-walker.hh"
-#include "p-score.hh"
-
-/** Aside from putting fields right
- */
-void
-Complex_staff::set_output(PScore* pscore_l )
-{
- pstaff_l_ = new PStaff(pscore_l);
- pscore_l_ = pscore_l;
- pscore_l_->add(pstaff_l_);
-}
-
-
-Staff_walker *
-Complex_staff::get_walker_p()
-{
- return new Complex_walker(this);
-}
/*
complex-walker.cc -- implement Complex_walker
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+#include "score.hh"
#include "staff-column.hh"
#include "voice.hh"
#include "p-score.hh"
-#include "complex-staff.hh"
#include "debug.hh"
#include "complex-walker.hh"
#include "walk-regs.hh"
+#include "score-elem.hh"
+#include "staff.hh"
+#include "staffline.hh"
void
Complex_walker::do_post_move()
{
if (!elem_p)
return;
+ staff_l_->staff_line_l_->add_element(elem_p);
if (elem_p->spanner())
- pscore_l_->typeset_spanner(elem_p->spanner(), staff()->pstaff_l_);
+ pscore_l_->typeset_unbroken_spanner(elem_p->spanner());
else
ptr()->typeset_musical_item(elem_p->item());
}
-Complex_walker::Complex_walker(Complex_staff*s)
- : Staff_walker(s, s->pstaff_l_->pscore_l_)
+Complex_walker::Complex_walker(Staff*s)
+ : Staff_walker(s, s->score_l_->pscore_p_)
{
walk_regs_p_ = new Walker_registers(this);
do_post_move();
Complex_walker::~Complex_walker()
{
-}
-
-Complex_staff*
-Complex_walker::staff()
-{
- return (Complex_staff*) staff_l_;
+ delete walk_regs_p_;
}
/*
crescendo.cc -- implement Crescendo
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "dimen.hh"
#include "crescendo.hh"
#include "lookup.hh"
#include "debug.hh"
Crescendo::Crescendo()
- : Staff_side(this)
{
grow_dir_i_ =0;
dir_i_ = -1 ;
left_dyn_b_ = right_dyn_b_ =false;
}
-Spanner*
-Crescendo::do_break_at(PCol*, PCol*)const
-{
- return new Crescendo(*this);
-}
Molecule*
}
if (w_dim < 0) {
- error("Crescendo too small");
+ warning("Crescendo too small");
w_dim = 0;
}
Real lookup_wid = w_dim * 0.9; // make it slightly smaller.
m_p->add(Atom(s));
int pos = get_position_i(s.dim.y);
m_p->translate(Offset(x_off_dim + 0.05 * w_dim,
- pos * paper()->internote()));
+ pos * paper()->internote_f()));
return m_p;
}
String
print_dimen(Real r)
{
- String s(r);
+ String s(r, "%.3f");
s += "pt ";
return s;
}
/*
dynamic-reg.cc -- implement Dynamic_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
--- /dev/null
+/*
+ elem-group.cc -- implement Element_group
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "elem-group.hh"
+#include "interval.hh"
+#include "item.hh"
+#include "debug.hh"
+
+Interval
+Element_group::do_height()const
+{
+ Interval r;
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ r.unite(elem_l_arr_[i]->height());
+ return r;
+}
+
+Interval
+Element_group::do_width()const
+{
+ Interval r;
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ if (elem_l_arr_[i]->item()) // makes no at preprocessing for spanners.
+ r.unite(elem_l_arr_[i]->width());
+ return r;
+}
+
+void
+Element_group::add_element(Score_elem*i_l)
+{
+ i_l->group_element_i_ ++;
+
+ assert(! elem_l_arr_.find_l(i_l));
+ elem_l_arr_.push(i_l);
+ add_dependency(i_l);
+}
+
+void
+Element_group::translate(Offset o)
+{
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ elem_l_arr_[i]->translate(o);
+}
+
+IMPLEMENT_STATIC_NAME(Element_group);
+
+void
+Element_group::do_print() const
+{
+#ifndef NPRINT
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ mtor << elem_l_arr_[i]->name() << ' ';
+#endif
+}
+
+void
+Element_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+{
+ int i;
+
+ while ((i=elem_l_arr_.find_i(old))>=0) {
+
+ old->group_element_i_--;
+ if (new_l){
+ new_l->group_element_i_ ++;
+ elem_l_arr_[i] = new_l;
+ }else {
+ elem_l_arr_.del(i);
+ }
+ }
+
+}
+
+String
+Element_group::TeX_string()const
+{
+ return "";
+}
+
+Element_group::Element_group(Element_group const&s)
+ :elem_l_arr_(s.elem_l_arr_)
+{
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ elem_l_arr_[i]->group_element_i_ ++;
+}
+
+Element_group::Element_group()
+{}
/*
global-regs.cc -- implement
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
grouping.cc -- implement Rhythmic_grouping
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- headreg.cc -- part of LilyPond
+ headreg.cc -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "notehead.hh"
+#include "note-head.hh"
#include "head-reg.hh"
#include "paper-def.hh"
#include "complex-walker.hh"
#include "musical-request.hh"
-Notehead_register::Notehead_register()
+Note_head_register::Note_head_register()
{
note_p_ = 0;
post_move_processing();
}
bool
-Notehead_register::try_request(Request *req_l)
+Note_head_register::try_request(Request *req_l)
{
if (req_l->note() || req_l->rest())
note_req_l_=req_l->rhythmic();
}
void
-Notehead_register::process_requests()
+Note_head_register::process_requests()
{
if (!note_req_l_)
return;
- Notehead*n_p = new Notehead(8); // ugh
+ Note_head*n_p = new Note_head(8); // ugh
note_p_ = n_p;
n_p->set_rhythmic(note_req_l_->rhythmic());
if (note_req_l_->rhythmic()->duration_.type_i_ <= 2)
note_p_->translate(
Offset(0,
- 6 * paper()->internote()));
+ 6 * paper()->internote_f()));
}
Score_elem_info itinf(note_p_,note_req_l_);
}
void
-Notehead_register::pre_move_processing()
+Note_head_register::pre_move_processing()
{
if (note_p_) {
typeset_element(note_p_);
}
}
void
-Notehead_register::post_move_processing()
+Note_head_register::post_move_processing()
{
note_req_l_ = 0;
}
-IMPLEMENT_STATIC_NAME(Notehead_register);
-ADD_THIS_REGISTER(Notehead_register);
+IMPLEMENT_STATIC_NAME(Note_head_register);
+ADD_THIS_REGISTER(Note_head_register);
#include "idealspacing.hh"
#include "p-col.hh"
#include "p-score.hh"
-#include "p-staff.hh"
#include "debug.hh"
void
#ifndef NPRINT
mtor << "idealspacing {" ;
mtor << "distance "<<space<< " strength " << hooke ;
- mtor << "left " << left->rank() << " right " << right->rank() << "}\n";
+ mtor << "left " << left->rank_i() << " right " << right->rank_i() << "}\n";
#endif
}
/*
identifier.cc -- implement identifier and derived classes
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
bar-reg.hh -- declare Bar_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- bar.hh -- part of LilyPond
+ bar.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- beam.hh -- part of LilyPond
+ beam.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef BEAM_HH
#define BEAM_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "directional-spanner.hh"
#include "plist.hh"
/** a beam connects multiple stems Beam adjusts the stems its owns to
make sure that they reach the beam and that point in the correct
direction */
-struct Beam: public Directional_spanner {
- Link_list<Stem*> stems;
+class Beam: public Directional_spanner {
+public:
+ Link_array<Stem> stems;
/// the slope of the beam in posns / point (dimension)
Real slope;
/* *************** */
-NAME_MEMBERS(Beam);
-
- virtual Interval do_width()const;
- Offset center() const;
- Spanner *do_break_at(PCol *, PCol *) const;
+ NAME_MEMBERS(Beam);
Beam();
void add(Stem*);
- void set_default_dir();
- void do_pre_processing();
- void do_post_processing();
-
- void do_print() const;
void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
void set_stemlens();
- ~Beam();
+ SPANNER_CLONE(Beam)
+protected:
+ virtual Interval do_width()const;
+ virtual Offset center() const;
+ virtual void do_break_at(PCol *, PCol *);
+ virtual void set_default_dir();
+ virtual void do_pre_processing();
+ virtual void do_post_processing();
+ virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+
+ virtual void do_print() const;
private:
Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
/*
bow.hh -- declare Bow
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "directional-spanner.hh"
/**
- base class for anything that looks like a slur.
+ Base class for anything that looks like a slur.
+ Anybody with a better name?
*/
class Bow : public Directional_spanner {
protected:
/*
break.hh -- declare Break_algorithm
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef BREAK_HH
#define BREAK_HH
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "colhpos.hh"
/** Class representation of an algorithm which decides where to put
/*
- clef.hh -- part of LilyPond
+ clef.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- colhpos.hh -- part of LilyPond
+ colhpos.hh -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef COLHPOS_HH
#define COLHPOS_HH
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
typedef Array<PCol*> Line_of_cols;
/*
collision-reg.hh -- declare Collision_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
collision.hh -- declare Collision
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
*/
class Collision : public Item {
protected:
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_pre_processing();
public:
- Array<Note_column*> clash_l_arr_;
+ Link_array<Note_column> clash_l_arr_;
NAME_MEMBERS(Collision);
void add (Note_column*ncol_l);
Collision();
/*
command-request.hh -- declare Non musical requests
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+++ /dev/null
-/*
- complex-staff.hh -- declare Complex_staff
-
- (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef COMPLEXSTAF_HH
-#define COMPLEXSTAF_HH
-
-
-#include "key.hh"
-#include "staff.hh"
-#include "staff-walker.hh"
-
-///
-struct Complex_staff : Staff {
-
- /* *************** */
-
- virtual void set_output(PScore *);
- virtual Staff_walker *get_walker_p();
-};
-
-#endif // COMPLEXSTAF_HH
-
#ifndef COMPLEXWALKER_HH
#define COMPLEXWALKER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "staff-walker.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
/**
A staff walker which uses registers to decide what to print
virtual void do_post_move();
virtual void do_pre_move();
- Complex_walker(Complex_staff*);
+ Complex_walker(Staff*);
~Complex_walker();
- Complex_staff *staff();
private:
};
/*
crescendo.hh -- declare Crescendo
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
The hairpin symbol. (cresc)
*/
class Crescendo : public Spanner , public Staff_side {
-
public:
int grow_dir_i_;
/// if there is a dynamic at the end, make the sign smaller.
bool left_dyn_b_;
Crescendo();
-private:
- Spanner* do_break_at( PCol*, PCol*) const;
- Molecule*brew_molecule_p()const;
+protected:
+ SPANNER_CLONE(Crescendo)
+ virtual Molecule*brew_molecule_p()const;
NAME_MEMBERS(Crescendo);
+
+private:
+
};
#endif // CRESCENDO_HH
#include <iostream.h>
#include "dstream.hh"
#include "real.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "warn.hh"
void error_t(const String& s, Time_description const & t_tdes);
/*
- directional-spanner.hh -- part of LilyPond
+ directional-spanner.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#include "spanner.hh"
/// a spanner which can be pointing "up" or "down"
-struct Directional_spanner : Spanner{
+class Directional_spanner : public Spanner{
+public:
/// -1 below heads, +1 above heads.
int dir_i_;
-
+ Directional_spanner();
+
/// offset of "center" relative to left-column/0-pos of staff
virtual Offset center() const=0;
virtual void set_default_dir();
+protected:
virtual void do_pre_processing();
- Directional_spanner();
-
};
#endif // DIRECTIONALSPANNER_HH
/*
dynamic-reg.hh -- declare Dynamic_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
--- /dev/null
+/*
+ elem-group.hh -- declare Element_group
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ELEM_GROUP_HH
+#define ELEM_GROUP_HH
+#include "score-elem.hh"
+
+/** A class to treat a group of elements as a single entity. The
+ dimensions are the unions of the dimensions of what it contains.
+ Translation means translating the contents.
+ */
+class Element_group : virtual Score_elem{
+protected:
+ Link_array<Score_elem> elem_l_arr_;
+ virtual void do_substitute_dependency(Score_elem* old, Score_elem* new_l);
+ virtual Interval do_height()const;
+ virtual Interval do_width()const;
+ virtual void do_print() const ;
+ virtual Element_group* elem_group() { return this; }
+
+
+public:
+ Element_group();
+ Element_group(Element_group const&);
+ NAME_MEMBERS(Element_group);
+ virtual void translate(Offset);
+ virtual void add_element(Score_elem*);
+ virtual String TeX_string()const;
+};
+
+#endif // ELEM_GROUP_HH
#include <math.h>
#include "real.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "const.hh"
#endif
/*
- grouping.hh -- part of LilyPond
+ grouping.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- headreg.hh -- part of LilyPond
+ headreg.hh -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#define HEADREG_HH
#include "register.hh"
-struct Notehead_register : Request_register {
- Notehead* note_p_;
+struct Note_head_register : Request_register {
+ Note_head* note_p_;
Rhythmic_req * note_req_l_;
/* *************** */
- Notehead_register();
+ Note_head_register();
virtual bool try_request(Request *req_l) ;
virtual void process_requests();
virtual void pre_move_processing();
virtual void post_move_processing();
- NAME_MEMBERS(Notehead_register);
+ NAME_MEMBERS(Note_head_register);
};
/*
- idealspacing.hh -- part of LilyPond
+ idealspacing.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef IDEALSPACING_HH
#define IDEALSPACING_HH
-#include "proto.hh"
+#include "lily-proto.hh"
/// ideal spacing between two columns
struct Idealspacing {
/*
- identifier.hh -- part of LilyPond
+ identifier.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef IDENTIFIER_HH
#define IDENTIFIER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "string.hh"
#include "input.hh"
/*
- input-music.hh -- part of LilyPond
+ input-music.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#define INPUTMUSIC_HH
#include "plist.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "voice.hh"
#include "moment.hh"
/*
input-register.hh -- declare Input_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "plist.hh"
#include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "input.hh"
struct Input_register : Input {
/*
- input-score.hh -- declare
+ input-score.hh -- declare Input_score
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#define INPUTSCORE_HH
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "plist.hh"
#include "string.hh"
#include "input.hh"
#include "string.hh"
#include "plist.hh"
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "input.hh"
class Input_staff:public Input {
/*
item.hh -- declare Item
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "glob.hh"
#include "boxes.hh"
#include "string.hh"
-#include "staff-elem.hh"
+#include "score-elem.hh"
/**
a horizontally fixed size element of the score
/// indirection to the column it is in
PCol * pcol_l_;
- /* *************** */
virtual Item *item() { return this; }
Item();
- void do_print()const;
Real hpos_f() const;
NAME_MEMBERS(Item);
- /**
-
- @return the line where this is in;
-
- PRE
- Breaking calc has to be finished
- */
- Line_of_score * line_l() const;
+ virtual Line_of_score * line_l() const;
+protected:
+ virtual void do_print()const;
+
};
+
#endif
/*
- key-item.hh -- part of LilyPond
+ key-item.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
key-reg.hh -- declare Key_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- keyword.hh -- part of LilyPond
+ keyword.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- leastsquare.hh -- part of LilyPond
+ leastsquare.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
lily-proto.hh -- declare class names.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
#ifndef LILY_PROTO_HH
#define LILY_PROTO_HH
#include "proto.hh"
-struct My_lily_lexer;
-struct My_lily_parser;
-struct Notename_table;
+struct My_lily_lexer;
struct Absolute_dynamic_req;
-struct Barcheck_req;
+struct Accidental;
+struct Atom;
+struct Bar;
+struct Bar_register;
struct Bar_req;
+struct Barcheck_req;
+struct Beam;
struct Beam_req;
struct Blank_req;
+struct Box;
struct Bracket_req;
struct Cadenza_req;
+struct Chord;
struct Clef_change_req;
+struct Clef_item;
+struct Clef_register;
+struct Col_hpositions;
+struct Colinfo;
+struct Collision;
+struct Collision_register;
+struct Command_req;
+struct Complex_music;
+struct Complex_walker;
struct Cresc_req;
+struct Crescendo ;
struct Decresc_req;
+struct Directional_spanner;
struct Durational_req;
+struct Dynamic;
struct Dynamic_req;
-struct Group_change_req;
+struct Element_group;
struct Feature;
+struct Group_change_req;
struct Group_feature_req;
+struct Idealspacing;
+struct Identifier;
+struct Input;
+struct Input_file;
+struct Input_music;
+struct Input_register;
+struct Input_score;
+struct Input_staff;
+struct Item;
+struct Key;
struct Key_change_req;
+struct Key_item;
+struct Key_register;
+struct Keyword;
+struct Keyword_table;
+struct Lily_stream;
+struct Line_of_score;
+struct Line_of_staff;
+struct Linestaff;
+struct Local_key;
+struct Local_key_item;
+struct Local_key_register;
+struct Lookup;
+struct Lyric_item;
struct Lyric_req;
-struct Melodic_req;
struct Measure_grouping_req;
+struct Melodic_req;
+struct Meter;
struct Meter_change_req;
+struct Meter_register;
+struct Midi_def;
+struct Midi_duration;
+struct Midi_header;
+struct Midi_item;
+struct Midi_output;
+struct Midi_pitch;
+struct Midi_score;
+struct Midi_staff;
+struct Midi_stream;
+struct Midi_track;
+struct Midi_walker;
+struct Mixed_qp;
+struct Molecule;
+struct Music_general_chord;
+struct Music_voice;
struct Musical_req;
-struct Command_req;
-struct Collision_register;
-struct Collision;
+struct My_lily_parser;
+struct Note_column;
+struct Note_column_register;
struct Note_req;
-struct Pulk_voices;
-struct Pulk_voice;
-struct Plet_req;
+struct Note_head;
+struct Note_head_register;
+struct Notename_table;
+struct Offset;
+struct Output;
+struct PCol;
+struct PScore;
+struct Paper_def;
struct Partial_measure_req;
+struct Plet;
+struct Plet_req;
+struct Pulk_voice;
+struct Pulk_voices;
+struct Rational;
+struct Register_group_register;
+struct Request;
struct Request_column;
+struct Request_register;
+struct Rest;
+struct Rest_collision;
+struct Rest_collision_register;
+struct Rest_column;
struct Rest_req;
+struct Rhythmic_grouping;
struct Rhythmic_grouping_req;
struct Rhythmic_req;
+struct Score;
+struct Score_column;
struct Score_elem;
struct Score_elem_info;
+struct Score_walker;
+struct Script;
+struct Script_column;
+struct Script_def;
+struct Script_register;
struct Script_req;
+struct Simple_music;
struct Skip_req;
+struct Slur;
+struct Slur_register;
struct Slur_req;
struct Spacing_req ;
-struct Span_req;
struct Span_dynamic_req;
-struct Subtle_req;
+struct Span_req;
+struct Spanner;
+struct Staff;
+struct Staff_column;
+struct Staff_side;
+struct Staff_symbol;
+struct Staff_walker;
+struct Stem;
+struct Stem_beam_register;
struct Stem_req;
-struct Tie_req;
-struct Tie;
-struct Tie_register;
+struct String;
+struct Subtle_req;
+struct Symbol;
+struct Symtable;
+struct Symtables;
+struct Super_elem;
struct Terminate_voice_req;
+struct Tex_stream;
+struct Text_def;
+struct Text_gob;
+struct Text_item ;
+struct Text_register;
struct Text_req;
+struct Tie;
+struct Tie_register;
+struct Tie_req;
+struct Time_description;
struct Timing_req;
-struct Note_column_register;
-struct Note_column;
-struct Staff_side;
-struct Staff_symbol;
-struct Script_column;
-struct Rest_column;
-struct Rest_collision_register;
-struct Rest_collision;
-struct Vertical_spanner;
struct Vertical_brace;
+struct Vertical_spanner;
+struct Voice;
+struct Voice_element;
+struct Voice_group_registers;
+struct Voice_list;
+struct Voice_registers;
+struct Voicegroup;
+struct Walker_registers;
+typedef Rational Moment;
#endif // LILY_PROTO_HH
/*
linespace.hh -- declare Colinfo, Spacing_problem
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- local-key-item.hh -- part of LilyPond
+ local-key-item.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/**
Accidentals which can be different for each octave.
+
+ TODO:
+ update item if Items are removed
*/
struct Local_key_item : Item {
NAME_MEMBERS(Local_key_item);
Array<Local_acc> accs;
- Array<Item*> support_items_;
+ Link_array<Item> support_items_;
int c0_position;
/* *************** */
void add(Item*);
void add(int oct, int pitch, int acc);
void add(Melodic_req*);
- void do_pre_processing();
- Molecule* brew_molecule_p()const;
+public:
+ virtual void do_pre_processing();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual Molecule* brew_molecule_p()const;
};
#endif // LOCALKEYITEM_HH
Key const *key_C_;
Array<Note_req* > mel_l_arr_;
Array<Item* > support_l_arr_;
- Link_array<Item * > forced_l_arr_;
- Link_array<Item *> tied_l_arr_;
+ Link_array<Item > forced_l_arr_;
+ Link_array<Item > tied_l_arr_;
/* *************** */
virtual void process_requests();
virtual void acknowledge_element(Score_elem_info);
/*
- lilypond, (c) 1996,97 Han-Wen Nienhuys
+ lookup.hh -- declare Lookup
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#ifndef LOOKUPSYMS_HH
#define LOOKUPSYMS_HH
/* *************** */
void add(String, Symtable*);
void print()const;
- Real internote()const;
+ Real internote_f()const;
Symbol linestaff(int n, Real w)const;
Symbol fill(Box b)const;
/*
- lyric-register.hh -- declare
+ lyric-register.hh -- declare Lyric_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "register.hh"
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
+
class Lyric_register : public Request_register {
Array<Lyric_req*> lreq_arr_;
virtual bool acceptable_request_b(Request*);
#ifndef MAIN_HH
#define MAIN_HH
-#include "proto.hh"
+#include "lily-proto.hh"
void debug_init();
void set_debug(bool);
/*
meter-reg.hh -- declare Meter_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- midi-def.hh -- declare
+ midi-def.hh -- declare Midi_def
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
#ifndef MIDIDEF_HH
#define MIDIDEF_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "real.hh"
#include "string.hh"
#include "moment.hh"
//
-// midiitem.hh -- part of LilyPond
+// midiitem.hh -- part of GNU LilyPond
//
// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
#ifndef MIDI_ITEM_HH
#define MIDI_ITEM_HH
#include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
struct Midi_item {
/* *************** */
/*
midioutput.hh -- declare Midi_output
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
//
-// midistream.hh -- part of LilyPond
+// midistream.hh -- part of GNU LilyPond
//
// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
#ifndef MIDIWALKER_HH
#define MIDIWALKER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "grouping.hh"
#include "staff-walker.hh"
#include "pcursor.hh"
#ifndef MISC_HH
#define MISC_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "real.hh"
#include "moment.hh"
#include "scalar.hh"
#ifndef MOLECULE_HH
#define MOLECULE_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "plist.hh"
#include "boxes.hh"
#include "symbol.hh"
void print() const;
- String TeXstring() const;
+ String TeX_string() const;
};
/// how big is #this#?
Box extent() const;
- String TeXstring() const;
+ String TeX_string() const;
Molecule(const Molecule&s);
void print() const;
/*
musical-request.hh -- declare Musical requests
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
lexer.hh -- declare My_lily_lexer
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include <FlexLexer.h>
#include "lily-proto.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "fproto.hh"
#include "varray.hh"
#include "string.hh"
/*
my-lily-parser.hh -- declare My_lily_parser
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef MY_LILY_PARSER_HH
#define MY_LILY_PARSER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "duration.hh"
#include "string.hh"
#include "varray.hh"
#include "lily-proto.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "duration.hh"
#include "string.hh"
#include "varray.hh"
/*
note-column-reg.hh -- declare Note_column_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
note-column.hh -- declare Note_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts ) as a single entity. */
class Note_column : public Script_column {
- void do_pre_processing();
+protected:
+ virtual void do_pre_processing();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
public:
/// link to the stem. For setting default direction
Stem * stem_l_;
bool h_shift_b_;
- Array<Notehead*> head_l_arr_;
+ Link_array<Note_head> head_l_arr_;
Interval_t<int> head_positions_interval()const;
/** The relative position of the "voice" containing this
NAME_MEMBERS(Note_column);
Note_column();
- void add(Notehead *);
+ void add(Note_head *);
void add(Stem *);
void sort();
void add(Script* s) { Script_column::add(s);}
--- /dev/null
+/*
+ note-head.hh -- part of GNU LilyPond
+
+ (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef NOTEHEAD_HH
+#define NOTEHEAD_HH
+
+#include "item.hh"
+
+/** ball at the end of the stem takes care of:
+
+ * help lines
+ * proper placing of dots
+
+ It also is the item for a Rest
+
+ */
+
+class Note_head : public Item {
+public:
+ NAME_MEMBERS(Note_head);
+
+ bool rest_b_;
+ int position_i_;
+
+ /// -1 = lowest, 0 = inside, 1 = top
+ int extremal_i_;
+
+ /// needed for the help-lines
+ int staff_size_i_;
+ int dots_i_;
+ int balltype_i_;
+ int x_dir_i_;
+
+ /* *************** */
+
+ void set_rhythmic(Rhythmic_req *);
+
+ /**
+ position of top line (5 linestaff: 8)
+ */
+ Note_head(int staff_size);
+ static int compare(Note_head * const &a, Note_head *const &b) ;
+protected:
+ virtual void do_print()const;
+ virtual Molecule* brew_molecule_p()const;
+};
+#endif // NOTEHEAD_HH
+
+++ /dev/null
-/*
- notehead.hh -- part of LilyPond
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef NOTEHEAD_HH
-#define NOTEHEAD_HH
-
-#include "item.hh"
-
-/** ball at the end of the stem takes care of:
-
- * help lines
- * proper placing of dots
-
- It also is the item for a Rest
-
- */
-
-class Notehead : public Item {
-public:
- NAME_MEMBERS(Notehead);
-
- bool rest_b_;
- int position_i_;
-
- /// -1 = lowest, 0 = inside, 1 = top
- int extremal_i_;
-
- /// needed for the help-lines
- int staff_size_i_;
- int dots_i_;
- int balltype_i_;
- int x_dir_i_;
-
- /* *************** */
-
- void set_rhythmic(Rhythmic_req *);
-
- /**
- position of top line (5 linestaff: 8)
- */
- Notehead(int staff_size);
- static int compare(Notehead * const &a, Notehead *const &b) ;
-protected:
- virtual void do_print()const;
- virtual Molecule* brew_molecule_p()const;
-};
-#endif // NOTEHEAD_HH
-
/*
notename-table.hh -- declare
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- notename.hh -- part of LilyPond
+ notename.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- offset.hh -- part of LilyPond
+ offset.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
class PCol {
public:
- Link_list<Item const *> its;
- Link_list<Spanner const *> stoppers, starters;
+ Link_list<Item *> its;
+ Link_list<Spanner *> stoppers, starters;
/** prebreak is put before end of line.
if broken here, then (*this) column is discarded, and prebreak
PCol *daddy_l_;
/// if lines are broken then this column is in #line#
- Line_of_score const *line_l_;
+ Line_of_score *line_l_;
/** if lines are broken then this column x-coord #hpos# if not
known, then hpos == -1.(ugh?) */
/* *************** */
/// which one (left =0)
- int rank() const;
+ int rank_i() const;
/// does this column have items
bool used_b() const;
/*
p-score.hh -- declare PScore
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#define P_SCORE_HH
#include "colhpos.hh"
-#include "varray.hh"
+#include "parray.hh"
#include "lily-proto.hh"
-#include "p-col.hh"
-#include "p-staff.hh"
+#include "plist.hh"
+/** all stuff which goes onto paper. notes, signs, symbols in a score
+ #PScore# contains the items, the columns.
+
+ */
-/** all stuff which goes onto paper. notes, signs, symbols in a score can be grouped in two ways:
- horizontally (staffwise), and vertically (columns). #PScore#
- contains the items, the columns and the staffs.
- */
-
-struct PScore {
+class PScore {
+public:
Paper_def *paper_l_;
-
+
/// the columns, ordered left to right
Pointer_list<PCol *> cols;
/// the idealspacings, no particular order
Pointer_list<Idealspacing*> suz;
- /// the staffs ordered top to bottom
- Pointer_list<PStaff*> staffs;
-
- /// all symbols in score. No particular order.
- Pointer_list<Item*> its;
-
- /// if broken, the different lines
- Pointer_list<Line_of_score*> lines;
-
/// crescs etc; no particular order
Pointer_list<Spanner *> spanners;
- /// broken spanners
- Pointer_list<Spanner*> broken_spans;
+ /// other elements
+ Pointer_list<Score_elem*> elem_p_list_;
+
+ Super_elem *super_elem_l_;
- Pointer_list<Vertical_spanner*> vspan_p_list_;
/* *************** */
/* CONSTRUCTION */
/// add a line to the broken stuff. Positions given in #config#
void set_breaking(Array<Col_hpositions> const &);
- void add(PStaff *);
-
-
/** add an item.
add the item in specified containers. If breakstatus is set
properly, add it to the {pre,post}break of the pcol.
*/
- void typeset_item(Item *item_p, PCol *pcol_l,PStaff*pstaf_l,int breakstatus=1);
+ void typeset_item(Item *item_p, PCol *pcol_l,int breakstatus=1);
- /// add a Spanner
- void typeset_spanner(Spanner*, PStaff*);
-
/// add to bottom of pcols
void add(PCol*);
- void add_broken(Spanner*);
- /* INSPECTION */
- Array<Item*> select_items(PStaff*, PCol*);
-
- /**
- @return argument as a cursor of the list
- */
+ /**
+ @return argument as a cursor of the list
+ */
PCursor<PCol *> find_col(PCol const *)const;
+ Link_array<PCol> col_range(PCol *left_l, PCol *right_l) const;
+
/* MAIN ROUTINES */
void process();
/* STANDARD ROUTINES */
void OK()const;
void print() const;
+ ~PScore();
+ void typeset_element(Score_elem*);
+ void typeset_broken_spanner(Spanner*);
+ /// add a Spanner
+ void typeset_unbroken_spanner(Spanner*);
+
+
private:
/// before calc_breaking
void preprocess();
+++ /dev/null
-#ifndef PSTAFF_HH
-#define PSTAFF_HH
-
-#include "proto.hh"
-#include "plist.hh"
-#include "item.hh"
-#include "symbol.hh"
-
-/// items grouped horizontally
-struct PStaff {
- PScore * pscore_l_;
-
-
- Link_list<Spanner const *> spans;
- Link_list<Item*> its;
-
- /* *************** */
- void add(Item*i);
- PStaff(PScore*);
-
-private:
- PStaff(PStaff const&);
-};
-
-#endif
/*
paper-def.hh -- declare Paper_def
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef PAPER_DEF_HH
#define PAPER_DEF_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "real.hh"
#include "string.hh"
#include "moment.hh"
/**
The distance between lines
*/
- Real interline()const;
+ Real interline_f()const;
/// half the distance between lines
- Real internote()const;
+ Real internote_f()const;
/// thickness of the standard line
Real rule_thickness()const;
/*
- parseconstruct.hh -- part of LilyPond
+ parseconstruct.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef PARSECONSTRUCT_HH
#define PARSECONSTRUCT_HH
-#include "proto.hh"
+#include "lily-proto.hh"
String * get_scriptdef(char c);
Request* get_script_req(char);
/*
pulk-voice.hh -- declare Pulk_voice
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef PULK_VOICE_HH
#define PULK_VOICE_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "lily-proto.hh"
#include "moment.hh"
#include "priorities.hh"
/*
pulk-voices.hh -- declare Pulk_voices
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
#include "pqueue.hh"
#include "plist.hh"
#include "moment.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "lily-proto.hh"
#include "voice.hh"
#include "time-description.hh"
/*
qlp.hh -- declare Ineq_constrained_qp, Mixed_qp
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
qlpsolve.hh -- declare Active_constraints, Inactive_iter
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- registergroup.hh -- declare
+ registergroup.hh -- declare Register_group_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "plist.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
#include "register.hh"
/**
/*
register.hh -- declare Request_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "lily-proto.hh"
#include "varray.hh"
#include "request.hh"
-#include "staff-elem-info.hh"
+#include "score-elem-info.hh"
#include "staff-info.hh"
/**
+++ /dev/null
-#if 0
-
-
-
-/**Draw a (Guitar) chord above or below this ``note''.
-Why a request?
-Because everything else is done in requests.
-*/
-struct Chord : Request {
- // don't know how this looks.
-};
-
-
-/// for absolute dynamics
-enum Loudness {
- FFF, FF, F, MF, MP, P, PP, PPP
-} ;
-
-
-/**
-Start/stop a bracket at this note. if #nplet# is set, the staff will
-try to put an appropriate number over the bracket
-*/
-struct Bracket_req : Span_req {
- int nplet; // print a number over the beam.
-};
-
-struct Subtle_req {
- Moment subtime;
-};
-
-
-/** helper in the hierarchy. 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). Dynamic changes can occur in a
- smaller time than the length of its note, therefore fore each
- Dynamic request carries a time, measured from the start of its
- note.
-
- This subfield would come in handy, if mpp96 was adapted for midi
- support.
-
- Dynamic should have been derived from request, but I don't want to
- fuss with virtual baseclasses. */
-
-struct Dynamic:Subtle_req {
-
-};
-/// do a crescendo
-struct Cresc_req : Span_req, Dynamic {
-
-};
-
-/// do a decrescendo
-struct Decresc_req : Span_req, Dynamic {
-
-};
-
-/// do a dynamic like "fff" or "mp"
-struct Absdynamic_req : Request, Dynamic {
- Loudness loudness;
-};
-
-struct Grace_req : Subtle_req {
-
-};
-
-struct Grace_turn_req : Grace_turn {
-
-};
-
-struct Grace_note : Melodic_req {
-
-};
-
-struct Grace_notes {
-
-};
-
-struct Glissando_req : Span_req {
-
-};
-#endif
/*
request-column.hh -- declare Request_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
request.hh -- declare Request baseclasses.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef REQUEST_HH
#define REQUEST_HH
-// LilyPond's second egg of columbus!
+// GNU LilyPond's second egg of columbus!
#include "glob.hh"
#include "string.hh"
#include "moment.hh"
-#include "class-name.hh"
+#include "virtual-methods.hh"
#include "input.hh"
/**
#define REQUESTMETHODS(T,accessor) \
virtual T * accessor() { return this;}\
NAME_MEMBERS(T);\
-virtual Request *clone() const { return new T(*this); } \
+VIRTUAL_COPY_CONS(T, Request)\
virtual void do_print() const
#endif
/*
rest-collision-reg.hh -- declare Rest_collision_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
rest-collision.hh -- declare Rest_collision
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "item.hh"
class Rest_collision : public Item {
- Array<Rest_column *> rest_l_arr_;
- Array<Note_column *> ncol_l_arr_;
+ Link_array<Rest_column> rest_l_arr_;
+ Link_array<Note_column> ncol_l_arr_;
public:
void add(Rest_column*);
void add(Collision*);
NAME_MEMBERS(Rest_collision);
protected:
virtual void do_post_processing();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
};
#endif // REST_COLLISION_HH
/*
rest-column.hh -- declare Rest_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
only produce one rest.
*/
class Rest_column : public Script_column {
- Array<Notehead*> head_l_arr_;
+ Link_array<Note_head> head_l_arr_;
public:
int dir_i_;
- void add(Notehead *);
+ void add(Note_head *);
NAME_MEMBERS(Rest_column);
void translate_y(Real dy);
Rest_column();
+protected:
+ virtual void do_substitute_dependency(Score_elem*, Score_elem*);
};
#endif // REST_COLUMN_HH
/*
- sccol.hh -- part of LilyPond
+ sccol.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCCOL_HH
#define SCCOL_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "varray.hh"
#include "moment.hh"
--- /dev/null
+/*
+ score-elem-info.hh -- declare Score_elem_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef STAFFELEMINFO_HH
+#define STAFFELEMINFO_HH
+
+#include "scalar.hh"
+#include "lily-proto.hh"
+#include "varray.hh"
+
+/// data container.
+struct Score_elem_info {
+ Score_elem * elem_l_;
+ Request*req_l_;
+ Voice const * voice_l_;
+ Array<Request_register*> origin_reg_l_arr_;
+
+ /* *** */
+ Score_elem_info(Score_elem*, Request*);
+ Score_elem_info();
+};
+
+
+struct Feature {
+ Scalar type_;
+ Scalar value_;
+};
+#endif // STAFFELEMINFO_HH
--- /dev/null
+/*
+ score-elem.hh -- part of GNU LilyPond
+
+ (c) 1996,97 Han-Wen Nienhuys
+*/
+
+#ifndef STAFFELEM_HH
+#define STAFFELEM_HH
+
+#include "parray.hh"
+#include "lily-proto.hh"
+#include "offset.hh"
+#include "molecule.hh"
+#include "virtual-methods.hh"
+#include "directed-graph.hh"
+
+
+/** Both Spanner and Item are Score_elem's. Most Score_elem's depend
+ on other Score_elem's, eg, Beam needs to know and set direction of
+ Stem. So the Beam has to be calculated *before* Stem. This is
+ accomplished with the dependencies fields of struct Score_elem,
+ which are implemented in the Directed_graph_node class: all elements
+ form an acyclic graph.
+
+ (elem) */
+class Score_elem : private Directed_graph_node {
+
+ /// member: the symbols
+ Molecule *output; // should scrap, and use temp var?
+
+
+ /**
+ This is needed, because #output# may still be
+ NULL.
+ */
+ Offset offset_;
+
+ enum Status {
+ ORPHAN, // not yet added to pstaff
+ VIRGIN, // added to pstaff
+ PRECALCING,
+ PRECALCED, // calcs before spacing done
+ BREAKING,
+ BROKEN,
+ POSTCALCING, // busy calculating. This is used to trap cyclic deps.
+ POSTCALCED, // after spacing calcs done
+ OUTPUT, // molecule has been output
+ DELMARKED, // mark for 'unclean' deletion
+ DELETED, // to catch malloc mistakes.
+ } status;
+
+
+ Score_elem* dependency(int) const;
+ Score_elem* dependent(int) const;
+ int dependent_size() const;
+ int dependency_size() const;
+public:
+ PScore *pscore_l_;
+ int group_element_i_;
+
+ Score_elem(Score_elem const&);
+ virtual String TeX_string () const ;
+ virtual void print() const;
+
+ Paper_def *paper() const;
+
+ virtual ~Score_elem();
+ Score_elem();
+ NAME_MEMBERS(Score_elem);
+ virtual bool is_type_b(const char *);
+
+ Interval width() const;
+ Interval height() const;
+ /**
+ translate the symbol. The symbol does not have to be created yet.
+ Overridable, since this score-elem might act as a pseudo-list.
+ */
+ virtual void translate(Offset);
+ Offset offset()const;
+
+ void add_processing();
+ void OK() const;
+ void pre_processing();
+ void break_processing();
+
+ void post_processing();
+ void molecule_processing();
+
+ void unlink();
+ void unlink_all();
+ void remove_dependency(Score_elem*);
+ /**
+ add a dependency. It may be the 0 pointer, in which case, it is ignored.
+ */
+ void add_dependency(Score_elem* );
+
+
+ virtual Spanner* spanner() { return 0; }
+ virtual Element_group* elem_group() { return 0; }
+ virtual Item * item() { return 0; }
+ virtual Line_of_score * line_l() const;
+protected:
+
+ virtual Interval do_height()const;
+ virtual Interval do_width()const;
+
+ /// do printing of derived info.
+ virtual void do_print() const {}
+ /// generate the molecule
+ virtual Molecule* brew_molecule_p()const;
+ ///executed directly after the item is added to the PScore
+ virtual void do_add_processing();
+ /// do calculations before determining horizontal spacing
+ virtual void do_pre_processing();
+
+
+ /// do calculations after determining horizontal spacing
+ virtual void do_post_processing();
+
+ virtual void do_substitute_dependency(Score_elem * , Score_elem *);
+ virtual void do_break_processing();
+ virtual void handle_broken_dependencies();
+};
+
+
+#endif // STAFFELEM_HH
+
/*
score-walker.hh -- declare Score_walker
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
#ifndef SCOREWALKER_HH
#define SCOREWALKER_HH
#include "pcursor.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "varray.hh"
/*
score.hh -- declare Score
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#define SCORE_HH
#include "varray.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "plist.hh"
#include "moment.hh"
#include "assoc.hh"
+
/*
- scoreline.hh -- part of LilyPond
+ scoreline.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCORELINE_HH
#define SCORELINE_HH
-#include "proto.hh"
-#include "plist.hh"
-#include "varray.hh"
-/// the columns of a score that form one line.
-struct
-Line_of_score {
- Link_list<PCol *> cols;
+#include "colhpos.hh"
+#include "spanner-elem-group.hh"
+/// the columns of a score that form one line.
+class Line_of_score : public Spanner_elem_group {
+public:
+ Link_array<Spanner_elem_group> line_arr_;
+ Link_array<PCol > cols;
bool error_mark_b_;
- // need to store height of each staff.
- Pointer_list<Line_of_staff*> staffs;
- PScore * pscore_l_; // needed to generate staffs
-
+ virtual String TeX_string() const;
+
/* *************** */
- void process() ;
- Line_of_score(Array<PCol *> sv, PScore *);
-
- String TeXstring() const;
-
- // is #c# contained in #*this#?
- bool element(PCol const *c);
+ NAME_MEMBERS(Line_of_score);
+ Line_of_score();
+
+ void add_line(Spanner_elem_group *);
+
+ /// is #c# contained in #*this#?
+ bool contains_b(PCol const *c)const;
+
+ Link_array<Line_of_score> get_lines()const;
+ void set_breaking(Array<Col_hpositions> const&);
+
+protected:
+ virtual void break_into_pieces();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void do_pre_processing();
+ virtual void do_post_processing();
+
+
+ SPANNER_CLONE(Line_of_score)
};
#endif
/*
script-column.hh -- declare Script_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef SCRIPT_COLUMN_HH
#define SCRIPT_COLUMN_HH
+#include "elem-group.hh"
#include "item.hh"
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts ) as a single entity. */
-class Script_column : public Item {
+class Script_column : public Item, public Element_group {
+
protected:
- virtual Interval do_height()const;
- virtual Interval do_width()const;
- virtual void do_print() const ;
- virtual void do_pre_processing();
+ virtual void do_print() const;
+ virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+ virtual void do_pre_processing() ;
public:
- Array<Script *> script_l_arr_;
- Array<Item *> support_l_arr_;
-
+ Link_array<Script> script_l_arr_;
+ Link_array<Item> support_l_arr_;
NAME_MEMBERS(Script_column);
- virtual void translate(Offset);
+
void add(Script *);
void add_support(Item*);
};
/*
- script-def.hh -- part of LilyPond
+ script-def.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- script-reg.hh -- part of LilyPond
+ script-reg.hh -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- script.hh -- part of LilyPond
+ script.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- slur.hh -- part of LilyPond
+ slur.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#include "directional-spanner.hh"
#include "lily-proto.hh"
-#include "varray.hh"
+#include "parray.hh"
#include "bow.hh"
+/**
+ A #Bow# which tries to drape itself around the stems too.
+ */
class Slur : public Bow {
public:
- Array<Note_column*> encompass_arr_;
-
- void do_post_processing();
- void do_pre_processing();
+ Link_array<Note_column> encompass_arr_;
void add(Note_column*);
- void set_default_dir();
-
- Spanner* do_break_at( PCol*, PCol*) const;
-private:
+protected:
+ virtual void set_default_dir();
+ virtual void do_break_at( PCol*, PCol*) ;
+ virtual void do_post_processing();
+ virtual void do_substitute_dependency(Score_elem*, Score_elem*);
+ virtual void do_pre_processing();
+ SPANNER_CLONE(Slur)
NAME_MEMBERS(Slur);
};
--- /dev/null
+/*
+ spanner-elem-group.hh -- declare Spanner_elem_group
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SPANNER_ELEM_GROUP_HH
+#define SPANNER_ELEM_GROUP_HH
+
+#include "spanner.hh"
+#include "elem-group.hh"
+
+class Spanner_elem_group : public Spanner, public Element_group {
+
+protected:
+ void do_break_at(PCol*,PCol*);
+ virtual Interval do_width()const;
+ virtual void do_print() const;
+ SPANNER_CLONE(Spanner_elem_group)
+ NAME_MEMBERS(Spanner_elem_group);
+};
+#endif // SPANNER_ELEM_GROUP_HH
/*
- spanner.hh -- part of LilyPond
+ spanner.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SPANNER_HH
#define SPANNER_HH
-#include "proto.hh"
-#include "staff-elem.hh"
+#include "lily-proto.hh"
+#include "score-elem.hh"
+#define SPANNER_CLONE(T) VIRTUAL_COPY_CONS(T, Spanner)
+
/** a symbol which is attached between two columns. A spanner is a
symbol which spans across several columns, so its final appearance
can only be calculated after the breaking problem is solved.
is absolutely necessary for beams, since they have to adjust the
length of stems of notes they encompass.
- */
+ */
class Spanner:public virtual Score_elem {
public:
PCol *left_col_l_, *right_col_l_;
-
/* *************** */
NAME_MEMBERS(Spanner);
virtual Spanner* spanner() { return this; }
Spanner();
- Spanner *broken_at(PCol *c1, PCol *c2) const;
+ bool broken_b() const;
+ Spanner* find_broken_piece(Line_of_score*)const;
protected:
+ SPANNER_CLONE(Spanner)
+ virtual void break_into_pieces();
+ Link_array<Spanner> broken_into_l_arr_;
+
+ virtual void do_break_processing();
virtual Interval do_width()const;
- void do_print()const;
-
-
- /**
- clone a piece of this spanner.
- PRE
- c1 >= start, c2 <= stop
- */
- virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0;
+ virtual void do_print()const;
+ virtual Line_of_score*line_l()const;
};
#endif
+++ /dev/null
-/*
- staff-elem-info.hh -- declare Score_elem_info
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef STAFFELEMINFO_HH
-#define STAFFELEMINFO_HH
-
-#include "scalar.hh"
-#include "lily-proto.hh"
-#include "varray.hh"
-
-/// data container.
-struct Score_elem_info {
- Score_elem * elem_l_;
- Request*req_l_;
- Voice const * voice_l_;
- Array<Request_register*> origin_reg_l_arr_;
-
- /* *** */
- Score_elem_info(Score_elem*, Request*);
- Score_elem_info();
-};
-
-
-struct Feature {
- Scalar type_;
- Scalar value_;
-};
-#endif // STAFFELEMINFO_HH
+++ /dev/null
-/*
- staff-elem.hh -- part of LilyPond
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFELEM_HH
-#define STAFFELEM_HH
-#include "varray.hh"
-#include "proto.hh"
-#include "offset.hh"
-#include "molecule.hh"
-#include "class-name.hh"
-
-
-/** Both Spanner and Item are Score_elem's. Most Score_elem's depend
- on other Score_elem's, eg, Beam needs to know and set direction of
- Stem. So the Beam has to be calculated *before* Stem. This is
- accomplished with the dependencies field of struct Score_elem.
-
- (elem)
- */
-class Score_elem {
-
- /// member: the symbols
- Molecule *output; // should scrap, and use temp var?
-
-
- /**
- This is needed, because #output# may still be
- NULL.
- */
- Offset offset_;
- Array<Score_elem*> dependancy_l_arr_;
-public:
- enum Status {
- ORPHAN, // not yet added to pstaff
- VIRGIN, // added to pstaff
- PRECALCING,
- PRECALCED, // calcs before spacing done
- POSTCALCING, // busy calculating. This is used to trap cyclic deps.
- POSTCALCED, // after spacing calcs done
- VERTICALCING, // height determined
- VERTICALCED,
- OUTPUT, // molecule has been output
- DELETED, // to catch malloc mistakes.
- } status;
-
- /// the pstaff it is in
- PStaff *pstaff_l_;
-
- /* *************** */
- Score_elem(Score_elem const&);
- String TeXstring () const ;
- virtual void print() const;
- virtual Interval width() const;
- virtual Interval height() const;
- Paper_def *paper() const;
- virtual ~Score_elem();
- Score_elem();
- NAME_MEMBERS(Score_elem);
-
- /**
- translate the symbol. The symbol does not have to be created yet.
- Overridable, since this staff-elem might act as a pseudo-list.
- */
- virtual void translate(Offset);
- Offset offset()const;
- void add_processing();
- void pre_processing();
- void post_processing();
- void molecule_processing();
-
- virtual Spanner* spanner() { return 0; }
- virtual Item * item() { return 0; }
- /**
- add a dependency. It may be the 0 pointer, in which case, it is ignored.
- */
- void add_dependency(Score_elem* );
- void substitute_dependency(Score_elem* old, Score_elem * newdep);
-
-protected:
- virtual Interval do_height()const;
- virtual Interval do_width()const;
- /// do printing of derived info.
- virtual void do_print() const {}
- /// generate the molecule
- virtual Molecule* brew_molecule_p()const;
- ///executed directly after the item is added to the PScore
- virtual void do_add_processing();
- /// do calculations before determining horizontal spacing
- virtual void do_pre_processing();
-
- /// do calculations after determining horizontal spacing
- virtual void do_post_processing();
-
- /// do calculations after height of spanners/items is determined.
- virtual void do_verticalcing();
- Array<Score_elem*> dependant_l_arr_;
-
-};
-
-
-#endif // STAFFELEM_HH
-
/*
staff-info.hh -- declare Staff_info
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staff-regs.hh -- declare Staff_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staff-side.hh -- declare Staff_side
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef STAFF_SIDE_HH
#define STAFF_SIDE_HH
-#include "staff-elem.hh"
+#include "score-elem.hh"
/// A symbol which sits along the staff
-class Staff_side {
- Array<Score_elem*> support_l_arr_;
+class Staff_side : virtual Score_elem {
+ Link_array<Score_elem> support_l_arr_;
int staff_size_i_;
- Score_elem * elem_l_;
Interval support_height()const;
Staff_symbol* staff_sym_l_;
+
void read_staff_sym();
public:
- Real inter_f_;
+
/**
Vertical dir of symbol relative to staff. -1 = below staff?
*/
/// follow the support inside the staff?
bool inside_staff_b_;
- void set_staffsym(Staff_symbol*);
+ void set_staffsym(Staff_symbol * );
- Staff_side(Score_elem*);
+ Staff_side();
void add_support(Score_elem*);
protected:
+ virtual void do_substitute_dependency(Score_elem *, Score_elem*);
int get_position_i()const;
int get_position_i(Interval)const;
};
/*
staff-sym-reg.hh -- declare
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staffsym.hh -- declare Staff_symbol
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
int no_lines_i_;
public:
+
void set_extent(PCol* p1, PCol* p2);
NAME_MEMBERS(Staff_symbol);
Staff_symbol(int lines);
Real inter_note_f()const;
int steps_i()const;
protected:
+ SPANNER_CLONE(Staff_symbol)
virtual Molecule* brew_molecule_p() const;
virtual void do_print()const;
- virtual Spanner *do_break_at( PCol *c1, PCol *c2) const;
};
#endif // STAFFSYM_HH
#ifndef STAFFWALKER_HH
#define STAFFWALKER_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "time-description.hh"
#include "pcursor.hh"
/*
staff.hh -- declare Staff
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#define STAFF_HH
#include "plist.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "moment.hh"
-/// base class for a collection of voices.
+/// A collection of voices.
class Staff {
Staff(const Staff&src);
Link_list<Voice*> voice_list_;
/// runtime field
Link_list<Staff_column*> cols_;
+ Line_of_staff * staff_line_l_;
Score *score_l_;
PScore *pscore_l_;
- PStaff *pstaff_l_;
/* *************************************************************** */
- void add(const Link_list<Voice*> &s);
+ void add(Link_list<Voice*> const&s);
void add_voice(Voice *v_p);
Paper_def*paper()const;
void clean_cols() ;
Staff();
- virtual void set_output(PScore * destination)=0;
- virtual Staff_walker *get_walker_p()=0;
- virtual ~Staff() { }
+ virtual void set_output(PScore * destination);
+ Staff_walker *get_walker_p();
+ virtual ~Staff();
void add_col(Staff_column*);
protected:
/*
staffeleminfo.hh -- declare Score_elem_info
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef STAFFELEMINFO_HH
#define STAFFELEMINFO_HH
-#include "proto.hh"
+#include "lily-proto.hh"
/// data container.
struct Score_elem_info {
/*
- staffline.hh -- horizontal structures for broken scores.
+ staffline.hh -- horizontal structures for broken scores.
(c) 1996,97 Han-Wen Nienhuys
*/
#ifndef STAFFLINE_HH
#define STAFFLINE_HH
-#include "proto.hh"
-#include "real.hh"
-#include "plist.hh"
-#include "varray.hh"
-#include "glob.hh"
-#include "p-staff.hh"
+#include "spanner-elem-group.hh"
/// one broken line of staff.
-struct Line_of_staff {
+struct Line_of_staff : public Spanner_elem_group{
- Line_of_score * line_of_score_l_;
- PStaff *pstaff_l_;
+ SPANNER_CLONE(Line_of_staff)
+public:
+ NAME_MEMBERS(Line_of_staff);
/* *************** */
-
- String TeXstring() const;
- Line_of_staff(Line_of_score*, PStaff *);
- Interval height() const;
- void process();
+ /**
+ Add an element. If it is a Element_group, only the dependency
+ (otherwise, might translate doubly) */
+ void add_element(Score_elem*);
};
#endif
/*
- stem-beam-reg.hh -- part of LilyPond
+ stem-beam-reg.hh -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/**
store the wholes (for vapourware tremolo)
*/
- Array<Notehead*> whole_l_arr_;
- Array<Notehead*> head_l_arr_;
- Array<Notehead*> rest_l_arr_;
+ Link_array<Note_head> whole_l_arr_;
+ Link_array<Note_head> head_l_arr_;
+ Link_array<Note_head> rest_l_arr_;
public:
/// flagtype? 4 none, 8 8th flag, 0 = beam.
Stem(int staff_size_i);
/// ensure that this Stem also encompasses the Notehead #n#
- void add(Notehead*n);
+ void add(Note_head*n);
NAME_MEMBERS(Stem);
void do_print() const;
void set_stemend(Real);
int get_default_dir();
+ int get_center_distance();
void set_default_dir();
void set_default_stemlen();
void set_default_extents();
Real stem_start_f() const;
bool invisible_b()const;
+ bool chord_b()const;
/// heads that the stem encompasses (positions)
int max_head_i() const;
int min_head_i() const;
protected:
- void do_pre_processing();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void do_pre_processing();
virtual Interval do_width() const;
Molecule* brew_molecule_p() const;
};
--- /dev/null
+/*
+ super-elem.hh -- declare Super_elem
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SUPER_ELEM_HH
+#define SUPER_ELEM_HH
+
+#include "score-elem.hh"
+/** The toplevel element. The PScore contains this element, and any
+ element shoud be a dependency for the super element.
+ */
+class Super_elem : public virtual Score_elem {
+public:
+ Link_array<Line_of_score> lines_arr_;
+ Line_of_score * line_of_score_l_;
+ void add_broken_line(Line_of_score*);
+ Super_elem();
+ virtual String TeX_string()const;
+protected:
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void handle_broken_dependencies();
+
+ virtual void do_add_processing();
+ NAME_MEMBERS(Super_elem);
+};
+
+#endif // SUPER_ELEM_HH
/*
swallow-reg.hh -- declare Swallow_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "string.hh"
#include "boxes.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
struct Symbol {
String tex;
+/*
+ tex.hh -- declare various functions for TeX output
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+
#ifndef TEX_HH
#define TEX_HH
#include "boxes.hh"
#include "scalar.hh"
-/** parameter substitution in TeXstrings.
+/** parameter substitution in TeX_strings.
this function provides a simple macro mechanism:
if source == "tex%bla%", then
String
substitute_args(String source, Array<String> args);
-/// parameter substitution in TeXstrings
+/// parameter substitution in TeX_strings
String
substitute_args(String source, Array<Scalar> args);
/*
- text-def.hh -- part of LilyPond
+ text-def.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
#define TEXT_DEF_HH
#include "string.hh"
-#include "proto.hh"
+#include "lily-proto.hh"
#include "input.hh"
class Text_def : public Input {
/*
- text-item.hh -- part of LilyPond
+ text-item.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/*
- text-reg.hh -- part of LilyPond
+ text-reg.hh -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
- textspanner.hh -- part of LilyPond
+ textspanner.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
/** a spanner which puts texts on top of other spanners. Use for
triplets, eentweetjes, ottava, etc. */
-struct Text_spanner : Spanner {
+class Text_spanner : public Spanner {
+public:
+ Directional_spanner * support;
Text_def spec;
Offset text_off_;
- Directional_spanner*support;
+ NAME_MEMBERS(Text_spanner);
- /* *************** */
+ void set_support(Directional_spanner*);
+ Text_spanner();
+protected:
+ SPANNER_CLONE(Text_spanner)
- NAME_MEMBERS(Text_spanner);
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_pre_processing();
virtual void do_post_processing();
virtual Interval height() const ;
virtual Molecule* brew_molecule_p()const;
virtual void do_print() const;
- virtual Spanner* do_break_at(PCol*,PCol*)const;
- Text_spanner();
- void set_support(Directional_spanner*);
};
#endif // TEXTSPANNER_HH
/*
tie-reg.hh -- declare Tie_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
tie.hh -- declare Tie
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "bow.hh"
+/**
+ Connect two noteheads.
+ */
class Tie : public Bow {
- virtual Spanner* do_break_at(PCol*,PCol*)const;
virtual void do_add_processing();
virtual void do_post_processing();
virtual void set_default_dir();
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+
public:
bool same_pitch_b_;
- Notehead * left_head_l_;
- Notehead * right_head_l_;
- void set_head(int, Notehead*head_l);
+ Note_head * left_head_l_;
+ Note_head * right_head_l_;
+ void set_head(int, Note_head*head_l);
+
Tie();
-
+ NAME_MEMBERS(Tie);
+ SPANNER_CLONE(Tie)
};
#endif // TIE_HH
/*
- moment.hh -- part of LilyPond
+ moment.hh -- part of GNU LilyPond
(c) 1996,97 Han-Wen Nienhuys
*/
+++ /dev/null
-/*
- vertical-brace.hh -- declare
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef VERTICAL_BRACE_HH
-#define VERTICAL_BRACE_HH
-
-#include "vertical-spanner.hh"
-
-class Vertical_brace : public Vertical_spanner {
-public:
-
-};
-
-#endif // VERTICAL_BRACE_HH
+++ /dev/null
-/*
- vertical-spanner.hh -- declare Vertical_spanner
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef VERTICAL_SPANNER_HH
-#define VERTICAL_SPANNER_HH
-
-#include "staff-elem.hh"
-
-class Vertical_spanner: virtual public Score_elem {
-public:
- PStaff *lower_pstaff_l_;
- PStaff *upper_pstaff_l_;
- NAME_MEMBERS(Vertical_spanner);
-
- Vertical_spanner();
-
-};
-#endif // VERTICAL_SPANNER_HH
/*
voice-element.hh -- declare Voice_element
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef VOICE_ELEMENT_HH
#define VOICE_ELEMENT_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "plist.hh"
#include "moment.hh"
#include "input.hh"
/*
voice-group-regs.hh -- declare Voice_group_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
voice-regs.hh -- declare Voice_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#ifndef VOICE_HH
#define VOICE_HH
-#include "proto.hh"
+#include "lily-proto.hh"
#include "plist.hh"
#include "moment.hh"
/*
walkregs.hh -- declare Walker_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "register-group.hh"
-
+#include "parray.hh"
/**
Top level registers: the interface to Complex_walker.
[sigh. Sometimes I wish C++ could do better late binding.]
- */
-struct Walker_registers : Register_group_register {
+
+ Basically, this distributes and collects elements and elementinfo to
+ children
+ */
+class Walker_registers : public Register_group_register {
+
Array<Item*> prebreak_item_p_arr_;
Array<Item*> nobreak_item_p_arr_;
Array<Item*> postbreak_item_p_arr_;
+ Link_array<Score_elem> musical_item_p_arr_;
+
Array<Score_elem_info> announce_info_arr_;
Complex_walker * walk_l_;
-
- /* *************** */
-
- void typeset_musical_item(Score_elem * elem_p);
- Walker_registers(Complex_walker*);
- void do_announces();
-
+protected:
virtual Staff_info get_staff_info();
virtual void announce_element(Score_elem_info);
virtual void acknowledge_element(Score_elem_info);
virtual void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p);
virtual void typeset_element(Score_elem*elem_p);
+ virtual Paper_def * paper() const;
+public:
virtual void pre_move_processing();
virtual void post_move_processing();
- virtual Paper_def * paper() const;
+
+
+ void do_announces();
+ Walker_registers(Complex_walker*);
};
#endif // WALKREGS_HH
/*
input-register.cc -- implement Input_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
input-score.cc -- implement Input_score
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
input-staff.cc -- implement Input_staff
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "input-music.hh"
#include "input-staff.hh"
#include "staff.hh"
-#include "complex-staff.hh"
#include "my-lily-lexer.hh"
#include "input-register.hh"
Staff*
Input_staff::parse(Score*score_l)
{
- Staff *p=new Complex_staff;
+ Staff *p=new Staff;
p->score_l_ = score_l;
p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
/*
item.cc -- implement Item
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
return pcol_l_->hpos + offset().x;
}
+
+
Line_of_score *
Item::line_l()const
{
Key_item::brew_molecule_p()const
{
Molecule*output = new Molecule;
- Real inter = paper()->internote();
+ Real inter = paper()->internote_f();
for (int i =0; i < pitch.size(); i++) {
Symbol s= paper()->lookup_l()->accidental(acc[i]);
/*
key-reg.cc -- implement Key_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
/*
key.cc -- implement Key, Octave_key
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
yy_pop_state();
}
}
-
+<longcomment><<EOF>> {
+ LexerError("EOF found inside a comment");
+ if (! close_input()) {
+ yyterminate(); // can't move this, since it actually rets a YY_NULL
+ }
+}
<notes,INITIAL,lyrics>
\\include {
yy_push_state(incl);
/*
lexerinit.cc -- implement some stuff
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
local-key-item.cc -- implement Local_key_item, Local_acc
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "lookup.hh"
#include "paper-def.hh"
#include "musical-request.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "misc.hh"
// do one octave
if (accs[i].octave_i_ != lastoct) {
if (octmol){
- Real dy =lastoct*7*paper()->internote();
+ Real dy =lastoct*7*paper()->internote_f();
octmol->translate(Offset(0, dy));
output->add(*octmol);
delete octmol;
lastoct = accs[i].octave_i_;
Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_);
Atom a(s);
- Real dy = (accs[i].name_i_ + c0_position) * paper()->internote();
+ Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f();
a.translate(Offset(0,dy));
octmol->add_right(a);
}
if (octmol){
- Real dy =lastoct*7*paper()->internote();
+ Real dy =lastoct*7*paper()->internote_f();
octmol->translate(Offset(0, dy));
output->add(*octmol);
delete octmol;
return a.accidental_i_ - b.accidental_i_;
};
IMPLEMENT_STATIC_NAME(Local_key_item);
+
+void
+Local_key_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Item* o_l = o->item();
+ Item* n_l = n?n->item():0;
+
+ support_items_.substitute(o_l, n_l);
+}
#include "debug.hh"
#include "key-item.hh"
#include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
Local_key_register::Local_key_register()
{
/*
lookup.cc -- implement simple Lookup methods.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
#include "tex.hh"
#include "scalar.hh"
+
Lookup::Lookup()
{
texsetting = "\\unknowntexsetting";
Real
-Lookup::internote() const
+Lookup::internote_f() const
{
return ball(4).dim.y.length()/2;
}
Symbol
Lookup::dots(int j) const
{
- if (j>3)
- error("max 3 dots"); // todo
+ if (j>3) {
+ j = 3;
+ warning("max 3 dots"); // todo
+ }
return (*symtables_)("dots")->lookup(j);
}
{
Symbol s;
s.dim.x = Interval(0,wid);
- Real dy = (lines >0) ? (lines-1)*internote()*2 : 0;
+ Real dy = (lines >0) ? (lines-1)*internote_f()*2 : 0;
s.dim.y = Interval(0,dy);
Array<String> a;
/*
lyric-register.cc -- implement Lyric_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
main.cc -- implement main: entrypoints
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
" -M, --midi produce midi output only\n"
" -V, --ignore-version ignore mudela version\n"
"\n"
- "LilyPond was compiled with the following settings:\n"
+ "GNU LilyPond was compiled with the following settings:\n"
#ifdef NDEBUG
"NDEBUG "
#endif
{
cout <<
"\n"
- "LilyPond, a music typesetter.\n"
+ "GNU LilyPond, a music typesetter.\n"
"Copyright (C) 1996,97 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
" Jan Nieuwenhuizen <jan@digicash.com>\n"
{
debug_init(); // should be first
-// File_path path(String(DIR_DATADIR)+"/init/") ;
- // silly File_path, now has two .:.
- File_path path( "." );
+
+ File_path path;
// must override (come before) "/usr/local/share/lilypond"!
char const * env_l=getenv("LILYINCLUDE");
if (env_l) {
path.add(env_l);
}
-
+ path.add( "" );
path.add( String( DIR_DATADIR ) + "/init/" );
path_l = & path;
/*
meter-reg.cc -- implement Meter_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
//
// midi-def.cc -- implement midi output
//
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
//
// (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
//
// midiitem.cc
//
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
//
// (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
/*
midioutput.cc -- implement Midi_output
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
*/
//
// midistream.cc
//
-// source file of the LilyPond music typesetter
+// source file of the GNU LilyPond music typesetter
//
// (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
/*
midi-walker.cc -- implement Midi_walker
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
String
-Atom::TeXstring() const
+Atom::TeX_string() const
{
/* infinity checks. */
assert( abs(off.x) < 100 CM);
/* *************** */
String
-Molecule::TeXstring() const
+Molecule::TeX_string() const
{
String s;
for(iter_top(ats,c); c.ok(); c++)
- s+=c->TeXstring();
+ s+=c->TeX_string();
return s;
}
/*
request.cc -- implement all musical requests.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
my-lily-lexer.cc -- implement My_lily_lexer
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
my-lily-parser.cc -- implement My_lily_parser
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
note-column-reg.cc -- implement Note_column_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "note-column-reg.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "stem.hh"
#include "note-column.hh"
#include "script.hh"
Note_column_register::acceptable_elem_b(Score_elem const*elem_C)const
{
char const*nC = elem_C->name();
- return (nC == Script::static_name() || nC == Notehead::static_name()
+ return (nC == Script::static_name() || nC == Note_head::static_name()
|| nC == Stem::static_name());
}
Note_column*
if (nC == Script::static_name()) {
script_l_arr_.push((Script*)i.elem_l_->item());
- } else if (nC == Notehead::static_name()) {
- Notehead * h_l = (Notehead*)i.elem_l_->item();
+ } else if (nC == Note_head::static_name()) {
+ Note_head * h_l = (Note_head*)i.elem_l_->item();
if (h_l->rest_b_)
rest_col_l()->add(h_l);
else
if (i.type_ == "vdir")
dir_i_ = i.value_;
if (i.type_ == "hshift")
- h_shift_b_ = i.value_;
+ h_shift_b_ = (bool)(int)i.value_;
}
Note_column_register::Note_column_register()
/*
note-column.cc -- implement Note_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "note-column.hh"
#include "debug.hh"
#include "script.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "stem.hh"
IMPLEMENT_STATIC_NAME(Note_column);
}
void
-Note_column::add(Notehead* n_l)
+Note_column::add(Note_head* n_l)
{
assert(!n_l->rest_b_);
head_l_arr_.push(n_l);
void
Note_column::sort()
{
- head_l_arr_.sort( Notehead::compare);
+ head_l_arr_.sort( Note_head::compare);
}
Interval_t<int>
dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1;
}
}
+
+
+
+void
+Note_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Script_column::do_substitute_dependency(o,n);
+ if (o->name() == Note_head::static_name()) {
+ head_l_arr_.substitute( (Note_head*)o->item(),
+ (n)? (Note_head*)n->item() : 0);
+ }
+ if (stem_l_ == o) {
+ stem_l_ = n ? (Stem*)n->item():0;
+ }
+}
#include "misc.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "dimen.hh"
#include "debug.hh"
#include "paper-def.hh"
-Notehead::Notehead(int ss)
+Note_head::Note_head(int ss)
{
x_dir_i_ = 0;
staff_size_i_=ss;
}
void
-Notehead::set_rhythmic(Rhythmic_req*r_req_l)
+Note_head::set_rhythmic(Rhythmic_req*r_req_l)
{
balltype_i_ = r_req_l->duration_.type_i_;
+ if (balltype_i_ > 4)
+ balltype_i_ = 4;
dots_i_ = r_req_l->duration_.dots_i_;
}
-IMPLEMENT_STATIC_NAME(Notehead);
+IMPLEMENT_STATIC_NAME(Note_head);
void
-Notehead::do_print()const
+Note_head::do_print()const
{
#ifndef NPRINT
if (rest_b_)
int
-Notehead::compare(Notehead *const &a, Notehead * const &b)
+Note_head::compare(Note_head *const &a, Note_head * const &b)
{
return a->position_i_ - b->position_i_;
}
Molecule*
-Notehead::brew_molecule_p() const
+Note_head::brew_molecule_p() const
{
Molecule*out = 0;
Paper_def *p = paper();
- Real dy = p->internote();
+ Real dy = p->internote_f();
Symbol s;
if (!rest_b_)
s = p->lookup_l()->ball(balltype_i_);
/*
notename-table.cc -- implement Notename_table
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
p-col.cc -- implement PCol
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "p-col.hh"
#include "p-score.hh"
-#include "p-staff.hh"
+
#include "debug.hh"
Interval
}
int
-PCol::rank() const
+PCol::rank_i() const
{
assert(rank_i_ != -1);
return rank_i_;
int
PCol::compare(PCol const &c1, PCol const &c2)
{
- return c1.rank() - c2.rank();
+ return c1.rank_i() - c2.rank_i();
}
void
+/*
+ p-score.cc -- implement PScore
+
+ source file of the LilyPond music typesetter
+
+ (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "super-elem.hh"
#include "idealspacing.hh"
#include "debug.hh"
#include "lookup.hh"
#include "tex-stream.hh"
#include "item.hh"
#include "break.hh"
+#include "p-col.hh"
+
+void
+PScore::typeset_element(Score_elem * elem_p)
+{
+ elem_p_list_.bottom().add(elem_p);
+ elem_p->pscore_l_ = this;
+ elem_p->add_processing();
+}
+
+void
+PScore::typeset_item(Item *i, PCol *c, int breakstat)
+{
+ assert(c && i);
+
+ if (breakstat == 0) {
+ typeset_item(i, c->prebreak_p_);
+ return;
+ }
+
+ if (breakstat == 2) {
+ typeset_item(i, c->postbreak_p_);
+ return;
+ }
+
+ c->add(i);
+ typeset_element(i);
+}
+
+void
+PScore::typeset_broken_spanner(Spanner*span_p)
+{
+ span_p->left_col_l_->starters.bottom().add (span_p);
+ span_p->right_col_l_->stoppers.bottom().add(span_p);
+ assert(span_p->left_col_l_->line_l_ == span_p->right_col_l_->line_l_);
+
+ typeset_element(span_p);
+}
+
+
+void
+PScore::typeset_unbroken_spanner(Spanner*span_p)
+{
+ spanners.bottom().add(span_p);
+ span_p->pscore_l_=this;
+ // do not init start/stop fields. These are for broken spans only.
+ span_p->add_processing();
+}
Idealspacing*
PScore::get_spacing(PCol*l, PCol*r)
c->set_rank(rank_i++);
c++;
}
-
}
-
-void
-PScore::add(PStaff *s)
-{
- assert(s->pscore_l_ == this);
- staffs.bottom().add(s);
-}
-
-
void
PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h)
{
do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h);
}
-void
-PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
-{
- assert(c && i && s);
-
- if (breakstat == 0) {
- typeset_item(i, c->prebreak_p_, s);
- return;
- }
-
- if (breakstat == 2) {
- typeset_item(i, c->postbreak_p_, s);
- return;
- }
-
-
- its.bottom().add(i);
- s->add(i);
- c->add(i);
-
- /* first do this, because i->width() may follow the 0-pointer */
- i->add_processing();
-}
-
-void
-PScore::typeset_spanner(Spanner*span_p, PStaff*ps)
-{
- span_p->pstaff_l_ = ps;
- spanners.bottom().add(span_p);
- ps->spans.bottom().add(span_p);
-
- // do not init start/stop fields. These are for broken spans only.
- span_p->add_processing();
-}
-
-
void
PScore::add(PCol *p)
{
cols.bottom().add(p);
}
-PScore::PScore( Paper_def*p)
+PScore::PScore(Paper_def*p)
{
paper_l_ = p;
+ super_elem_l_ = new Super_elem;
+ typeset_element(super_elem_l_);
}
void
PScore::output(Tex_stream &ts)
{
- int l=1;
-
ts << "\n "<< paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
- for (iter_top(lines,lic); lic.ok(); lic++) {
- ts << "% line of score no. " << l++ <<"\n";
- ts << lic->TeXstring();
- if ((lic+1).ok())
- ts << "\\interscoreline\n";
- }
+ ts<< super_elem_l_->TeX_string();
ts << "\n\\EndLilyPondOutput";
}
-Array<Item*>
-PScore::select_items(PStaff*ps, PCol*pc)
+PScore::~PScore()
{
- Array<Item*> ret;
- assert(ps && pc);
- for (iter_top(pc->its,i); i.ok(); i++){
- if (i->pstaff_l_ == ps)
- ret.push((Item*)(Item const *)i);
- }
- return ret;
+ super_elem_l_->unlink_all();
}
void
#ifndef NPRINT
mtor << "PScore { ";
paper_l_->print();
+ mtor << "\n elements: ";
+ for (iter_top(elem_p_list_,cc); cc.ok(); cc++)
+ cc->print();
mtor << "\ncolumns: ";
- for (iter_top(cols,cc); cc.ok(); cc++)
+ for (iter_top(cols,cc); cc.ok(); cc++)
cc->print();
mtor << "\nideals: ";
void
PScore::preprocess()
{
- for (iter_top(spanners,i); i.ok(); i++) {
- i->pre_processing();
- }
- for (iter_top(its,i); i.ok(); i++){
- i->pre_processing();
- }
+ super_elem_l_->pre_processing();
}
void
PScore::postprocess()
{
- for (iter_top(broken_spans,i); i.ok(); i++) { // could chase spans as well.
- i->post_processing();
- }
- for (iter_top(its,i); i.ok(); i++){
- i->post_processing();
- }
-
- for (iter_top(broken_spans,i); i.ok(); i++) {
- i->molecule_processing();
- }
- for (iter_top(its,i); i.ok(); i++){
- i->molecule_processing();
- }
-
- for (iter_top(lines,i); i.ok(); i++)
- i->process();
-
+ super_elem_l_->post_processing();
+ super_elem_l_->molecule_processing();
}
PCursor<PCol *>
return cols.find((PCol*)what);
}
-void
-PScore::add_broken(Spanner*s)
-{
- assert(s->left_col_l_->line_l_ == s->right_col_l_->line_l_);
- broken_spans.bottom().add(s);
- s->left_col_l_->starters.bottom().add (s);
- s->right_col_l_->stoppers.bottom().add (s);
-}
void
PScore::set_breaking(Array<Col_hpositions> const &breaking)
{
- for (int j=0; j < breaking.size(); j++) {
- const Array<PCol*> &curline(breaking[j].cols);
- const Array<PCol*> &errors(breaking[j].error_col_l_arr_);
- const Array<Real> &config(breaking[j].config);
-
- Line_of_score *s_p = new Line_of_score(curline,this);
- s_p->error_mark_b_ = breaking[j].ugh_b_;
- lines.bottom().add(s_p);
- for (int i=0; i < curline.size(); i++){
- curline[i]->hpos = config[i];
+ super_elem_l_->line_of_score_l_->set_breaking( breaking);
+ super_elem_l_->break_processing();
+
+
+ for (iter_top(spanners,i); i.ok(); ) {
+ Spanner *span_p = i.remove_p();
+ if (span_p->broken_b()) {
+ span_p->unlink();
+ delete span_p;
+ }else{
+ typeset_broken_spanner(span_p);
}
- for (int i=0; i < errors.size(); i++)
- errors[i]->error_mark_b_ = true;
}
}
*mlog << "\nPostprocessing elements..." << endl;
postprocess();
}
+
+Link_array<PCol>
+PScore::col_range(PCol*l,PCol*r)const
+{
+ Link_array<PCol> ret;
+
+ PCursor<PCol*> start(l ? find_col(l)+1 : cols.top() );
+ PCursor<PCol*> stop(r ? find_col(r) : cols.bottom());
+ ret.push(l);
+ while ( start < stop )
+ ret.push(start++);
+ ret.push(r);
+ return ret;
+}
+++ /dev/null
-#include "p-staff.hh"
-#include "molecule.hh"
-
-PStaff::PStaff(PScore*ps)
-{
- pscore_l_=ps;
-}
-
-void
-PStaff::add(Item *i)
-{
- its.bottom().add(i);
- i->pstaff_l_ = this;
-}
/*
paper-def.cc -- implement Paper_def
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
}
Real
-Paper_def::interline() const
+Paper_def::interline_f() const
{
return lookup_p_->ball(4).dim.y.length();
}
Real
-Paper_def::internote() const
+Paper_def::internote_f() const
{
- return lookup_p_->internote();
+ return lookup_p_->internote_f();
}
Real
Paper_def::note_width()const
ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
$$ =ad_p;
}
- |SPANDYNAMIC '{' int int '}' {
+ | SPANDYNAMIC '{' int int '}' {
Span_dynamic_req * sp_p = new Span_dynamic_req;
sp_p->spantype = $4;
sp_p-> dynamic_dir_i_ = $3;
/*
pulk-voices.cc -- implement Pulk_voice
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
pulk-voices.cc -- implement Pulk_voices
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
qlpsolve.cc -- implement Active_constraints, Inactive_iter
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
/*
registergroup.cc -- implement Register_group_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
register.cc -- implement Request_register
- Sourcefile of LilyPond musictypesetter
+ Sourcefile of GNU LilyPond musictypesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "voice.hh"
#include "musical-request.hh"
#include "register.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "complex-walker.hh"
#include "local-key-item.hh"
-#include "complex-staff.hh"
#include "register-group.hh"
#include "debug.hh"
/*
request-column.cc -- implement Request_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
rest-collision-reg.cc -- implement Rest_collision_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
rest-collision.cc -- implement Rest_collision
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#endif
}
IMPLEMENT_STATIC_NAME(Rest_collision);
+void
+Rest_collision::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Item*o_l = o->item();
+ Item*n_l = n?n->item():0;
+
+ rest_l_arr_.substitute((Rest_column*)o_l,(Rest_column*)n_l);
+ ncol_l_arr_.substitute((Note_column*)o_l,(Note_column*)n_l);
+}
/*
rest-column.cc -- implement Rest_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "rest-column.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "rest-column.hh"
void
-Rest_column::add(Notehead *n_l)
+Rest_column::add(Note_head *n_l)
{
add_support(n_l);
head_l_arr_.push(n_l);
dir_i_ = 0;
}
+
+void
+Rest_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Script_column::do_substitute_dependency(o,n);
+ if (o->name() == Note_head::static_name()) {
+ head_l_arr_.substitute( (Note_head*)o->item(),
+ (n)? (Note_head*)n->item() : 0);
+ }
+}
/*
score-column.cc -- implement Score_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
--- /dev/null
+/*
+ score-elem-info.cc -- implement Score_elem_info
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "score-elem-info.hh"
+#include "request.hh"
+
+Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l)
+{
+ elem_l_ = s_l;
+ voice_l_ = (r_l)?r_l->voice_l():0;
+ req_l_ = r_l;
+}
+
+Score_elem_info::Score_elem_info()
+{
+ elem_l_ = 0;
+ voice_l_ = 0;
+
+ req_l_ = 0;
+}
+
+
+
--- /dev/null
+/*
+ score-elem.cc -- implement Score_elem
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "p-score.hh"
+#include "paper-def.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "score-elem.hh"
+#include "debug.hh"
+#include "tex.hh"
+#include "dimen.hh"
+#include "spanner.hh"
+#include "scoreline.hh"
+
+Score_elem*
+Score_elem::dependency(int i)const
+{
+ return (Score_elem*) get_out_edge_arr()[i];
+}
+
+int
+Score_elem::dependency_size() const
+{
+ return get_out_edge_arr().size();
+}
+
+Score_elem*
+Score_elem::dependent(int i) const
+{
+ return (Score_elem*) get_in_edge_arr()[i];
+}
+
+int
+Score_elem::dependent_size() const
+{
+ return get_in_edge_arr().size();
+}
+
+
+String
+Score_elem::TeX_string() const
+{
+ assert( status > POSTCALCED);
+ String s("\\placebox{%}{%}{%}");
+ Array<String> a;
+ a.push(print_dimen(offset_.y));
+ a.push(print_dimen(offset_.x));
+ a.push( output->TeX_string());
+ return substitute_args(s, a);
+}
+
+
+Score_elem::Score_elem(Score_elem const&s)
+{
+ /* called from derived ctor, so most info points to the same deps
+ as (Directed_graph_node&)s. Nobody points to us, so don't copy
+ dependents.
+ */
+ copy_edges_out(s);
+ group_element_i_ = 0;
+ status = s.status;
+ assert(!s.output);
+ output = 0;
+ pscore_l_ = s.pscore_l_;
+ offset_ = Offset(0,0);
+}
+
+Score_elem::~Score_elem()
+{
+ // some paranoia to prevent weird segv's
+ assert(status < DELETED);
+ delete output;
+ status = DELETED;
+ output = 0;
+ assert(!group_element_i_ );
+}
+
+void
+Score_elem::translate(Offset O)
+{
+ offset_ += O;
+}
+
+Interval
+Score_elem::do_width() const
+{
+ Interval r;
+
+ if (!output){
+ Molecule*m = brew_molecule_p();
+ r = m->extent().x;
+ delete m;
+ } else
+ r = output->extent().x;
+ return r;
+}
+
+Interval
+Score_elem::width() const
+{
+ Interval r=do_width();
+
+ if (!r.empty_b()) // float exception on DEC Alpha
+ r+=offset_.x;
+
+ return r;
+}
+
+Interval
+Score_elem::do_height() const
+{
+ Interval r;
+ if (!output){
+ Molecule*m = brew_molecule_p();
+ r = m->extent().y;
+ delete m;
+ } else
+ r = output->extent().y;
+ return r;
+}
+
+Interval
+Score_elem::height() const
+{
+ Interval r=do_height();
+
+ if (!r.empty_b())
+ r+=offset_.y;
+
+
+ return r;
+}
+
+void
+Score_elem::print()const
+{
+#ifndef NPRINT
+ mtor << name() << "{\n";
+ mtor << "deps: " << dependent_size() << "depts: \n" <<
+ dependency_size() << "\n";
+ do_print();
+ if (output)
+ output->print();
+
+ mtor << "}\n";
+#endif
+}
+
+
+
+Score_elem::Score_elem()
+{
+ group_element_i_ = 0;
+ pscore_l_=0;
+ offset_ = Offset(0,0);
+ output = 0;
+ status = ORPHAN;
+}
+
+
+Paper_def*
+Score_elem::paper() const
+{
+ assert(pscore_l_);
+ return pscore_l_->paper_l_;
+}
+
+void
+Score_elem::add_processing()
+{
+ if (status >= VIRGIN)
+ return;
+ status = VIRGIN;
+ do_add_processing();
+}
+
+void
+Score_elem::pre_processing()
+{
+ if (status >= PRECALCED )
+ return;
+
+ assert(status != PRECALCING); // cyclic dependency
+ status = PRECALCING;
+
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->pre_processing();
+
+
+ do_pre_processing();
+ status = PRECALCED;
+}
+
+void
+Score_elem::break_processing()
+{
+ if (status >= BROKEN )
+ return;
+
+ assert(status != BREAKING); // cyclic dependency
+ status = BREAKING;
+
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->break_processing();
+
+
+ do_break_processing();
+ status = BROKEN;
+}
+
+void
+Score_elem::do_break_processing()
+{
+ handle_broken_dependencies();
+}
+
+
+void
+Score_elem::post_processing()
+{
+ if (status >= POSTCALCED)
+ return;
+ assert(status != POSTCALCING);// cyclic dependency
+ status=POSTCALCING;
+
+
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->post_processing();
+ do_post_processing();
+ status=POSTCALCED;
+}
+
+void
+Score_elem::molecule_processing()
+{
+ if (status >= OUTPUT)
+ return;
+ status = OUTPUT; // do it only once.
+
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->molecule_processing();
+
+ output= brew_molecule_p();
+}
+
+void
+Score_elem::do_post_processing()
+{
+}
+
+void
+Score_elem::do_pre_processing()
+{
+}
+
+void
+Score_elem::do_add_processing()
+{
+
+}
+
+void
+Score_elem::do_substitute_dependency(Score_elem*,Score_elem*)
+{
+}
+
+
+IMPLEMENT_STATIC_NAME(Score_elem);
+
+Molecule*
+Score_elem::brew_molecule_p()const
+{
+ Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0))));
+ return new Molecule (a);
+}
+Offset
+Score_elem::offset() const
+{
+ return offset_;
+}
+
+Line_of_score *
+Score_elem::line_l()const
+{
+ return 0;
+}
+
+/********************
+ DEPENDENCIES
+ */
+
+void
+Score_elem::remove_dependency(Score_elem*e)
+{
+ remove_edge_out(e);
+ do_substitute_dependency(e, 0);
+}
+
+void
+Score_elem::add_dependency(Score_elem*e)
+{
+ Directed_graph_node::add(e);
+}
+
+bool
+Score_elem::is_type_b(char const *s)
+{
+ return s == static_name();
+}
+
+void
+Score_elem::handle_broken_dependencies()
+{
+ Line_of_score *line = line_l();
+ if (!line)
+ return;
+
+ Link_array<Score_elem> remove_us_arr;
+ for (int i=0; i < dependency_size(); i++) {
+ Score_elem * elt = dependency(i);
+ if (elt->line_l() != line){
+ if (elt->spanner()) {
+ Spanner * sp = elt->spanner();
+ Spanner * broken = sp->find_broken_piece(line);
+ do_substitute_dependency(sp, broken);
+ add_dependency(broken);
+ remove_us_arr.push(sp);
+ }
+ remove_us_arr.push(elt);
+ }
+
+ }
+
+ remove_us_arr.default_sort();
+ remove_us_arr.uniq();
+ for (int i=0; i <remove_us_arr.size(); i++)
+ remove_dependency(remove_us_arr[i]);
+}
+
+
+void
+Score_elem::unlink_all()
+{
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->unlink_all();
+ junk_links();
+ group_element_i_ = 0;
+}
+
+void
+Score_elem::unlink()
+{
+ while ( dependency_size()) {
+ do_substitute_dependency(dependency(0),0);
+ remove_edge_out_idx(0);
+ }
+ while ( dependent_size() ) {
+ dependent(0)->remove_dependency(this);
+ }
+}
+
+
+
+void
+Score_elem::OK()const
+{
+#ifndef NDEBUG
+ for (int i=0; i < dependency_size(); i++) {
+ dependency(i)->OK();
+ }
+#endif
+}
/*
score-walker.cc -- implement Score_walker
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
score.cc -- implement Score
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "midi-def.hh"
#include "pulk-voices.hh"
#include "request-column.hh"
+#include "p-col.hh"
extern String default_out_fn;
/*
scoreline.cc -- implement Line_of_score
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "p-score.hh"
+/* To do:
+ take out hard coded TeX stuff.
+
+ */
String
-Line_of_score::TeXstring() const
+Line_of_score::TeX_string() const
{
- String s("\\vbox{%<- line of score\n");
+ String s("\\hbox{%<- line of score\n");
if (error_mark_b_)
s+= "\\scorelineerrormark";
- for (iter_top(staffs,sc); sc.ok(); sc++){
- s += sc->TeXstring();
- if ((sc+1).ok())
- s+= "\\interstaffline\n";
+
+
+ Real lastpos = cols[0]->hpos;
+ for (int i=0; i < cols.size(); i++){
+ PCol* col_l= cols[i];
+ // all items in the current line & staff.
+ String chunk_str;
+ Real delta = col_l->hpos - lastpos;
+
+
+ if (col_l->error_mark_b_) {
+ chunk_str += String("\\columnerrormark");
+ }
+ // now output the items.
+ for (iter_top(col_l->its,j); j.ok(); j++) {
+ chunk_str += j->TeX_string();
+ }
+ // spanners.
+ for (iter_top(col_l->starters,j); j.ok(); j++) {
+ if (j->name() != name())
+ chunk_str += j->TeX_string();
+ }
+ if (chunk_str!="") {
+ // moveover
+ if (delta)
+ s +=String( "\\kern ") + print_dimen(delta);
+ s += chunk_str;
+ lastpos = col_l->hpos;
+ }
}
s += "}";
return s;
}
-Line_of_score::Line_of_score(Array<PCol *> sv,
- PScore *ps)
+Line_of_score::Line_of_score()
{
error_mark_b_ = 0;
- pscore_l_ = ps;
- for (int i=0; i< sv.size(); i++) {
- PCol *p=(PCol *) sv[i];
- cols.bottom().add(p);
- p->line_l_=this;
+}
+
+
+void
+Line_of_score::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+ Spanner_elem_group::do_substitute_dependency(o,n);
+
+ int i;
+ while ((i =line_arr_.find_i((Spanner_elem_group*)o->spanner())) >=0)
+ if (n)
+ line_arr_[i] = (Spanner_elem_group*)n->spanner();
+ else
+ line_arr_.del(i);
+}
+
+
+void
+Line_of_score::do_post_processing()
+{
+ Real y_pos=0;
+ for (int i=line_arr_.size(); i--; ) {
+ Interval y = line_arr_[i]->height() ;
+ if (y.empty_b())
+ continue;
+ line_arr_[i]->translate(Offset(0, -y[-1] + y_pos));
+ y_pos += y.length();
}
+ translate(Offset(0, -y_pos));
+}
+
+IMPLEMENT_STATIC_NAME(Line_of_score);
- for (iter_top(pscore_l_->staffs,sc); sc.ok(); sc++)
- staffs.bottom().add(new Line_of_staff(this, sc));
+void
+Line_of_score::add_line(Spanner_elem_group*e)
+{
+ add_element(e);
+ line_arr_.push(e);
}
-/* construct a line with the named columns. Make the line field
- in each column point to this
-
- #sv# isn't really const!!
- */
+bool
+Line_of_score::contains_b(PCol const* c)const
+{
+ return cols.find_l((PCol*)c);
+}
void
-Line_of_score::process()
+Line_of_score::do_pre_processing()
{
- for (iter_top(staffs,i); i.ok(); i++)
- i->process();
+ left_col_l_ = pscore_l_->cols.top();
+ right_col_l_ = pscore_l_->cols.bottom();
+ for (int i=0; i < line_arr_.size(); i++){
+ line_arr_[i]->left_col_l_ = left_col_l_;
+ line_arr_[i]->right_col_l_ = right_col_l_;
+ }
}
+
+void
+Line_of_score::set_breaking(Array<Col_hpositions> const &breaking)
+{
+ for (int j=0; j < breaking.size(); j++) {
+ const Array<PCol*> &curline(breaking[j].cols);
+ const Array<PCol*> &errors(breaking[j].error_col_l_arr_);
+ const Array<Real> &config(breaking[j].config);
+ for (int i=0; i < errors.size(); i++)
+ errors[i]->error_mark_b_ = true;
+
+ Line_of_score *line_p = (Line_of_score*)clone();
+ for (int i=0; i < curline.size(); i++){
+ curline[i]->hpos = config[i];
+ curline[i]->line_l_ = (Line_of_score*)line_p;
+ }
+ ((Array<PCol*> &)line_p->cols) = curline;
+ line_p->left_col_l_ = curline[0];
+ line_p->right_col_l_= curline.top();
+ pscore_l_->typeset_broken_spanner(line_p);
+ broken_into_l_arr_.push(line_p);
+ }
+}
+
+void
+Line_of_score::break_into_pieces()
+{
+
+}
+
+Link_array<Line_of_score>
+Line_of_score::get_lines()const
+{
+ Link_array<Line_of_score> ret;
+ assert(broken_into_l_arr_.size());
+ for (int i=0; i < broken_into_l_arr_.size(); i++) {
+ ret.push((Line_of_score*)broken_into_l_arr_[i]);
+ }
+ return ret;
+}
/*
script-column.cc -- implement Script_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "script-column.hh"
#include "debug.hh"
#include "script.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "stem.hh"
IMPLEMENT_STATIC_NAME(Script_column);
Script_column::add(Script*s_l)
{
script_l_arr_.push(s_l);
- add_dependency(s_l);
-}
-
-void
-Script_column::translate(Offset o)
-{
- for (int i=0; i < script_l_arr_.size(); i++)
- script_l_arr_[i]->translate(o);
- for (int i=0; i < support_l_arr_.size(); i++)
- support_l_arr_[i]->translate(o);
+ add_element(s_l);
}
mtor << "scripts: " << script_l_arr_.size() << '\n';
}
-Interval
-Script_column::do_height()const return r
-{
- for (int i=0; i < script_l_arr_.size(); i++)
- r.unite(script_l_arr_[i]->height());
-}
-
-Interval
-Script_column::do_width()const
-{
- Interval r;
- for (int i=0; i < script_l_arr_.size(); i++)
- r.unite(script_l_arr_[i]->width());
- return r;
-}
void
Script_column::do_pre_processing()
Script_column::add_support(Item*i_l)
{
support_l_arr_.push(i_l);
- add_dependency(i_l);
+ add_element(i_l);
+}
+
+void
+Script_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Element_group::do_substitute_dependency(o,n);
+ if (o->item()) {
+ script_l_arr_.substitute((Script*)o->item(),(Script*) (n?n->item():0));
+ support_l_arr_.substitute(o->item(), (n?n->item():0));
+ }
}
/*
script.cc -- implement Script
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
Script::Script(Script_req* rq)
- :Staff_side(this)
{
specs_l_ = rq->scriptdef_p_;
inside_staff_b_ = specs_l_->inside_staff_b_;
Molecule*
Script::brew_molecule_p() const
{
- Real dy = paper()->internote();
+ Real dy = paper()->internote_f();
Molecule*out = new Molecule(Atom(symbol()));
out->translate(Offset(0,dy * pos_i_));
/*
slur.cc -- implement Slur
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
left_col_l_ = encompass_arr_[0]->pcol_l_;
}
-Spanner*
-Slur::do_break_at(PCol*l, PCol*r) const
+void
+Slur::do_break_at(PCol*l, PCol*r)
{
assert(l->line_l_ == r->line_l_);
- Slur*ret = new Slur(*this);
- ret->encompass_arr_.set_size(0);
- for (int i =0; i < encompass_arr_.size(); i++) {
- if (encompass_arr_[i]->pcol_l_->line_l_==l->line_l_)
- ret->encompass_arr_.push(encompass_arr_[i]);
+ Array<Note_column*> old_encompass_arr = encompass_arr_;
+ encompass_arr_.set_size(0);
+ for (int i =0; i < old_encompass_arr.size(); i++) {
+ if (old_encompass_arr[i]->pcol_l_->line_l_==l->line_l_)
+ encompass_arr_.push(old_encompass_arr[i]);
}
+}
- return ret;
+void
+Slur::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+ int i;
+ while((i = encompass_arr_.find_i((Note_column*)o->item())) >=0) {
+ if (n)
+ encompass_arr_[i] = (Note_column*)n->item();
+ else
+ encompass_arr_.del(i);
+ }
}
+
void
Slur::do_post_processing()
{
if (!dir_i_)
set_default_dir();
- Real inter_f = paper()->internote();
+ Real inter_f = paper()->internote_f();
if (encompass_arr_[0]->stem_l_)
left_pos_i_ = rint(encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f);
else
--- /dev/null
+/*
+ spanner-elem-group.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "p-col.hh"
+#include "spanner-elem-group.hh"
+
+void
+Spanner_elem_group::do_break_at(PCol*c1, PCol*c2 )
+{
+ Line_of_score * line_C = c1->line_l_;
+ Array<Score_elem*> old_elems=elem_l_arr_;
+ elem_l_arr_.set_size(0);
+ for (int i=0; i < old_elems.size(); i++) {
+ if (old_elems[i]->line_l() == line_C) {
+ add_element(old_elems[i]);
+ }
+ }
+}
+
+IMPLEMENT_STATIC_NAME(Spanner_elem_group);
+
+Interval
+Spanner_elem_group::do_width() const
+{
+ return Spanner::do_width();
+}
+
+void
+Spanner_elem_group::do_print() const
+{
+ Element_group::do_print();
+}
+
+/*
+ spanner.cc -- implement Spanner
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "debug.hh"
#include "spanner.hh"
#include "p-col.hh"
-
-
+#include "p-score.hh"
IMPLEMENT_STATIC_NAME(Spanner);
void
Spanner::do_print()const
{
- mtor << " (unknown) ";
+ if (broken_into_l_arr_.size())
+ mtor << "Spanner with broken pieces\n";
}
-Spanner*
-Spanner::broken_at(PCol*c1, PCol *c2)const
+void
+Spanner::break_into_pieces()
{
- Spanner *span_p = do_break_at(c1,c2);
-
- for (int i=0; i < dependant_l_arr_.size(); i++) {
- dependant_l_arr_[i]->
- substitute_dependency((Score_elem*)this, span_p);
+ PCol * left = left_col_l_;
+ PCol * right = right_col_l_;
+ if (left->daddy_l_)
+ left = left->daddy_l_;
+ if (right->daddy_l_)
+ right = right->daddy_l_;
+
+ Link_array<PCol> all_cols = pscore_l_->col_range(left, right);
+
+ Line_of_score *line = left->line_l_;
+ if (!line) {
+ left = left->postbreak_p_;
+ line = left->line_l_;
}
- span_p->left_col_l_ = c1;
- span_p->right_col_l_ = c2;
- span_p->pstaff_l_ = pstaff_l_;
+ for (int i=1; i < all_cols.size(); i++) {
+ if (!all_cols[i]->line_l_) {
+
+ Spanner* span_p = clone();
+ right = all_cols[i]->prebreak_p_;
+ assert(left&&right && left->line_l_ == right->line_l_);
+
+ span_p->left_col_l_ = left;
+ span_p->right_col_l_ = right;
+ left = all_cols[i]->postbreak_p_;
+ line = left->line_l_;
+
+ pscore_l_->typeset_broken_spanner(span_p);
+ broken_into_l_arr_.push( span_p );
+ }
+ }
+}
+
+void
+Spanner::do_break_processing()
+{
+ if (!left_col_l_->line_l_)
+ left_col_l_ = left_col_l_->postbreak_p_;
+ if (!right_col_l_->line_l_)
+ right_col_l_ = right_col_l_->prebreak_p_;
+
- return span_p;
+ if (!line_l()) {
+ break_into_pieces();
+ for (int i=0; i < broken_into_l_arr_.size(); i++)
+ broken_into_l_arr_[i]->handle_broken_dependencies();
+ } else {
+ handle_broken_dependencies();
+ }
}
+
Spanner::Spanner()
{
left_col_l_ = right_col_l_ = 0;
return Interval(0, r-l);
}
+
+Line_of_score *
+Spanner::line_l()const
+{
+ if ( left_col_l_->line_l_ != right_col_l_->line_l_)
+ return 0;
+ return left_col_l_->line_l_;
+}
+
+
+Spanner*
+Spanner::find_broken_piece(Line_of_score*l)const
+{
+ for (int i=0; i < broken_into_l_arr_.size(); i++)
+ if(broken_into_l_arr_[i]->line_l() == l)
+ return broken_into_l_arr_[i];
+ return 0;
+
+}
+
+bool
+Spanner::broken_b()const
+{
+ return broken_into_l_arr_.size();
+}
/*
staff-column.cc -- implement Staff_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
{
assert(i);
Score_column * scorecolumn_l = req_col_l_->musical_column_l_;
- scorecolumn_l->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_,
- staff_l_->pstaff_l_);
+ scorecolumn_l->pcol_l_->pscore_l_->typeset_item(i, scorecolumn_l->pcol_l_);
}
/**
for (int i =0; i < item_l_arr.size(); i++)
item_l_arr[i]->translate(Offset(x, 0));
}
-/*
- UGR
- This still sux
+/**
+ TODO:
+ Write a "horizontal align" item, which aligns the pres, nobreaks, posts, etc.
+
*/
void
Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
PScore *ps_l=scol_l->pcol_l_->pscore_l_;
if (!c->breakable_b()) {
- for (int i =0; i < pre_p_arr.size(); i++)
+ for (int i =0; i < pre_p_arr.size(); i++) {
+ pre_p_arr[i]->unlink();
delete pre_p_arr[i];
+ }
pre_p_arr.set_size(0);
- for (int i =0; i < post_p_arr.size(); i++)
+ for (int i =0; i < post_p_arr.size(); i++) {
+ post_p_arr[i]->unlink();
delete post_p_arr[i];
+ }
post_p_arr.set_size(0);
}
for (int i =0; i < pre_p_arr.size(); i++) {
- ps_l->typeset_item(pre_p_arr[i], c, staff_l_->pstaff_l_,0);
+ ps_l->typeset_item(pre_p_arr[i], c,0);
}
for (int i =0; i < nobreak_p_arr.size(); i++) {
- ps_l->typeset_item(nobreak_p_arr[i], c, staff_l_->pstaff_l_,1);
+ ps_l->typeset_item(nobreak_p_arr[i], c, 1);
}
for (int i =0; i < post_p_arr.size(); i++) {
- ps_l->typeset_item(post_p_arr[i], c, staff_l_->pstaff_l_,2);
+ ps_l->typeset_item(post_p_arr[i], c, 2);
}
Interval pre_wid= align_items(pre_p_arr);
+++ /dev/null
-/*
- staff-elem-info.cc -- implement Score_elem_info
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "staff-elem-info.hh"
-#include "request.hh"
-
-Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l)
-{
- elem_l_ = s_l;
- voice_l_ = (r_l)?r_l->voice_l():0;
- req_l_ = r_l;
-}
-
-Score_elem_info::Score_elem_info()
-{
- elem_l_ = 0;
- voice_l_ = 0;
-
- req_l_ = 0;
-}
-
-
-
+++ /dev/null
-/*
- staff-elem.cc -- implement Score_elem
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "p-score.hh"
-#include "symbol.hh"
-#include "p-staff.hh"
-#include "molecule.hh"
-#include "staff-elem.hh"
-#include "debug.hh"
-
-String
-Score_elem::TeXstring() const
-{
- Molecule m(*output);
- m.translate(offset_); // ugh?
- return m.TeXstring();
-}
-
-Score_elem::Score_elem(Score_elem const&s)
- :dependancy_l_arr_(s.dependancy_l_arr_),
- dependant_l_arr_(s.dependant_l_arr_)
-{
- status = s.status;
- assert(!s.output);
- output = 0;
- pstaff_l_ = s.pstaff_l_;
- offset_ = Offset(0,0);
-}
-
-/**
- TODO:
- If deleted, then remove dependant_l_arr_ depency!
- */
-Score_elem::~Score_elem()
-{
- assert(status < DELETED);
- delete output;
- status = DELETED;
- output = 0;
-}
-
-void
-Score_elem::translate(Offset O)
-{
- offset_ += O;
-}
-
-Interval
-Score_elem::do_width() const
-{
- Interval r;
-
- if (!output){
- Molecule*m = brew_molecule_p();
- r = m->extent().x;
- delete m;
- } else
- r = output->extent().x;
- return r;
-}
-
-Interval
-Score_elem::width() const
-{
- Interval r=do_width();
-
- if (!r.empty_b()) // float exception on DEC Alpha
- r+=offset_.x;
-
- return r;
-}
-Interval
-Score_elem::do_height() const
-{
- Interval r;
- if (!output){
- Molecule*m = brew_molecule_p();
- r = m->extent().y;
- delete m;
- } else
- r = output->extent().y;
- return r;
-}
-
-Interval
-Score_elem::height() const
-{
- Interval r=do_height();
-
- if (!r.empty_b())
- r+=offset_.y;
-
-
- return r;
-}
-
-void
-Score_elem::print()const
-{
-#ifndef NPRINT
- mtor << name() << "{\n";
- do_print();
- if (output)
- output->print();
-
- mtor << "}\n";
-#endif
-}
-
-
-
-Score_elem::Score_elem()
-{
- pstaff_l_=0;
- offset_ = Offset(0,0);
- output = 0;
- status = ORPHAN;
-}
-
-
-Paper_def*
-Score_elem::paper() const
-{
- assert(pstaff_l_);
- return pstaff_l_->pscore_l_->paper_l_;
-}
-
-void
-Score_elem::add_processing()
-{
- if (status >= VIRGIN)
- return;
- status = VIRGIN;
- do_add_processing();
-}
-
-void
-Score_elem::pre_processing()
-{
- if (status >= PRECALCED )
- return;
- assert(status != PRECALCING); // cyclic dependency
- status = PRECALCING;
-
- for (int i=0; i < dependancy_l_arr_.size(); i++)
- if (dependancy_l_arr_[i])
- dependancy_l_arr_[i]->pre_processing();
-
-
- do_pre_processing();
- status = PRECALCED;
-}
-void
-Score_elem::post_processing()
-{
- if (status >= POSTCALCED)
- return;
- assert(status != POSTCALCING);// cyclic dependency
- status=POSTCALCING;
-
- for (int i=0; i < dependancy_l_arr_.size(); i++)
- if (dependancy_l_arr_[i])
- dependancy_l_arr_[i]->post_processing();
- do_post_processing();
- status=POSTCALCED;
-}
-
-void
-Score_elem::molecule_processing()
-{
- if (status >= OUTPUT)
- return;
- status = OUTPUT; // do it only once.
- for (int i=0; i < dependancy_l_arr_.size(); i++)
- if (dependancy_l_arr_[i])
- dependancy_l_arr_[i]->molecule_processing();
-
- output= brew_molecule_p();
-}
-
-void
-Score_elem::do_post_processing()
-{
-}
-
-void
-Score_elem::do_pre_processing()
-{
-}
-void
-Score_elem::do_verticalcing()
-{
-}
-
-void
-Score_elem::do_add_processing()
-{
-}
-
-void
-Score_elem::substitute_dependency(Score_elem * old, Score_elem * newdep)
-{
- bool hebbes_b=false;
- for (int i=0; i < dependancy_l_arr_.size(); i++) {
- if (dependancy_l_arr_[i] == old){
- dependancy_l_arr_[i] = newdep;
- hebbes_b = true;
- } else if (dependancy_l_arr_[i] == newdep) {
- hebbes_b = true;
- }
- }
- if (!hebbes_b)
- dependancy_l_arr_.push(newdep);
-}
-
-void
-Score_elem::add_dependency(Score_elem * p)
-{
- for (int i=0; i < dependancy_l_arr_.size(); i ++)
- if (dependancy_l_arr_[i] == p)
- return;
-
- dependancy_l_arr_.push(p);
- p->dependant_l_arr_.push(p);
-}
-IMPLEMENT_STATIC_NAME(Score_elem);
-
-Molecule*
-Score_elem::brew_molecule_p()const
-{
- Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0))));
- return new Molecule (a);
-}
-Offset
-Score_elem::offset() const
-{
- return offset_;
-}
/*
staff-info.cc -- implement Staff_info
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "proto.hh"
/*
staff-regs.cc -- implement Staff_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staff-side.cc -- implement Staff_side
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+#include "paper-def.hh"
#include "dimen.hh"
#include "staff-side.hh"
#include "staff-sym.hh"
staff_sym_l_ = s_l;
}
-Staff_side::Staff_side(Score_elem * elem_l)
+Staff_side::Staff_side()
{
- inter_f_ = 2 PT;
staff_size_i_ = 0;
staff_sym_l_=0;
- elem_l_ = elem_l;
dir_i_ =0;
inside_staff_b_ =false;
}
{
if (! staff_sym_l_)
return ;
- inter_f_ = staff_sym_l_->inter_note_f();
staff_size_i_ = staff_sym_l_->steps_i();
}
Staff_side::add_support(Score_elem*i)
{
support_l_arr_.push(i);
- elem_l_->add_dependency(i);
+ add_dependency(i);
}
int
Staff_side::get_position_i()const
{
- ((Staff_side*)this)->read_staff_sym();
if (!dir_i_) {
warning("Staff_side::get_position_i(): "
"somebody forgot to set my vertical direction, returning -20");
Real y=0;
+ Real inter_f = paper()-> internote_f();
if (!inside_staff_b_) {
- y = (dir_i_ > 0) ? staff_size_i_ + 2: -2;
- y *=inter_f_;
+ y = (dir_i_ > 0 && staff_sym_l_) ? staff_sym_l_->steps_i() + 2: -2;
+ y *=inter_f;
Interval v= support_height();
if (dir_i_ > 0) {
- y = y >? (v.max() + 2*inter_f_);
+ y = y >? (v.max() + 2*inter_f);
} else if (dir_i_ < 0) {
- y = y <? (v.min() - 2*inter_f_);
+ y = y <? (v.min() - 2*inter_f);
}
} else {
Interval v= support_height();
- y = v[dir_i_] + 2*dir_i_*inter_f_; // ugh
+ y = v[dir_i_] + 2*dir_i_*inter_f; // ugh
}
- return int(rint(Real(y)/inter_f_)); // should ret a float?
+ return int(rint(Real(y)/inter_f)); // should ret a float?
}
int
Staff_side::get_position_i(Interval sym_dim) const
{
int i= get_position_i();
- return i+ int(rint(- sym_dim[-dir_i_] / inter_f_));
+ return i+ int(rint(- sym_dim[-dir_i_] / paper()->internote_f()));
+}
+
+
+void
+Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
+{
+ int i;
+ while ((i=support_l_arr_.find_i(o) ) >=0)
+ if (n)
+ support_l_arr_[i] = n;
+ else
+ support_l_arr_.del(i);
+
+ if (staff_sym_l_ == o)
+ staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
}
/*
staff-sym-reg.cc -- implement Staff_sym_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staffsym.cc -- implement Staff_symbol
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
return new Molecule(a);
}
-Spanner*
-Staff_symbol::do_break_at(PCol*p1, PCol*p2)const
-{
- Staff_symbol *span_p=new Staff_symbol(*this);
- return span_p;
-}
-
void
Staff_symbol::set_extent(PCol*p1, PCol*p2)
{
Real
Staff_symbol::inter_note_f()const
{
- return paper()->internote();
+ return paper()->internote_f();
}
int
/*
staff-walker.cc -- implement Staff_walker
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
staff.cc -- implement Staff
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "input-register.hh"
+
#include "proto.hh"
+#include "plist.hh"
+#include "input-register.hh"
#include "staff.hh"
#include "score.hh"
#include "voice.hh"
#include "debug.hh"
#include "musical-request.hh"
#include "command-request.hh" // todo
-
+#include "staffline.hh"
+#include "complex-walker.hh"
+#include "super-elem.hh"
+#include "p-score.hh"
+#include "scoreline.hh"
void
Staff::add(Link_list<Voice*> const &l)
#ifndef NDEBUG
cols_.OK();
voice_list_.OK();
- iter_top(cols_, i);
- iter_top(cols_, j);
- i++;
assert(score_l_);
#endif
}
#endif
}
+Staff::~Staff()
+{
+ delete ireg_p_;
+}
+
Staff::Staff()
{
ireg_p_ =0;
score_l_ =0;
pscore_l_ =0;
- pstaff_l_ =0;
}
void
cols_.bottom().add(c_l);
c_l->staff_l_ = this;
}
+
+void
+Staff::set_output(PScore* pscore_l )
+{
+ pscore_l_ = pscore_l;
+ staff_line_l_ = new Line_of_staff;
+ pscore_l_->typeset_unbroken_spanner(staff_line_l_);
+ pscore_l_->super_elem_l_->line_of_score_l_->add_line(staff_line_l_);
+}
+
+
+Staff_walker *
+Staff::get_walker_p()
+{
+ return new Complex_walker(this);
+}
#include "p-col.hh"
#include "p-score.hh"
-static String
-make_vbox(Interval i)
-{
- if (i.empty_b())
- i = Interval(0,0);
- Real r = i.length();
- String s("\\vbox to ");
- s += print_dimen(r);
- s += "{\\vskip "+print_dimen(i.right)+" ";
- return s;
-}
-
-
-String
-Line_of_staff::TeXstring() const
-{
- String s("%line_of_staff\n");
-
- s+=make_vbox(height());
- // the staff itself: eg lines, accolades
- s += "\\hbox{";
- {
- iter_top(line_of_score_l_->cols,cc);
- Real lastpos=cc->hpos;
-
- // all items in the current line & staff.
- for (; cc.ok(); cc++) {
- String chunk_str;
-
- Real delta = cc->hpos - lastpos;
-
-
- if (cc->error_mark_b_) {
- chunk_str += String("\\columnerrormark");
- }
- // now output the items.
- for (iter_top(cc->its,i); i.ok(); i++) {
- if (i->pstaff_l_ == pstaff_l_)
- chunk_str += i->TeXstring();
- }
- // spanners.
- for (iter_top(cc->starters,i); i.ok(); i++)
- if (i->pstaff_l_ == pstaff_l_)
- chunk_str += i->TeXstring();
-
- if (chunk_str!="") {
- // moveover
- if (delta)
- s +=String( "\\kern ") + print_dimen(delta);
- s += chunk_str;
- lastpos = cc->hpos;
- }
- }
- }
- s+="\\hss}\\vss}";
- return s;
-}
-
-Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
-{
- line_of_score_l_=sc;
- pstaff_l_=st;
-
- PCol *linestart = sc->cols.top();
- PCol *linestop = sc->cols.bottom();
-
- for (iter_top(pstaff_l_->spans,i); i.ok(); i++) {
- PCol *brokenstart = &max(*linestart, *i->left_col_l_);
- PCol *brokenstop = &min(*linestop, *i->right_col_l_);
- if ( *brokenstart < *brokenstop) {
- Spanner*span_p =i->broken_at(brokenstart,brokenstop);
- line_of_score_l_->pscore_l_-> // higghl
- add_broken(span_p);
- }
- }
-}
-
-
-Interval
-Line_of_staff::height() const
-{
- Interval y(0,0);
-
- iter_top(line_of_score_l_->cols,cc);
-
- // all items in the current line & staff.
- for (; cc.ok(); cc++) {
- for (iter_top(cc->its,i); i.ok(); i++) {
- if (i->pstaff_l_ == pstaff_l_)
- y.unite(i->height());
-
- }
- // spanners.
- for (iter_top(cc->starters,i); i.ok(); i++)
- if (i->pstaff_l_ == pstaff_l_) {
- y.unite(i->height());
- }
- }
-
- return y;
-}
+IMPLEMENT_STATIC_NAME(Line_of_staff);
void
-Line_of_staff::process()
+Line_of_staff::add_element(Score_elem*elem_l)
{
-#if 0
- if (!pstaff_l_->stafsym_p_)
- pstaff_l_->brew_molecule_p(line_of_score_l_->pscore_l_->
- paper_l_->linewidth);
-#endif
+ if (!elem_l->group_element_i_)
+ Element_group::add_element(elem_l);
}
/*
- stem-beam-reg.cc -- part of LilyPond
+ stem-beam-reg.cc -- part of GNU LilyPond
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "grouping.hh"
#include "text-spanner.hh"
#include "complex-walker.hh"
-#include "complex-staff.hh"
#include "debug.hh"
#include "grouping.hh"
-#include "notehead.hh"
+#include "note-head.hh"
Stem_beam_register::Stem_beam_register()
{
}
if (stem_req_l_) {
- stem_p_ = new Stem(10);
+ stem_p_ = new Stem(8);
if (current_grouping)
current_grouping->add_child(
get_staff_info().time_C_->whole_in_measure_,
if (!stem_p_)
return;
- if (info.elem_l_->name() == Notehead::static_name() &&
+ if (info.elem_l_->name() == Note_head::static_name() &&
stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){
- Notehead * n_l= (Notehead*)info.elem_l_->item();
+ Note_head * n_l= (Note_head*)info.elem_l_->item();
stem_p_->add(n_l);
}
}
#include "dimen.hh"
#include "debug.hh"
#include "paper-def.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "lookup.hh"
#include "molecule.hh"
#include "p-col.hh"
return (dir_i_ < 0)? stem_bottom_f_ : stem_top_f_;
}
+
void
Stem::set_stemend(Real se)
{
}
void
-Stem::add(Notehead *n)
+Stem::add(Note_head *n)
{
n->add_dependency(this);
if (n->rest_b_) {
{
return !head_l_arr_.size();
}
+bool
+Stem::chord_b() const
+{
+ return head_l_arr_.size() > 1;
+}
+
+// if dir_i_ is set we return a fake value.
+
+int
+Stem::get_center_distance()
+{
+ if (dir_i_)
+ return -dir_i_;
+
+ int staff_center = staff_size_i_ / 2;
+ int min = min_head_i() - staff_center;
+ int max = max_head_i() - staff_center;
+ return (abs(max) > abs(min)) ? max : min;
+}
int
Stem::get_default_dir()
{
- int staff_center = staff_size_i_ /2;
if (dir_i_)
- return dir_i_;
- Real mean = (min_head_i() + max_head_i())/2;
- return (mean > staff_center) ? -1: 1;
+ return dir_i_;
+ return -sign(get_center_distance());
}
+
void
Stem::set_default_dir()
{
{
if(!head_l_arr_.size())
return;
- head_l_arr_.sort(Notehead::compare);
+ head_l_arr_.sort(Note_head::compare);
head_l_arr_[0]->extremal_i_ = -1;
head_l_arr_.top()->extremal_i_ = 1;
int parity=1;
Paper_def *p =paper();
- Real dy = p->internote();
+ Real dy = p->internote_f();
Symbol ss =p->lookup_l()->stem(bot*dy,top*dy);
out = new Molecule(Atom(ss));
}
+void
+Stem::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Item * o_l = o->item();
+ Item * n_l = n? n->item():0;
+ whole_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+ head_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+ rest_l_arr_.substitute((Note_head*)o_l, (Note_head*)n_l);
+}
--- /dev/null
+/*
+ super-elem.cc -- implement Super_elem
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "super-elem.hh"
+#include "scoreline.hh"
+#include "p-score.hh"
+
+String
+Super_elem::TeX_string()const
+{
+ String s;
+ for (int i=0; i < lines_arr_.size(); i++){
+ s += lines_arr_[i]->TeX_string();
+ if (i + 1<lines_arr_.size() )
+ s += "\\interscoreline"; // TODO
+ }
+ return s;
+}
+
+void
+Super_elem::handle_broken_dependencies()
+{
+ lines_arr_ = line_of_score_l_->get_lines();
+ for (int i =0; i < lines_arr_.size(); i++)
+ add_dependency(lines_arr_[i]);
+}
+
+
+void
+Super_elem::do_substitute_dependency(Score_elem*o,Score_elem* n)
+{
+ if (line_of_score_l_ == o->spanner())
+ line_of_score_l_ = n?(Line_of_score*)n->spanner():0;
+}
+
+Super_elem::Super_elem()
+{
+ line_of_score_l_ = new Line_of_score ;
+}
+
+void
+Super_elem::do_add_processing()
+{
+ pscore_l_->typeset_unbroken_spanner( line_of_score_l_ );
+ add_dependency(line_of_score_l_);
+}
+
+
+
+IMPLEMENT_STATIC_NAME(Super_elem);
/*
swallow-reg.cc -- implement Swallow_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
symtable.cc -- implement Symbol_table
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
if (elt_b(s))
return (*this)[s];
else {
- error( "Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
+ warning( "Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n");
+ Symbol sy; // unreachable
+ sy.tex = "";
+ return sy;
}
- Symbol sy; // unreachable
- return sy;
}
Symtable*
+/*
+ template1.cc -- instantiate some List classes
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "proto.hh"
#include "idealspacing.hh"
#include "plist.hh"
#include "spanner.hh"
#include "scoreline.hh"
#include "staffline.hh"
-#include "vertical-spanner.hh"
#include "pcursor.tcc"
#include "plist.tcc"
IPLC_instantiate(Line_of_score);
IPLC_instantiate(Line_of_staff);
-IPLC_instantiate(Item);
+IPLC_instantiate(Score_elem);
IPLC_instantiate(Spanner);
-IPLC_instantiate(Vertical_spanner);
-IPLC_instantiate(PStaff);
IPLC_instantiate(Idealspacing);
IPLC_instantiate(PCol);
/*
template2.cc -- instantiate some list templates.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
template4.cc -- instantiate Link_list baseclass.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#/*
template7.cc -- instantiate Request_column
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
m.add(a);
Symbol ret;
- ret.tex = m.TeXstring();
+ ret.tex = m.TeX_string();
ret.dim.y = Interval(0,width*slope);
ret.dim.x = Interval(0,width);
s.tex = f;
Atom a(s);
a.translate(Offset(dx/2,0));
- s.tex = a.TeXstring();
+ s.tex = a.TeX_string();
return s;
}
Atom a(s);
a.translate(Offset(dx/2,0));
s.dim = a.extent();
- s.tex = a.TeXstring();
+ s.tex = a.TeX_string();
return s;
}
Molecule mol;
mol.add(l);
Atom a(m);
- a.translate(Offset(0,slur_extra * internote()));
+ a.translate(Offset(0,slur_extra * internote_f()));
mol.add_right(m);
mol.add_right(r);
- mol.translate(Offset(0, l_dy * internote()));
+ mol.translate(Offset(0, l_dy * internote_f()));
Symbol s;
- s.tex = mol.TeXstring();
+ s.tex = mol.TeX_string();
s.dim = mol.extent();
return s;
}
/*
tex-stream.cc -- implement Tex_stream
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+
+ TODO
+
+ make an abstract interface to output, operations:
+
+ move(x,y), put(symbol).
*/
#include <fstream.h>
void
Tex_stream::header()
{
- *os << "% Creator: " << get_version_str();
+ *os << "% Creator: " << get_version_str() << "\n";
*os << "% Automatically generated, at ";
time_t t(time(0));
*os << ctime(&t)<<"\n";
String retval (source);
for (int i = 0 ; i < args.size(); i++)
substitute_arg(retval, args[i]);
+ /*
while (retval.index_i('%') >= 0)
substitute_arg(retval, "");
+ */
return retval;
}
/*
text-item.cc -- implement Text_item
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "lookup.hh"
Text_item::Text_item(Text_def *tdef_l, int d)
- : Staff_side(this)
{
dir_i_ = d;
fat_b_ = false;
if(dir_i_<0 ) // should do something better anyway.
mol_p->translate(Offset(0, -mol_p->extent().y.left ));
- mol_p->translate(Offset(0, pos_i_ * paper()->internote()));
+ mol_p->translate(Offset(0, pos_i_ * paper()->internote_f()));
return mol_p;
}
+/*
+ text-spanner.cc -- implement Text_spanner
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "molecule.hh"
#include "boxes.hh"
#include "text-spanner.hh"
void
Text_spanner::set_support(Directional_spanner*d)
{
- support = d;
+ if (support)
+ remove_dependency(support);
+
+ support =d;
add_dependency(d);
}
switch(spec.align_i_) {
case 0:
text_off_ = support->center() +
- Offset(0,support->dir_i_ * paper()->internote() * 4); // todo
+ Offset(0,support->dir_i_ * paper()->internote_f() * 4); // todo
break;
default:
assert(false);
return brew_molecule_p()->extent().y;
}
-Spanner*
-Text_spanner::do_break_at(PCol*c1, PCol*c2)const
+void
+Text_spanner::do_substitute_dependency(Score_elem* o, Score_elem*n)
{
- return new Text_spanner(*this); // todo
+ Directional_spanner * old = (Directional_spanner*)o->spanner();
+ if (support == old)
+ support = (Directional_spanner*) n->spanner();
}
+
/*
tie-reg.cc -- implement Tie_register
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "tie-reg.hh"
#include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "musical-request.hh"
#include "voice-element.hh"
void
Tie_register::acknowledge_element(Score_elem_info i)
{
- if (i.elem_l_->name() == Notehead::static_name()) {
+ if (i.elem_l_->name() == Note_head::static_name()) {
if (tie_p_) {
- tie_p_->set_head(-1, (Notehead*)i.elem_l_->item());
+ tie_p_->set_head(-1, (Note_head*)i.elem_l_->item());
melodic_req_l_ = i.req_l_->musical()->melodic();
}
if (end_tie_p_) {
- end_tie_p_->set_head(1, (Notehead*)i.elem_l_->item());
+ end_tie_p_->set_head(1, (Note_head*)i.elem_l_->item());
if (!Melodic_req::compare ( *end_melodic_req_l_, *melodic_req_l_))
end_tie_p_->same_pitch_b_ = true;
announce_element(Score_elem_info(end_tie_p_,end_req_l_));
/*
tie.cc -- implement Tie
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "paper-def.hh"
#include "tie.hh"
-#include "notehead.hh"
+#include "note-head.hh"
#include "p-col.hh"
-Spanner*
-Tie::do_break_at(PCol*l, PCol*r) const
-{
- Tie * tie_p = new Tie(*this);
- Line_of_score const *line_C=l->line_l_;
- tie_p->left_head_l_ = (left_head_l_->line_l()== line_C) ?
- left_head_l_ : 0;
- tie_p->right_head_l_ = (right_head_l_->line_l() == line_C)?
- right_head_l_ : 0;
-
- return tie_p;
-}
void
-Tie::set_head(int x_pos, Notehead * head_l)
+Tie::set_head(int x_pos, Note_head * head_l)
{
if (x_pos >0) {
assert(!right_head_l_);
right_col_l_ = right_head_l_ -> pcol_l_;
}
+/**
+ This is already getting hairy. Should use Note_head *heads[2]
+ */
void
Tie::do_post_processing()
{
left_dx_f_ += 0.25;
} else
left_dx_f_ += 0.5;
+
+ if (!right_head_l_)
+ right_pos_i_ = left_pos_i_;
+ if (! left_head_l_)
+ left_pos_i_ = right_pos_i_;
+}
+
+
+
+void
+Tie::do_substitute_dependency(Score_elem*o, Score_elem*n)
+{
+ Note_head *new_l =n?(Note_head*)n->item():0;
+ if (o->item() == left_head_l_)
+ left_head_l_ = new_l;
+ else if (o->item() == right_head_l_)
+ right_head_l_ = new_l;
}
+IMPLEMENT_STATIC_NAME(Tie);
/*
time-description.cc -- implement Time_description
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+++ /dev/null
-/*
- vertical-brace.cc -- implement
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "vertical-brace.hh"
+++ /dev/null
-/*
- vertical-spanner.cc -- implement Vertical_spanner
-
- source file of the LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "vertical-spanner.hh"
-
-Vertical_spanner::Vertical_spanner()
-{
- upper_pstaff_l_ = lower_pstaff_l_ = 0;
-}
-
-IMPLEMENT_STATIC_NAME(Vertical_spanner);
-
/*
voice-elt.cc -- implement Voice_element
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
voicegroup.cc -- implement Voice_group_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
voice-regs.cc -- implement Voice_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
voice.cc -- implement Voice
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
/*
walkregs.cc -- implement Walker_registers
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "debug.hh"
#include "walk-regs.hh"
#include "staff-regs.hh"
-#include "staff-elem.hh"
+#include "score-elem.hh"
#include "staff.hh"
#include "complex-walker.hh"
#include "staff-column.hh"
#include "score-walker.hh"
#include "bar.hh" // needed for Bar::static_name
#include "input-register.hh"
+#include "staffline.hh"
Walker_registers::Walker_registers(Complex_walker *w)
{
void
Walker_registers::typeset_element(Score_elem *elem_p)
{
- typeset_musical_item(elem_p);
-}
-
-void
-Walker_registers::typeset_musical_item(Score_elem * elem_p)
-{
- walk_l_->typeset_element(elem_p);
+ musical_item_p_arr_.push(elem_p);
}
void
Walker_registers::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
Item * post_p)
{
- if (pre_p)
+ if (pre_p) {
prebreak_item_p_arr_.push(pre_p);
- if (nobreak_p)
+ walk_l_->staff_l_->staff_line_l_->add_element(pre_p);
+ }
+ if (nobreak_p) {
nobreak_item_p_arr_.push(nobreak_p);
- if (post_p)
+ walk_l_->staff_l_->staff_line_l_->add_element(nobreak_p);
+ }
+ if (post_p) {
postbreak_item_p_arr_.push(post_p);
+ walk_l_->staff_l_->staff_line_l_->add_element(post_p);
+ }
}
void
walk_l_->ptr()->typeset_breakable_items(prebreak_item_p_arr_,
nobreak_item_p_arr_,
postbreak_item_p_arr_);
+ for (int i=0; i < musical_item_p_arr_.size(); i++)
+ walk_l_->typeset_element(musical_item_p_arr_[i]);
+ musical_item_p_arr_.set_size(0);
}
void
Walker_registers::post_move_processing()
/*
warn.cc -- implement warning and error messages. Needs cleanup.
- source file of the LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+/*
+ wordwrap.cc -- implement Word_wrap
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "break.hh"
#include "p-score.hh"
#include "debug.hh"
-
+#include "p-col.hh"
/** el stupido. This should be done more accurately:
It would be nice to have a Dynamic Programming type of algorithm
uninstallexe:
for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $a`; done
+
+ifneq ($(DEPFILES),)
+include $(DEPFILES)
+endif
Begin3
Title: LilyPond
-Version: 0.0.64
-Entered-date: 05/16/97
+Version: 0.0.65
+Entered-date: 05/23/97
Description: LilyPond is a program which converts a music-script (mudela) into
TeX output, or MIDI to produce multi-staff scores. Features include multiple
meters, clefs, keys, lyrics, versatile input-language, cadenzas
jan@digicash.com (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: pcnov095.win.tue.nl /pub/lilypond/
- 300k lilypond-0.0.64.tar.gz
+ 300k lilypond-0.0.65.tar.gz
Alternate-site:
Original-site:
Platform: unix/win32, GNU C++
Name: lilypond
-Version: 0.0.64
+Version: 0.0.65
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.64.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.65.tar.gz
Summary: A preprocessor to make TeX typeset music.
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>
make all
%install
rm -rf $RPM_BUILD_ROOT
-strip bin/lilypond bin/mi2mu
+strip lily/out/lilypond mi2mu/out/mi2mu
make prefix="$RPM_BUILD_ROOT/usr" install
%files
%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/lelie_logo.gif
/usr/bin/lilypond
/usr/lib/libflower.so
/usr/bin/mi2mu
+/usr/man/man1/mi2mu.1
/usr/man/man1/lilypond.1
/usr/man/man5/mudela.5
/usr/man/man1/convert-mudela.1
/usr/share/lilypond/
%post
-texhash
-%post
-texhash
+echo please run texhash to update TeX directory listings
make all
%install
rm -rf $RPM_BUILD_ROOT
-strip bin/lilypond bin/mi2mu
+strip lily/out/lilypond mi2mu/out/mi2mu
make prefix="$RPM_BUILD_ROOT/usr" install
%files
%doc @TEXT_DOCS@ @EXAMPLE_LYS@ Documentation/lelie_logo.gif
/usr/bin/lilypond
/usr/lib/libflower.so
/usr/bin/mi2mu
+/usr/man/man1/mi2mu.1
/usr/man/man1/lilypond.1
/usr/man/man5/mudela.5
/usr/man/man1/convert-mudela.1
/usr/share/lilypond/
%post
-texhash
-%post
-texhash
+echo please run texhash to update TeX directory listings
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 16
+PATCH_LEVEL = 17
# use to send patches, always empty for released version:
MY_PATCH_LEVEL =
#
# list of distribution files:
#
-DISTFILES = Makefile .version $(ALL_SOURCES)
-
+EXTRA_DISTFILES = .version TODO
#
# list of custom libraries:
--- /dev/null
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation.
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+ * important? lily is important, go work on lily!
+
+ * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+ * write something interesting in mi2mu manual page
+
+ * check/use type 0 / 1 / 2 of midi file
+
+ * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+ * use dynamic info
+
+ * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+ * lyric events
+
+ * parse all midi events
+
+ * handle time based midi files
+
+ * use dstream feature from lily
+
+ * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+ * read unsigned words as U16 (not as I16)
+
+ * check use of integral and unsigned in lexer
+
+ * get rid of ugly statics in Duration_convert
+
+ * change option double-dots to max-dots
+
+ * set Key, Meter, ... command line options
+
+BUGS
+
+ * mi2mu nonexist.midi ?
+
+ * output of 0 duration c'0
+
+ * no output on certain midis
+
+ * silly progress indicator upon mudela output
+
+ * check for illegal track names, e.g. "Piano________ = \melodic"
+
+ * array memleaks(?): use Link_array / create Pointer_array?
+
+ * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*>
+
+ * split notes that cross bar limit
+
+FUTURE
+
+ * guess plets (i.e.: only use plet-duration *2/3 if there's a
+ whole plet)
+
+ * merge midi-events with lily's midi-items?
+
+ * guess beams
+
+ * guess / follow tempo changes
+
+ * check out NIFF / analogies?
+
+ * steal good ideas of other gpl midi parsers
+
+ * lily: add mudela info into midi as specials
+ mi2mu: use special info
+
+# mi2mu/TODO
+
+Most of the items are marked in the code as well, with full explanation.
+grep for TODO and ugh/ugr
+
+
+IMPORTANT
+
+ * important? lily is important, go work on lily!
+
+ * faq about mi2mu midi t1. ?
+
+PROJECTS
+
+ * write something interesting in mi2mu manual page
+
+ * check/use type 0 / 1 / 2 of midi file
+
+ * create Indentable_stream (see Tex_stream) as base for Lily_stream
+
+ * use dynamic info
+
+ * use aftertouch info (to guess slurs/ties, scripts (staccato?))
+
+ * lyric events
+
+ * parse all midi events
+
+ * handle time based midi files
+
+ * use dstream feature from lily
+
+ * midi esp.: use I32 iso int where 32 bits are needed (or assumed...)
+
+ * read unsigned words as U16 (not as I16)
+
+ * check use of integral and unsigned in lexer
+
+ * get rid of ugly statics in Duration_convert
+
+ * change option double-dots to max-dots
+
+ * set Key, Meter, ... command line options
+
+BUGS
+
+ * mi2mu nonexist.midi ?
+
+ * output of 0 duration c'0
+
+ * no output on certain midis
+
+ * silly progress indicator upon mudela output
+
+ * check for illegal track names, e.g. "Piano________ = \melodic"
+
+ * array memleaks(?): use Link_array / create Pointer_array?
+
+ * fix "#undef MEVENT_LIST" source tree: Array<Midi_event*>
+
+ * split notes that cross bar limit
+
+FUTURE
+
+ * guess plets (i.e.: only use plet-duration *2/3 if there's a
+ whole plet)
+
+ * merge midi-events with lily's midi-items?
+
+ * guess beams
+
+ * guess / follow tempo changes
+
+ * check out NIFF / analogies?
+
+ * steal good ideas of other gpl midi parsers
+
+ * lily: add mudela info into midi as specials
+ mi2mu: use special info
+
--- /dev/null
+/*
+ mi2mu-proto.hh -- declare type names in mi2mu
+
+ source file of mi2mu, part of the GNU LilyPond package,
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MI2MU_PROTO_HH
+#define MI2MU_PROTO_HH
+
+
+struct Lily_stream ;
+class Midi_event ;
+class Midi_key ;
+class Midi_note ;
+class Midi_tempo ;
+class Midi_text ;
+class Midi_time ;
+class Midi_score ;
+class Midi_track ;
+class Midi_voice ;
+class My_midi_lexer ;
+class My_midi_parser ;
+class Track_column ;
+
+#endif // MI2MU_PROTO_HH
#include <ctype.h>
#include <time.h>
+#include "mi2mu-proto.hh"
#include "proto.hh"
#include "plist.hh"
#include "warn.hh"
// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
#include "mi2mu.hh"
+#include "path.hh"
Sources source;
Sources* source_l_g = &source;
exit( 0 );
break;
case 'x':
- Duration_convert::no_double_dots_b_s = false;
+ Duration_convert::no_double_dots_b_s = true;
break;
default:
assert( 0 );
str += String( (char)( ( key_i_ + 2 ) % 7 + 'A' ) );
else // heu, -2: should be - 1 1/2: A -> fis
str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a' ) );
-// if ( !command_mode_bo )
-// str = String( '\\' ) + str;
str = String( "%" ) + str + "\n"; // "\key\F" not supported yet...
return str;
}
this switch can be used to write simple plets like
c4*2/3
as
- \plet{ 2/3 } c4 \plet{ 1/1 }
+ \plet 2/3; c4 \plet 1/1;
*/
bool const Midi_note::simple_plet_b_s = true;
Midi_note::mudela_str( bool command_mode_bo )
{
// assert( !command_mode_bo );
+ if ( !dur_.type_i_ )
+ return "";
+
if ( simple_plet_b_s )
return name_str_ + Duration_convert::dur2_str( dur_ );
//ugh
String str;
if ( dur_.plet_b() )
- str += String( "\\plet{ " )
+ str += String( "\\plet " )
+ String_convert::i2dec_str( dur_.plet_.iso_i_, 0, 0 )
+ "/"
+ String_convert::i2dec_str( dur_.plet_.type_i_, 0, 0 )
- + " } ";
+ + "; ";
str += name_str_;
str += Duration_convert::dur2_str( dur );
if ( dur_.plet_b() )
- str += String( " \\plet{ 1/1 }" );
+ str += String( " \\plet 1/1;" );
return str;
}
String
Midi_time::mudela_str( bool command_mode_bo )
{
- String str = "\\meter{ "
+ String str = "\\meter "
+ String( num_i_ ) + "/" + String( 1 << den_i_ )
- + " }";
-// if ( !command_mode_bo )
-// str = String( '\\' ) + str;
+ + ";";
return str;
}
%{//-*-Fundamental-*-
// midi-lexer.l
+/*
+ yes, i know that midi is not really a (n evolving?) language,
+ and that using lex/yacc to parse midi is overkill, as well as
+ a grand example of misuse and asking for performance loss.
+
+ it is, however, quite robust, simple, and very easy to extend
+ incrementally.
+ */
+
/*
backup rules
char c;
int i;
String* str_p;
- Request* request_p;
Midi_event* midi_event_p; // Voice_element* ?
Midi_score* midi_score_p; // Input_score* ?
Midi_track* midi_track_p; // Input_music* ?
lily_stream << "\\score{";
lily_stream.indent();
for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
+ if ( ( midi_track_p_list_.size() != 1 )
+ && ( i == midi_track_p_list_.top() ) )
+ continue;
lily_stream << "\\staff{ melodicregs ";
lily_stream << i->name_str();
lily_stream << " }";
tcol_l->midi_event_p_array_.del( 0 );
}
#else
- for ( int i = 0; i < tcol_l->midi_event_p_array_.size(); i++ ) {
- get_free_midi_voice_l( tcol_l->mom() )->add_event( tcol_l->midi_event_p_array_[ i ] );
- tcol_l->midi_event_p_array_[ i ] = 0;
+ for ( int j = 0; j < tcol_l->midi_event_p_array_.size(); j++ ) {
+ get_free_midi_voice_l( tcol_l->mom() )->add_event( tcol_l->midi_event_p_array_[ j ] );
+ tcol_l->midi_event_p_array_[ j ] = 0;
}
tcol_l->midi_event_p_array_.clear();
#endif
//IPL_instantiate(Midi_event);
IPL_instantiate(Midi_track);
// PL_instantiate(Midi_voice);
-// IPL_instantiate(Midi_voice);
+IPL_instantiate(Midi_voice);
//IPL_instantiate(Track_column);