File_path 1
My_lily_lexer 1
PCol 0
-Score_column 1
-Ineq_constrained_qp 1
-Spacing_problem 1
-Colinfo 1
-Mixed_qp 1
+Score_column 0
+Ineq_constrained_qp 0
+Spacing_problem 0
+Colinfo 0
+Mixed_qp 0
PScore 0
-Idealspacing 1
+Idealspacing 0
# yydebug
InitParser 1
InitLexer 1
Lexer 1
-parse_duration 1
-parse_pitchmod 1
-Col_configuration 1
+parse_duration 0
+parse_pitchmod 0
+Col_configuration 0
Request 0
Note_req 0
Rhythmic_req 0
-Rest_req 1
-delete_identifiers 1
-Command 1
-Staff_commands 1
-Stem 1
-Staff 1
-Score 1
+Rest_req 0
+delete_identifiers 0
+Command 0
+Staff_commands 0
+Stem 0
+Staff 0
+Score 0
Voice 0
Voice_element 0
-Input_cursor 1
-Commands_at 1
-Input_command 1
-Time_description 1
+Input_cursor 0
+Commands_at 0
+Input_command 0
+Time_description 0
Melodic_req 0
-Midi_walker 1
-Stem_req 1
+Midi_walker 0
+Stem_req 0
Group_change_req 0
-Script_req 1
-Colinfo 1
-Word_wrap 1
+Script_req 0
+Colinfo 0
+Word_wrap 0
Text_req 0
-Script_def 1
+Script_def 0
Text_def 0
-Paperdef 1
+Paperdef 0
Symtable 1
Symtables 1
TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 67
+TOPLEVEL_PATCH_LEVEL = 68
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL = pre
[DRAFT]
+ Born .. 1997,
+
+ Lily
+
+ GNU LilyPond 0.1, daughter to
+
+ Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
+
+Lily is a health baby weighing 330 kilobyte
+
+Visiting hours: 24hrs a day at ftp://, pictures & droppings at http://
+
+Congratulations to janneke & wendy, hanwen@stack.nl, jan@digicash.com
+
+**************************
+
+ I would like to dedicate this program to all friends that
+music got me. Those deserving special mention (In no particular order)
+Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn,
+Maartje, Suzanne, Ilse (gee, again?), and last (but certainly not
+least) Janneke!
+
+ HW
+
+[misschien wat monieks invoegen?]
+
+**************************
+
Announcing
GNU LilyPond
-19/May/97 LilyPond 0.0.67 1
+19/May/97 LilyPond 0.0.68 1
Use them.
+The following generic identifications are used:
+
+ up == 1
+ left == -1
+ right == 1
+ down == -1
+
+Intervals are pictured lying on a horizontal numberline (Interval[-1]
+is the minimum)
+
issue: in a future version, GNU LilyPond might bypass TeX, but at the moment
TeX is very convenient for producing output.
-
=item *
GNU LilyPond does not display notes directly, nor will it be rehacked to be
=item *
-define the (musical) message of the composer as unambiguously as possible,
+define the (musical) message of the composer as unambiguously as possible.
+
+This means that, given a piece Mudela, it should be possible for a
+program to play a reasonable interpretation of the piece.
+
+It also means that, given a piece of Mudela, it should be possible for a
+program to print a score of the piece.
=item *
-be intuitive, and easily readable
-(compared to, say, Musi*TeX input, or MIDI :-),
+be intuitive, and easily readable (compared to, say, Musi*TeX input,
+or MIDI :-),
=item *
-be writable in ASCII with a simple texteditor, yfte(TM).
+be easily writable in ASCII with a simple texteditor, yfte(TM).
=back
=item *
-short excerpts to be used in musicological publications.
+Short excerpts to be used in musicological publications.
=back
localuninstall:
rm -f $(mandir)/man1/lilypond.1
rm -f $(mandir)/man1/convert-mudela.1
+
+xpms:
A:
- ~/something
- lilypond # the directory as unpacked from the tarball
- releases # directory for .tar.gz releases
- patches # directory for patches between different releases
+ ~/something/
+which contains:
+
+ lilypond/ # the directory as unpacked from the tarball
+ releases/ # directory for .tar.gz releases
+ patches/ # directory for patches between different releases
+ test/
+
~/something/lilypond/bin is in the PATH, and contains symlinks to the
compiled executables.
+If you don't use patches, you'd probably want to symlink
+
+ lilypond -> lilypond-x.y.z
+
=head2 Language: mudela
Q: Why can't you type C<#c> in stead of C<cis> ?
cis cis
#c #c
+Why, you might ask? Because independently of how it was written, you
+would say that you are playing and reading "two C-sharp" notes.
+
+
+Q: What is C<cis> anyway
+
+A: C<cis> is the dutch naming for C-sharp. The notes are named
+a, b,.., g. The suffix -is means sharp, and -es flat. This system is
+common in a number of languages (such as swedish, dutch, german.)
+Certain other languages (such as English, French and Italian) just add
+the word for "sharp" to the notename.
+
+We chose the Dutch system, because we're dutch. You are free to chose
+whatever names you like; they are user definable.
Q: I can type
=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.
-
+Preferably in Metafont, suited to both screen display and use on
+paper; This is because the copyright heritage of {Opus,Musix}tex is unclear.
=item A typesetting engine.
</a
>
+=item *
+<a href=other-packages.html
+>
+Other packages for printing music.
+</a
+>
+
=item *
<a href=mi2mu.html
>
=head1 NAME
-Lily literature -- reading on music engraving
+Lily literature -- reading on music engraving/typesetting/etc.
=head1 DESCRIPTION
A list of resources on music printing/writing and engraving. Please
-note that don't have access to most material (except Wanske and a
-library copy of Chlapik)
+note that don't have access to most material.
+[What I do know, I've commented inside brackets. They are just
+my personal comments, not to be taken too seriously]
More on GNU Music: http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
=head2 References
-[partly by Mark Basinski <basinski@arizona.edu>]
-
-Chlapik, Herbert. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
-ISBN 3-9000 035-96-2.
-
Wanske, Helene. ``Musiknotation --- Von der Syntax des Notenstichs
-zum EDV-gesteuerten-1 Notensatz'', Schott-Verlag, Mainz 1988. ISBN
-3-7957-2886-x. 1) e(lektronischen) D(aten)v(erarbeitung).
+zum EDV-gesteuerten Notensatz'', Schott-Verlag, Mainz 1988. ISBN
+3-7957-2886-x.
+
+[I. A very thorough overview of engraving practices of various
+craftsmen. It includes detailed specs of characters, dimensions etc.
+II. a thorough overview of a (by now antiquated) automated system
+called Ikarus; EDV Means e(lektronischen) D(aten)v(erarbeitung),
+electronic data processing]
Maxwell Weaner and Walter Boelke, Standard Music Notation Practice,
revised edition by Arnold Broido and Daniel Dorff. Music Publisher's
Association of the United States Inc., 1993.
-
+
W.A. Hegazy and J. S. Gourlay. Optimal line breaking in music. In
``Document Manipulation and Typography'', J.C. van Vliet (ed) 1988.
+[This generalizes TeX's breaking algorithm to music]
+
Ross, Ted. ``Teach yourself the art of music engraving and
processing'' (3rd edition). Hansen House, Miami Beach, FL.
Read, Gardner. ``Music Notation'' (2nd edition). Taplinger Publishing,
New York.
-
+
[This is as close to the ``standard'' reference work for music notation issues
as one is likely to get.]
-The University of Colorado Music Engraving page.
-http://www.cc.colorado.edu/cgi-bin/mfs/01/Dept/MU/Musicpress/Welcome.html
+=head2 Related papers
+
+David A. Gomberg; A Computer-oriented System for Music Printing.
+Computers and the Humanities, Vol.11, pp 63-80.
+
+J. Gourlay, ``Spacing a Line of Music,'' Technical Report
+OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+The Ohio State University, 1987.
+
+J. Gourlay, A. Parrish, D. Roush, F. Sola, Y. Tien, ``Computer
+Formatting of Music,'' Technical Report OSU-CISRC-2/87-TR3,
+Department of Computer and Information Science, The Ohio State
+University, 1987.
+
+W. Hegazy, ``On the Implementation of the MusiCopy Language
+Processor,'' Technical Report OSU-CISRC-10/87-TR34, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+A. Parrish and J. Gourlay, ``Computer Formatting of Musical
+Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department
+of Computer and Information Science, The Ohio State University, 1987.
+
+D. Roush, ``Music Formatting Guidelines,'' Technical Report
+OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
+The Ohio State University, 1988.
+
+F. Sola, ``Computer Design of Musical Slurs, Ties and Phrase
+Marks,'' Technical Report OSU-CISRC-10/87-TR32, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+F. Sola and D. Roush, ``Design of Musical Beams,'' Technical
+Report OSU-CISRC-10/87-TR30, Department of Computer and Information
+Science, The Ohio State University, 1987.
+
+J. S. Gourlay. A language for music printing. In ``Communications of
+the ACM''. Vol. 29(5), 388--401, 1986.
+
+[This paper describes a vapourware music setting system and an input
+language to go with it. ]
+
+D. Blostein and L. Haken, The Lime Music Editor: A Diagram Editor
+Involving Complex Translations, Software Practice and Experience,
+Vol. 24, No. 3, March 1994, pp. 289-306.
+
+[A description of various conversions, decisions and issues relating
+to this interactive editor]
+
+L. Haken and D. Blostein, The Tilia Music Representation:
+Extensibility, Abstraction, and Notation Contexts for the Lime Music
+Editor, Computer Music Journal, Vol. 17, No. 3, 1993, pp. 43-58
+
+[A description of Lime internals (which resemble LilyPond pre 0.0.68
+data structures somewhat)]
+
+L. Haken and D. Blostein, A New Algorithm for Horizontal Spacing of
+Printed Music, International Computer Music Conference, Banff,
+Sept. 1995, pp. 118-119.
+
+[This describes an algorithm which uses springs between adjacent
+columns. This algorithm is a "subclass" of the LilyPond algorithm.]
+
+D. Blostein and L. Haken, Justification of Printed Music,
+Communications of the ACM, VolJ34, No. 3, March 1991, pp. 88-99.
+
+[This paper provides a shallow overview of the algorithm used in LIME
+for spacing individual lines.]
=head2 Further reading
+Chlapik, Herbert. ``Die Praxis des Notengraphikers''. Doblinger, 1987.
+ISBN 3-9000 035-96-2.
+
+[An clearly written book for the casually interested reader. It shows
+some of the conventions and difficulties in printing music]
+
+The University of Colorado Music Engraving page.
+http://obenamots.cc.colorado.edu/cgi-bin/Musicpress/engraving.html
+
(of varying usefulness):
Donato, Anthony. Preparing Music Manuscript. Englewood Cliffs:
Roelofs, Ren\'e. ``Een Geautomatiseerd Systeem voor het Afdrukken van
Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
universiteit Rotterdam, 1991. (``An automated system for printing
-music'' Master's Thesis Management and Computer Science.)
+music'' Master's Thesis Managerial Computer Science.)
+
+[This thesis describes a simplistic (monophonic) typesetting system,
+and focuses on the breaking algorithm, which is taken from Hegazy & Gourlay]
C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
(CA), 1973.
Stone, Kurt. Music Notation in the Twentieth Century. New York: Norton, 1980.
-
-=head2 On typesettig programs
-
-From: Miguel Filgueiras <mig@ncc.up.pt>
-
-... as well as other systems. I contribute with some references:
-
-
-D. Blostein, L. Haken, The Lime Music Editor: a Diagram Editor
-Involving Complex Translations. {\em
-Software --- Practice and Experience}, Vol. 24(3), 289--306, 1994.
-
-Alexander Brinkman, {\em PASCAL Programming for Music Research}.
-The University of Chicago Press, 1990.
-
-Miguel Filgueiras, Implementing a Symbolic Music Processing
-System. LIACC, Universidade do Porto, 1996; submitted.
-
-Miguel Filgueiras, Some Music Typesetting Algorithms. LIACC,
-Universidade do Porto, {\em forthcoming}.
-
- Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of
-\SceX, a Music Typesetting System. Centro de Inform\'atica da
-Universidade do Porto, 1993.
-
-Miguel Filgueiras and Jos\'e Paulo Leal. Representation and
-manipulation of music documents in \SceX. {\em Electronic Publishing},
-vol. 6 (4), 507--518, 1993.
-
-Eric Foxley, Music --- A language for typesetting music scores. {\em
-Software --- Practice and Experience}, Vol. 17(8), 485--502, 1987.
-
-John S. Gourlay, A language for music printing. {\em Communications of
-the ACM}, Vol. 29(5), 388--401, 1986.
-
-Cindy Grande, NIFF6a Notation Interchange File Format.
-Grande Software Inc., 1995. {\tt ftp:blackbox.cartah.washington.edu}
-
-Fran\c{c}ois Jalbert, Mu\TeX\ User's Guide (Version $1.1$). Computer
-Science Department, University of British Columbia, 1989.
-
-Peter S. Langston, Unix music tools at Bellcore. {\em
-Software --- Practice and Experience}, Vol. 20(S1), S1/47--S1/61, 1990.
+=head2 other stuff
Andreas Mahling, J. Herczeg, M. Herczeg and S<H.-D.> B\"ocker, Beyond
visualization: knowing and understanding. In P.~Gorny, M.~J. Tauber
-(eds.), {\em Visualization in Human-Computer Interaction}, Lecture
+(eds.), Visualization in Human-Computer Interaction, Lecture
Notes in Computer Science, 439, 16--26, Springer-Verlag, 1990.
-Jan Nieuwenhuizen, Using \TeX\ and the MusiX\TeX\ macro package to
-write parts and scores of music. Department of Physics, Eindhoven
-University of Technology, 1995.
+Peter S. Langston, Unix music tools at Bellcore.
+Software --- Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
-Don Simons, PMX, A Preprocessor for MusiX\TeX\ (Version 1.04).
-dsimons@logicon.com.
+[This paper deals with some command-line tools for music editing and
+playback. It doesn't mention notation issues, but does come with the
+grand idea (not) of using music to monitor complex systems. Imagine your
+nuclear plant supervisor to use AC/DC for checking the reactor]
-Daniel Taupin. Music\TeX: Using \TeX\ to Write Polyphonic or
-Instrumental Music (Version 5.17). Laboratoire de Physique des
-Solides, Centre Universitaire, Orsay, 1996.
+Cindy Grande, NIFF6a Notation Interchange File Format.
+Grande Software Inc., 1995. ftp://blackbox.cartah.washington.edu/pub/
+
+[Specs for NIFF, a comprehensive but binary (yuk) format for notation]
-Daniel Taupin, Ross Mitchell and Andreas Egler, Musix\TeX: Using \TeX\
-to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire
-de Physique des Solides, Centre Universitaire, Orsay, 1993.
+Miguel Filgueiras and Jos\'e Paulo Leal. Representation and
+manipulation of music documents in SceX. Electronic Publishing,
+vol. 6 (4), 507--518, 1993.
-Barry Vercoe, Csound --- A Manual for the Audio Processing System and
-Supporting Programs with Tutorials. Media Lab, M.I.T., Cambridge,
-Massachusetts, 1986 (rev. 1992).
+Eric Foxley, Music --- A language for typesetting music scores.
+Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
-Chris Walshaw, {\tt ABC2M\TeX} --- An easy way of transcribing folk
-and traditional music. School of Maths, University of Greenwich, 1993.
+[A paper on a TROFF preprocessor to typeset music. The output shown is
+not very sophisticated, and contains some typographical atrocities]
+Alexander Brinkman, PASCAL Programming for Music Research.
+The University of Chicago Press, 1990.
+Miguel Filgueiras, Implementing a Symbolic Music Processing
+System. LIACC, Universidade do Porto, 1996; submitted.
+Miguel Filgueiras, Some Music Typesetting Algorithms. LIACC,
+Universidade do Porto, forthcoming.
effective language for defining music. We call this language
(rather arrogantly) The Musical Definition Language (S<Mudela 0.1>).
+[If anybody comes up with a better name, we'd gladly take this Gourlay
+already uses Musical Description Language, GSharp Score Definition
+Language. We're not being original here]
+
The first aim of Mudela is to define a piece of music,
being complete from both from a musical typesetting,
as from a musical performing point of view.
and up-to-date definition, see F<lily/parser.y> and F<lily/lexer.l>):
As a related note, you should take a look at the examples and the init
-file, as this document does not cover every aspect of mudela yet, and
+files, as this document does not cover every aspect of mudela yet, and
may be out of date.
=head2 Files
--- /dev/null
+=head1 NAME
+
+Other-packages -- related packages
+
+=head1 DESCRIPTION
+
+A (not-at-all complete) overview of other music-typesetting/notation
+packages. Feel free to add info (and mail it to me). Partly based on
+a reflist by Miguel Filgueiras <mig@ncc.up.pt>.
+
+=head2 Free packages (with source)
+
+G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+
+Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html
+
+Common Music/Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp
+
+Vivace
+
+MPP, http://www.stack.nl/~hanwen/mpp-english.html
+
+Jan Nieuwenhuizen, Using TeX and the MusiXTeX macro package to
+write parts and scores of music. Department of Physics, Eindhoven
+University of Technology, 1995.
+
+
+MusE
+
+A-R Editions, Inc.
+
+Mup, http://www.arkkra.com/
+
+A program which creates PS from a script input. Although it comes with
+C source code, it is Shareware ($29).
+
+PMX
+
+Don Simons, PMX, A Preprocessor for MusiXTeX (Version 1.04).
+dsimons@logicon.com.
+
+Musi*TeX, http://www.gmd.de/misc/music
+
+Daniel Taupin, Ross Mitchell and Andreas Egler, MusixTeX: Using TeX
+to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire
+de Physique des Solides, Centre Universitaire, Orsay, 1993.
+
+ABC2MTeX
+
+Chris Walshaw, ABC2MTeX --- An easy way of transcribing folk
+and traditional music. School of Maths, University of Greenwich, 1993.
+
+SceX
+
+Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of
+SceX, a Music Typesetting System. Centro de Inform\'atica da
+Universidade do Porto, 1993.
+
+MUTEX
+
+Fran\ccois Jalbert, MuTeX User's Guide (Version 1.1). Computer
+Science Department, University of British Columbia, 1989.
+
+
+=head2 Free (zero cents)
+
+Calliope, http://www.cl.cam.ac.uk/users/wfc/
+
+A NeXT package
+
+Mozart
+
+A windows package
+
+=head2 Proprietary
+
+LIME, http://datura.cerl.uiuc.edu/
+
+Sibelius, http://www.acorn.co.uk/developers/sibelius
+
+Finale
+
+Score
+
+Musicator
+
+=head2 Unknown
+
+Berlioz, http://www.bsi.fr/~montel/
+
-28/May/97 LilyPond 0.0.67 1
+28/May/97 LilyPond 0.0.68 1
-28/May/97 LilyPond 0.0.67 2
+28/May/97 LilyPond 0.0.68 2
-28/May/97 LilyPond 0.0.67 3
+28/May/97 LilyPond 0.0.68 3
-28/May/97 LilyPond 0.0.67 4
+28/May/97 LilyPond 0.0.68 4
-28/May/97 LilyPond 0.0.67 5
+28/May/97 LilyPond 0.0.68 5
+pl 68
+ - doco: other-packages.pod, lots of lilyliterature.pod
+ - last duration mode now is default.
+ - some OpusTeX stuff.
+ - bf Y2K in convert-mudela
+ - Grand rewrite of Music/Register stuff:
+ * separation of Y and X-elt-groups
+ * Registers: info up: broadcasts, info down: get_xxx_info()
+ * Registers: try_request works from bottom to top of tree.
+ * Score_elem invisible_b_ flag
+ * Junk Staff_column, and find the requests while walking the
+ Voices.
+ * Score_register
+ * Staff_group, Score_request_register.
+ * align key/Meters/bar across staffs
+ * junked Staff, Staff_column, Staff_walker, Complex_walker,
+ Request_column Pulk_voice, Pulk_voices, Walker_registers,
+ Voice_element,
+ Input_score, Input_staff, Input_music and a lot of
+ parserjunk.
+ * mudela: lots of structure changes : now much simpler
+ * generation of pre/postbreak items now in Score_elem with deps.
+
+ - bf: make_patch explanation
+ - bf: make install TeX stuff
+ - new Beam/Stem code (WL)
+ - mudela: . mandatory for REALs
+
+******
+june 3
pl 67
- sketch of Music classes
- General_script_def as baseclass for Text_def and Script_def
Most of the items are marked in the code as well, with full explanation.
grep for TODO and ugh/ugr
+bugs introduced in pl68:
+
+ * lyrics broken,
+
+ * midi broken
+
+ * scripts broken
IMPORTANT
* a Hands on tutorial [HKN]
PROJECTS
+
+ * Convert all ref/bib stuff into BibTeX.
+
* Output class, handles : (smallish)
- help text /(c) notice?
- version line
- poor man's ascii output possible?
- MusixTeX output possible? (would have to be done before break calc.)
- NIFF ?
+ - Common Music Notation
- 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.
+ .. ) and non-user-settable part. Maybe use something like X-resources:
+ "Staff=oboe*dir: 0", "Staff=*.Voice_group=solo*dir: 1"
* TeX spanners , use texbeam.cc as an example (smallish)
- Glissando
* stacked scripts.
+ * should adjust stemlength for flag number.
+
* lilypond - -> crash
* standchen triool beam up/down
INPUTLANGUAGE
+ * c4 4 4 4 for c4 c4 c4 c4?
+
+ * neatly (and readably) expressing concurrent
+ voices
+
+ * <c f a>4 ?
+
* should have \require{package.ly} to read req'd packages.
+ * Viola mode?
+
+ @c c g e g
+ for
+ c g es g,
+
+ @A c g e g
+ for
+ cis gis e gis
+
* relative mode for pitch entering
* bracket (bracketplets)
* Do RTTI i.s.o. static_name(), name() and request-junk.
- * add remove() methods to all items/spanners.
-
SMALLISH PROJECTS
* A range for context errors (eg. mark both { and }. )
* text in staff (sharpsharp in staff, text below)
+ * fix Egler definitions ( see tex/eglerdefs.tex )
+
* replace Score_elem member access by get()/set() methods, to enable
future embedded code.
* bugreport to doc++ devel: struct not in class hier; public
virtual baseclasses
+ * get rid of init_end;
+
* cleanup lily-proto.hh and proto.hh
* half-sharps, half-flats
* adaptive accidental spacing.
- * Score_elem invisible_b_ flag
-
* unix style paths for LILYINCLUDE env
* indentable stream as baseclass for TeX stream, lily stream, Dstream.
* Brackets
- * caching of Register_group_register hierarchies.
-
+
* use (char *) iso. String for communication between lexer and
parser.
* guitar chord
- * Junk Staff_column, and find the requests while walking the
- Voices.?
-
* better beamslope calculation: QLP for beams?
* Text_crescendo
* 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
* default convert mudela-file.ly -> mudela-file.tex
- rename {standchen,scsii-menuetto,...}.tex
- * (related with above) --simple-mudela option for lily,
- to lily input files with one-voice simple mudela
- (no red tape)
-
* stack scripts in chords:
% fingering: footing:
< a-4 c-2 g-1 > < c-\ltoe e-\lheel >
(where "to" is a tiny bow)
* move towards incremental algorithms.
+
=head1 TODO
detect \lyrics and \melodic, and do substitution accordingly.
+ count <> and {} ?
=cut
-$convert_mudela_version = "0.1";
+$convert_mudela_version = "0.1.1";
use Getopt::Long;
+sub cmpver
+{
+
+ my(@a)= split /\./,$a;
+ my(@b)= split /\./,$b;
+
+ for $i (0,1,2) {
+ return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
+ }
+ return $a cmp $b;
+}
+
sub version_string_conv
{
my ($from_version, $to_version) = @_;
- s/\version \"0.0.$from_version\"/\version \"0.0.$to_version\"/g;
+ s/\version \"$from_version\"/\version \"$to_version\"/g;
}
################################################################
s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g;
}
+sub convert_0_0_58_to_0_0_58
+{
+ die "Not smart enough to convert 0.0.58 to 0.0.59\n";
+}
###############################################################
sub last_conversion
{
print STDERR "This is convert-mudela " . $convert_mudela_version .
- " (up to mudela version 0.0.", last_conversion, ")\n";
+ " (up to mudela version ", last_conversion, ")\n";
}
. " -h, --help print this help\n"
. " -o, --output=FILE name output file\n"
. " -s, --show-rules print all known conversion rules\n"
- . " -t, --to=PATCHLEVEL convert to version 0.0.PATCHLEVEL\n"
+ . " -t, --to=VERSION convert to version VERSION\n"
}
-# beware of the year 2000
-my %minor_conversions = (50 => \&no_conv,
- 52 => \&convert_0_0_50_to_0_0_52,
- 53 => \&convert_0_0_52_to_0_0_53,
- 54 => \&convert_0_0_53_to_0_0_54,
- 55 => \&convert_0_0_54_to_0_0_55,
- 56 => \&convert_0_0_55_to_0_0_56,
- 57 => \&convert_0_0_56_to_0_0_57,
- 58 => \&convert_0_0_57_to_0_0_58
+
+my %minor_conversions = ("0.0.50" => \&no_conv,
+ "0.0.52" => \&convert_0_0_50_to_0_0_52,
+ "0.0.53" => \&convert_0_0_52_to_0_0_53,
+ "0.0.54" => \&convert_0_0_53_to_0_0_54,
+ "0.0.55" => \&convert_0_0_54_to_0_0_55,
+ "0.0.56" => \&convert_0_0_55_to_0_0_56,
+ "0.0.57" => \&convert_0_0_56_to_0_0_57,
+ "0.0.58" => \&convert_0_0_57_to_0_0_58,
+ "0.0.59" => \&convert_0_0_58_to_0_0_59
);
sub versions
{
- return (sort keys %minor_conversions);
+ return (sort keys %minor_conversions);
}
my $u;
return $u;
}
- $ver =~ s/0\.0\.// ;
close INLY;
return $ver;
}
rm `find $nm$old $nm$new -name $a`
done
-echo 'use cd source-dir; patch -E -p0 < this_patch'> patch-$new
+cat <<EOF > patch-$new
+Generated with
+
+ make_patch $1 $2 $3
+
+usage
+
+ cd lilypond-source-dir; patch -E -p0 < patch-$new
+
+Patches do not contain automatically generated files,
+i.e. you should rerun configure
+EOF
(cd $nm$new; diff -urN ../$nm$old . >> ../patch-$new)
rm -rf $nm$old $nm$new
PA=$TOPLEVEL_PATCH_LEVEL
MP=$TOPLEVEL_MY_PATCH_LEVEL
NEWVER=$MJ.$MI.$PA$MP
-if [ -z $MP ]
+if [ -z $MP -o x$MP = xpre ]
then
LASTVER=$MJ.$MI.`expr $PA - 1`
else
fi
# however, C++ support in mingw32 v 0.1.4 is still flaky
-if test $MINGWPREFIX != no; then // huh?
+if test x$MINGWPREFIX != xno; then
ICFLAGS="-I$MINGWPREFIX/include"
ILDFLAGS="-$MINGWPREFIX/lib"
fi
+
+
for ac_prog in bison
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:950: checking for $ac_word" >&5
+echo "configure:952: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:984: checking for $ac_word" >&5
+echo "configure:986: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1018: checking for $ac_word" >&5
+echo "configure:1020: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1052: checking for $ac_word" >&5
+echo "configure:1054: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6
-echo "configure:1088: checking TeX/MF root dir directory" >&5
+echo "configure:1090: checking TeX/MF root dir directory" >&5
find_root_prefix="$prefix"
echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1126: checking TeX input directory" >&5
+echo "configure:1128: checking TeX input directory" >&5
find_dirdir=`(cd $find_texprefix;
$FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
echo $ac_n "checking MF input directory""... $ac_c" 1>&6
-echo "configure:1148: checking MF input directory" >&5
+echo "configure:1150: checking MF input directory" >&5
find_dirdir=`(cd $find_texprefix;
$FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')`
fi
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1204: checking how to run the C++ preprocessor" >&5
+echo "configure:1206: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 1217 "configure"
+#line 1219 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1242: checking for FlexLexer.h" >&5
+echo "configure:1244: checking for FlexLexer.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1247 "configure"
+#line 1249 "configure"
#include "confdefs.h"
#include <FlexLexer.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
eval "DIR_DATADIR=$datadir"
DIR_DATADIR="$DIR_DATADIR/lilypond"
echo $ac_n "checking ""... $ac_c" 1>&6
-echo "configure:1654: checking " >&5
+echo "configure:1656: checking " >&5
cat << EOF > lib/out/config.hh
fi
# however, C++ support in mingw32 v 0.1.4 is still flaky
-if test $MINGWPREFIX != no; then // huh?
+if test x$MINGWPREFIX != xno; then
ICFLAGS="-I$MINGWPREFIX/include"
ILDFLAGS="-$MINGWPREFIX/lib"
fi
AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
fi
+AC_SUBST(CXXFLAGS)
+AC_SUBST(CPPFLAGS)
AC_SUBST(CXX)
AC_SUBST(ICFLAGS)
AC_SUBST(ILDFLAGS)
}
IMPLEMENT_STATIC_NAME(Full_storage);
IMPLEMENT_STATIC_NAME(Matrix_storage);
+IMPLEMENT_IS_TYPE_B(Matrix_storage);
+IMPLEMENT_IS_TYPE_B1(Full_storage,Matrix_storage);
int operator -(Cursor<T> op) const;
Cursor<T> operator -=(int);
Cursor<T> operator +=(int);
-
+ /// move one down
+ void next();
+ /// move one up.
+ void previous();
/// return current and move one down
Cursor<T> operator ++( int );
{
return ( pointer_ != 0 );
}
-
+template<class T>
+inline void
+Cursor<T>::next()
+{
+ assert( pointer_ );
+ pointer_ = pointer_->next();
+}
template<class T>
inline Cursor<T>
Cursor<T>::operator ++( int )
{
Cursor<T> r (*this);
- assert( pointer_ );
- pointer_ = pointer_->next();
+ next();
return r;
}
+template<class T>
+inline void
+Cursor<T>::previous()
+{
+ assert( pointer_ );
+ pointer_ = pointer_->previous();
+}
+
template<class T>
inline Cursor<T>
Cursor<T>::operator --( int )
{
Cursor<T> r (*this);
- assert( pointer_ );
- pointer_ = pointer_->previous();
+ previous();
return r;
}
Cursor<void*>::ok;
Cursor<void*>::del;
Cursor<void*>::backspace;
+ Cursor<void*>::next;
+ Cursor<void*>::previous;
+
T remove_p() {
T p = ptr();
Cursor<void*>::del();
*/
#define NAME_MEMBERS() \
static char const *static_name();\
+virtual bool is_type_b(const char *)const; \
virtual char const *name() const{ return static_name(); } \
int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out()
#define VIRTUAL_COPY_CONS(T, R)\
virtual R *clone() const { return new T(*this); } \
-
+#define IMPLEMENT_IS_TYPE_B(D) \
+ bool D::is_type_b(const char *s) const \
+{ \
+ return s == static_name(); \
+}
+
+#define IMPLEMENT_IS_TYPE_B1(D,B) \
+ bool D::is_type_b(const char *s)const \
+{ \
+ return s == static_name() || B::is_type_b(s); \
+}
+#define IMPLEMENT_IS_TYPE_B2(D, BA, BB) \
+ bool D::is_type_b(const char *s) const \
+{ \
+ return s == static_name() || BA::is_type_b(s) || BB::is_type_b(s); \
+}
+
#endif // CLASS-NAME_HH
%
-melodicregs = \inputregister {
- Staff_registers
- \inputregister {Bar_register}
- \inputregister {Clef_register}
- \inputregister {Key_register}
- \inputregister {Meter_register}
- \inputregister {Local_key_register}
- \inputregister { Staff_sym_register }
- \inputregister { Collision_register }
- \inputregister { Rest_collision_register }
- \inputregister {
- Voice_group_registers
- \inputregister { Dynamic_register }
- \inputregister { Stem_beam_register }
- \inputregister { Text_register }
- \inputregister { Script_register }
- \inputregister { Note_column_register }
- \inputregister { Slur_register }
- \inputregister { Voice_registers
- \inputregister { Note_head_register }
- \inputregister { Tie_register }
+\requestregister {
+ "Score_register"
+ \alias "Score";
+% \consists "Score_bar_register";
+ \consists "Bar_align_register";
+ \consists "Clef_align_register";
+ \consists "Key_align_register";
+ \consists "Meter_align_register";
+ \consists "Score_horizontal_align_register";
+
+ \contains\requestregister {
+ "Staff_registers"
+
+ \consists "Bar_register";
+ \consists "Clef_register";
+ \consists "Key_register";
+ \consists "Meter_register";
+ \consists "Local_key_register";
+ \consists "Staff_sym_register";
+ \consists "Collision_register";
+ \consists "Rest_collision_register";
+ \contains \requestregister {
+ "Voice_group_registers"
+ \alias "Voice_group";
+ \consists "Dynamic_register";
+ \consists "Stem_beam_register";
+ \consists "Text_register";
+ \consists "Script_register";
+ \consists "Note_column_register";
+ \consists "Slur_register";
+ \contains \requestregister {
+ "Voice_registers"
+ \alias "Voice";
+ \consists "Note_head_register" ;
+ \consists "Tie_register";
+ }
}
}
}
-lyricregs = \inputregister {
- Lyric_register % ugh.
- \inputregister { Lyric_register }
- \inputregister { Swallow_register }
-
-}
+
+
-\version "0.0.58";
+\version "0.0.59";
\include "register.ini"
\include "dynamic.ini"
\include "table_sixteen.ini"
+%% Fix Me. This sux.
\init_end ;
% index TeXstring, xmin xmax ymin ymax
"scripts" = \table {
- "fermata" "\fermata" 0\pt 0\pt 0\pt 6\pt
- "-fermata" "\ifermata" 0\pt 0\pt -6\pt 0\pt
- "portato" "\portato" 0\pt 4.8\pt 0\pt 2\pt
- "-portato" "\iportato" 0\pt 4.8\pt -2\pt 0\pt
- "tenuto" "\tenuto" 0\pt 4.8\pt 0\pt 1\pt
- "-tenuto" "\itenuto" 0\pt 4.8\pt -1\pt 0\pt
+ "fermata" "\fermata" 0.0\pt 0.0\pt 0.0\pt 6.0\pt
+ "-fermata" "\ifermata" 0.0\pt 0.0\pt -6.0\pt 0.0\pt
+ "portato" "\portato" 0.0\pt 4.8\pt 0.0\pt 2.0\pt
+ "-portato" "\iportato" 0.0\pt 4.8\pt -2.0\pt 0.0\pt
+ "tenuto" "\tenuto" 0.0\pt 4.8\pt 0.0\pt 1.0\pt
+ "-tenuto" "\itenuto" 0.0\pt 4.8\pt -1.0\pt 0.0\pt
"sforzato" "\sforzato" -0.8\pt 4.8\pt -1.92\pt 1.92\pt
- "marcato" "\marcato" 0\pt 4.8\pt 0\pt 4\pt
- "-marcato" "\imarcato" 0\pt 4.8\pt -4\pt 0\pt
- "staccato" "\staccato" 0\pt 0\pt 0\pt 5\pt
- "staccatissimo" "\staccatissimo" 0\pt 0\pt 0\pt 1\pt
- "-staccatissimo" "\istaccatissimo" 0\pt 0\pt 0\pt 1\pt
- "upbow" "\upbow" -1\pt 6\pt 0\pt 5\pt
- "downbow" "\downbow" 0\pt 5\pt 0\pt 7.5\pt
- "back" "\backorfront" 0\pt 6\pt 0\pt 3\pt
- "-front" "\backorfront" 0\pt 6\pt 0\pt 3\pt
- "heel" "\heel" 0\pt 6\pt -1\pt 5\pt
- "toe" "\toe" 0\pt 6\pt -1\pt 5\pt
- "bheel" "\bheel" 0\pt 6\pt -1\pt 5\pt
- "btoe" "\btoe" 0\pt 6\pt -1\pt 5\pt
- "fheel" "\fheel" 0\pt 6\pt -1\pt 5\pt
- "ftoe" "\ftoe" 0\pt 6\pt -1\pt 5\pt
- "-back" "\backorfront" 0\pt 6\pt 0\pt 3\pt
- "front" "\backorfront" 0\pt 6\pt 0\pt 3\pt
+ "marcato" "\marcato" 0.0\pt 4.8\pt 0.0\pt 4.0\pt
+ "-marcato" "\imarcato" 0.0\pt 4.8\pt -4.0\pt 0.0\pt
+ "staccato" "\staccato" 0.0\pt 0.0\pt 0.0\pt 5.0\pt
+ "staccatissimo" "\staccatissimo" 0.0\pt 0.0\pt 0.0\pt 1.0\pt
+ "-staccatissimo" "\istaccatissimo" 0.0\pt 0.0\pt 0.0\pt 1.0\pt
+ "upbow" "\upbow" -1.0\pt 6.0\pt 0.0\pt 5.0\pt
+ "downbow" "\downbow" 0.0\pt 5.0\pt 0.0\pt 7.5\pt
+ "back" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt
+ "-front" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt
+ "heel" "\heel" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "toe" "\toe" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "bheel" "\bheel" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "btoe" "\btoe" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "fheel" "\fheel" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "ftoe" "\ftoe" 0.0\pt 6.0\pt -1.0\pt 5.0\pt
+ "-back" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt
+ "front" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt
}
"style" = \table {
- "roman" "\settext{%}" 0\pt 5\pt 0\pt 8\pt
- "italic" "\setitalic{%}" 0\pt 0\pt 0\pt 8\pt
- "dynamic" "\setdynamic{%}" 0\pt 0\pt 0\pt 8\pt
+ "roman" "\settext{%}" 0.0\pt 5.0\pt 0.0\pt 8.0\pt
+ "italic" "\setitalic{%}" 0.0\pt 0.0\pt 0.0\pt 8.0\pt
+ "dynamic" "\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 8.0\pt
}
"dynamics" = \table {
}
"clefs" = \table {
- "violin" "\violinclef" 0\pt 12.8\pt -10\pt 18\pt
- "bass" "\bassclef" 0\pt 12.8\pt 0\pt 16\pt
- "alto" "\altoclef" 0\pt 12.8\pt 0\pt 16\pt
- "tenor" "\altoclef" 0\pt 12.8\pt 0\pt 16\pt
- "violin_change" "\cviolinclef" 0\pt 11.2\pt -12\pt 12\pt
- "bass_change" "\cbassclef" 0\pt 11.2\pt 0\pt 16\pt
- "alto_change" "\caltoclef" 0\pt 11.2\pt 0\pt 16\pt
- "tenor_change" "\caltoclef" 0\pt 11.2\pt 0\pt 16\pt
+ "violin" "\violinclef" 0.0\pt 12.8\pt -10.0\pt 18.0\pt
+ "bass" "\bassclef" 0.0\pt 12.8\pt 0.0\pt 16.0\pt
+ "alto" "\altoclef" 0.0\pt 12.8\pt 0.0\pt 16.0\pt
+ "tenor" "\altoclef" 0.0\pt 12.8\pt 0.0\pt 16.0\pt
+ "violin_change" "\cviolinclef" 0.0\pt 11.2\pt -12.0\pt 12.0\pt
+ "bass_change" "\cbassclef" 0.0\pt 11.2\pt 0.0\pt 16.0\pt
+ "alto_change" "\caltoclef" 0.0\pt 11.2\pt 0.0\pt 16.0\pt
+ "tenor_change" "\caltoclef" 0.0\pt 11.2\pt 0.0\pt 16.0\pt
}
"balls" = \table {
- "1" "\wholeball" 0\pt 6\pt -2 \pt 2\pt
- "2" "\halfball" 0\pt 5\pt -2 \pt 2\pt
- "4" "\quartball" 0\pt 5\pt -2 \pt 2\pt
+ "1" "\wholeball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt
+ "2" "\halfball" 0.0\pt 5.0\pt -2.0\pt 2.0\pt
+ "4" "\quartball" 0.0\pt 5.0\pt -2.0\pt 2.0\pt
}
"slur" = \table {
"half" "\hslurchar%{%}"
}
"accidentals" = \table {
- "-2" "\flatflat" 0\pt 8.16\pt -2.5\pt 7.5\pt
- "-1" "\flat" 0\pt 4.8\pt -2.5\pt 7.5\pt
- "0" "\natural" 0\pt 4.8\pt -7.5\pt 7.5\pt
- "1" "\sharp" 0\pt 3.6\pt -7.5\pt 7.5\pt
- "2" "\sharpsharp" 0\pt 4.8\pt -2.5\pt 7.5\pt
+ "-2" "\flatflat" 0.0\pt 8.16\pt -2.5\pt 7.5\pt
+ "-1" "\flat" 0.0\pt 4.8\pt -2.5\pt 7.5\pt
+ "0" "\natural" 0.0\pt 4.8\pt -7.5\pt 7.5\pt
+ "1" "\sharp" 0.0\pt 3.6\pt -7.5\pt 7.5\pt
+ "2" "\sharpsharp" 0.0\pt 4.8\pt -2.5\pt 7.5\pt
}
"streepjes" = \table {
- "toplines" "\toplines{%}" -1\pt 7\pt 0\pt 0\pt
- "botlines" "\botlines{%}" -1\pt 7\pt 0\pt 0\pt
+ "toplines" "\toplines{%}" -1.0\pt 7.0\pt 0.0\pt 0.0\pt
+ "botlines" "\botlines{%}" -1.0\pt 7.0\pt 0.0\pt 0.0\pt
}
"bars" = \table {
"empty" "\emptybar"
- "|" "\maatstreep" 0\pt 0.4\pt -8\pt 8\pt
- "||" "\doublebar" 0\pt 4\pt -8\pt 8\pt
- "|." "\finishbar" -4\pt 0\pt -8\pt 8\pt
- ":|" "\repeatbar" -4\pt 0\pt -8\pt 8\pt
- "|:" "\startrepeat" 0\pt 4\pt -8\pt 8\pt
- ":|:" "\repeatbarstartrepeat" 0\pt 16\pt -8\pt 8\pt
+ "|" "\maatstreep" 0.0\pt 0.4\pt -8.0\pt 8.0\pt
+ "||" "\doublebar" 0.0\pt 4.0\pt -8.0\pt 8.0\pt
+ "|." "\finishbar" -4.0\pt 0.0\pt -8.0\pt 8.0\pt
+ ":|" "\repeatbar" -4.0\pt 0.0\pt -8.0\pt 8.0\pt
+ "|:" "\startrepeat" 0.0\pt 4.0\pt -8.0\pt 8.0\pt
+ ":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt -8.0\pt 8.0\pt
}
"rests" = \table {
- "1" "\wholerest" 0\pt 6\pt 0\pt 2\pt
- "2" "\halfrest" 0\pt 6\pt -2\pt 0\pt
- "4" "\quartrest" -5\pt 2\pt -5\pt 5\pt
- "8" "\eighthrest" 0\pt 5\pt 0\pt 8\pt
- "16" "\sixteenthrest" 0\pt 6\pt 0\pt 12\pt
- "32" "\thirtysecondrest" 0\pt 6\pt 0\pt 16\pt
- "64" "\sixtyfourthrest" 0\pt 6\pt 0\pt 16\pt
- "128" "\hundredtwentyeighthrest" 0\pt 6\pt 0\pt 16\pt
+ "1" "\wholerest" 0.0\pt 6.0\pt 0.0\pt 2.0\pt
+ "2" "\halfrest" 0.0\pt 6.0\pt -2.0\pt 0.0\pt
+ "4" "\quartrest" -5.0\pt 2.0\pt -5.0\pt 5.0\pt
+ "8" "\eighthrest" 0.0\pt 5.0\pt 0.0\pt 8.0\pt
+ "16" "\sixteenthrest" 0.0\pt 6.0\pt 0.0\pt 12.0\pt
+ "32" "\thirtysecondrest" 0.0\pt 6.0\pt 0.0\pt 16.0\pt
+ "64" "\sixtyfourthrest" 0.0\pt 6.0\pt 0.0\pt 16.0\pt
+ "128" "\hundredtwentyeighthrest" 0.0\pt 6.0\pt 0.0\pt 16.0\pt
}
"meters" = \table {
- "C" "\fourfourmeter" 0\pt 10\pt -5\pt 5\pt
- "C2" "\allabreve" 0\pt 10\pt -5\pt 5\pt
+ "C" "\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt
+ "C2" "\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt
}
% dims ignored for this table
"param" = \table {
- "meter" "\generalmeter{%}{%}" 0\pt 10\pt -5\pt 5\pt
+ "meter" "\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt
"linestaf" "\linestafsym{%}{%}"
"stem" "\stem{%}{%}"
"fill" "\hbox{}"
% ugh. 8pt
- "crescendosym" "\crescendosym{%}" 0\pt 0\pt -3\pt 3\pt
- "decrescendosym" "\decrescendosym{%}" 0\pt 0\pt -3\pt 3\pt
+ "crescendosym" "\crescendosym{%}" 0.0\pt 0.0\pt -3.0\pt 3.0\pt
+ "decrescendosym" "\decrescendosym{%}" 0.0\pt 0.0\pt -3.0\pt 3.0\pt
}
"dots" = \table {
- "1" "\lsingledot" 0\pt 2\pt -1\pt 1\pt
- "2" "\ldoubledot" 0\pt 5\pt -1\pt 1\pt
- "3" "\ltripledot" 0\pt 8\pt -1\pt 1\pt
+ "1" "\lsingledot" 0.0\pt 2.0\pt -1.0\pt 1.0\pt
+ "2" "\ldoubledot" 0.0\pt 5.0\pt -1.0\pt 1.0\pt
+ "3" "\ltripledot" 0.0\pt 8.0\pt -1.0\pt 1.0\pt
}
"flags" = \table {
- "8" "\eighthflag" 0\pt 4\pt 0\pt 0\pt
- "16" "\sixteenthflag" 0\pt 4\pt 0\pt 0\pt
- "32" "\thirtysecondflag" 0\pt 4\pt 0\pt 0\pt
- "64" "\sixtyfourthflag" 0\pt 4\pt 0\pt 0\pt
- "128" "\hundredtwentyeighthflag" 0\pt 4\pt 0\pt 0\pt
- "-8" "\deighthflag" 0\pt 4\pt 0\pt 0\pt
- "-16" "\dsixteenthflag" 0\pt 4\pt 0\pt 0\pt
- "-32" "\dthirtysecondflag" 0\pt 4\pt 0\pt 0\pt
- "-64" "\dsixtyfourthflag" 0\pt 4\pt 0\pt 0\pt
- "-128" "\dhundredtwentyeighthflag" 0\pt 4\pt 0\pt 0\pt
+ "8" "\eighthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "16" "\sixteenthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "32" "\thirtysecondflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "64" "\sixtyfourthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "128" "\hundredtwentyeighthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "-8" "\deighthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "-16" "\dsixteenthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "-32" "\dthirtysecondflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "-64" "\dsixtyfourthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
+ "-128" "\dhundredtwentyeighthflag" 0.0\pt 4.0\pt 0.0\pt 0.0\pt
}
"beamslopes" = \table {
EndMudelaHeader
%}
-\version "0.0.58";
+\version "0.0.59";
cad = \melodic {
}
\score {
- \staff { melodicregs cad }
+ \melodic{ \cad }
\paper {
- \unitspace 14\mm
+ \unitspace 14.0\mm
\geometric 1.4}
\midi { \tempo 4:90 }
}
Tested Features:test the Collision resolution
EndMudelaHeader
%}
-\version "0.0.58";
+\version "0.0.59";
-two_voice = \melodic {
- < \multivoice
- { \octave c'; \stem -1;\duration "last";
+two_voice = \melodic
+ < \multi 2;
+ { \octave c'; \stem -1;
c4 d e f g2~ g4 a [c8 d e f] c2| }
{ \stem 1;
g4 f e g ~ g2 g2 c4 g4 g2 }
>
-}
-two_voice_steminvert = \melodic {
- < \multivoice
+two_voice_steminvert = \melodic
+ < \multi 2;
{ \octave c'; \stem 1;
% the f and g on 4th beat are exceptionally ugh.
c4 d e f g2 g4 a | }
g4 f e g g2 g2 }
>
-}
-three_voice = \melodic {
- < \multivoice
+
+three_voice = \melodic
+ < \multi 2;
{ \stem 1;
g4 f e f g a g2 }
{ \hshift 1; \stem 1;
{ \stem -1;
c4 d e d c d es }
>
-}
-rests = \melodic {
- < \multivoice
+
+rests = \melodic
+ < \multi 2;
{ \stem 1;
| r8 r r r r r r r
[c' b a g] [f e d c]
r r r r r r r r r
}
>
-}
+
\score{
- \staff{ melodicregs
- \melodic { \$two_voice ++ \$two_voice_steminvert
- ++ \$three_voice ++ \rests
+
+ \melodic { \$two_voice \$two_voice_steminvert
+ \$three_voice \rests
}
- }
+
\paper {}
% \midi { \tempo 4:80 }
}
alto = \melodic{
\meter 4/4;
- \duration 8 ;
\key bes es as;
\clef "alto";
<
{ \octave c ;
- [ c c-. ] c2.( |
+ [ c8 c-. ] c2.( |
%31
- [ ) c c-. ] c2.( |
+ [ ) c8 c-. ] c2.( |
%32
- [ ) c c-. ] c4. c-. c4( |
+ [ ) c8 c-. ] c4. c-. c4( |
%33
- [ ) c c-. ] c4. c-. c4
+ [ ) c8 c-. ] c4. c-. c4
\group "+bla";
\stem 1 ;[ c16^"div." c16 c16 c16 ] c4 c2
\group "-";
- \ \ \ \ - \ \ \ \ -" ] c2.( |
\textstyle "roman";
%31:2
- [ ) c c-. ] c2.( |
+ [ ) c8 c-. ] c2.( |
%32:2
- [ ) c c-. ] c4. c-. c4( |
+ [ ) c8 c-. ] c4. c-. c4( |
%33:2
- [ ) c c-. ] c4. c-. c4 |
+ [ ) c8 c-. ] c4. c-. c4 |
\octave c ;
%34
filename: kortjakje.ly
title: Ah, vous dirais-je, maman (variations)
description: bare bones version. (written down from memory :-)
- composers:Mozart, KV 265
+ composers: Mozart, KV 265
entered-by: HWN
copyright: none
Tested Features: example file with comments
EndMudelaHeader
%}
-\version "0.0.58";
+\version "0.0.59";
% the % is a comment.
\octave c'; % set the default octave
% the default note duratino is 4
%%% theme
- c c | % the '|' checks if there is a new measure here.
+ c4 c | % the '|' checks if there is a new measure here.
g g|
a a|
g2| % g2 means a "g-1" pitched half-note
- f f| e e| d d| c2
- g g| f f| e e| d d| g g| f f| e e| d d|
+ f4 f| e e| d d| c2
+ g4 g| f f| e e| d d| g g| f f| e e| d d|
%%% var 1
- c r8 c8 % r8 means an 8th rest.
+ c4 r8 c % r8 means an 8th rest.
(| % start a slur
% NOTE: the slurstart should be directly after the note
) % end a slur.
- g r8 g8 () a r8 a8 () g r4
- f r8 f8 () e4 r8 e8 (|) d4 r8 d8 () c4 r4
+ g4 r8 g8 () a4 r8 a8 () g4 r4
+ f4 r8 f8 () e4 r8 e8 (|) d4 r8 d8 () c4 r4
}
% more of this.
\octave c'; % default octave: 1 below the first octave.
%%% theme
- 'c % ' before note means one octave lower.
+ 'c4 % ' before note means one octave lower.
% Similarly: ' after means one higher.
- c e c f c e c d 'b c 'a 'f 'g 'c2
+ c e c f c e c d 'b c 'a 'f 'g 'c2 |
\octave 'c ;
- e 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g
+ e4 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g
%%%% var 1
- r8 e8() c r8 e8() c r8 f8() c r8 e8() c
- r8 d8() 'b r8 c8() 'a r8 'a8() 'f r8 'e8() 'c
+ r8 e8() c4 r8 e8() c4 r8 f8() c4 r8 e8() c4
+ r8 d8() 'b4 r8 c8() 'a4 r8 'a8() 'f4 r8 'e8() 'c4
}
\score{
- \staff{ melodicregs melodie }
- \staff{ melodicregs begeleiding }
+ \melodic < \multi 3;
+
+ \melodie
+ \begeleiding
+ >
\paper{
\unitspace 2.5\cm % a whole note takes 2.5 \cm ideally.
}
--- /dev/null
+
+% stupid testfile for pl68 features.
+
+\score{
+ \melodic
+ { \octave c'; c4 c4
+ < \multi 1; { c2 c2 } { c'2 c'2 } >
+ < \multi 2; { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } >
+ < \multi 3; { \clef "bass"; c2 c2 } { \bar "||"; \key cis ; c'2 c'2 } >
+ % c1 c1 % bug
+
+ }
+}
% scales with accents.
%
-\version "0.0.58";
-blah = \staff{ melodicregs
- \melodic {
+\version "0.0.59";
+blah = \melodic {
\meter 6/8;
- \duration 4.;
\octave 'c ;
- \clef "bass";
- c d
+ \clef "bass";
+ c4. d
\octave c ;
c d
\clef "violin" ;
\octave c' ;
- ++ \transpose { d { e f } } ++
+ \transpose d { e f }
\octave c'' ;
- c d
+ c d
\duration 8 ;
%ugr
|[6/9 a \< a a a a a a \! a a \ff \> ]1/1
}
\score{
- blah
+ \melodic {\blah}
\paper{
\symboltables {table_sixteen}
\unitspace 1.5 \cm
EndMudelaHeader
%}
-\version "0.0.58";
+\version "0.0.59";
+
%% Stuff from MPP version
% \lefttitle{Menuetto}
% \tempo{Moderato}
% \stemlength3 % shorter \stemlength
% % because piece is set very tightly
-ii_menuetto = \melodic{
+IImenuetto = \melodic{
\clef"alto";
\meter 3/4;
\key bes;
%%10
< [ e' g > d' cis'_"2" e' a~ g ] |
%%11
- < \multivoice
+ < \multi 2;
{\stem 1; a4~ d'4 cis'4-. }
{ \stem -1; f2 e4 } > |
%%12
< [ g'^"4" d > f' e' f' d'^"3"~ c' ] |
%%13
\clef "alto";
- < \multivoice
+ < \multi 2;
{ \stem 1; bes2 c'4 }
{ \stem -1; g4~ f4 e4 }% ugh
> |
%%20
< { [ c'( bes a )bes g~ bes ] } { [ d ] } { [ g ] } > |
%%21
- < \multivoice
+ < \multi 2;
{\stem 1; d'4 (\stem 1; ) cis'4 d'4 }
{ \stem -1; g2 f4 }
> |
}
\score{
- \staff{ melodicregs ii_menuetto }
+ \melodic { \IImenuetto }
\paper{
- \width 195\mm
- \unitspace 9\mm % to get lily to use only three lines
- \geometric 1.4
+ \width 195.0\mm
+ \unitspace 9.0\mm % to get lily to use only three lines
+ \geometric 1.40
\output "scsii-menuetto.out"
}
\midi{
%}
-\version "0.0.58";
+\version "0.0.59";
toccata_commands = \melodic{
\meter 4/4;
\key fis cis gis dis; % E-major
}
-%toccata_right = \melodic \$toccata_commands {
toccata_right = \melodic{
- \$toccata_commands ++
+ \$toccata_commands
% 13 -- how to type -- where to split -- this more neatly ?
\octave c';
- <\multivoice
+ <\multi 2;
{ \stem 1; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 }
{ \stem 1; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
{ \stem -1; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
}
toccata_left = \melodic{
- \$toccata_commands ++
+ \$toccata_commands
\octave c;
\clef bass;
% 13
- <\multivoice
+ <\multi 2;
{ \stem 1; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
{ \stem 1; \hshift 1; r4 gis4. gis8~ gis4 | \stem -1; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 }
{ \stem -1; r4 < dis4 fis4 > < cis4 e4 > }
}
toccata_pedal = \melodic{
- \$toccata_commands ++
+ \$toccata_commands
\octave c;
\clef bass;
% 13
}
fuga2_right = \melodic{
- \$fuga2_commands ++
+ \$fuga2_commands
% 15
\octave c';
- <\multivoice
+ <\multi 2;
{ \stem 1; [b8 fis8] b4 }
{ \stem -1; fis2 }
>
|x
|
%}
- < \multivoice
+ < \multi 2;
{ \stem 1; \hshift 0; e'4 }
{ \stem 1; \hshift 1; cis'4 }
{ \stem 1; \hshift 2; ais4 }
{ \stem -1; fis4 }
> |
% 16
- <\multivoice
+ <\multi 2;
{ \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] }
{ \stem 1; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 }
{ \stem -1; fis2.~ fis2.~ fis4 e2 }
}
fuga2_left = \melodic{
- \$fuga2_commands ++
+ \$fuga2_commands
\octave c;
\clef bass;
% 15
b2
- <\multivoice
+ <\multi 2;
{ \stem 1; ais4 | bes2. }
{ \stem -1; e4 | fis2 fis4 }
>
}
fuga2_pedal = \melodic{
- \$fuga2_commands ++
+ \$fuga2_commands
\octave c;
\clef bass;
% 15
% these should be two separate scores...
\score{
- \staff{ melodicregs
- % why the extra "\melodic" (silly)
- % let "[ x ]" be "dimension of x":
- % [ melodic ++ melodic ] == [ simple-mudela ]
- % [ \melodic{ melodic ++ melodic } ] == [ melodic ]
- % ?
- \melodic{
- \$toccata_right ++ \break ++ \$fuga2_right
- }
- }
- \staff{ melodicregs
- \melodic{
- \$toccata_left ++ \break ++ \$fuga2_left
- }
- }
- \staff{ melodicregs
- \melodic{
- \$toccata_pedal
- ++ \break
- ++ \$fuga2_pedal
- }
- }
+ \melodic < \multi 3;
+ { \$toccata_right \break \$fuga2_right }
+ { \$toccata_left \break \$fuga2_left }
+
+ { \$toccata_pedal \break \$fuga2_pedal }
+
+ >
\paper{}
\midi{
\tempo 4:96
%}
-\version "0.0.58";
+\version "0.0.59";
% should add \need{dutch.ini} for
% correct parsing of note names
\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] |
bassdux =
\melodic {
\clef "bass";
-
\octave c';
r1 |
r |
[F16 G] As4 [G16 F] Es4 r8 es |
[d c g G]
%% 30
- < \multivoice
+ < \multi 2;
{ \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}
- global bassdux
- }
+ \melodic < \multi 1;
+ < \multi 2;
+ \global
+ \dux
+ \comes
+ >
+ < \multi 2;
+ \global
+ \bassdux
+ >
+
+ >
\paper{}
\midi {
\tempo 4:84
if (!sl) {
LexerError("Can't find file `" + s+ "'");
return;
- } else
+ }
char_count_stack_.push(0);
char_count_stack_.pop();
cout << "]"<<flush;
yy_delete_buffer(yy_current_buffer );
+ yy_current_buffer = 0;
if (state_stack_.empty()) {
- yy_current_buffer = 0;
return false;
}else {
yy_switch_to_buffer(state_stack_.pop());
#include "rational.hh"
class String;
typedef Rational Moment;
-void print(Moment);
+void printm(Moment const&);
#endif //
+/*
+ moment.cc -- implement Moment
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include <iostream.h>
#include "string.hh"
#include "moment.hh"
void
-print(Moment m)
+printm(Moment const &m)
{
cout << String(m) << flush;
}
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 67
+PATCH_LEVEL = 68
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
-MY_PATCH_LEVEL =
+MY_PATCH_LEVEL = pre
# kept in dist bo stripping stable stuff, still to copy...
# a bit of a hack to keep exec size under control.
-stablecc=command-request.cc musical-request.cc bar.cc boxes.cc \
- item.cc keyword.cc leastsquares.cc \
+stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \
+ keyword.cc leastsquares.cc \
lookup.cc molecule.cc meter.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 \
- voice-element.cc identifier.cc note.cc\
+ identifier.cc note.cc\
void
Atom::print() const
{
- mtor << "texstring: " <<sym.tex<<"\n";
+ mtor << "texstring: " <<sym_.tex<<"\n";
}
Box
Atom::extent() const
{
- Box b( sym.dim);
- b.translate(off);
+ Box b( sym_.dim);
+ b.translate(off_);
return b;
}
Atom::Atom(Symbol s)
{
- sym=s;
+ sym_=s;
}
Atom::TeX_string() const
{
/* infinity checks. */
- assert( abs(off.x) < 100 CM);
- assert( abs(off.y) < 100 CM);
+ assert( abs(off_.x) < 100 CM);
+ assert( abs(off_.y) < 100 CM);
// whugh.. Hard coded...
String s("\\placebox{%}{%}{%}");
Array<String> a;
- a.push(print_dimen(off.y));
- a.push(print_dimen(off.x));
- a.push(sym.tex);
+ a.push(print_dimen(off_.y));
+ a.push(print_dimen(off_.x));
+ a.push(sym_.tex);
return substitute_args(s, a);
}
Bar_register::Bar_register()
{
- post_move_processing();
+ do_post_move_processing();
}
bool
-Bar_register::try_request(Request*r_l)
+Bar_register::do_try_request(Request*r_l)
{
Command_req* c_l = r_l->command();
if (!c_l|| !c_l->bar())
}
void
-Bar_register::process_requests()
+Bar_register::do_process_requests()
{
if (bar_req_l_ ) {
- bar_p_ = new Bar(bar_req_l_->type_str_);
+ bar_p_ = new Bar;
+ bar_p_->type_str_=bar_req_l_->type_str_;
} else if (!get_staff_info().time_C_->whole_in_measure_) {
- bar_p_ = new Bar("|");
+ bar_p_ = new Bar;
}
if (bar_p_){
}
-
-void
-Bar_register::split_bar(Bar *& pre, Bar * no, Bar * &post)
-{
- String s= no->type;
- if (s == ":|:") {
- pre = new Bar(":|");
- post = new Bar("|:");
- }else if (s=="|:") {
- post = new Bar(s);
- } else {
- pre = new Bar(*no);
- }
-}
-
void
-Bar_register::pre_move_processing()
+Bar_register::do_pre_move_processing()
{
if (bar_p_) {
- Bar * post_p =0;
- Bar * pre_p =0;
- split_bar(pre_p, bar_p_, post_p);
-
- typeset_breakable_item(pre_p, bar_p_, post_p);
+ typeset_breakable_item(bar_p_);
bar_p_ =0;
}
}
void
-Bar_register::post_move_processing()
+Bar_register::do_post_move_processing()
{
bar_req_l_ = 0;
bar_p_ =0;
}
IMPLEMENT_STATIC_NAME(Bar_register);
+IMPLEMENT_IS_TYPE_B1(Bar_register,Request_register);
ADD_THIS_REGISTER(Bar_register);
#include "lookup.hh"
#include "debug.hh"
-Bar::Bar( String t)
+Bar::Bar()
{
- type = t;
+ type_str_ = "|";
}
+
IMPLEMENT_STATIC_NAME(Bar);
+IMPLEMENT_IS_TYPE_B1(Bar,Item);
void
Bar::do_print()const
{
- mtor << type;
+ mtor << type_str_;
}
Molecule*
Bar::brew_molecule_p()const
{
- Symbol s = paper()->lookup_l()->bar(type);
+ Symbol s = paper()->lookup_l()->bar(type_str_);
Molecule*output = new Molecule(Atom(s));
return output;
}
+
+/**
+ TODO: parametrise this (input-settable)
+ */
+char const *bar_breaks[][3] ={
+ {":|", ":|:", "|:"},
+ {"|", "|", ""},
+ {"", "|:", "|:"},
+ {"||.", "||.", ""},
+ {0,0,0}
+};
+
+void
+Bar::do_pre_processing()
+{
+ for (int i=0; bar_breaks[i][0]; i++) {
+ if (bar_breaks[i][1] == type_str_)
+ type_str_ = bar_breaks[i][break_status_i()+1];
+ }
+
+ transparent_b_ = empty_b_ = (type_str_ == "");
+}
*/
+#include <math.h>
+
+#include "p-col.hh"
#include "varray.hh"
#include "proto.hh"
#include "dimen.hh"
#include "symbol.hh"
#include "molecule.hh"
#include "leastsquares.hh"
-#include "p-col.hh"
#include "stem.hh"
#include "paper-def.hh"
#include "lookup.hh"
void
Beam::set_default_dir()
{
- int dirs_single = 0, dirs_chord = 0;
+ int up = 0, down = 0;
+ int up_count = 0, down_count = 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();
+ int cur_down = sl->get_center_distance_from_top();
+ int cur_up = sl->get_center_distance_from_bottom();
+ if (cur_down) {
+ down += cur_down;
+ down_count++;
+ }
+ if (cur_up) {
+ up += cur_up;
+ up_count++;
+ }
}
- dirs_single = -sign(dirs_single);
- dir_i_ = (dirs_single + dirs_chord > 0) ? 1 : -1;
+ if (!down)
+ down_count = 1;
+ if (!up)
+ up_count = 1;
+
+ // the following relation is equal to
+ // up / up_count > down / down_count
+ dir_i_ = (up * down_count > down * up_count) ? 1 : -1;
for (int i=0; i <stems.size(); i++) {
Stem *sl = stems[i];
Beam::solve_slope()
{
Array<Stem_info> sinfo;
- for (int j=0; j <stems.size(); j++) {
+ for (int j=0; j <stems.size(); j++) {
Stem *i = stems[j];
i->set_default_extents();
}
left_pos += dy;
left_pos *= dir_i_;
+
slope *= dir_i_;
+ slope = 0.6 * tanh(slope); // damping
// ugh
Real sl = slope*paper()->internote_f();
void
Beam::do_pre_processing()
{
- left_col_l_ = stems[0] ->pcol_l_;
- right_col_l_ = stems.top()->pcol_l_;
assert(stems.size()>1);
if (!dir_i_)
set_default_dir();
a.translate(Offset (-w, -w * sl));
for (int j = 0; j < lhalfs; j++) {
Atom b(a);
- b.translate(Offset(0, -dir_i_ * dy * (lwholebeams+j)));
+ b.translate_y( -dir_i_ * dy * (lwholebeams+j));
leftbeams.add( b );
}
}
int j = 0;
for (; j < rwholebeams; j++) {
Atom b(a);
- b.translate(Offset(0, -dir_i_ * dy * j));
+ b.translate_y( -dir_i_ * dy * j);
rightbeams.add( b );
}
for (; j < rwholebeams + rhalfs; j++) {
Atom b(a);
- b.translate(Offset(0, -dir_i_ * dy * j));
+ b.translate_y( -dir_i_ * dy * j);
rightbeams.add(b );
}
sb.translate(Offset(x, (x * slope + left_pos)* inter));
out->add(sb);
}
- out->translate(Offset(x0 - left_col_l_->hpos,0));
+ out->translate_x(x0 - left_col_l_->hpos);
return out;
}
IMPLEMENT_STATIC_NAME(Beam);
+IMPLEMENT_IS_TYPE_B1(Beam, Spanner);
void
Beam::do_print()const
}
IMPLEMENT_STATIC_NAME(Bow);
+IMPLEMENT_IS_TYPE_B1(Bow,Directional_spanner);
--- /dev/null
+/*
+ break-align-item.cc -- implement Break_align_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "break-align-item.hh"
+
+void
+Break_align_item::do_pre_processing()
+{
+
+ align_i_ = break_status_i();
+ Horizontal_align_item::do_pre_processing();
+}
+IMPLEMENT_STATIC_NAME(Break_align_item);
+IMPLEMENT_IS_TYPE_B1(Break_align_item, Horizontal_align_item);
#include "clef-reg.hh"
+void
+Clef_item::do_pre_processing()
+{
+ change_b_ = ! (break_status_i() == 1);
+
+ if (default_b_){
+ empty_b_ = (break_status_i() != 1);
+ transparent_b_ = (break_status_i() != 1);
+ }
+}
Clef_item::Clef_item()
{
- change = true;
+ default_b_ = false;
+ change_b_ = true;
read("violin");
}
Clef_item::brew_molecule_p()const
{
String t = type_;
- if (change)
+ if (change_b_)
t += "_change";
Symbol s = paper()->lookup_l()->clef(t);
Molecule*output = new Molecule(Atom(s));
- output->translate(Offset(0, paper()->internote_f() * y_off));
+ output->translate_y( paper()->internote_f() * y_off);
return output;
}
IMPLEMENT_STATIC_NAME(Clef_item);
+IMPLEMENT_IS_TYPE_B1(Clef_item,Item);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>,
Mats Bengtsson <matsb@s3.kth.se>
*/
+
#include "bar.hh"
#include "clef-reg.hh"
#include "clef-item.hh"
#include "debug.hh"
#include "command-request.hh"
#include "time-description.hh"
-#include "staff-column.hh"
Clef_register::Clef_register()
{
clef_p_ = 0;
+ clef_req_l_ =0;
- /* ugly hack to prevent segfault (daddy_reg_l_ == 0 at construction) */
- clef_type_str_ = "";
+ set_type("violin");
}
bool
c0_position_i_= 6;
} else if (clef_type_str_ == "bass") {
c0_position_i_= 10;
- }else
+ } else
return false;
- *get_staff_info().c0_position_i_l_ = c0_position_i_;
return true;
}
+void
+Clef_register::fill_staff_info(Staff_info &i)
+{
+ i.c0_position_i_l_ = &c0_position_i_;
+}
+
void
Clef_register::read_req(Clef_change_req*c_l)
{
void
Clef_register::acknowledge_element(Score_elem_info info)
{
- if (info.elem_l_->name() == Bar::static_name()) {
+ if (info.elem_l_->name() == Bar::static_name() ) {
if (!clef_p_){
create_clef();
- clef_p_->change = false;
+ clef_p_->default_b_ = true;
}
}
}
+
+void
+Clef_register::do_creation_processing()
+{
+ create_clef();
+ clef_p_->default_b_ = false;
+}
+
bool
-Clef_register::try_request(Request * r_l)
+Clef_register::do_try_request(Request * r_l)
{
Command_req* creq_l= r_l->command();
if (!creq_l || !creq_l->clefchange())
void
Clef_register::create_clef()
{
- clef_p_ = new Clef_item;
- clef_p_->read(*this);
- announce_element(Score_elem_info(clef_p_,
- clef_req_l_));
-}
+ if (!clef_p_) {
+ clef_p_ = new Clef_item;
+ announce_element(Score_elem_info(clef_p_,
+ clef_req_l_));
+
+ clef_p_->read(*this);
+ }
+}
void
-Clef_register::process_requests()
+Clef_register::do_process_requests()
{
if (clef_req_l_) {
create_clef();
- clef_p_->change = true;
+ clef_p_->default_b_ = false;
}
}
void
-Clef_register::pre_move_processing()
+Clef_register::do_pre_move_processing()
{
if (!clef_p_)
return;
- if (clef_p_->change) {
- Clef_item* post_p = new Clef_item(*clef_p_);
- post_p->change = false;
- typeset_breakable_item(new Clef_item(*clef_p_),
- clef_p_, post_p);
- } else {
- typeset_breakable_item(0, 0, clef_p_);
- }
+ typeset_breakable_item(clef_p_);
clef_p_ = 0;
}
void
-Clef_register::post_move_processing()
+Clef_register::do_post_move_processing()
{
clef_req_l_ = 0;
- /* not in ctor, since the reg might not be linked in.*/
- if (clef_type_str_ == "") {
- set_type("violin");
- }
}
+
+void
+Clef_register::do_removal_processing()
+{
+ delete clef_p_;
+ clef_p_ =0;
+}
+
IMPLEMENT_STATIC_NAME(Clef_register);
+IMPLEMENT_IS_TYPE_B1(Clef_register,Request_register);
ADD_THIS_REGISTER(Clef_register);
}
void
-Collision_register::pre_move_processing()
+Collision_register::do_pre_move_processing()
{
if (col_p_) {
typeset_element(col_p_);
}
IMPLEMENT_STATIC_NAME(Collision_register);
+IMPLEMENT_IS_TYPE_B1(Collision_register,Request_register);
ADD_THIS_REGISTER(Collision_register);
// reproduction of bugfix at 3am ?
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 )) {
+ 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[idx(1,1)] -= 0.5;
x_off[idx(-1,1)] += 0.5;
}
IMPLEMENT_STATIC_NAME(Collision);
+IMPLEMENT_IS_TYPE_B1(Collision, Item);
void
Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l)
Command_script_req::do_print() const
{}
IMPLEMENT_STATIC_NAME(Command_script_req);
+IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
+
IMPLEMENT_STATIC_NAME(Cadenza_req);
+IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
void
Cadenza_req::do_print()const
}
IMPLEMENT_STATIC_NAME(Bar_req);
+IMPLEMENT_IS_TYPE_B1(Bar_req,Command_req);
void
Bar_req::do_print() const
/* *************** */
IMPLEMENT_STATIC_NAME(Timing_req);
+IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
void
Timing_req::do_print()const{}
IMPLEMENT_STATIC_NAME(Command_req);
+IMPLEMENT_IS_TYPE_B1(Command_req,Request);
void
Command_req::do_print()const{}
/* *************** */
IMPLEMENT_STATIC_NAME(Barcheck_req);
+IMPLEMENT_IS_TYPE_B1(Barcheck_req,Timing_req);
void
Barcheck_req::do_print() const{}
/* *************** */
IMPLEMENT_STATIC_NAME(Clef_change_req);
+IMPLEMENT_IS_TYPE_B1(Clef_change_req,Command_req);
void
Clef_change_req::do_print() const
}
/* *************** */
IMPLEMENT_STATIC_NAME(Group_feature_req);
+IMPLEMENT_IS_TYPE_B1(Group_feature_req,Command_req);
void
Group_feature_req::do_print() const
#endif
}
-IMPLEMENT_STATIC_NAME(Group_change_req);
-
-void
-Group_change_req::do_print()const
-{
-#ifndef NPRINT
- mtor << "id : " << newgroup_str_;
-#endif
-}
/* *************** */
-IMPLEMENT_STATIC_NAME(Terminate_voice_req);
-
-void
-Terminate_voice_req::do_print()const
-{
-}
-/* *************** */
IMPLEMENT_STATIC_NAME(Partial_measure_req);
+IMPLEMENT_IS_TYPE_B1(Partial_measure_req,Timing_req);
void
Partial_measure_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Meter_change_req);
+IMPLEMENT_IS_TYPE_B1(Meter_change_req,Timing_req);
void
Meter_change_req::do_print() const
/* *************** */
IMPLEMENT_STATIC_NAME(Measure_grouping_req);
+IMPLEMENT_IS_TYPE_B1(Measure_grouping_req,Timing_req);
void
Measure_grouping_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Key_change_req);
+IMPLEMENT_IS_TYPE_B1(Key_change_req,Command_req);
void
Key_change_req::squash_octaves()
{
+++ /dev/null
-/*
- complex-walker.cc -- implement Complex_walker
-
- 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 "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()
-{
- walk_regs_p_->post_move_processing();
-}
-
-void
-Complex_walker::do_pre_move()
-{
- walk_regs_p_->pre_move_processing();
-}
-
-void
-Complex_walker::do_announces()
-{
- walk_regs_p_->do_announces();
-}
-
-
-void
-Complex_walker::try_request(Request*req)
-{
- bool b =walk_regs_p_->try_request(req);
- if (!b)
- req->warning("junking request: " + String(req->name()));
-}
-
-void
-Complex_walker::process_requests()
-{
- Staff_column*c =ptr();
-
- for (int i=0; i < c->creationreq_l_arr_.size(); i++) {
- try_request(c->creationreq_l_arr_[i]);
- }
- for (int i=0; i < c->commandreq_l_arr_.size(); i++) {
- try_request(c->commandreq_l_arr_[i]);
- }
-
- for (int i=0; i < c->musicalreq_l_arr_.size(); i++) {
- try_request(c->musicalreq_l_arr_[i]);
- }
-
- regs_process_requests();
- do_announces();
-}
-
-void
-Complex_walker::regs_process_requests()
-{
- walk_regs_p_->process_requests();
-}
-
-void
-Complex_walker::typeset_element(Score_elem *elem_p)
-{
- if (!elem_p)
- return;
- staff_l_->staff_line_l_->add_element(elem_p);
- if (elem_p->spanner())
- pscore_l_->typeset_unbroken_spanner(elem_p->spanner());
- else
- ptr()->typeset_musical_item(elem_p->item());
-}
-
-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()
-{
- delete walk_regs_p_;
-}
-
-
-
}
IMPLEMENT_STATIC_NAME(Crescendo);
+IMPLEMENT_IS_TYPE_B1(Crescendo,Spanner);
#include "debug.hh"
#include "dstream.hh"
#include "flower-debug.hh"
+#include "moment.hh"
Dstream *monitor=0;
ostream * nulldev =0;
+static void (*rat_printer)(Moment const&);
+
// ugh
struct _Dinit {
_Dinit() {
void
debug_init()
{
+ rat_printer = printm; // make sure this is linked in
#ifndef NDEBUG
set_new_handler(&mynewhandler);
#endif
{
check_debug =b;
set_flower_debug(*monitor, check_debug);
- }
+}
Dynamic_register::Dynamic_register()
{
dir_i_ =0;
- post_move_processing();
+ do_post_move_processing();
dynamic_p_ =0;
to_end_cresc_p_ = cresc_p_ = 0;
cresc_req_l_ = 0;
}
void
-Dynamic_register::post_move_processing()
+Dynamic_register::do_post_move_processing()
{
dynamic_req_l_arr_.set_size(0);
}
bool
-Dynamic_register::try_request(Request * r)
+Dynamic_register::do_try_request(Request * r)
{
Musical_req * m = r->musical();
if (!m || !m->dynamic())
return true;
}
void
-Dynamic_register::process_requests()
+Dynamic_register::do_process_requests()
{
Crescendo* new_cresc_p=0;
for (int i=0; i < dynamic_req_l_arr_.size(); i++) {
}
void
-Dynamic_register::pre_move_processing()
+Dynamic_register::do_pre_move_processing()
{
Staff_symbol* s_l = get_staff_info().staff_sym_l_;
if (dynamic_p_) {
}
}
-bool
-Dynamic_register::acceptable_request_b(Request*r)const
-{
- Musical_req * m = r->musical();
- return (m && m->dynamic());
-}
-
void
Dynamic_register::set_feature(Feature i)
{
}
IMPLEMENT_STATIC_NAME(Dynamic_register);
+IMPLEMENT_IS_TYPE_B1(Dynamic_register,Request_register);
ADD_THIS_REGISTER(Dynamic_register);
Dynamic_register::~Dynamic_register()
--- /dev/null
+/*
+ elem-group-item.cc -- implement Horizontal_vertical_group_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "elem-group-item.hh"
+
+void
+Horizontal_vertical_group_item::do_print()const
+{
+ Horizontal_vertical_group::do_print();
+}
+IMPLEMENT_STATIC_NAME(Horizontal_vertical_group_item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item);
+
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+IMPLEMENT_STATIC_NAME(Horizontal_group_item);
/*
- elem-group.cc -- implement Element_group
+ elem-group.cc -- implement Horizontal_vertical_group
source file of the GNU LilyPond music typesetter
#include "item.hh"
#include "debug.hh"
+bool
+Elbement_group::contains_b(Score_elem const*e)const
+{
+ return elem_l_arr_.find_l(e);
+}
+
Interval
-Element_group::do_height()const
+Vertical_group::do_height()const
{
Interval r;
for (int i=0; i < elem_l_arr_.size(); i++)
}
Interval
-Element_group::do_width()const
+Horizontal_group::do_width()const
{
Interval r;
for (int i=0; i < elem_l_arr_.size(); i++)
return r;
}
+IMPLEMENT_STATIC_NAME(Horizontal_group);
+IMPLEMENT_IS_TYPE_B1(Horizontal_group, Elbement_group);
+IMPLEMENT_IS_TYPE_B1(Vertical_group, Elbement_group);
+IMPLEMENT_STATIC_NAME(Vertical_group);
+
void
-Element_group::add_element(Score_elem*i_l)
+Elbement_group::add_element(Score_elem*i_l)
{
- i_l->group_element_i_ ++;
-
- assert(! elem_l_arr_.find_l(i_l));
+ assert(i_l!= this);
+ assert(! contains_b(i_l));
+
elem_l_arr_.push(i_l);
add_dependency(i_l);
}
void
-Element_group::translate(Offset o)
+Horizontal_group::add_element(Score_elem*elt)
+{
+ elt->x_group_element_i_ ++;
+ Elbement_group::add_element(elt);
+}
+
+void
+Vertical_group::add_element(Score_elem*e)
+{
+ e->y_group_element_i_++;
+ Elbement_group::add_element(e);
+}
+
+
+void
+Horizontal_group::translate_x(Real x)
+{
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ elem_l_arr_[i]->translate_x(x);
+}
+
+void
+Vertical_group::translate_y(Real y)
{
for (int i=0; i < elem_l_arr_.size(); i++)
- elem_l_arr_[i]->translate(o);
+ elem_l_arr_[i]->translate_y(y);
}
-IMPLEMENT_STATIC_NAME(Element_group);
+IMPLEMENT_STATIC_NAME(Elbement_group);
+IMPLEMENT_IS_TYPE_B1(Elbement_group, Score_elem);
void
-Element_group::do_print() const
+Elbement_group::do_print() const
{
#ifndef NPRINT
for (int i=0; i < elem_l_arr_.size(); i++)
}
void
-Element_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+Horizontal_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
{
int i;
while ((i=elem_l_arr_.find_i(old))>=0) {
+ old->x_group_element_i_--;
- old->group_element_i_--;
if (new_l){
- new_l->group_element_i_ ++;
+ new_l->x_group_element_i_ ++;
elem_l_arr_[i] = new_l;
}else {
elem_l_arr_.del(i);
}
}
+}
+
+void
+Vertical_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+{
+ int i;
+ while ((i=elem_l_arr_.find_i(old))>=0) {
+ old->y_group_element_i_--;
+
+ if (new_l){
+ new_l->y_group_element_i_ ++;
+ elem_l_arr_[i] = new_l;
+ }else {
+ elem_l_arr_.del(i);
+ }
+ }
}
-String
-Element_group::TeX_string()const
+Vertical_group::Vertical_group(Vertical_group
+ const &s)
+ : Elbement_group(s)
{
- return "";
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ elem_l_arr_[i]->y_group_element_i_ ++;
}
-Element_group::Element_group(Element_group const&s)
- :elem_l_arr_(s.elem_l_arr_)
+Horizontal_group::Horizontal_group(Horizontal_group
+ const &s)
+ : Elbement_group(s)
{
for (int i=0; i < elem_l_arr_.size(); i++)
- elem_l_arr_[i]->group_element_i_ ++;
+ elem_l_arr_[i]->x_group_element_i_ ++;
+}
+
+Elbement_group::Elbement_group()
+{
+ transparent_b_ = true;
+}
+
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group);
+IMPLEMENT_STATIC_NAME(Horizontal_vertical_group);
+
+void
+Horizontal_vertical_group::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Vertical_group::do_substitute_dependency(o,n);
+ Horizontal_group::do_substitute_dependency(o,n);
+}
+
+void
+Horizontal_vertical_group::add_element(Score_elem*e)
+{
+ Vertical_group::add_element(e);
+ Horizontal_group::add_element(e);
+}
+
+void
+Horizontal_vertical_group::do_print()const
+{
+ Vertical_group::do_print();
}
-Element_group::Element_group()
-{}
+void
+Vertical_group::do_print()const
+{
+ Elbement_group::do_print();
+}
+
+void
+Horizontal_group::do_print() const
+{
+ Elbement_group::do_print();
+}
return Atom(s);
}
IMPLEMENT_STATIC_NAME(General_script_def);
+IMPLEMENT_IS_TYPE_B(General_script_def);
Request_register*
-get_nongroup_register_p(String s)
+get_register_p(String s)
{
for (int i=0; i < reg_table->size(); i++) {
if ((*reg_table)[i].name_str_ == s)
#include "note-head.hh"
#include "head-reg.hh"
#include "paper-def.hh"
-#include "complex-walker.hh"
#include "musical-request.hh"
Note_head_register::Note_head_register()
{
note_p_ = 0;
- post_move_processing();
+ do_post_move_processing();
}
bool
-Note_head_register::try_request(Request *req_l)
+Note_head_register::do_try_request(Request *req_l)
{
+ if (note_req_l_)
+ return false;
+
if (req_l->musical() && (req_l->musical()->note() || req_l->musical()->rest()))
note_req_l_=req_l->musical()->rhythmic();
else
}
void
-Note_head_register::process_requests()
+Note_head_register::do_process_requests()
{
if (!note_req_l_)
return;
}
void
-Note_head_register::pre_move_processing()
+Note_head_register::do_pre_move_processing()
{
if (note_p_) {
typeset_element(note_p_);
}
}
void
-Note_head_register::post_move_processing()
+Note_head_register::do_post_move_processing()
{
note_req_l_ = 0;
}
IMPLEMENT_STATIC_NAME(Note_head_register);
+IMPLEMENT_IS_TYPE_B1(Note_head_register,Request_register);
ADD_THIS_REGISTER(Note_head_register);
--- /dev/null
+/*
+ horizontal-align-item.cc -- implement Horizontal_align_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "horizontal-align-item.hh"
+IMPLEMENT_STATIC_NAME(Horizontal_align_item);
+IMPLEMENT_IS_TYPE_B1(Horizontal_align_item,Item);
+
+bool
+Horizontal_align_item::contains_b(Item *i)const
+{
+ return item_l_arr_.find_l(i);
+}
+
+void
+Horizontal_align_item::add(Item *i,int p)
+{
+ assert(! contains_b(i));
+ priority_i_arr_.push(p);
+ item_l_arr_.push(i);
+ add_dependency(i);
+}
+
+void
+Horizontal_align_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ int i;
+ while ((i = item_l_arr_.find_i(o->item())) >=0) {
+ if (n)
+ item_l_arr_[i] = n->item();
+ else
+ item_l_arr_.del(i);
+ }
+}
+
+struct Horizontal_align_item_content {
+ Item * item_l_;
+ int priority_i_;
+ static int compare (Horizontal_align_item_content const &h1,
+ Horizontal_align_item_content const &h2) {
+ return h1.priority_i_ - h2.priority_i_;
+ }
+ Horizontal_align_item_content(Item*i, int p) {
+ priority_i_ = p;
+ item_l_ = i;
+ }
+ Horizontal_align_item_content(){item_l_ =0; priority_i_ =0; }
+};
+
+
+void
+Horizontal_align_item::do_pre_processing()
+{
+ {
+ Array<Horizontal_align_item_content> content;
+ for (int i =0; i < item_l_arr_.size(); i++)
+ content.push(
+ Horizontal_align_item_content(
+ item_l_arr_[i], priority_i_arr_[i]));
+ content.sort(Horizontal_align_item_content::compare);
+ item_l_arr_.set_size(0);
+ priority_i_arr_.set_size(0);
+ for (int i =0; i < content.size(); i++) {
+ item_l_arr_.push( content[i].item_l_ );
+ priority_i_arr_.push( content[i].priority_i_);
+ }
+ }
+
+ Array<Interval> dims;
+ Real total =0;
+ for (int i =0; i < item_l_arr_.size(); i++) {
+
+ Interval item_width= item_l_arr_[i]->width();
+ if (item_width.empty_b()) {
+ item_width = Interval(0,0);
+ }
+ dims.push( item_width);
+ total += item_width.length();
+ }
+
+ Real where_f= total * (align_i_-1.0)/2.0;
+ for ( int i=0 ; i < item_l_arr_.size(); i++) {
+ item_l_arr_[i]->translate_x(where_f -dims[i][-1] );
+ where_f += dims[i].length();
+ }
+}
+
+Interval
+Horizontal_align_item::do_width() const
+{
+ return Interval(0,0);
+}
+
+void
+Horizontal_align_item::do_print()const
+{
+}
+
+Horizontal_align_item::Horizontal_align_item()
+{
+ align_i_ = 0;
+ empty_b_ = true;
+ transparent_b_ = true;
+}
#include <assert.h>
+#include "score.hh"
#include "identifier.hh"
#include "my-lily-lexer.hh"
#include "debug.hh"
#include "input-register.hh"
-#include "input-score.hh"
#include "symtable.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
#include "lookup.hh"
#include "script-def.hh"
#include "request.hh"
#include "input-register.hh"
+IMPLEMENT_STATIC_NAME(Identifier);
+IMPLEMENT_IS_TYPE_B(Identifier);
+
Identifier::~Identifier()
{
if (!accessed_b_ && !init_b_)
Identifier::error(String expect)
{
String e("Wrong identifier type: ");
- e += String(classname()) + "(expected " + expect + ")";
+ e += String(name()) + "(expected " + expect + ")";
::error(e);
}
} \
class Class
-DEFAULT_PRINT(Script_id, Script_def, script);
+DEFAULT_PRINT(Script_id, General_script_def, script);
DEFAULT_PRINT(Lookup_id, Lookup, lookup);
DEFAULT_PRINT(Symtables_id, Symtables, symtables);
-DEFAULT_PRINT(Staff_id, Input_staff, staff);
-DEFAULT_PRINT(M_chord_id, Music_general_chord, mchord);
-DEFAULT_PRINT(M_voice_id, Music_voice, mvoice);
+DEFAULT_PRINT(Music_id,Music , music);
DEFAULT_PRINT(Request_id, Request, request);
-DEFAULT_PRINT(Score_id, Input_score, score);
+DEFAULT_PRINT(Score_id, Score, score);
DEFAULT_PRINT(Input_regs_id, Input_register, iregs);
void
mtor << *((Real_id*)this)->real(false)<< "\n";
}
-#define implement_id_class(Idclass, Class, accessor) \
-char const * Idclass::classname() const\
-{\
- return #Class;\
-}\
+#define default_accessor(Idclass, Class, accessor)\
Class*\
Idclass::accessor(bool copy) {\
if (copy){ \
}else\
return (Class*) data;\
}\
+
+#define virtual_accessor(Idclass, Class, accessor)\
+Class*\
+Idclass::accessor(bool copy) {\
+ if (copy){ \
+ accessed_b_ = true;\
+ return (Class*) ((Class*) data)->clone();\
+ }else\
+ return (Class*) data;\
+ }\
+
+
+#define implement_id_class(Idclass, Class, accessor) \
+IMPLEMENT_STATIC_NAME(Idclass)\
+IMPLEMENT_IS_TYPE_B1(Idclass,Identifier)\
Idclass::~Idclass() { delete accessor(false); }\
Idclass::Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\
+
implement_id_class(Real_id, Real, real);
-implement_id_class(Script_id, Script_def, script);
+implement_id_class(Script_id, General_script_def, script);
implement_id_class(Lookup_id, Lookup, lookup);
implement_id_class(Symtables_id, Symtables, symtables);
-implement_id_class(Staff_id, Input_staff, staff);
-implement_id_class(M_chord_id, Music_general_chord, mchord);
-implement_id_class(M_voice_id, Music_voice, mvoice);
-implement_id_class(Score_id, Input_score, score);
+implement_id_class(Music_id, Music, music);
+implement_id_class(Score_id, Score, score);
implement_id_class(Request_id, Request, request);
implement_id_class(Input_regs_id, Input_register, iregs);
{
assert(false);
}
+
+
+default_accessor(Real_id, Real, real);
+default_accessor(Script_id, General_script_def, script);
+default_accessor(Lookup_id, Lookup, lookup);
+default_accessor(Symtables_id, Symtables, symtables);
+virtual_accessor(Music_id, Music, music);
+default_accessor(Score_id, Score, score);
+virtual_accessor(Request_id, Request, request);
+default_accessor(Input_regs_id, Input_register, iregs);
+++ /dev/null
-/*
- atom.hh -- declare
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef ATOM_HH
-#define ATOM_HH
-
-#include "symbol.hh"
-#error
-
-
-#endif // ATOM_HH
--- /dev/null
+/*
+ bar-align-reg.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_ALIGN_REG_HH
+#define BAR_ALIGN_REG_HH
+
+#endif // BAR_ALIGN_REG_HH
generate bars. Either user ("|:"), or default (new measure)
*/
class Bar_register : public Request_register {
- void split_bar(Bar *& pre, Bar * no, Bar * &post);
-public:
Bar_req * bar_req_l_;
Bar * bar_p_;
-
- virtual bool try_request(Request *req_l);
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+public:
Bar_register();
NAME_MEMBERS();
+
+
+protected:
+ virtual bool do_try_request(Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#endif // BARREG_HH
*/
class Bar:public Item {
public:
- String type;
+ String type_str_;
NAME_MEMBERS();
- Bar(String type);
+ SCORE_ELEM_CLONE(Bar)
+ Bar();
private:
void do_print() const;
+protected:
+ virtual void do_pre_processing();
Molecule*brew_molecule_p()const;
};
#endif // BAR_HH
void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
void set_stemlens();
- SPANNER_CLONE(Beam)
+ SCORE_ELEM_CLONE(Beam)
protected:
virtual Interval do_width()const;
virtual Offset center() const;
--- /dev/null
+/*
+ break-align-item.hh -- declare Break_align_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BREAK_ALIGN_ITEM_HH
+#define BREAK_ALIGN_ITEM_HH
+
+#include "horizontal-align-item.hh"
+
+/// align breakable items (clef, bar, etc.)
+class Break_align_item : public Horizontal_align_item {
+
+protected:
+ virtual void do_pre_processing();
+public:
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Break_align_item)
+
+};
+#endif // BREAK_ALIGN_ITEM_HH
-
/*
clef-item.hh -- declare Clef_item
*/
class Clef_item : public Item {
protected:
+ virtual void do_pre_processing();
Molecule* brew_molecule_p()const;
public:
int y_off;
/// is this a change clef (smaller size)?
- bool change;
+ bool change_b_;
+
+ /// set because of existence of a bar
+ bool default_b_;
/* *************** */
-NAME_MEMBERS();
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Clef_item)
Clef_item();
void read(Clef_register const&);
void read(String);
void read_req(Clef_change_req*);
bool set_type(String);
protected:
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
- virtual bool try_request(Request*);
+ virtual void do_process_requests();
+ virtual void fill_staff_info(Staff_info&);
+ virtual void do_pre_move_processing();
+ virtual void do_removal_processing();
+ virtual void do_creation_processing();
+ virtual void do_post_move_processing();
+ virtual bool do_try_request(Request*);
virtual void acknowledge_element(Score_elem_info);
public:
int c0_position_i_;
protected:
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
+ virtual void do_pre_move_processing();
public:
Collision_register();
NAME_MEMBERS();
class Command_req : public virtual Request {
public:
REQUESTMETHODS(Command_req, command);
- virtual Terminate_voice_req *terminate() {return 0;}
- virtual Group_change_req * groupchange() { return 0;}
virtual Group_feature_req * groupfeature() { return 0; }
virtual Measure_grouping_req * measuregrouping() { return 0; }
virtual Clef_change_req * clefchange() { return 0; }
REQUESTMETHODS(Measure_grouping_req, measuregrouping);
};
-class Group_change_req : public Command_req {
-public:
- String newgroup_str_;
- REQUESTMETHODS(Group_change_req, groupchange);
-};
-
/** draw a (repeat)-bar. This something different than #Barcheck_req#,
the latter should only happen at the start of a measure. */
class Bar_req : public Command_req {
int compare(const Bar_req&)const;
REQUESTMETHODS(Bar_req,bar);
};
-class Terminate_voice_req : public Command_req {
-public:
- REQUESTMETHODS(Terminate_voice_req,terminate);
-};
class Group_feature_req : public Command_req {
public:
+++ /dev/null
-/*
- complex-walker.hh -- declare Complex_walker
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef COMPLEXWALKER_HH
-#define COMPLEXWALKER_HH
-
-#include "lily-proto.hh"
-#include "staff-walker.hh"
-#include "score-elem-info.hh"
-
-/**
- A staff walker which uses registers to decide what to print
- */
-class Complex_walker: public Staff_walker {
- bool try_command_request(Command_req *req_l);
- void do_announces();
- void try_request(Request*req);
-
-
-
-public:
- Walker_registers *walk_regs_p_;
-
- /* *************** */
-
- void regs_process_requests();
- void typeset_element(Score_elem *elem_p);
- void announce_element(Score_elem_info);
- virtual void process_requests();
- virtual void do_post_move();
- virtual void do_pre_move();
-
- Complex_walker(Staff*);
- ~Complex_walker();
-
-private:
-};
-
-
-#endif // COMPLEXWALKER_HH
-
-
bool left_dyn_b_;
Crescendo();
protected:
- SPANNER_CLONE(Crescendo)
+ SCORE_ELEM_CLONE(Crescendo)
virtual Molecule*brew_molecule_p()const;
NAME_MEMBERS();
#include "real.hh"
#include "string.hh"
-const Real INCH_TO_PT=72.0;
+const Real INCH_TO_PT=72.270;
const Real CM_TO_PT=INCH_TO_PT/2.54;
const Real MM_TO_PT=CM_TO_PT/10;
const Real PT_TO_PT =1.0;
NAME_MEMBERS();
protected:
virtual void acknowledge_element(Score_elem_info);
- virtual bool try_request(Request *req_l);
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
- virtual bool acceptable_request_b(Request*) const;
+ virtual bool do_try_request(Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
virtual void set_feature(Feature);
};
--- /dev/null
+/*
+ elem-group-item.hh -- declare Element_group_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef ELEM_GROUP_ITEM_HH
+#define ELEM_GROUP_ITEM_HH
+
+#include "elem-group.hh"
+#include "item.hh"
+
+class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group {
+public:
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Horizontal_vertical_group_item)
+protected:
+ virtual void do_print() const;
+};
+
+class Horizontal_group_item : public Item, public Horizontal_group {
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Horizontal_group_item)
+protected:
+ virtual void do_print() const { Elbement_group::do_print(); }
+};
+
+#endif // ELEM_GROUP_ITEM_HH
/*
- elem-group.hh -- declare Element_group
+ elem-group.hh -- declare Horizontal_vertical_group
source file of the GNU LilyPond music typesetter
#define ELEM_GROUP_HH
#include "score-elem.hh"
+class Elbement_group: public virtual Score_elem {
+protected:
+ Link_array<Score_elem> elem_l_arr_;
+
+ virtual void do_print() const ;
+public:
+ Elbement_group();
+ bool contains_b(Score_elem const *)const;
+ void add_element(Score_elem*);
+ NAME_MEMBERS();
+
+};
+
+class Horizontal_group : public Elbement_group {
+public:
+ NAME_MEMBERS();
+ Horizontal_group(Horizontal_group const&);
+ Horizontal_group(){}
+ void add_element(Score_elem*);
+protected:
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void do_print() const ;
+ virtual void translate_x(Real);
+ virtual Interval do_width()const;
+};
+
+class Vertical_group : public Elbement_group {
+protected:
+ virtual void translate_y(Real);
+ virtual void do_print() const ;
+ virtual Interval do_height()const;
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ void add_element(Score_elem*);
+public:
+ Vertical_group(Vertical_group const &);
+ Vertical_group(){}
+ NAME_MEMBERS();
+};
+
/** 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{
+class Horizontal_vertical_group : public Vertical_group,
+ public Horizontal_group
+{
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; }
-
-
+ virtual Horizontal_vertical_group* elem_group() { return this; }
public:
Element_group();
- Element_group(Element_group const&);
+ bool contains_b(Score_elem const *)const;
NAME_MEMBERS();
- virtual void translate(Offset);
- virtual void add_element(Score_elem*);
- virtual String TeX_string()const;
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void do_print() const;
+ void add_element(Score_elem*);
};
#endif // ELEM_GROUP_HH
/* *************** */
Note_head_register();
- virtual bool try_request(Request *req_l) ;
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual bool do_try_request(Request *req_l) ;
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
NAME_MEMBERS();
};
--- /dev/null
+/*
+ horizontal-align-item.hh -- declare Horizontal_align_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef HORIZONTAL_ALIGN_ITEM_HH
+#define HORIZONTAL_ALIGN_ITEM_HH
+#include "elem-group.hh"
+#include "item.hh"
+
+/**
+ Order elems left to right.
+
+ TODO: insert(order, elem)
+ */
+class Horizontal_align_item : public Item {
+protected:
+ Link_array<Item> item_l_arr_;
+ Array<int> priority_i_arr_;
+ int align_i_;
+
+public:
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Horizontal_align_item)
+ void add(Item*, int p);
+ Horizontal_align_item();
+protected:
+ virtual void do_substitute_dependency(Score_elem * , Score_elem *);
+ /// do calculations before determining horizontal spacing
+ virtual void do_pre_processing();
+ virtual void do_print()const;
+ virtual Interval do_width()const;
+ bool contains_b(Item*)const;
+};
+#endif // HORIZONTAL_ALIGN_ITEM_HH
#include "lily-proto.hh"
#include "string.hh"
#include "input.hh"
+#include "virtual-methods.hh"
/* boolean argument to accesor is copy_b..*/
#define IDACCESSOR( Input_staff, staff)\
virtual ~Identifier() ;
void print()const;
- virtual char const *classname() const{ return "new Identifier"; }
+ NAME_MEMBERS();
void error(String);
- IDACCESSOR(Input_staff, staff)
- IDACCESSOR(Input_music, music)
- IDACCESSOR(Music_voice, mvoice)
+ IDACCESSOR(Music, music)
IDACCESSOR(Input_register, iregs)
-
- IDACCESSOR(Script_def, script)
+ IDACCESSOR(General_script_def, script)
IDACCESSOR(Symtables, symtables)
- IDACCESSOR(Music_general_chord, mchord)
IDACCESSOR(Lookup,lookup)
IDACCESSOR(Real,real)
IDACCESSOR(Request, request)
- IDACCESSOR(Input_score, score)
+ IDACCESSOR(Score, score)
+ IDACCESSOR(int, intid)
protected:
virtual void do_print()const=0;
#define declare_id_class(Idclass, Class, accessor) \
struct Idclass : Identifier {\
- virtual char const *classname()const;\
+ NAME_MEMBERS(); \
Idclass(String s, Class*st, int code);\
virtual Class* accessor(bool copy);\
~Idclass();\
declare_id_class(Real_id, Real, real);
-declare_id_class(Script_id, Script_def, script);
+declare_id_class(Script_id, General_script_def, script);
declare_id_class(Lookup_id, Lookup, lookup);
declare_id_class(Symtables_id, Symtables, symtables);
-declare_id_class(Staff_id, Input_staff, staff);
-declare_id_class(M_chord_id, Music_general_chord, mchord);
-declare_id_class(M_voice_id, Music_voice, mvoice);
-declare_id_class(Score_id, Input_score, score);
+declare_id_class(Music_id, Music, music);
+declare_id_class(Int_id, int, intid);
+declare_id_class(Score_id, Score, score);
declare_id_class(Request_id, Request, request);
declare_id_class(Input_regs_id, Input_register, iregs);
+++ /dev/null
-/*
- input-music.hh -- part of GNU LilyPond
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef INPUTMUSIC_HH
-#define INPUTMUSIC_HH
-
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "voice.hh"
-#include "moment.hh"
-
-struct Voice_list : public Link_list<Voice*> {
- void translate_time(Moment dt);
-};
-
-/**
-
- A set voices.
- Input_music is anything that can simply be regarded as/converted to
- a set of voices "cooperating" or independant. It has some basic
- characteristics that real music has too:
-
- - it is rhythmic (it has a length, and can be translated horizontally)
- - a pitch (it can be transposed)
-
- */
-struct Input_music {
- virtual Voice_list convert()const=0;
- virtual Moment length()const=0;
- virtual void translate_time(Moment dt)=0;
- virtual ~Input_music(){}
- virtual void print() const =0;
- virtual void set_default_group(String)=0;
- virtual void transpose(Melodic_req const&) const =0;
-
-
- virtual Input_music *clone() const = 0;
- virtual Simple_music *simple() { return 0; }
-};
-
-/// Simple music consists of one voice
-struct Simple_music : Input_music {
- Voice voice_;
-
- /* *** */
- virtual void transpose(Melodic_req const&) const ;
-
- virtual Simple_music*simple() { return this; }
- void add(Voice_element*);
- virtual void set_default_group(String g) { voice_.set_default_group(g); }
- virtual Moment length()const;
- virtual Voice_list convert()const;
- virtual void translate_time(Moment dt);
- virtual void print() const;
- virtual Input_music *clone() const {
- return new Simple_music(*this);
- }
-};
-
-/// Complex_music consists of multiple voices
-struct Complex_music : Input_music {
- Pointer_list<Input_music*> elts;
- /* *************** */
- virtual void transpose(Melodic_req const&) const ;
- virtual void set_default_group(String g);
- void add(Input_music*inmusic_p);
- Complex_music();
- Complex_music(Complex_music const &);
- virtual void print() const ;
- void concatenate(Complex_music*);
-};
-
-
-/**
- A voice like list of music.
-
- different music forms which start after each other ( concatenated,
- stacked "horizontally )
-
- */
-
-struct Music_voice : Complex_music {
-
-
- /* *************** */
- Moment length()const;
- virtual void translate_time(Moment dt);
- virtual Voice_list convert()const;
- void add_elt(Voice_element*);
- virtual Input_music *clone() const {
- return new Music_voice(*this);
- }
- virtual void print() const ;
-};
-
-/**
- Multiple musicstuff stacked on top of each other
- chord like :
-
- - different music forms which start at the same time ( stacked "vertically" )
-
- */
-struct Music_general_chord : Complex_music {
-
-
- /* *************** */
-
- virtual Moment length()const;
- virtual Voice_list convert()const;
- virtual void translate_time(Moment dt);
- void add_elt(Voice_element*);
- virtual Input_music *clone() const {
- return new Music_general_chord(*this);
- }
-
- virtual void print() const ;
-};
-
-struct Multi_voice_chord : Music_general_chord {
- void set_default_group(String);
- virtual Input_music *clone() const {
- return new Multi_voice_chord(*this);
- }
-};
-struct Voice_group_chord : Music_general_chord {
-
- virtual Input_music *clone() const {
- return new Voice_group_chord(*this);
- }
-};
-#endif // INPUTMUSIC_HH
#include "string.hh"
#include "lily-proto.hh"
#include "input.hh"
+#include "string.hh"
+#include "varray.hh"
struct Input_register : Input {
- Pointer_list<Input_register*> ireg_list_;
+ Pointer_list<Input_register*> contains_ireg_p_list_;
+ Array<String> consists_str_arr_;
+ Array<String> alias_str_arr_;
String name_str_;
+
+ void add(Input_register *);
- void add(Input_register*);
- Input_register();
- bool group_b() const;
- ~Input_register();
- /** Get an Input_register with a certain name
-
- @return 0 if not found.
- */
- Input_register *get_ireg_l(String name) const;
- Input_register(Input_register const&);
- /**
- The names of all non -groups.
- */
- Array<String> get_nongroups_str_arr() const;
+ bool accept_req_b();
+ bool accepts_b(String);
void print() const;
- /**
- Construct the registers.
- */
- Array<Request_register*> get_nongroup_p_arr()const;
+ Register_group_register * get_group_register_p();
+ Input_register * get_default_ireg_l();
+ Input_register * recursive_find(String nm);
+ Input_register * find_ireg_l(String nm);
};
-Request_register * get_nongroup_register_p(String);
+
+void add_global_input_register(Input_register* ireg_p);
+Input_register*lookup_reg(String);
+Request_register*get_register_p(String s);
#endif // INPUT_REGISTER_HH
+++ /dev/null
-/*
- input-score.hh -- declare Input_score
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef INPUTSCORE_HH
-#define INPUTSCORE_HH
-
-#include "varray.hh"
-#include "lily-proto.hh"
-#include "plist.hh"
-#include "string.hh"
-#include "input.hh"
-
-/// the total music def of one movement
-class Input_score : public Input {
-public:
- int errorlevel_i_;
-
- /// paper_, staffs_ and commands_ form the problem definition.
- Paper_def *paper_p_;
- Midi_def* midi_p_;
- Pointer_list<Input_staff*> staffs_;
-
-
- /* *************************************************************** */
- Input_score();
- Input_score(Input_score const&);
-
- void add(Input_staff*);
- ~Input_score();
- /// construction
- void set(Paper_def* paper_p);
- void set(Midi_def* midi_p);
- void print() const;
- Score*parse();
-};
-
-#endif
+++ /dev/null
-/*
- input-staff.hh -- declare Input_staff
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef INPUTSTAFF_HH
-#define INPUTSTAFF_HH
-
-#include "string.hh"
-#include "plist.hh"
-#include "varray.hh"
-#include "lily-proto.hh"
-#include "input.hh"
-
-class Input_staff:public Input {
-public:
-
- Pointer_list<Input_music*> music_;
- Input_register * ireg_p_;
-
- /* *************** */
- ~Input_staff();
- void add(Input_music*m);
- Input_staff(Input_staff const&);
- Input_staff();
- Staff* parse(Score*);
- void print() const;
-};
-
-
-#endif // INPUTSTAFF_HH
-
--- /dev/null
+/*
+ interpretor.hh -- declare Interpreter
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Interpreter_HH
+#define Interpreter_HH
+
+class Interpreter {
+public:
+ virtual bool interpret_request_b(Request*) { return false;}
+};
+
+#endif // Interpreter_HH
--- /dev/null
+/*
+ interpretor.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Interpreter_HH
+#define Interpreter_HH
+
+class Interpreter {
+public:
+ /// link to my definition
+ Input_register * ireg_l_;
+ void interpret_request(Request *);
+ NAME_MEMBERS();
+ ~Interpreter();
+ /** typeset any items/spanners. Default: do nothing
+ */
+ virtual void do_pre_move_processing(){}
+};
+
+class Paper_interpreter : Interpreter {
+
+};
+
+class Midi_interpreter : Interpreter {
+};
+
+#endif // Interpreter_HH
public:
/// indirection to the column it is in
PCol * pcol_l_;
+
+ Item * broken_to_a_[2];
+
+ // nobreak = 0, pre =1, post = 2
+ int break_status_i()const;
+ Item * find_prebroken_piece(PCol*)const;
+ Item * find_prebroken_piece(Line_of_score*)const;
virtual Item *item() { return this; }
Item();
NAME_MEMBERS();
virtual Line_of_score * line_l() const;
protected:
+ virtual void do_breakable_col_processing();
+ virtual void handle_prebroken_dependencies();
virtual void do_print()const;
};
/* *************** */
-NAME_MEMBERS();
+ NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Key_item)
+
Key_item(int cposition);
void add(int pitch, int acc);
void read(const Key_register&);
bool default_key_b_;
bool change_key_b_;
- virtual bool try_request(Request *req_l);
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual bool do_try_request(Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
virtual void acknowledge_element(Score_elem_info);
Key_register();
NAME_MEMBERS();
struct Beam_req;
struct Blank_req;
struct Box;
+struct Break_align_item;
struct Bracket_req;
struct Cadenza_req;
+struct Change_iterator;
+struct Change_reg;
struct Chord;
struct Clef_change_req;
struct Clef_item;
struct Clef_register;
struct Col_hpositions;
+struct Chord;
struct Colinfo;
struct Collision;
struct Collision_register;
struct Command_req;
struct Command_script_req;
struct Complex_music;
-struct Complex_walker;
struct Cresc_req;
struct Crescendo ;
struct Decresc_req;
struct Dynamic;
struct Dynamic_req;
struct Element_group;
+struct Element_group_item;
struct Feature;
struct General_script_def;
struct Group_change_req;
struct Group_feature_req;
+struct Horizontal_align_item;
+struct Horizontal_group;
+struct Horizontal_group_item;
+struct Horizontal_vertical_group;
struct Idealspacing;
struct Identifier;
-struct Input;
+struct Interpreter;
struct Input_file;
-struct Input_music;
struct Input_register;
struct Input_score;
-struct Input_staff;
struct Item;
struct Key;
struct Key_change_req;
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 Musical_script_req;
struct Music_voice;
struct Musical_req;
+struct Music;
+struct Music_list;
struct My_lily_parser;
struct Note_column;
struct Note_column_register;
struct Score_column;
struct Score_elem;
struct Score_elem_info;
-struct Score_walker;
struct Script;
struct Script_column;
struct Script_def;
struct Span_dynamic_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 Timing_req;
struct Vertical_brace;
struct Vertical_spanner;
+struct Vertical_group;
+
struct Voice;
struct Voice_element;
struct Voice_group_registers;
Link_array<Item > forced_l_arr_;
Link_array<Item > tied_l_arr_;
/* *************** */
- virtual void process_requests();
+ virtual void do_process_requests();
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
+ virtual void do_pre_move_processing();
Local_key_register();
NAME_MEMBERS();
};
class Lyric_register : public Request_register {
Array<Lyric_req*> lreq_arr_;
- virtual bool acceptable_request_b(Request*);
- virtual bool try_request(Request*);
- virtual void process_requests();
- virtual void post_move_processing();
+ virtual bool do_try_request(Request*);
+ virtual void do_process_requests();
+ virtual void do_post_move_processing();
public:
NAME_MEMBERS();
Lyric_register();
void debug_init();
void set_debug(bool);
void do_scores();
-void add_score(Input_score * s);
+void add_score(Score* s);
void set_default_output(String s);
Input_score* current_iscore_l();
String find_file(String);
#ifndef METERREG_HH
#define METERREG_HH
#include "register.hh"
+#include "time-description.hh"
+#include "grouping.hh"
/**
generate meters.
*/
class Meter_register : public Request_register {
public:
+ Time_description time_;
+ Rhythmic_grouping default_grouping_;
+
Meter_change_req * meter_req_l_;
Meter * meter_p_;
- virtual bool try_request(Request *req_l);
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void fill_staff_info(Staff_info&);
+ virtual bool do_try_request(Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_creation_processing();
+ virtual void do_post_move_processing();
Meter_register();
NAME_MEMBERS();
};
public:
Meter(Array<Scalar> args) ;
NAME_MEMBERS();
+ SCORE_ELEM_CLONE(Meter)
};
#endif // METER_HH
struct Midi_output {
+ #if 0
Midi_output(Score* score_l, Midi_def* );
void do_staff(Staff*st_l, int count);
Score* score_l_;
Midi_def* midi_l_;
Midi_stream* midi_stream_l_;
+#endif
};
#endif // MIDIOUTPUT_HH
#ifndef MIDIWALKER_HH
#define MIDIWALKER_HH
+#if 0
#include "lily-proto.hh"
#include "grouping.hh"
#include "staff-walker.hh"
#include "pcursor.hh"
#include "pqueue.hh"
+
+
struct Note_event : PQueue_ent<Moment,Melodic_req*>
{
bool ignore_b_;
public:
Midi_walker(Staff*, Midi_track*);
- void process_requests();
+ void do_process_requests();
~Midi_walker();
};
-
+#endif
#endif // MIDIWALKER_HH
void add_bottom(const Molecule &m);
void add(Molecule const &m);
void translate(Offset);
+ void translate_y(Real);
+ void translate_x(Real);
void add(Atom const & a) ;
/// how big is #this#?
Box extent() const;
--- /dev/null
+/*
+ music-iterator.hh -- declare {Music,Chord,Voice}_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSIC_ITERATOR_HH
+#define MUSIC_ITERATOR_HH
+
+#include "lily-proto.hh"
+#include "plist.hh"
+#include "moment.hh"
+
+class Music_iterator {
+protected:
+ bool first_b_;
+
+public:
+ Music_iterator *daddy_iter_l_;
+ NAME_MEMBERS();
+ Register_group_register *report_to_reg_l_;
+
+ static Music_iterator* static_get_iterator_p(Music*,Register_group_register*);
+ Music_iterator* get_iterator_p(Music*)const;
+ Music_iterator();
+ virtual void next(Moment until);
+ virtual Moment next_moment()const;
+ virtual bool ok()const;
+ virtual ~Music_iterator();
+ virtual void construct_children();
+ virtual Register_group_register * get_req_acceptor_l();
+};
+
+// duh.
+class Request_iterator : public Music_iterator {
+ Request *req_l_;
+public:
+ Request_iterator(Request const *);
+ NAME_MEMBERS();
+protected:
+ virtual void next(Moment);
+};
+
+class Change_iterator : public Music_iterator {
+ Change_reg * change_l_;
+public:
+ NAME_MEMBERS();
+ virtual void next(Moment);
+ Change_iterator(Change_reg*);
+};
+
+class Chord_iterator : public Music_iterator
+{
+ const Chord *chord_C_;
+ Pointer_list<Music_iterator*> children_p_list_;
+public:
+ Chord_iterator(Chord const*);
+ NAME_MEMBERS();
+protected:
+ virtual void construct_children();
+ virtual void next(Moment);
+ virtual Moment next_moment()const;
+ virtual bool ok()const;
+};
+
+class Voice_element_iterator : public Chord_iterator {
+
+protected:
+ virtual void construct_children();
+public:
+ Voice_element_iterator(Voice_element*);
+ NAME_MEMBERS();
+};
+
+
+class Voice_iterator : private PCursor<Music*>, public Music_iterator
+{
+ Moment here_mom_;
+ const Voice * voice_C_;
+ Music_iterator * iter_p_;
+ void next_element();
+public:
+ Voice_iterator(Voice const*);
+ NAME_MEMBERS();
+protected:
+ virtual void construct_children();
+ ~Voice_iterator();
+ virtual void next(Moment);
+ virtual Moment next_moment()const;
+ virtual bool ok()const;
+};
+
+#endif // MUSIC_ITERATOR_HH
--- /dev/null
+/*
+ music-list.hh -- declare Music_list, Chord and Voice
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef MUSIC_LIST_HH
+#define MUSIC_LIST_HH
+
+#include "music.hh"
+#include "plist.hh"
+
+
+/**
+ Music can be a list of other "Music" elements
+ */
+class Music_list : public Music {
+
+public:
+ int multi_level_i_;
+
+ /// what kind of iterator needed to walk this music?
+ String type_str_;
+
+ /// what name (or look for this name)
+ String id_str_;
+ Music_list(Music_list const&);
+ Music_list();
+ NAME_MEMBERS();
+ VIRTUAL_COPY_CONS(Music_list,Music)
+ virtual void add(Music*);
+ virtual void transpose(Melodic_req const *);
+
+ Pointer_list<Music*> music_p_list_;
+protected:
+
+ virtual void do_print() const;
+};
+
+/**
+ Chord is a list of music-elements which happen simultaneously
+ */
+
+class Chord : public Music_list {
+public:
+ Chord();
+ NAME_MEMBERS();
+ VIRTUAL_COPY_CONS(Chord,Music)
+ virtual void translate(Moment dt);
+ virtual MInterval time_int()const;
+};
+
+class Voice_element : public Chord {
+public:
+ NAME_MEMBERS();
+ VIRTUAL_COPY_CONS(Voice_element,Music)
+};
+
+/**
+ Voice is a list of music-elements which are placed behind each other.
+ */
+class Voice : public Music_list {
+
+public:
+ Moment offset_mom_;
+
+ Voice();
+ NAME_MEMBERS();
+ VIRTUAL_COPY_CONS(Voice, Music)
+ virtual void translate(Moment dt);
+ virtual MInterval time_int()const;
+};
+
+/** A simple piece of music, which wishes to change the spot of its
+ interpretor */
+class Change_reg : public Music {
+public:
+
+ /// what kind of iterator needed to walk this music?
+ String type_str_;
+
+ /// what name (or look for this name)
+ String id_str_;
+
+ NAME_MEMBERS();
+ VIRTUAL_COPY_CONS(Change_reg, Music)
+};
+#endif // MUSIC_LIST_HH
#ifndef MUSIC_HH
#define MUSIC_HH
-#include "plist.hh"
#include "virtual-methods.hh"
#include "input.hh"
#include "minterval.hh"
#include "lily-proto.hh"
+#include "string.hh"
+/** In Lily, everything that has a length and a pitch (which can be
+ transposed) is considered "music",
+
+ Music is hierarchical:
+
+ @seealso Music_list
+ */
class Music:public Input {
public:
+ Music_list * parent_music_l_;
+
virtual MInterval time_int()const;
virtual ~Music(){}
void print() const;
};
-class Music_list : public Music {
-public:
- Music_list(Music_list const&);
- Music_list();
- NAME_MEMBERS();
- VIRTUAL_COPY_CONS(Music_list,Music)
- virtual void add(Music*);
- virtual void transpose(Melodic_req const *);
-protected:
- Pointer_list<Music*> music_p_list_;
-
- virtual void do_print() const;
-};
-
-
-class Chord : public Music_list {
-public:
- NAME_MEMBERS();
- VIRTUAL_COPY_CONS(Chord,Music)
- virtual void translate(Moment dt);
- virtual MInterval time_int()const;
-};
-
-
-class MVoice : public Music_list {
-public:
- NAME_MEMBERS();
- VIRTUAL_COPY_CONS(MVoice, Music)
- virtual void translate(Moment dt);
- virtual MInterval time_int()const;
-};
-
#endif // MUSIC_HH
/**
- A request which is coupled to a #Voice_element# with nonzero duration.
+ A request which is coupled to a #Voice_element#
Base class only
*/
class Musical_req : public virtual Request {
virtual Beam_req *beam() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0; }
virtual Musical_script_req*musicalscript() { return 0; }
+ virtual Text_req*text() { return 0; }
+ virtual Rest_req *rest() { return 0; }
virtual Skip_req* skip() { return 0; }
virtual Dynamic_req* dynamic() { return 0; }
virtual Absolute_dynamic_req * absdynamic() { return 0; }
};
-class Skip_req : public Musical_req {
-public:
- Moment duration_;
-
- virtual Moment duration() const;
- REQUESTMETHODS(Skip_req, skip);
-};
/** a request with a duration.
This request is used only a base class.
REQUESTMETHODS(Rhythmic_req, rhythmic);
};
+class Skip_req : public Rhythmic_req {
+public:
+ REQUESTMETHODS(Skip_req, skip);
+};
struct Spacing_req :virtual Request {
Moment next;
Real distance;
Array<Input> define_spot_array_;
String init_str_;
- void add_requests( Voice_element*v);
+ void add_requests( Chord*v);
+
+ Chord * get_note_element(Note_req * ,Duration *);
+ Chord* get_rest_element(String,Duration *);
+ Chord* get_word_element(Text_def*, Duration*);
- Voice_element * get_note_element(Note_req * ,Duration *);
- Voice_element* get_rest_element(String,Duration *);
- Voice_element* get_word_element(Text_def*, Duration*);
void set_last_duration(Duration const *);
void set_default_duration(Duration const *);
void set_duration_mode(String s);
Duration default_duration_;
String textstyle_str_;
bool first_b_;
- bool last_duration_mode ;
+ bool last_duration_mode_b_ ;
Array<Request*> pre_reqs, post_reqs;
int fatal_error_i_;
Sources * source_l_;
protected:
virtual void set_feature(Feature);
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
public:
Note_column_register();
NAME_MEMBERS();
/// does this column have items
bool used_b() const;
+ bool breakpoint_b() const;
+ void clean_breakable_items();
void add(Item *i);
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,int breakstatus=1);
+ void typeset_item(Item *item_p, PCol *pcol_l,int breakstatus=0);
/// add to bottom of pcols
void add(PCol*);
/*
-paper-def.hh -- declare Paper_def
+ paper-def.hh -- declare Paper_def
source file of the GNU LilyPond music typesetter
symbols, dimensions and constants
This struct takes care of all kinds of symbols, dimensions and
- constants. Most of them are related to the point-size of the fonts,
- so therefore, the lookup table for symbols is also in here.
-
- TODO:
-
- add support for multiple fontsizes
- split into "Input_paper_def" and Paper_def
- add support for other len->wid conversions.
+ constants. Most of them are related to the point-size of the fonts,
+ so therefore, the lookup table for symbols is also in here.
+
+ TODO:
+
+ add support for multiple fontsizes
+ split into "Input_paper_def" and Paper_def
+ add support for other len->wid conversions.
+
*/
class Paper_def {
Lookup *lookup_p_;
+++ /dev/null
-/*
- pulk-voice.hh -- declare Pulk_voice
-
- 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 "lily-proto.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-#include "priorities.hh"
-#include "pcursor.hh"
-
-/**
- Align requests with starting time.
-
- To our foreign readers "pulk"ing is what you do with the stuff in
- your nose to get it out. (and I don't mean blowing) */
-class Pulk_voice
-{
- PCursor<Voice_element*> cur_;
- Moment elt_mom_;
- Priorities<Moment> subtle_moment_priorities_;
- int subtle_idx_;
- void set_subtle();
- void next();
-public:
- int staff_idx_;
-
- Moment when()const;
- bool ok()const { return cur_.ok() ; }
-
- Pulk_voice(Voice*, int staff_idx);
-
- /**
- Get the requests at when(), and advance.
- */
- Array<Request*> get_req_l_arr();
-};
-
-#endif // PULK_VOICE_HH
+++ /dev/null
-/*
- pulk-voices.hh -- declare Pulk_voices
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-
- TODO
- integrate Meter handling, to guarantee proper creation of staff_columns.
-*/
-
-
-#ifndef PULK_VOICES_HH
-#define PULK_VOICES_HH
-
-#include "pqueue.hh"
-#include "plist.hh"
-#include "moment.hh"
-#include "lily-proto.hh"
-#include "lily-proto.hh"
-#include "voice.hh"
-#include "time-description.hh"
-
-
-struct Voice_l {
- Voice *l_;
- int staff_idx_;
- Voice_l(Voice*v, int i){ l_ = v;
- staff_idx_ = i;
- }
- Voice_l() { l_ = 0; staff_idx_ =0; }
-};
-int compare(Voice_l const &p1, Voice_l const &p2);
-
-class Pulk_voices
-{
-PQueue< Voice_l > voice_pq_;
- Pointer_list< Pulk_voice * > pulk_p_list_;
- Link_list<Staff *> staff_l_list_;
- Array < Time_description > time_arr_;
- Moment next_mom_;
-
-public:
- Moment last_;
- bool time_checks_failed_b() const;
- bool ok() const;
- Moment next_mom() const;
- Pulk_voices(Link_list<Staff*> const&);
- void get_aligned_request(Request_column *col_l );
-};
-
-
-#endif // PULK_VOICES_HH
#ifndef REGISTERGROUP_HH
#define REGISTERGROUP_HH
-
+#include "parray.hh"
#include "plist.hh"
#include "score-elem-info.hh"
#include "register.hh"
class Register_group_register : public Request_register {
protected:
Pointer_list<Request_register*> reg_list_;
+ Link_array<Register_group_register> group_l_arr_;
+ Link_array<Request_register> nongroup_l_arr_;
+ String id_str_;
+
+ Array<Score_elem_info> announce_info_arr_;
+
virtual void do_print()const;
+
public:
-
+ /// Score_register = 0, Staff_registers = 1, etc)
+ virtual int depth_i()const;
+ /**
+ Go up in the tree. default: choose next parent
+ */
+ Register_group_register * ancestor_l(int l=1);
+
+ Input_register * ireg_l_;
+
/**
Junk #reg_l#.
/**
Remove #reg_l# from the list, and return it.
*/
- virtual Request_register * get_register_p(Request_register*reg_l);
+ virtual Request_register * remove_register_p(Request_register*reg_l);
virtual void set_feature(Feature i);
- virtual bool acceptable_request_b(Request*)const;
virtual void sync_features() ;
- virtual void pre_move_processing();
- virtual void post_move_processing();
- virtual void acknowledge_element(Score_elem_info info);
- virtual bool try_request(Request*);
- virtual void process_requests();
- virtual ~Register_group_register();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+
+ virtual void do_removal_processing();
+ virtual bool do_try_request(Request*);
+ virtual void do_process_requests();
+ virtual Staff_info get_staff_info()const;
+
+ virtual Register_group_register * find_register_l(String name,String id);
+ virtual void do_announces();
+ virtual void announce_element(Score_elem_info);
+ virtual Register_group_register* find_get_reg_l(String name, String id);
+ virtual Register_group_register * get_default_interpreter();
+
virtual void add(Request_register* reg_p);
- void add(Array<Request_register*> reg_p_arr);
+
virtual bool contains_b(Request_register*)const;
};
#include "score-elem-info.hh"
#include "staff-info.hh"
+
+
+
/**
a struct which processes requests, and creates the #Score_elem#s.
It may use derived classes. Hungarian postfix: register
You cannot copy a Request_register
*/
Request_register(const Request_register&){}
+
+ enum {
+ VIRGIN,
+ CREATION_INITED,
+ MOVE_INITED,
+ ACCEPTED_REQS,
+ PROCESSED_REQS,
+ ACKED_REQS,
+ MOVE_DONE
+ } status;
+
protected:
/// utility
virtual Paper_def * paper() const;
- /**
- try to fit the request in this register
-
- @return
- false: not noted, not taken.
-
- true: request swallowed. Don't try to put the request elsewhere.
-
-
- Default: always return false
- */
- virtual bool try_request(Request *req_l);
/// make items/spanners with the requests you got
- virtual void process_requests(){}
+ virtual void do_process_requests(){}
/** typeset any items/spanners. Default: do nothing
*/
- virtual void pre_move_processing(){}
+ virtual void do_pre_move_processing(){}
/** reset any appropriate data. Default: do nothing
*/
- virtual void post_move_processing(){}
+ virtual void do_post_move_processing(){}
- /**
- Is this request eligible to be processed? Default: return false.
- */
- virtual bool acceptable_request_b(Request*) const;
+
+ virtual void do_creation_processing () {}
+ virtual void do_removal_processing() {}
/**
typeset a "command" item. Default: pass on to daddy.
If the column is not breakable, #pre_p# and #post_p# are junked
*/
- virtual void typeset_breakable_item(Item * pre_p ,
- Item * nobreak_p, Item * post_p);
+ virtual void typeset_breakable_item(Item * nobreak_p);
/**
Invoke walker method to typeset element. Default: pass on to daddy.
*/
*/
virtual void sync_features() {}
-
+
virtual bool contains_b(Request_register*reg_l)const;
/**
Get information on the staff. Default: ask daddy.
*/
- virtual Staff_info get_staff_info();
+ virtual Staff_info get_staff_info()const;
+ virtual void fill_staff_info(Staff_info&);
virtual void do_print()const;
+ /*
+ @see{try_request}
+ Default: always return false
+ */
+ virtual bool do_try_request(Request *req_l);
public:
- /** Every Request_register (except for the 'top' which is directly
- inside the Staff_walker, is a element of a group. */
+ void pre_move_processing();
+ void process_requests();
+ /**
+ try to fit the request in this register
+
+ @return
+ false: not noted, not taken.
+
+ true: request swallowed. Don't try to put the request elsewhere.
+
+ */
+ bool try_request(Request*);
+
+ void post_move_processing();
+ virtual Interpreter * interpreter_l() { return 0; }
+
Register_group_register * daddy_reg_l_;
Request_register();
+++ /dev/null
-/*
- request-column.hh -- declare Request_column
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef REQUEST_COLUMN_HH
-#define REQUEST_COLUMN_HH
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-#include "varray.hh"
-/**
- Like staff_column, but Score wide. One per when().
- */
-class Request_column
-{
- Pointer_list<Staff_column*> staff_cols_;
- Array<Staff_column*> staff_col_l_arr_;
- Moment when_;
-
-public:
- Score_column *musical_column_l_, *command_column_l_;
- Request_column(Link_list<Staff*> const& );
- bool used_b()const;
- Moment when();
- void add_reqs(int staff_idx, Array<Request*> const&);
- void update_time(int staff_idx, Time_description &);
- void set_score_cols(Score_column*, Score_column*);
-};
-
-#endif // REQUEST_COLUMN_HH
#ifndef REQUEST_HH
#define REQUEST_HH
-// GNU LilyPond's second egg of columbus!
#include "glob.hh"
#include "string.hh"
#include "moment.hh"
#include "virtual-methods.hh"
#include "input.hh"
+#include "music.hh"
/**
a voice element wants something printed.
Hungarian postfix: req
@see lilygut manpage
*/
-class Request : public Input {
+class Request : public Music {
+
public:
- Voice_element*elt_l_;
+ Voice * voice_l();
/* *************** */
- Voice * voice_l();
- Request();
- Request(Request const&);
+
virtual ~Request(){}
NAME_MEMBERS();
- virtual Request* clone() const { return new Request(*this); }
- void print()const ;
+ VIRTUAL_COPY_CONS(Request,Music)
+ void print()const ;
+ virtual MInterval time_int() const;
virtual void transpose(Melodic_req const &){}
virtual Moment duration() const { return 0; }
*/
virtual Barcheck_req *barcheck() { return 0; }
virtual Script_req *script() { return 0;}
- virtual Text_req*text() { return 0; }
- virtual Rest_req *rest() { return 0; }
virtual Span_req *span() { return 0; }
virtual Spacing_req * spacing() { return 0; }
virtual Blank_req * blank() { return 0; }
Array< Collision *> collision_l_arr_;
protected:
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
+ virtual void do_pre_move_processing();
public:
Rest_collision_register();
NAME_MEMBERS();
--- /dev/null
+/*
+ score-align-reg.hh -- declare Score_align_reg
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_ALIGN_REG_HH
+#define SCORE_ALIGN_REG_HH
+
+#include "register.hh"
+
+class Score_align_register: public Request_register
+{
+
+ const char* type_ch_C_;
+ Horizontal_group_item * align_p_;
+public:
+ int priority_i_;
+ Score_align_register(char const*);
+ NAME_MEMBERS();
+protected:
+ virtual void acknowledge_element(Score_elem_info);
+ virtual void do_pre_move_processing();
+};
+#endif // SCORE_ALIGN_REG_HH
/*
- sccol.hh -- part of GNU LilyPond
+ score-column.hh -- declare Score_column
- (c) 1996,97 Han-Wen Nienhuys
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#ifndef SCCOL_HH
-#define SCCOL_HH
+
+#ifndef SCORE_COLUMN_HH
+#define SCORE_COLUMN_HH
+
#include "lily-proto.hh"
#include "varray.hh"
#include "moment.hh"
instantiate_compare(Score_column&, Score_column::compare);
-#endif // SCCOL_HH
+#endif // SCORE_COLUMN_HH
+
+
#include "virtual-methods.hh"
#include "directed-graph.hh"
+#define SCORE_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem)
/** 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
enum Status {
ORPHAN, // not yet added to pstaff
VIRGIN, // added to pstaff
+ PREBREAKING,
+ PREBROKEN,
PRECALCING,
PRECALCED, // calcs before spacing done
BREAKING,
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_;
-
+ int x_group_element_i_;
+ int y_group_element_i_;
Score_elem(Score_elem const&);
virtual String TeX_string () const ;
virtual void print() const;
virtual ~Score_elem();
Score_elem();
NAME_MEMBERS();
- virtual bool is_type_b(const char *);
Interval width() const;
Interval height() const;
+ virtual void translate_x(Real);
+ virtual void translate_y(Real);
/**
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);
+ void translate(Offset);
Offset offset()const;
void add_processing();
void OK() const;
void pre_processing();
+ void breakable_col_processing();
void break_processing();
void post_processing();
virtual Spanner* spanner() { return 0; }
- virtual Element_group* elem_group() { return 0; }
+ virtual Horizontal_vertical_group* elem_group() { return 0; }
virtual Item * item() { return 0; }
virtual Line_of_score * line_l() const;
+ SCORE_ELEM_CLONE(Score_elem)
protected:
virtual Interval do_height()const;
/// do calculations before determining horizontal spacing
virtual void do_pre_processing();
-
+ virtual void do_breakable_col_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();
+ virtual void handle_prebroken_dependencies();
+
+ Score_elem* dependency(int) const;
+ Score_elem* dependent(int) const;
+ int dependent_size() const;
+ int dependency_size() const;
+
+
+ /// no dimension, translation is noop
+ bool empty_b_;
+ /// do not print anything black
+ bool transparent_b_;
};
--- /dev/null
+/*
+ score-halign-reg.hh -- declare Score_horizontal_align_register
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_HALIGN_REG_HH
+#define SCORE_HALIGN_REG_HH
+#include "register.hh"
+class Score_horizontal_align_register : public Request_register {
+
+ Break_align_item * halign_p_;
+public:
+ NAME_MEMBERS();
+ Score_horizontal_align_register();
+protected:
+ virtual void acknowledge_element(Score_elem_info);
+ virtual void do_pre_move_processing();
+};
+#endif // SCORE_HALIGN_REG_HH
--- /dev/null
+/*
+ score-reg.hh -- declare Score_register
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCORE_REG_HH
+#define SCORE_REG_HH
+
+#include "register-group.hh"
+#include "pqueue.hh"
+
+class Score_register : public Register_group_register {
+ Line_of_score * scoreline_l_;
+ Score * score_l_;
+
+ Array<Item*> nobreak_item_p_arr_;
+ Link_array<Score_elem> musical_item_p_arr_;
+
+ Score_column* command_column_l_;
+ Score_column* musical_column_l_;
+
+ friend class Score;
+ void set_cols(Score_column*,Score_column*);
+ void typeset_all();
+
+ PQueue<Moment> extra_mom_pq_;
+ Moment last_mom_;
+public:
+ NAME_MEMBERS();
+
+ void add_moment_to_process(Moment);
+ Score_register();
+ int depth_i() const;
+protected:
+ void set_score(Score * score_l);
+
+
+ virtual Staff_info get_staff_info()const;
+ virtual bool do_try_request(Request*);
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
+ virtual void announce_element(Score_elem_info);
+ virtual void typeset_breakable_item(Item * nobreak_p);
+ virtual void do_announces();
+ virtual void typeset_element(Score_elem*elem_p);
+ virtual Paper_def * paper() const;
+ virtual void do_pre_move_processing();
+
+};
+
+#endif // SCORE_REG_HH
+++ /dev/null
-/*
- score-walker.hh -- declare Score_walker
-
- 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 "lily-proto.hh"
-#include "varray.hh"
-
-
-/**
- walk through the score_columns, and while doing so, walk all staffs in a score.
-
- TODO
- support for vertical spanners.
- */
-class Score_walker : public PCursor<Score_column *>
-{
- Score* score_l_;
- /// walkers for the individual staves.
- Array<Staff_walker *> walker_p_arr_;
- Array<Staff_walker *> disallow_break_walk_l_arr;
- int disallow_break_count_;
- int breaks_i_;
- void reinit();
-public:
- bool break_allowed_b();
- void allow_break(Staff_walker*w);
- Score_walker(Score*);
- ~Score_walker();
- Moment when();
- void operator++(int);
- /// process staff walkers.
- void process();
-};
-#endif // SCOREWALKER_HH
#include "lily-proto.hh"
/// the total music def of one movement
-struct Score {
+class Score: public Input {
+public:
/// paper_, staffs_ and commands_ form the problem definition.
Paper_def *paper_p_;
Midi_def *midi_p_;
- Pointer_list<Staff*> staffs_;
+ Music * music_p_;
- /// "runtime" fields for setting up spacing
- Pointer_list<Request_column*> rcols_;
Pointer_list<Score_column*> cols_;
PScore *pscore_p_;
- Input input_;
int errorlevel_i_;
/* *************************************************************** */
/// construction
Score();
~Score();
- void add(Staff*);
/// do everything except outputting to file
void process();
/// when does the last *musical* element finish?
Moment last() const;
+ Score(Score const&);
+
private:
void paper_output();
void setup_music();
- void process_music();
/// do midi stuff
void midi();
// utils:
PCursor<Score_column*> create_cols(Moment, PCursor<Score_column*> &last);
- Score(Score const&){}
/**
make the pcol_l_ fields of each Score_column point to the correct PCol,
-
/*
scoreline.hh -- part of GNU LilyPond
#include "colhpos.hh"
#include "spanner-elem-group.hh"
+#include "vertical-align-elem.hh"
/// the columns of a score that form one line.
-class Line_of_score : public Spanner_elem_group {
+class Line_of_score : public Spanner, public Vertical_align_elem {
public:
- Link_array<Spanner_elem_group> line_arr_;
- Link_array<PCol > cols;
+ Link_array<PCol> cols;
bool error_mark_b_;
virtual String TeX_string() const;
- /* *************** */
+
NAME_MEMBERS();
Line_of_score();
- void add_line(Spanner_elem_group *);
+ void add(Score_elem *);
/// is #c# contained in #*this#?
bool contains_b(PCol const *c)const;
+ bool contains_b(Score_elem const*e) const {
+ return Vertical_align_elem::contains_b(e);
+ }
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)
+ virtual Interval do_width()const;
+ virtual void do_print() const;
+ SCORE_ELEM_CLONE(Line_of_score)
};
#endif
#ifndef SCRIPT_COLUMN_HH
#define SCRIPT_COLUMN_HH
-#include "elem-group.hh"
-#include "item.hh"
+#include "elem-group-item.hh"
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts ) as a single entity. */
-class Script_column : public Item, public Element_group {
+class Script_column : public Horizontal_vertical_group_item {
protected:
virtual void do_print() const;
NAME_MEMBERS();
Script_register();
protected:
- virtual bool try_request(Request*);
- virtual void process_requests();
+ virtual bool do_try_request(Request*);
+ virtual void do_process_requests();
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
/* *************** */
protected:
virtual ~Slur_register();
- virtual bool try_request(Request*);
+ virtual bool do_try_request(Request*);
virtual void set_feature(Feature);
- virtual bool acceptable_request_b(Request*);
- virtual void process_requests();
+ virtual void do_process_requests();
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
public:
Slur_reg();
NAME_MEMBERS();
virtual void do_post_processing();
virtual void do_substitute_dependency(Score_elem*, Score_elem*);
virtual void do_pre_processing();
- SPANNER_CLONE(Slur)
+ SCORE_ELEM_CLONE(Slur)
NAME_MEMBERS();
};
#include "spanner.hh"
#include "elem-group.hh"
-class Spanner_elem_group : public Spanner, public Element_group {
+class Spanner_elem_group : public Spanner, public Horizontal_vertical_group {
protected:
virtual Interval do_width()const;
virtual void do_print() const;
- SPANNER_CLONE(Spanner_elem_group)
+ SCORE_ELEM_CLONE(Spanner_elem_group)
+public:
NAME_MEMBERS();
};
#endif // SPANNER_ELEM_GROUP_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
bool broken_b() const;
Spanner* find_broken_piece(Line_of_score*)const;
protected:
- SPANNER_CLONE(Spanner)
+ SCORE_ELEM_CLONE(Spanner)
virtual void break_into_pieces();
Link_array<Spanner> broken_into_l_arr_;
+++ /dev/null
-/*
- staff-column.hh -- declare Staff_column
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFCOLUMN_HH
-#define STAFFCOLUMN_HH
-
-#include "lily-proto.hh"
-#include "varray.hh"
-#include "moment.hh"
-
-/// store simultaneous requests
-class Staff_column {
-
- Staff_column(Staff_column const&);
-
-public:
- Array<Request*> creationreq_l_arr_;
- Array<Request*> musicalreq_l_arr_;
- Array<Request*> commandreq_l_arr_;
- Staff * staff_l_;
- Request_column * req_col_l_;
- /// fields to collect timing data vertically.
- Array<Timing_req*> timing_req_l_arr_;
-
- /* *************** */
-
- Staff_column();
- Score_column* command_column_l();
- Score_column* musical_column_l();
- Moment when() const;
- void set_req_col(Request_column *c1);
- void add_reqs (Array<Request*> req_l_arr);
- void OK() const;
- ~Staff_column();
- void update_time(Time_description&, Rhythmic_grouping*);
- void typeset_breakable_items(Array<Item *> &pre_p_arr,
- Array<Item *> &nobreak_p_arr,
- Array<Item *> &post_p_arr);
- void typeset_musical_item(Item *i);
- void setup_one_request(Request*);
-protected:
-};
-
-
-
-#endif // STAFFCOLUMN_HH
-
#ifndef STAFF_INFO_HH
#define STAFF_INFO_HH
+#include "lily-proto.hh"
+
/// struct to pass staff info along a Request_register hierarchy.
struct Staff_info {
int *c0_position_i_l_;
- Staff_walker *walk_l_;
Staff_symbol*staff_sym_l_;
/// when is now?
Time_description const *time_C_;
Rhythmic_grouping const *rhythmic_C_;
+ Score_column *musical_l_;
+ Score_column *command_l_;
///
bool break_allowed_b_;
-
+ Score * score_l_;
Moment when();
- Staff * staff_l();
Score *score_l();
PCol * command_pcol_l();
- PCol * musical_pcol_l();
- Staff_column *column_l();
- Score_column *musical_l();
+ Score_column* musical_l();
Score_column *command_l();
+ PCol * musical_pcol_l();
Staff_info();
};
/**
Registers which manage a Staff (one 5-line linestaff)
+
*/
class Staff_registers : public Register_group_register {
- int c0_position_i_;
- Input_register const *ireg_C_;
- int base_position_i_;
- Array<Voice_group_registers*> group_l_arr_;
- Staff_symbol * staff_sym_l_;
+ Line_of_staff *staffline_p_;
+ Link_array<Score_elem> staff_elem_l_arr_;
+
+ void group_staff_elems();
protected:
- virtual bool try_request(Request * r);
- virtual Staff_info get_staff_info();
- virtual bool acceptable_request_b(Request*) const ;
- virtual void acknowledge_element(Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual void do_creation_processing();
+ virtual void do_removal_processing();
+ virtual void typeset_element(Score_elem*);
+ virtual void typeset_breakable_item( Item * it_p);
+
public:
- /* *************** */
NAME_MEMBERS();
- void change_group(Group_change_req * greq_l,
- Voice_registers *voice_regs_l,
- Voice_group_registers * old_group);
- Voice_group_registers * get_group(String id);
- void terminate_register(Request_register * reg);
- Staff_registers(Input_register const*);
+ Staff_registers();
};
#endif // STAFF_REGS_HH
Staff_side();
void add_support(Score_elem*);
+ NAME_MEMBERS();
protected:
virtual void do_substitute_dependency(Score_elem *, Score_elem*);
*/
class Staff_sym_register : public Request_register {
Staff_symbol *span_p_;
- Moment last_mom_;
public:
Staff_sym_register();
NAME_MEMBERS();
protected:
- virtual void process_requests();
- ~Staff_sym_register();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void do_process_requests();
+ virtual void fill_staff_info(Staff_info&);
+ virtual void do_removal_processing();
+ virtual void do_creation_processing();
+
};
#endif // STAFF_SYM_REG_HH
Real inter_note_f()const;
int steps_i()const;
protected:
- SPANNER_CLONE(Staff_symbol)
+ SCORE_ELEM_CLONE(Staff_symbol)
virtual Molecule* brew_molecule_p() const;
virtual void do_print()const;
};
+++ /dev/null
-/*
- staff-walker.hh -- declare Staff_walker
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFWALKER_HH
-#define STAFFWALKER_HH
-
-#include "lily-proto.hh"
-#include "time-description.hh"
-#include "pcursor.hh"
-
-/**
- manage run-time info when walking staffcolumns such as: key,
- meter, pending beams & slurs
- */
-struct Staff_walker : public PCursor<Staff_column*> {
- Staff * staff_l_;
- PScore * pscore_l_;
- Score_walker *score_walk_l_;
- Time_description time_;
- Rhythmic_grouping *default_grouping;
-
- /* *************** */
-
- Moment when() const;
- virtual ~Staff_walker();
- Staff_walker(Staff*, PScore*);
- void process() ;
-
- void operator++(int);
- void allow_break();
-
-protected:
- /// every time before ++ is called
- virtual void do_pre_move(){}
- /// every time after ++ is called
- virtual void do_post_move(){}
- virtual void process_requests()=0;
-private:
- void process_timing_reqs();
- Staff_walker(Staff_walker const&);
-};
-
-#endif // STAFFWALKER_HH
-
+++ /dev/null
-/*
- staff.hh -- declare Staff
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef STAFF_HH
-#define STAFF_HH
-
-#include "plist.hh"
-#include "lily-proto.hh"
-#include "moment.hh"
-
-/// A collection of voices.
-class Staff {
- Staff(const Staff&src);
-
-public:
- Input_register * ireg_p_;
-
- Link_list<Voice*> voice_list_;
- /// runtime field
- Link_list<Staff_column*> cols_;
- Line_of_staff * staff_line_l_;
-
- Score *score_l_;
- PScore *pscore_l_;
-
- /* *************************************************************** */
-
- void add(Link_list<Voice*> const&s);
-
- void add_voice(Voice *v_p);
- Paper_def*paper()const;
-
- void OK() const;
- void print() const;
-
- /// when does the last *musical* element finish?
- Moment last() const;
-
- /// remove unused cols
- void clean_cols() ;
- Staff();
-
- virtual void set_output(PScore * destination);
- Staff_walker *get_walker_p();
- virtual ~Staff();
- void add_col(Staff_column*);
-protected:
-
-};
-#endif
+++ /dev/null
-/*
- staffeleminfo.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 "lily-proto.hh"
-
-/// data container.
-struct Score_elem_info {
- Score_elem * elem_p_;
- Request*req_l_;
- Voice const * voice_l_;
- Voice_group_registers * group_regs_l_;
- Request_register * origin_reg_l_;
-
- /* *** */
- Score_elem_info(Score_elem*, Request*, Request_register*);
- Score_elem_info();
-};
-
-#endif // STAFFELEMINFO_HH
/// one broken line of staff.
struct Line_of_staff : public Spanner_elem_group{
- SPANNER_CLONE(Line_of_staff)
+ SCORE_ELEM_CLONE(Line_of_staff)
public:
NAME_MEMBERS();
protected:
~Stem_beam_register();
virtual void set_feature(Feature dir_i_);
- virtual bool try_request(Request*);
- virtual void process_requests();
+ virtual bool do_try_request(Request*);
+ virtual void do_process_requests();
virtual void acknowledge_element(Score_elem_info);
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
};
#endif // STEMBEAMREG_HH
\end{itemize}
should move beam_{left, right} into Beam
+
+ TODO.
+
+ Stem size depends on flag.
*/
class Stem : public Item {
void do_print() const;
void set_stemend(Real);
int get_default_dir();
- int get_center_distance();
+ int get_center_distance_from_top();
+ int get_center_distance_from_bottom();
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;
class Swallow_register : public Request_register {
protected:
bool acceptable_request_b(Request*) const;
- bool try_request(Request*) ;
+ bool do_try_request(Request*) ;
public:
NAME_MEMBERS();
};
/// a symbol which can be translated, and freely copied
struct Atom {
- Offset off;
- Symbol sym;
+ Offset off_;
+ Symbol sym_;
/* *************** */
void translate(Offset o) {
- off += o;
+ off_ += o;
+ }
+ void translate_x(Real r){
+ off_.x += r;
+ }
+ void translate_y(Real r) {
+ off_.y += r;
}
/// how big is #this#?
/* *************** */
protected:
virtual void set_feature(Feature );
- virtual bool try_request(Request*);
- virtual void process_requests();
- virtual void pre_move_processing();
- virtual void post_move_processing();
+ virtual bool do_try_request(Request*);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
virtual void acknowledge_element(Score_elem_info);
public:
Text_register();
void set_support(Directional_spanner*);
Text_spanner();
protected:
- SPANNER_CLONE(Text_spanner)
+ SCORE_ELEM_CLONE(Text_spanner)
~Text_spanner();
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_pre_processing();
protected:
virtual ~Tie_register();
virtual void acknowledge_element(Score_elem_info);
- virtual bool try_request(Request*);
+ virtual bool do_try_request(Request*);
virtual bool acceptable_request_b(Request*);
virtual void sync_features();
- virtual void process_requests();
- virtual void post_move_processing();
- virtual void pre_move_processing();
+ virtual void do_process_requests();
+ virtual void do_post_move_processing();
+ virtual void do_pre_move_processing();
virtual void set_feature(Feature);
public:
Tie_register();
Tie();
NAME_MEMBERS();
- SPANNER_CLONE(Tie)
+ SCORE_ELEM_CLONE(Tie)
};
#endif // TIE_HH
--- /dev/null
+/*
+ vertical-align-item.hh -- declare Vertical_align_elem
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef VERTICAL_ALIGN_ITEM_HH
+#define VERTICAL_ALIGN_ITEM_HH
+
+#include "elem-group.hh"
+/**
+ Order elements top to bottom.
+ */
+class Vertical_align_elem : virtual public Score_elem {
+ Link_array<Score_elem> elem_l_arr_;
+public:
+ void add(Score_elem*);
+ bool contains_b(Score_elem const*)const;
+ NAME_MEMBERS();
+protected:
+ virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+ virtual void do_post_processing() ;
+};
+#endif // VERTICAL_ALIGN_ITEM_HH
+++ /dev/null
-/*
- voice-element.hh -- declare Voice_element
-
- 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 "lily-proto.hh"
-#include "plist.hh"
-#include "moment.hh"
-#include "input.hh"
-
-/** one horizontal bit. Voice_element is nothing but a container for
- *the requests, */
-class Voice_element : public Input{
-public:
- /** the duration of the element. This can be 0; The duration is
- determined from rhythmical requests contained in this
- Voice_element */
- Moment duration_;
- Voice const *voice_C_;
- Pointer_list<Request*> req_p_list_;
- Request * principal_req_l_;
-
- /* *************** */
- void transpose(Melodic_req const &)const;
- Voice_element();
- Voice_element(Voice_element const & src );
-
- void add(Request*);
- void print ()const;
- void set_default_group(String id);
-};
-
-#endif // VOICE-ELEMENT_HH
*/
class Voice_group_registers : public Register_group_register {
Moment termination_mom_;
- Input_register const *ireg_C_;
int dir_i_;
protected:
virtual void do_print() const;
- virtual void set_feature(Feature);
virtual Scalar get_feature(String);
- virtual void post_move_processing();
- virtual bool try_request(Request*);
+ virtual void do_post_move_processing();
+ virtual bool do_try_request(Request*);
public:
- void OK() const;
- virtual Request_register * get_register_p(Request_register * reg_l);
- /// each group in a staff has an unique ID.
- String group_id_str_;
-
- /// The pointers are in the base class. This is just administration
- Array<Voice_registers*> voice_reg_l_arr_;
- /* *************** */
+
NAME_MEMBERS();
static bool static_acceptable_request_b(Request*);
- virtual void add(Request_register*);
- Voice_group_registers(String id, Input_register const *);
+ Voice_group_registers();
};
#endif // VOICEGROUPREGS_HH
#define VOICEREGS_HH
#include "register-group.hh"
+#include "interpreter.hh"
-class Voice_registers : public Register_group_register {
- Input_register const *ireg_C_;
- bool terminate_b_;
+class Voice_registers : public Interpreter, public Register_group_register {
public:
- Voice *voice_l_;
- /* *************** */
-
- Voice_registers(Voice*, Input_register const*);
+ Voice_registers();
NAME_MEMBERS();
protected:
- virtual void pre_move_processing();
- virtual bool acceptable_request_b(Request*);
- virtual void acknowledge_element(Score_elem_info info);
- virtual bool try_request(Request*);
+ virtual bool interpret_request_b(Request*);
+ virtual Interpreter* interpreter_l() { return this; }
virtual void do_print() const;
};
+++ /dev/null
-/*
- voice.hh -- declare Voice
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#ifndef VOICE_HH
-#define VOICE_HH
-
-#include "lily-proto.hh"
-#include "plist.hh"
-#include "moment.hh"
-
-/** class for horizontal stuff.
-
- Voice is a ordered row of Voice_elements. It is strictly
- horizontal: you cannot have two rhythmic elements running parallel
- in a Voice. For proper processing, each Voice should have
- Group_change_req as a first element.
-
- */
-
-struct Voice {
- /** the elements, earliest first.
- Please use the member #add()# to add a new element
- */
- Pointer_list<Voice_element *> elts_;
- Moment start_;
-
- /* *************** */
- Voice();
- Voice(Voice const&);
-
- Moment when(Voice_element const *)const;
- Moment last() const;
- void transpose(Melodic_req const &)const;
- void add(Voice_element*);
- void print() const;
- void set_default_group(String id);
-};
-
-#endif
+++ /dev/null
-/*
- walkregs.hh -- declare Walker_registers
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef WALKREGS_HH
-#define WALKREGS_HH
-
-
-#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.]
-
- 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_;
-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();
-
-
- void do_announces();
- Walker_registers(Complex_walker*);
-};
-
-#endif // WALKREGS_HH
+++ /dev/null
-#include "debug.hh"
-#include "input-music.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "voice-element.hh"
-
-void
-Simple_music::transpose(Melodic_req const &d)const
-{
- voice_.transpose(d);
-}
-
-void
-Simple_music::add(Voice_element*v)
-{
- voice_.add(v);
-}
-
-Moment
-Simple_music::length()const
-{
- return voice_.last();
-}
-void
-Simple_music::translate_time(Moment t)
-{
- voice_.start_ += t;
-}
-
-Voice_list
-Simple_music::convert()const
-{
- Voice_list l;
- Voice * v_p = new Voice(voice_);
- PCursor<Voice_element*> i= v_p->elts_.bottom();
-
- if (!i.ok() || i->duration_) {
- v_p->add ( new Voice_element);
- i=v_p->elts_.bottom();
- }
-
- // need-to-have, otherwise memory will be filled up with regs.
- i->add(new Terminate_voice_req);
- l.bottom().add(v_p);
- return l;
-}
-
-
-void
-Simple_music::print() const
-{
-#ifndef NPRINT
- mtor << "Simple_music {";
- voice_.print();
- mtor << "}\n";
-#endif
-}
-
-/* *************** */
-
-void
-Complex_music::transpose(Melodic_req const& d) const
-{
- for (iter_top(elts,i); i.ok(); i++)
- i->transpose(d);
-}
-void
-Complex_music::add(Input_music*v)
-{
- elts.bottom().add(v);
-}
-
-void
-Complex_music::print() const
-{
- for (iter_top(elts,i); i.ok(); i++)
- i->print();
-}
-
-void
-Complex_music::concatenate(Complex_music*h)
-{
- for (iter_top(h->elts,i); i.ok(); i++)
- add(i->clone());
-}
-
-Complex_music::Complex_music()
-{
-}
-
-Complex_music::Complex_music(Complex_music const&s)
-{
- for (iter_top(s.elts,i); i.ok(); i++)
- add(i->clone());
-}
-void
-Complex_music::set_default_group(String g)
-{
- for (iter_top(elts,i); i.ok(); i++)
- i->set_default_group(g);
-}
-/* *************************************************************** */
-
-void
-Music_voice::print() const
-{
- mtor << "Music_voice {";
- Complex_music::print();
- mtor << "}\n";
-}
-
-void
-Music_voice::add_elt(Voice_element*v)
-{
- PCursor<Input_music*> c(elts.bottom());
- if (!c.ok() || !c->simple()) {
- Simple_music*vs = new Simple_music;
-
- c.add(vs);
- }
-
- c = elts.bottom();
- Simple_music *s = c->simple();
- s->add(v);
-}
-
-Moment
-Music_voice::length()const
-{
- Moment l = 0;
-
- for (iter_top(elts,i); i.ok(); i++)
- l += i->length();
- return l;
-}
-
-
-Voice_list
-Music_voice::convert()const
-{
- Voice_list l;
- Moment here = 0;
-
- for (iter_top(elts,i); i.ok(); i++) {
- Moment len = i->length();
- Voice_list k(i->convert());
- k.translate_time(here);
- l.concatenate(k);
- here +=len;
- }
- return l;
-}
-
-void
-Music_voice::translate_time(Moment t)
-{
- elts.bottom()->translate_time(t);
-}
-
-
-
-/* *************** */
-
-void
-Music_general_chord::add_elt(Voice_element*v)
-{
- Simple_music*vs = new Simple_music;
- vs->add(v);
- elts.bottom().add(vs);
-}
-
-void
-Music_general_chord::print() const
-{
- mtor << "Music_general_chord {";
- Complex_music::print();
- mtor << "}\n";
-}
-
-void
-Music_general_chord::translate_time(Moment t)
-{
- for (iter_top(elts,i); i.ok(); i++)
- i->translate_time(t);
-}
-
-Moment
-Music_general_chord::length()const
-{
- Moment l =0;
-
- for (iter_top(elts,i); i.ok(); i++)
- l = l >? i->length();
- return l;
-}
-
-Voice_list
-Music_general_chord::convert()const
-{
- Voice_list l;
- for (iter_top(elts,i); i.ok(); i++) {
- Voice_list k(i->convert());
- l.concatenate(k);
- }
- return l;
-}
-
-/* *************** */
-
-void
-Multi_voice_chord::set_default_group(String g)
-{
- int j=0;
- for (iter_top(elts, i); i.ok(); i++) {
- i->set_default_group(g + String(j));
- j++;
- }
-}
-
-
-/* *************** */
-
-void
-Voice_list::translate_time(Moment x)
-{
- for (iter_top(*this,i); i.ok(); i++)
- i->start_ += x;
-}
-
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "debug.hh"
#include "register.hh"
#include "input-register.hh"
-Input_register::~Input_register()
-{}
+#include "parray.hh"
+#include "input-register.hh"
+#include "register-group.hh"
-Input_register::Input_register()
+void
+Input_register::print() const
{
+#ifndef NPRINT
+ mtor << "name " << name_str_;
+ mtor << "Consists of ";
+ for (int i=0; i< consists_str_arr_.size(); i++)
+ mtor << consists_str_arr_[i] << ',';
+ mtor << "contains " ;
+ for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++)
+ i->print();
+#endif
}
-bool
-Input_register::group_b()const
+/*
+ UGH. Global.
+ */
+Link_array<Input_register> iregs_p_arr;
+
+void
+add_global_input_register(Input_register *reg_p)
{
- return ireg_list_.size();
+ iregs_p_arr.push(reg_p);
}
-Array<String>
-Input_register::get_nongroups_str_arr()const
+Input_register *
+lookup_reg(String nm)
{
- Array<String> s_arr;
- for (iter_top(ireg_list_, i); i.ok(); i++) {
- if (!i->group_b())
- s_arr.push(i->name_str_);
- }
- return s_arr;
+ for (int i=0; i < iregs_p_arr.size(); i++)
+ if (iregs_p_arr[i]->name_str_ == nm)
+ return iregs_p_arr[i];
+
+ error("can't find reg `" + nm + "'");
}
-Input_register*
-Input_register::get_ireg_l(String nm)const
+Input_register *
+Input_register::recursive_find(String nm)
+{
+ if ( nm == name_str_)
+ return this;
+
+ Input_register * r =0;
+ for (iter(contains_ireg_p_list_.top(), i); !r &&i.ok(); i++)
+ r = i->recursive_find(nm);
+
+ return r;
+}
+Input_register *
+Input_register::find_ireg_l(String nm)
{
- for (iter_top(ireg_list_, i); i.ok(); i++) {
+ for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++)
if (i->name_str_ == nm)
return i;
- }
+
return 0;
}
-Array<Request_register*>
-Input_register::get_nongroup_p_arr() const
+
+
+Register_group_register *
+Input_register::get_group_register_p()
{
- Array <Request_register*>a;
- Array<String> sa(get_nongroups_str_arr());
- for (int i=0; i < sa.size(); i++)
- a.push(get_nongroup_register_p(sa[i]));
- return a;
+ Register_group_register * reg_p = (Register_group_register*)
+ get_register_p(name_str_);
+
+
+
+ for (int i=0; i < consists_str_arr_.size(); i++) {
+ reg_p->add( get_register_p( consists_str_arr_[i]) );
+ }
+ reg_p -> ireg_l_ = this;
+ return reg_p;
}
-void
-Input_register::add(Input_register *p)
+
+bool
+Input_register::accept_req_b()
{
- ireg_list_.bottom().add(p);
+ return ! contains_ireg_p_list_.size();
}
void
-Input_register::print() const
+Input_register::add(Input_register *ip)
{
-#ifndef NPRINT
- mtor << name_str_ << " { ";
- for (iter_top(ireg_list_, i); i.ok(); i++)
- i->print();
- mtor <<" }\n";
-#endif
+ contains_ireg_p_list_.bottom().add(ip);
}
-
-Input_register::Input_register(Input_register const&s)
- : Input(s)
+Input_register*
+Input_register::get_default_ireg_l()
{
- name_str_ = s.name_str_;
- for (iter_top(s.ireg_list_, i); i.ok(); i++)
- add(new Input_register(*i.ptr()));
+ return contains_ireg_p_list_.top();
}
+++ /dev/null
-/*
- input-score.cc -- implement Input_score
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "debug.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
-#include "score.hh"
-#include "paper-def.hh"
-#include "midi-def.hh"
-
-
-
-void
-Input_score::add(Input_staff*s)
-{
- staffs_.bottom().add(s);
-}
-
-void
-Input_score::set(Paper_def*p)
-{
- delete paper_p_;
- paper_p_ = p;
-}
-
-void
-Input_score::set(Midi_def* midi_p)
-{
- delete midi_p_;
- midi_p_ = midi_p;
-}
-
-Input_score::Input_score(Input_score const&s)
- : Input(s)
-{
- paper_p_ = (s.paper_p_)? new Paper_def(*s.paper_p_) :0;
- midi_p_ = (s.midi_p_)? new Midi_def(*s.midi_p_) : 0;
- errorlevel_i_ = s.errorlevel_i_;
-}
-
-Score*
-Input_score::parse()
-{
- Score *s_p = new Score;
-
- s_p->errorlevel_i_ = errorlevel_i_;
- if (midi_p_)
- s_p->set(new Midi_def(*midi_p_));
- if (paper_p_)
- s_p->set(new Paper_def(*paper_p_));
-
- for (iter_top(staffs_,i); i.ok(); i++) {
- Staff* staf_p=i->parse(s_p);
- s_p->add(staf_p);
- }
-
- return s_p;
-}
-
-
-Input_score::~Input_score()
-{
- delete paper_p_;
- delete midi_p_;
-}
-
-Input_score::Input_score()
-{
- paper_p_= 0;
- midi_p_ = 0;
- errorlevel_i_ = 0;
-}
-
-void
-Input_score::print()const
-{
-#ifndef NPRINT
- mtor << "Input_score {\n";
- for (iter_top(staffs_,i); i.ok(); i++) {
- i->print();
- }
- mtor << "}\n";
-#endif
-}
+++ /dev/null
-/*
- input-staff.cc -- implement Input_staff
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "debug.hh"
-#include "score.hh"
-#include "input-music.hh"
-#include "input-staff.hh"
-#include "staff.hh"
-#include "my-lily-lexer.hh"
-#include "input-register.hh"
-
-Input_staff::Input_staff()
-{
- ireg_p_ =0;
-}
-
-void
-Input_staff::add(Input_music*m)
-{
- music_.bottom().add(m);
-}
-
-Staff*
-Input_staff::parse(Score*score_l)
-{
- Staff *p=new Staff;
-
- p->score_l_ = score_l;
- p->ireg_p_ = (ireg_p_)? new Input_register(*ireg_p_):0;
- for (iter_top(music_,i); i.ok(); i++) {
- Voice_list vl = i->convert();
- p->add(vl);
- }
- return p;
-}
-
-Input_staff::Input_staff(Input_staff const&s)
- : Input(s)
-{
- for (iter_top(s.music_,i); i.ok(); i++)
- add(i->clone());
-
- ireg_p_ = (s.ireg_p_)? new Input_register(*s.ireg_p_):0;
-}
-
-void
-Input_staff::print() const
-{
-#ifndef NPRINT
- mtor << "Input_staff {\n";
- for (iter_top(music_,i); i.ok(); i++)
- i->print();
- ireg_p_->print();
- mtor << "}\n";
-#endif
-}
-Input_staff::~Input_staff()
-{
- delete ireg_p_;
-}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+#include "p-score.hh"
#include "debug.hh"
#include "item.hh"
#include "p-col.hh"
Item::Item()
{
pcol_l_ = 0;
+
+ broken_to_a_[0]
+ = broken_to_a_[1]=0;
}
IMPLEMENT_STATIC_NAME(Item);
+IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
void
Item::do_print() const
{
return pcol_l_->line_l_;
}
+
+int
+Item::break_status_i() const
+{
+ PCol * c = pcol_l_;
+ if (c->breakable_b())
+ return 0;
+ else if (!c->daddy_l_)
+ return 0;
+ else if (c == c->daddy_l_->prebreak_p_)
+ return -1;
+ else
+ return 1;
+}
+
+void
+Item::do_breakable_col_processing()
+{
+ PCol * c = pcol_l_;
+ if (!c->breakable_b())
+ return;
+
+ for (int i=0; i < 2; i++) {
+ broken_to_a_[i] = clone()->item();
+ pscore_l_->typeset_item(broken_to_a_[i], c, -1+ 2*i);
+ broken_to_a_[i]->handle_prebroken_dependencies();
+ }
+
+ handle_prebroken_dependencies();
+}
+
+Item*
+Item::find_prebroken_piece(Line_of_score*l) const
+{
+ if (line_l() == l)
+ return this;
+ else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
+ return broken_to_a_[0];
+ else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
+ return broken_to_a_[1];
+
+ return 0;
+}
+
+Item*
+Item::find_prebroken_piece(PCol*c)const
+{
+ if (c == pcol_l_ )
+ return (Item *) this; // ugh
+
+ if (c == pcol_l_->prebreak_p_)
+ return (Item *) broken_to_a_[0];
+ else if (c==pcol_l_->postbreak_p_)
+ return (Item *)broken_to_a_[1];
+
+ assert(false);
+}
+
+void
+Item::handle_prebroken_dependencies()
+{
+ if ( pcol_l_->breakable_b() || pcol_l_->daddy_l_ )
+ Score_elem::handle_prebroken_dependencies();
+}
for (int i =0; i < pitch.size(); i++) {
Symbol s= paper()->lookup_l()->accidental(acc[i]);
Atom a(s);
- a.translate(Offset(0,(c_position + pitch[i]) * inter));
+ a.translate_y((c_position + pitch[i]) * inter);
Molecule m(a);
output->add_right(m);
}
Molecule m(paper()->lookup_l()->fill(Box(
Interval(0, paper()->note_width()),
Interval(0,0))));
- output->add_right(m);
+ if ( pitch.size() )
+ output->add_right(m);
return output;
}
IMPLEMENT_STATIC_NAME(Key_item);
+IMPLEMENT_IS_TYPE_B1(Key_item,Item);
#include "key-reg.hh"
#include "key-item.hh"
#include "command-request.hh"
-#include "staff-column.hh"
#include "local-key-reg.hh"
#include "musical-request.hh"
#include "local-key-item.hh"
Key_register::Key_register()
{
- post_move_processing();
+ do_post_move_processing();
}
bool
-Key_register::try_request(Request * req_l)
+Key_register::do_try_request(Request * req_l)
{
Command_req* creq_l= req_l->command();
if (!creq_l|| !creq_l->keychange())
return false;
- assert(!keyreq_l_); // todo
+ if (keyreq_l_)
+ return false; // TODO
keyreq_l_ = creq_l->keychange();
change_key_b_ = true;
read_req(keyreq_l_);
void
Key_register::acknowledge_element(Score_elem_info info)
{
- Command_req * r_l = info.req_l_->command() ;
+ int c0_i= *get_staff_info().c0_position_i_l_;
+ Command_req * r_l = info.req_l_->command() ;
if (r_l && r_l->clefchange()) {
- change_key_b_ = true;
+
+ if (!kit_p_) {
+ kit_p_ = new Key_item(c0_i);
+ announce_element(Score_elem_info(kit_p_,0));
+ }
+ change_key_b_ = true;
}
- if (info.elem_l_->name() == Bar::static_name())
+ if (info.elem_l_->name() == Bar::static_name()) {
default_key_b_ = true;
+ if (!kit_p_) {
+ kit_p_ = new Key_item(c0_i);
+ announce_element(Score_elem_info(kit_p_,0));
+ }
+ }
}
void
-Key_register::process_requests()
+Key_register::do_process_requests()
{
int c0_i= *get_staff_info().c0_position_i_l_;
if (key_.multi_octave_b_)
assert(false); // TODO .
- else
+ else if (keyreq_l_) {
kit_p_ = new Key_item(c0_i);
- kit_p_->read(*this);
- announce_element(Score_elem_info(kit_p_, keyreq_l_));
+ kit_p_->read(*this);
+ announce_element(Score_elem_info(kit_p_, keyreq_l_));
+ }
}
void
-Key_register::pre_move_processing()
+Key_register::do_pre_move_processing()
{
- Time_description const * time_C_ = get_staff_info().time_C_;
- if ( time_C_->whole_in_measure_&& default_key_b_ && ! change_key_b_ ) {
- delete kit_p_ ;
- kit_p_ =0;
- }
-
if (kit_p_) {
- if (change_key_b_)
- typeset_breakable_item(
- new Key_item(*kit_p_), kit_p_, new Key_item(*kit_p_));
- else
- typeset_breakable_item(0,0,kit_p_);
+ typeset_breakable_item( kit_p_);
kit_p_ = 0;
}
}
}
void
-Key_register::post_move_processing()
+Key_register::do_post_move_processing()
{
keyreq_l_ = 0;
default_key_b_ = false;
change_key_b_ = false;
}
IMPLEMENT_STATIC_NAME(Key_register);
+IMPLEMENT_IS_TYPE_B1(Key_register,Request_register);
ADD_THIS_REGISTER(Key_register);
#include "varray.hh"
#include "parser.hh"
#include "debug.hh"
-#include "input-score.hh"
#include "parseconstruct.hh"
#include "main.hh"
#include "identifier.hh"
WORD {A}{AN}*
ALPHAWORD {A}+
INT -?{N}+
-REAL {INT}?(\.{N}+)?
+REAL {INT}?\.{N}*
KEYWORD \\{WORD}
WHITE [ \n\t\f]
BLACK [^ \n\t\f]
RESTNAME [rs]
NOTECOMMAND \\{A}+
-DOTS \.+
LYRICS ({AA}|{NATIONAL})[^0-9 \t\n\f]*
%%
return scan_escaped_word(YYText()+1);
}
- {DOTS} {
- yylval.i = strlen(YYText());
- return DOTS;
- }
{INT} {
yylval.i = String_convert::dec2_i( String( YYText() ) );
return INT;
\" {
start_quote();
}
- {DOTS} {
- yylval.i = strlen(YYText());
- return DOTS;
- }
{INT} {
yylval.i = String_convert::dec2_i( String( YYText() ) );
return INT;
return REAL;
}
-{INT}\. { // backup rule
- cerr << "int. encountered" << endl;
- exit( 1 );
+{INT} {
+ yylval.i = String_convert::dec2_i( String( YYText() ) );
+ return INT;
}
[{}] {
char const *
lily_version_sz()
{
- static char v[1024];
+ static char v[1024]; // ugh
sprintf(v, s, build);
return v;
}
if (accs[i].octave_i_ != lastoct) {
if (octmol){
Real dy =lastoct*7*paper()->internote_f();
- octmol->translate(Offset(0, dy));
+ octmol->translate_y( dy);
output->add(*octmol);
delete octmol;
}
Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_);
Atom a(s);
Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f();
- a.translate(Offset(0,dy));
+ a.translate_y(dy);
octmol->add_right(a);
}
if (octmol){
Real dy =lastoct*7*paper()->internote_f();
- octmol->translate(Offset(0, dy));
+ octmol->translate_y( dy);
output->add(*octmol);
delete octmol;
}
Interval head_width=itemlist_width(support_items_);
- output->translate(Offset(-output->extent().x.right + head_width.left ,0));
+ output->translate_x(-output->extent().x.right + head_width.left );
return output;
}
return a.accidental_i_ - b.accidental_i_;
};
IMPLEMENT_STATIC_NAME(Local_key_item);
+IMPLEMENT_IS_TYPE_B1(Local_key_item,Item);
void
Local_key_item::do_substitute_dependency(Score_elem*o,Score_elem*n)
#include "command-request.hh"
#include "local-key-reg.hh"
#include "local-key-item.hh"
-#include "complex-walker.hh"
#include "key-reg.hh"
#include "debug.hh"
#include "key-item.hh"
#include "tie.hh"
#include "note-head.hh"
+#include "time-description.hh"
Local_key_register::Local_key_register()
{
}
void
-Local_key_register::pre_move_processing()
+Local_key_register::do_pre_move_processing()
{
Local_key_item *key_item_p = 0;
if (mel_l_arr_.size()) {
}
void
-Local_key_register::process_requests()
+Local_key_register::do_process_requests()
{
Time_description const * time_C_ = get_staff_info().time_C_;
if (! time_C_->whole_in_measure_){
if (key_C_)
local_key_= *key_C_;
- else if( time_C_->when_ >Moment(0))
+ else if(0&& time_C_->when_ >Moment(0))
warning ("Help me! can't figure out current key");
}
}
IMPLEMENT_STATIC_NAME(Local_key_register);
+IMPLEMENT_IS_TYPE_B1(Local_key_register,Request_register);
ADD_THIS_REGISTER(Local_key_register);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "staff-walker.hh"
#include "lyric-register.hh"
#include "musical-request.hh"
#include "text-item.hh"
}
bool
-Lyric_register::try_request(Request*r)
+Lyric_register::do_try_request(Request*r)
{
Musical_req * m =r->musical();
if (!m || ! m->lreq_l())
}
void
-Lyric_register::process_requests()
+Lyric_register::do_process_requests()
{
Text_item * last_item_l =0;
for (int i=0; i < lreq_arr_.size(); i++) {
last_item_l = lp;
typeset_element(lp);
}
- get_staff_info().walk_l_->allow_break();
}
void
-Lyric_register::post_move_processing()
+Lyric_register::do_post_move_processing()
{
lreq_arr_.set_size(0);
}
-bool
-Lyric_register::acceptable_request_b(Request*r)
-{
- Musical_req * m =r->musical();
- return (!m || ! m->lreq_l()) ;
-}
-
IMPLEMENT_STATIC_NAME(Lyric_register);
+IMPLEMENT_IS_TYPE_B1(Lyric_register,Request_register);
ADD_THIS_REGISTER(Lyric_register);
" Jan Nieuwenhuizen <jan@digicash.com>\n"
"Contributors\n"
" Mats Bengtsson <matsb@s3.kth.se>\n"
+ " Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>\n"
"\n"
" This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License version 2\n"
#include "meter-reg.hh"
#include "meter.hh"
#include "command-request.hh"
+#include "score-reg.hh"
Meter_register::Meter_register()
+{
+ meter_req_l_ = 0;
+ meter_p_ =0;
+ default_grouping_ = Rhythmic_grouping(MInterval(0,4),4); // ugh
+}
+
+void
+Meter_register::fill_staff_info(Staff_info&inf)
{
- post_move_processing();
+ inf.time_C_ = &time_;
+ inf.rhythmic_C_ = &default_grouping_;
}
bool
-Meter_register::try_request(Request*r_l)
+Meter_register::do_try_request(Request*r)
{
- Command_req* creq_l= r_l->command();
- if (!creq_l || !creq_l->meterchange())
- return false;
- Meter_change_req *m = creq_l->meterchange();
- if (meter_req_l_ && meter_req_l_->compare(*m))
- return false;
-
- meter_req_l_ = m;
- return true;
+ bool gotcha = false;
+
+ if (r->command() && r->command()->timing()) {
+ gotcha = true;
+ Timing_req * tr_l = r->command()->timing();
+ Meter_change_req *m_l = tr_l->meterchange();
+ if (m_l) {
+ meter_req_l_ = m_l;
+
+ int b_i= m_l->beats_i_;
+ int o_i = m_l->one_beat_i_;
+ if (! time_.allow_meter_change_b() )
+ tr_l->warning("Meter change not allowed here");
+ else{
+ time_.set_meter(b_i, o_i);
+ default_grouping_ =
+ Rhythmic_grouping(MInterval(0,Moment(b_i, o_i)), b_i);
+ }
+ } else if (tr_l->partial()) {
+ Moment m = tr_l->partial()->duration_;
+ String error = time_.try_set_partial_str(m);
+ if (error != "") {
+ tr_l->warning(error);
+ } else
+ time_.setpartial(m);
+ } else if (tr_l->barcheck()) {
+ if (time_.whole_in_measure_) {
+ tr_l ->warning( "Barcheck failed");
+
+ time_.whole_in_measure_ = 0; // resync
+ time_.error_b_ = true;
+ }
+
+ } else if (tr_l->cadenza()) {
+ time_.set_cadenza(tr_l->cadenza()->on_b_);
+
+ } else if (tr_l->measuregrouping()) {
+ default_grouping_ = parse_grouping(
+ tr_l->measuregrouping()->beat_i_arr_,
+ tr_l->measuregrouping()->elt_length_arr_);
+
+ }
+ }
+
+ return gotcha;
}
void
-Meter_register::process_requests()
+Meter_register::do_creation_processing()
+{
+ time_.when_ = get_staff_info().when();
+}
+
+void
+Meter_register::do_process_requests()
{
if (meter_req_l_ ) {
Array<Scalar> args;
}
void
-Meter_register::pre_move_processing()
+Meter_register::do_pre_move_processing()
{
if (meter_p_) {
- Meter * post_p =new Meter(*meter_p_);
- Meter * pre_p =new Meter(*meter_p_);
-
- typeset_breakable_item(pre_p, meter_p_, post_p);
+ typeset_breakable_item(meter_p_);
meter_p_ =0;
+ meter_req_l_ = 0;
}
+
+ Register_group_register * reg_l = daddy_reg_l_;
+ while (reg_l->daddy_reg_l_) {
+ reg_l = reg_l->daddy_reg_l_;
+ }
+
+ assert( reg_l->name() == Score_register::static_name());
+ if (!time_.cadenza_b_)
+ ((Score_register*)reg_l)->add_moment_to_process( time_.next_bar_moment());
}
void
-Meter_register::post_move_processing()
+Meter_register::do_post_move_processing()
{
- meter_req_l_ = 0;
- meter_p_ =0;
+ time_.add( get_staff_info().when() - time_.when_ );
}
+
IMPLEMENT_STATIC_NAME(Meter_register);
ADD_THIS_REGISTER(Meter_register);
+IMPLEMENT_IS_TYPE_B1(Meter_register,Request_register);
}
IMPLEMENT_STATIC_NAME(Meter);
+
+IMPLEMENT_IS_TYPE_B1(Meter,Item);
#include "string-convert.hh"
#include "request.hh"
#include "musical-request.hh"
-#include "voice.hh"
+#include "music-list.hh"
#include "midi-item.hh"
#include "midi-stream.hh"
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
*/
+#if 0
#include "time.h"
#include "main.hh"
#include "source.hh"
#include "string-convert.hh"
#include "debug.hh"
#include "score.hh"
-#include "staff.hh"
#include "main.hh"
#include "midi-stream.hh"
#include "midi-def.hh"
midi_track.add( Moment( 0 ), &midi_tempo );
for (Midi_walker w (st_l, &midi_track); w.ok(); w++)
- w.process_requests();
+ w.do_process_requests();
*midi_stream_l_ << midi_track;
}
do_staff(i, track_i++);
}
+#endif
#include "command-request.hh"
#include "musical-request.hh"
#include "p-score.hh"
-#include "staff.hh"
#include "midi-walker.hh"
#include "midi-item.hh"
#include "midi-stream.hh"
#include "debug.hh"
-#include "staff-column.hh"
-
+#if 0
Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
: PCursor<Staff_column*>(st_l->cols_)
{
}
void
-Midi_walker::process_requests()
+Midi_walker::do_process_requests()
{
do_stop_notes(ptr()->when());
{
return sign(e1.key - e2.key);
}
+#endif
c->translate(o);
}
+void
+Molecule::translate_x(Real x)
+{
+ translate(Offset(x,0));
+}
+
+void
+Molecule::translate_y(Real y)
+{
+ translate(Offset(0,y));
+}
+
void
Molecule::add(Molecule const &m)
{
}
Real yof=extent().y.right - m.extent().y.left;
Molecule toadd(m);
- toadd.translate(Offset(0,yof));
+ toadd.translate_y(yof);
add(toadd);
}
}
Real yof=extent().y.left- m.extent().y.right;
Molecule toadd(m);
- toadd.translate(Offset(0,yof));
+ toadd.translate_y(yof);
add(toadd);
}
--- /dev/null
+/*
+ music-iterator.cc -- implement {Music,Chord,Voice}_iterator
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "music-list.hh"
+#include "music-iterator.hh"
+#include "register.hh"
+#include "register-group.hh"
+#include "interpreter.hh"
+
+IMPLEMENT_STATIC_NAME(Music_iterator);
+IMPLEMENT_IS_TYPE_B(Music_iterator);
+
+Register_group_register *
+Music_iterator::get_req_acceptor_l()
+{
+ assert(report_to_reg_l_);
+ if (report_to_reg_l_->interpreter_l() )
+ return report_to_reg_l_;
+
+ report_to_reg_l_ = report_to_reg_l_->get_default_interpreter();
+ return report_to_reg_l_;
+}
+
+void
+Music_iterator::construct_children()
+{
+
+}
+
+Music_iterator::~Music_iterator(){
+}
+
+Moment
+Music_iterator::next_moment()const
+{
+ return 0;
+}
+
+void
+Music_iterator::next(Moment)
+{
+ first_b_ = false;
+}
+
+bool
+Music_iterator::ok()const
+{
+ return first_b_;
+}
+
+Music_iterator*
+Music_iterator::static_get_iterator_p(Music *m,
+ Register_group_register *report_l)
+{
+ Music_iterator * p =0;
+ if (m->is_type_b( Change_reg::static_name()))
+ p = new Change_iterator((Change_reg*)m);
+ else if (m->is_type_b( Voice_element::static_name()))
+ p = new Voice_element_iterator( (Voice_element*) m);
+ else if (m->is_type_b( Chord::static_name()))
+ p = new Chord_iterator( (Chord*) m);
+ else if (m->is_type_b( Voice::static_name()))
+ p = new Voice_iterator( (Voice*) m);
+ else if (m->is_type_b( Request::static_name() ))
+ p = new Request_iterator( (Request*) m );
+
+ if ( m->is_type_b( Music_list::static_name())) {
+ Music_list* ml = (Music_list*) m;
+ if (ml -> type_str_ != "") {
+ p->report_to_reg_l_ =
+ report_l->find_get_reg_l(ml-> type_str_, ml->id_str_);
+
+ }
+ }
+ if (! p->report_to_reg_l_ )
+ p ->report_to_reg_l_ = report_l;
+
+ return p;
+}
+
+Music_iterator*
+Music_iterator::get_iterator_p(Music*m)const
+{
+ Music_iterator*p = static_get_iterator_p(m,report_to_reg_l_);
+ p->daddy_iter_l_ = (Music_iterator*)this;
+ p->construct_children();
+ return p;
+}
+
+Music_iterator::Music_iterator()
+{
+ daddy_iter_l_ =0;
+ report_to_reg_l_ = 0;
+ first_b_ = true;
+}
+
+/* ************** */
+
+Chord_iterator::Chord_iterator(Chord const *chord_C)
+{
+ chord_C_ = chord_C;
+}
+
+void
+Chord_iterator::construct_children()
+{
+ int j =0;
+ for(iter(chord_C_->music_p_list_.top(), i); i.ok(); j++, i++) {
+
+ Music_iterator * mi = get_iterator_p( i.ptr());
+ report_to_reg_l_ = mi->report_to_reg_l_->ancestor_l( chord_C_->multi_level_i_ );
+ children_p_list_.bottom().add( mi );
+ }
+}
+
+void
+Chord_iterator::next(Moment until)
+{
+ for (iter(children_p_list_.top(), i); i.ok(); ) {
+ if (i->next_moment() == until) {
+ i->next(until);
+ }
+ if (!i->ok())
+ i.del();
+ else
+ i++;
+ }
+ Music_iterator::next(until);
+
+ assert(!ok() || next_moment() > until);
+}
+
+IMPLEMENT_STATIC_NAME(Chord_iterator);
+IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
+
+Moment
+Chord_iterator::next_moment()const
+{
+ Moment next_ = INFTY;
+ for (iter(children_p_list_.top(), i); i.ok(); i++)
+ next_ = next_ <? i->next_moment() ;
+ return next_;
+}
+
+
+
+bool
+Chord_iterator::ok()const
+{
+ return children_p_list_.size();
+}
+
+/* ************** */
+
+Voice_iterator::Voice_iterator(Voice const*v)
+ : PCursor<Music*> ( v->music_p_list_)
+{
+ here_mom_ = v->offset_mom_;
+ voice_C_ = v;
+ iter_p_ =0;
+}
+
+void
+Voice_iterator::construct_children()
+{
+ if (ok()) {
+
+ iter_p_ = Music_iterator::get_iterator_p( ptr() );
+ report_to_reg_l_ =
+ iter_p_->report_to_reg_l_->ancestor_l( voice_C_ ->multi_level_i_ );
+ }
+}
+
+void
+Voice_iterator::next_element()
+{
+ delete iter_p_ ;
+ iter_p_ =0;
+ here_mom_ += ptr()->time_int().length();
+ PCursor<Music*>::next();
+ construct_children();
+}
+
+Voice_iterator::~Voice_iterator()
+{
+ delete iter_p_;
+}
+
+IMPLEMENT_STATIC_NAME(Voice_iterator);
+IMPLEMENT_IS_TYPE_B1(Voice_iterator,Music_iterator);
+
+void
+Voice_iterator::next(Moment until)
+{
+ while (ok()) {
+ Moment local_until = until - here_mom_;
+ while ( iter_p_ && iter_p_->ok() ) {
+ Moment here = iter_p_->next_moment();
+ if (here != local_until)
+ return;
+ iter_p_->next(local_until);
+ }
+ if (!iter_p_)
+ iter_p_ = Music_iterator::get_iterator_p( ptr() );
+ else if (!iter_p_->ok() )
+ next_element();
+ }
+ Music_iterator::next(until);
+ assert(!ok() || next_moment() > until);
+}
+
+Moment
+Voice_iterator::next_moment()const
+{
+ return iter_p_->next_moment() + here_mom_;
+}
+
+bool
+Voice_iterator::ok()const
+{
+ return PCursor<Music*>::ok();
+}
+
+/* ***************** */
+
+Request_iterator::Request_iterator(Request const*c)
+{
+ req_l_ = (Request*)c;
+}
+
+void
+Request_iterator::next(Moment m)
+{
+ if ( !daddy_iter_l_->report_to_reg_l_->
+ interpreter_l()->interpret_request_b(req_l_) )
+ req_l_->warning("Junking request: " + String(req_l_->name()));
+
+
+ Music_iterator::next(m);
+}
+
+IMPLEMENT_STATIC_NAME(Request_iterator);
+IMPLEMENT_IS_TYPE_B1(Request_iterator, Music_iterator);
+
+/* ****************** */
+
+Change_iterator::Change_iterator(Change_reg * ch)
+{
+ change_l_ = ch;
+}
+
+IMPLEMENT_STATIC_NAME(Change_iterator);
+IMPLEMENT_IS_TYPE_B1(Change_iterator,Music_iterator);
+
+/*
+ TODO: pop/pushgroup
+ */
+void
+Change_iterator::next(Moment mom)
+{
+ Register_group_register *group_l =
+ report_to_reg_l_->find_get_reg_l(change_l_->type_str_,
+ change_l_->id_str_);
+
+ report_to_reg_l_->daddy_reg_l_->remove_register_p(report_to_reg_l_);
+ group_l->add(report_to_reg_l_);
+
+ Music_iterator::next(mom);
+}
+
+
+
+/* ******************** */
+
+IMPLEMENT_STATIC_NAME(Voice_element_iterator);
+IMPLEMENT_IS_TYPE_B1(Voice_element_iterator,Chord_iterator);
+
+void
+Voice_element_iterator::construct_children()
+{
+ if ( daddy_iter_l_
+ && daddy_iter_l_->is_type_b(Voice_iterator::static_name() )) {
+ report_to_reg_l_ = daddy_iter_l_-> get_req_acceptor_l();
+ } else if (daddy_iter_l_
+ && daddy_iter_l_-> is_type_b( Chord_iterator::static_name() )) {
+
+ get_req_acceptor_l();
+ }
+ Chord_iterator::construct_children();
+}
+
+Voice_element_iterator::Voice_element_iterator(Voice_element*el_l)
+ : Chord_iterator(el_l)
+{
+
+}
/*
- music-list.cc -- implement Music_list,
+ music-list.cc -- implement Music_list, Chord, Voice
source file of the GNU LilyPond music typesetter
#include "music.hh"
#include "debug.hh"
+#include "music-list.hh"
Music_list::Music_list(Music_list const&s)
{
+ multi_level_i_ = s.multi_level_i_;
for (iter(s.music_p_list_.top(), i); i.ok(); i++)
add(i->clone());
}
-
IMPLEMENT_STATIC_NAME(Music_list);
+IMPLEMENT_STATIC_NAME(Chord);
+IMPLEMENT_STATIC_NAME(Voice);
+IMPLEMENT_IS_TYPE_B1(Music_list, Music);
+IMPLEMENT_IS_TYPE_B1(Voice,Music_list);
+IMPLEMENT_IS_TYPE_B1(Chord,Music_list);
+MInterval
+Chord::time_int()const
+{
+ MInterval m;
+ for (iter(music_p_list_.top(), i); i.ok(); i++)
+ m.unite(i->time_int());
+ return m;
+}
void
-Music_list::add(Music*mus_p)
+Chord::translate(Moment m)
{
- music_p_list_.bottom().add(mus_p);
+ for (iter(music_p_list_.top(), i); i.ok(); i++)
+ i->translate(m);
}
-void
-Music_list::transpose(Melodic_req const*m)
+Chord::Chord()
{
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- i->transpose(m);
+
}
-void
-Music_list::do_print() const
+Voice::Voice()
{
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- i->print();
+ offset_mom_ =0;
}
-IMPLEMENT_STATIC_NAME(Chord);
+MInterval
+Voice::time_int() const
+{
+ Moment last=0;
+ for (iter(music_p_list_.top(), i); i.ok(); i++)
+ last += i->time_int().length();
+ return offset_mom_ + MInterval(0,last);
+}
void
-Chord::translate(Moment dt)
+Voice::translate(Moment dt)
{
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- i->translate(dt);
+ offset_mom_ += dt;
}
-MInterval
-Chord::time_int()const
+
+Music_list::Music_list()
{
- MInterval m;
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- m.unite(i->time_int());
- return m;
+ multi_level_i_ = 0;
}
-MInterval
-MVoice::time_int() const
+void
+Music_list::add(Music*m_p)
{
- Moment last=0;
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- last += i->time_int().length();
- return MInterval (0,last);
+ if (!m_p)
+ return;
+
+ m_p->parent_music_l_ = this;
+ music_p_list_.bottom().add(m_p);
}
void
-MVoice::translate(Moment dt)
+Music_list::transpose(Melodic_req const*rq)
{
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- i->translate(dt);
+ for (iter(music_p_list_.top(),i); i.ok(); i++)
+ i->transpose(rq);
}
-IMPLEMENT_STATIC_NAME(MVoice);
+void
+Music_list::do_print()const
+{
+#ifndef NPRINT
+ for (iter(music_p_list_.top(),i); i.ok(); i++)
+ i->print();
+#endif
+}
+
+IMPLEMENT_IS_TYPE_B1(Voice_element, Chord);
+IMPLEMENT_STATIC_NAME(Voice_element);
+
+Voice_element::Voice_element()
+{
+ multi_level_i_ =0;
+}
#include "music.hh"
+#include "music-list.hh"
#include "debug.hh"
MInterval
void
Music::print()const
{
- #ifndef NPRINT
+#ifndef NPRINT
mtor << name() << "{" ;
do_print();
mtor << "}\n";
- #endif
+#endif
}
+
void
Music::transpose(Melodic_req const*)
{
}
IMPLEMENT_STATIC_NAME(Music);
+IMPLEMENT_IS_TYPE_B(Music);
+
-Music::Music(){}
+Music::Music()
+{
+ parent_music_l_ =0;
+}
+
+IMPLEMENT_IS_TYPE_B1(Change_reg,Music)
+IMPLEMENT_STATIC_NAME(Change_reg);
#include "debug.hh"
#include "script-def.hh"
#include "text-def.hh"
-#include "voice.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
IMPLEMENT_STATIC_NAME(Stem_req);
+IMPLEMENT_IS_TYPE_B1(Stem_req,Rhythmic_req);
void
Stem_req::do_print() const
{
/* ************** */
IMPLEMENT_STATIC_NAME(Musical_req);
+IMPLEMENT_IS_TYPE_B1(Musical_req,Request);
void
Musical_req::do_print()const{}
void
Tie_req::do_print()const{}
-IMPLEMENT_STATIC_NAME(Request);
-
-void Request::do_print() const{}
/* *************** */
-
-void
-Request::print() const
-{
-#ifndef NPRINT
- mtor << name() << " {";
- do_print();
- mtor << "}\n";
-#endif
-}
-
+
IMPLEMENT_STATIC_NAME(Span_req);
+IMPLEMENT_IS_TYPE_B1(Span_req,Musical_req);
void
Span_req::do_print() const
#endif
}
-Request::Request()
-{
- elt_l_ = 0;
-}
-Request::Request(Request const&src)
- :Input(src)
-{
- elt_l_ = 0;
-}
-/* *************** */
Spacing_req::Spacing_req()
{
next = 0;
strength = 0;
}
IMPLEMENT_STATIC_NAME(Spacing_req);
+IMPLEMENT_IS_TYPE_B1(Spacing_req,Request);
void
Spacing_req::do_print()const
}
IMPLEMENT_STATIC_NAME(Blank_req);
+IMPLEMENT_IS_TYPE_B2(Blank_req,Spacing_req,Rhythmic_req);
void
Blank_req::do_print()const
}
IMPLEMENT_STATIC_NAME(Melodic_req);
+IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
int
Melodic_req::compare(Melodic_req const&m1, Melodic_req const&m2)
}
IMPLEMENT_STATIC_NAME(Rhythmic_req);
+IMPLEMENT_IS_TYPE_B1(Rhythmic_req,Musical_req);
void
Rhythmic_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Lyric_req);
+IMPLEMENT_IS_TYPE_B2(Lyric_req,Musical_req,Rhythmic_req);
void
Lyric_req::do_print() const
forceacc_b_ = false;
}
IMPLEMENT_STATIC_NAME(Note_req);
+IMPLEMENT_IS_TYPE_B2(Note_req,Melodic_req,Rhythmic_req);
void
Note_req::do_print() const
}
/* *************** */
IMPLEMENT_STATIC_NAME(Rest_req);
+IMPLEMENT_IS_TYPE_B1(Rest_req,Rhythmic_req);
void
Rest_req::do_print() const
nplet = 0;
}
IMPLEMENT_STATIC_NAME(Beam_req);
+IMPLEMENT_IS_TYPE_B1(Beam_req,Span_req);
void
Beam_req::do_print()const{}
/* *************** */
IMPLEMENT_STATIC_NAME(Slur_req);
+IMPLEMENT_IS_TYPE_B1(Slur_req,Span_req);
void
Slur_req::do_print()const{}
/* *************** */
}
IMPLEMENT_STATIC_NAME(Script_req);
+IMPLEMENT_IS_TYPE_B1(Script_req,Request);
void
Script_req::do_print() const
{}
IMPLEMENT_STATIC_NAME(Musical_script_req);
+IMPLEMENT_IS_TYPE_B2(Musical_script_req,Musical_req, Script_req);
Script_req::~Script_req()
}
IMPLEMENT_STATIC_NAME(Text_req);
+IMPLEMENT_IS_TYPE_B1(Text_req,Musical_req);
void
Text_req::do_print() const
/* *************** */
-Moment
-Skip_req::duration() const
-{
- return duration_;
-}
-
IMPLEMENT_STATIC_NAME(Skip_req);
+IMPLEMENT_IS_TYPE_B1(Skip_req,Musical_req);
void
Skip_req::do_print() const
Voice *
Request::voice_l()
{
- if (!elt_l_)
+ if (!parent_music_l_)
return 0;
else
- return (Voice*)elt_l_->voice_C_;
+ return (Voice*)parent_music_l_;
}
/* *************** */
IMPLEMENT_STATIC_NAME(Subtle_req);
+IMPLEMENT_IS_TYPE_B1(Subtle_req,Musical_req);
void
Subtle_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Dynamic_req,Musical_req);
void
Dynamic_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Absolute_dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Absolute_dynamic_req,Musical_req);
void
Absolute_dynamic_req::do_print() const
}
IMPLEMENT_STATIC_NAME(Span_dynamic_req);
+IMPLEMENT_IS_TYPE_B1(Span_dynamic_req,Musical_req);
void
Span_dynamic_req::do_print()const
}
IMPLEMENT_STATIC_NAME(Tie_req);
+IMPLEMENT_IS_TYPE_B1(Tie_req,Musical_req);
#include "parseconstruct.hh"
static Keyword_ent the_key_tab[]={
+ {"accepts", ACCEPTS},
+ {"alias", ALIAS},
{"bar", BAR},
{"cadenza", CADENZA},
{"clear", CLEAR},
{"clef", CLEF},
{"cm", CM_T},
+ {"consists", CONSISTS},
+ {"contains", CONTAINS},
{"duration", DURATIONCOMMAND},
{"absdynamic", ABSDYNAMIC},
{"group", GROUP},
{"geometric", GEOMETRIC},
{"hshift", HSHIFT},
+ {"id", ID},
{"in", IN_T},
{"init_end", INIT_END},
- {"inputregister", INPUT_REGS},
+ {"requestregister", REQUESTREGISTER},
{"lyric", LYRIC},
{"key", KEY},
{"melodic" , MELODIC},
{"meter", METER},
{"midi", MIDI},
{"mm", MM_T},
- {"multivoice", MULTIVOICE},
+ {"multi", MULTI},
{"note", NOTE},
{"notenames", NOTENAMES},
{"octave", OCTAVECOMMAND},
#include "my-lily-lexer.hh"
#include "debug.hh"
#include "main.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
#include "musical-request.hh"
#include "command-request.hh"
#include "parser.hh"
My_lily_parser::set_duration_mode(String s)
{
s = s.upper_str();
- last_duration_mode = (s== "LAST");
+ last_duration_mode_b_ = (s== "LAST");
}
void
My_lily_parser::set_default_duration(Duration const *d)
{
- last_duration_mode = false;
+ last_duration_mode_b_ = false;
default_duration_ = *d;
}
void
My_lily_parser::set_last_duration(Duration const *d)
{
- if (last_duration_mode)
+ if (last_duration_mode_b_)
default_duration_ = *d;
}
-Voice_element*
+Chord*
My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p)
{
- Voice_element* velt_p = new Voice_element;
+ Chord* velt_p = new Voice_element;
Lyric_req* lreq_p = new Lyric_req(tdef_p);
return velt_p;
}
-Voice_element *
+Chord *
My_lily_parser::get_rest_element(String s, Duration * duration_p )
{
- Voice_element* velt_p = new Voice_element;
+ Chord* velt_p = new Voice_element;
velt_p->set_spot( here_input());
if (s=="s") { /* Space */
Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = duration_p->length();
+ skip_p->duration_ = *duration_p;
+
skip_p->set_spot( here_input());
velt_p->add(skip_p);
}
return velt_p;
}
-Voice_element *
+Chord *
My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p )
{
- Voice_element*v = new Voice_element;
+ Chord*v = new Voice_element;
v->set_spot( here_input());
v->add(rq);
default_octave_i_ = 0;
textstyle_str_="roman"; // in lexer?
error_level_i_ = 0;
- last_duration_mode = false;
+ last_duration_mode_b_ = true;
fatal_error_i_ = 0;
}
void
-My_lily_parser::add_requests(Voice_element*v)
+My_lily_parser::add_requests(Chord*v)
{
for (int i = 0; i < pre_reqs.size(); i++) {
v->add(pre_reqs[i]);
}
void
-Note_column_register::pre_move_processing()
+Note_column_register::do_pre_move_processing()
{
Script_column *col_l = ( ncol_p_ ) ? ncol_p_ : restcol_p_;
if (!col_l)
}
void
-Note_column_register::post_move_processing()
+Note_column_register::do_post_move_processing()
{
script_l_arr_.set_size(0);
stem_l_ =0;
ncol_p_=0;
restcol_p_ =0;
- post_move_processing();
+ do_post_move_processing();
}
IMPLEMENT_STATIC_NAME(Note_column_register);
+IMPLEMENT_IS_TYPE_B1(Note_column_register,Request_register);
ADD_THIS_REGISTER(Note_column_register);
#include "stem.hh"
IMPLEMENT_STATIC_NAME(Note_column);
+IMPLEMENT_IS_TYPE_B1(Note_column,Script_column);
void
Note_column::add(Stem*stem_l)
#include "debug.hh"
#include "musical-request.hh"
#include "command-request.hh"
-#include "voice.hh"
+#include "music-list.hh"
#include "script.hh"
#include "identifier.hh"
#include "varray.hh"
#include "text-def.hh"
#include "parseconstruct.hh"
-#include "input-music.hh"
-#include "voice-element.hh"
+
String *
}
Request*
-get_script_req(int d , Script_def*def)
+get_script_req(int d , General_script_def*def)
{
Musical_script_req* script_req_p = new Musical_script_req;
script_req_p->dir_i_ =d;
return script_req_p;
}
-Request*
-get_text_req(int d , Text_def*def)
-{
- Text_req* text_req_p = new Text_req(d, def);
- return text_req_p;
-}
+
Request*
get_stemdir_req(int d)
}
IMPLEMENT_STATIC_NAME(Note_head);
+IMPLEMENT_IS_TYPE_B1(Note_head,Item);
void
Note_head::do_print()const
Molecule dm;
dm.add(Atom(d));
if (!(position_i_ %2))
- dm.translate(Offset(0,dy));
+ dm.translate_y(dy);
out->add_right(dm);
}
- out->translate(Offset(x_dir_i_ * p->note_width(),0));
+ out->translate_x(x_dir_i_ * p->note_width());
bool streepjes = (position_i_<-1)||(position_i_ > staff_size_i_+1);
if (rest_b_ && balltype_i_ > 2)
Molecule sm;
sm.add(Atom(str));
if (position_i_ % 2)
- sm.translate(Offset(0,-dy* dir));
+ sm.translate_y(-dy* dir);
out->add(sm);
}
- out->translate(Offset(0,dy*position_i_));
+ out->translate_y(dy*position_i_);
return out;
}
return w;
}
+void
+PCol::clean_breakable_items()
+{
+ if (!line_l_) {
+ for(iter(its.top(), j); j.ok(); ) {
+ j->unlink();
+ j.del();
+ }
+ }
+ if (prebreak_p_) prebreak_p_->clean_breakable_items();
+ if (postbreak_p_) postbreak_p_->clean_breakable_items();
+}
+
int
PCol::rank_i() const
{
postbreak_p_->pscore_l_ = pscore_l_;
}
+bool
+PCol::breakpoint_b() const
+{
+ return !line_l_;
+}
+
bool
PCol::breakable_b() const
{
{
elem_p_list_.bottom().add(elem_p);
elem_p->pscore_l_ = this;
+
elem_p->add_processing();
}
{
assert(c && i);
- if (breakstat == 0) {
+ if (breakstat == -1) {
typeset_item(i, c->prebreak_p_);
return;
}
- if (breakstat == 2) {
+ if (breakstat == 1) {
typeset_item(i, c->postbreak_p_);
return;
}
void
PScore::preprocess()
{
+ super_elem_l_->breakable_col_processing();
super_elem_l_->pre_processing();
}
super_elem_l_->break_processing();
- for (iter_top(spanners,i); i.ok(); ) {
+ for (iter(spanners.top(),i); i.ok(); ) {
Spanner *span_p = i.remove_p();
if (span_p->broken_b()) {
span_p->unlink();
typeset_broken_spanner(span_p);
}
}
+
+ for (iter_top(cols, i); i.ok(); i++)
+ i->clean_breakable_items();
}
void
*mlog << "\nPostprocessing elements..." << endl;
postprocess();
}
+
/** Get all breakable columns between l and r, (not counting l and r). */
Link_array<PCol>
PScore::breakable_col_range(PCol*l,PCol*r)const
-// golden ratio
-const Real PHI = (1+sqrt(5))/2;
-
-// see Roelofs, p. 57
Real
Paper_def::duration_to_dist(Moment d)
{
%{ // -*-Fundamental-*-
#include <iostream.h>
-#define MUDELA_VERSION "0.0.58"
+#define MUDELA_VERSION "0.0.59"
#include "script-def.hh"
#include "symtable.hh"
#include "paper-def.hh"
#include "midi-def.hh"
#include "main.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
#include "keyword.hh"
#include "debug.hh"
#include "parseconstruct.hh"
#include "identifier.hh"
#include "command-request.hh"
#include "musical-request.hh"
-#include "voice-element.hh"
#include "my-lily-parser.hh"
#include "text-def.hh"
#include "input-register.hh"
+#include "score.hh"
+#include "music-list.hh"
#ifndef NDEBUG
#define YYDEBUG 1
Array<String> * strvec;
Array<int> *intvec;
Box *box;
+ Chord * chord;
Duration *duration;
Identifier *id;
Input_register * iregs;
- Input_music *music;
- Input_score *score;
- Input_staff *staff;
+ Music *music;
+ Music_list *musiclist;
+ Score *score;
Interval *interval;
Lookup*lookup;
Melodic_req * melreq;
Midi_def* midi;
Moment *moment;
- Music_general_chord *chord;
- Music_voice *mvoice;
Note_req *notereq;
Paper_def *paper;
Real real;
Request * request;
- Script_def * script;
+ General_script_def * script;
String *string;
Symbol * symbol;
Symtable * symtable;
Symtables * symtables;
Text_def * textdef;
- Voice *voice;
- Voice_element *el;
char c;
const char *consstr;
int i;
/* tokens which are not keywords */
%token CONCAT
+%token ALIAS
%token BAR
%token CADENZA
%token CLEAR
%token CLEF
+%token CONTAINS
+%token CONSISTS
+%token ACCEPTS
%token CM_T
%token DURATIONCOMMAND
%token ABSDYNAMIC
%token GEOMETRIC
%token GROUPING
%token GROUP
-%token INPUT_REGS
+%token REQUESTREGISTER
%token HSHIFT
%token IN_T
+%token ID
%token INIT_END
%token LYRIC
%token KEY
%token METER
%token MIDI
%token MM_T
-%token MULTIVOICE
+%token MULTI
%token NOTE
%token NOTENAMES
%token OCTAVECOMMAND
/* escaped */
%token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
-%token <i> DOTS
+%type <i> dots
%token <i> INT
%token <melreq> NOTENAME_ID
-%token <id> REGS_IDENTIFIER
%token <id> IDENTIFIER
%token <id> MELODIC_REQUEST_IDENTIFIER
-%token <id> CHORD_IDENTIFIER
+%token <id> MUSIC_IDENTIFIER
%token <id> VOICE_IDENTIFIER
%token <id> POST_REQUEST_IDENTIFIER
%token <id> SCRIPT_IDENTIFIER
%token <id> STAFF_IDENTIFIER
%token <id> REAL_IDENTIFIER
+%token <id> INT_IDENTIFIER
%token <id> SCORE_IDENTIFIER
%token <id> REQUEST_IDENTIFIER
%token <real> REAL
%type <box> box
%type <c> open_request_parens close_request_parens
%type <c> open_plet_parens close_plet_parens
-%type <chord> music_chord music_chord_body init_music_chord
-%type <el> voice_elt full_element lyrics_elt command_elt
+%type <music> simple_element music_elt full_element lyrics_elt command_elt
%type <i> int
%type <i> script_dir
%type <id> declaration
%type <melreqvec> pitch_list
%type <midi> midi_block midi_body
%type <moment> duration_length
-%type <music> init_music
-%type <mvoice> simple_horizontal_music horizontal_music horizontal_music_body
-%type <mvoice> transposed_music_voice init_lyrics_voice
-%type <mvoice> music_voice_body init_music_voice
+%type <music> init_melodic init_lyrics init_music
+%type <music> Music transposed_music
+%type <musiclist> Voice Voice_body
+%type <chord> Chord Chord_body
%type <paper> paper_block paper_body
%type <real> dim real
%type <real> unit
%type <request> post_request pre_request command_req verbose_command_req abbrev_command_req
-%type <request> pure_post_request pure_post_request_choice
-%type <request> script_req textscript_req dynamic_req
+%type <request> script_req dynamic_req
%type <score> score_block score_body
-%type <script> script_definition script_body mudela_script
-%type <staff> staff_block staff_init staff_body
+%type <script> script_definition script_body mudela_script gen_script_def
+%type <textdef> text_def
%type <string> declarable_identifier
%type <string> script_abbreviation
%type <id> old_identifier
%type <symbol> symboldef
%type <symtable> symtable symtable_body
-%type <textdef> mudela_text
-%type <iregs> input_regs input_regs_body
+%type <iregs> input_register_spec input_register_spec_body
%left PRIORITY
-%expect 1 /* have to fix this. */
-
%%
mudela: /* empty */
| mudela check_version { }
| mudela add_notenames { }
| mudela init_end {}
+ | mudela input_register_spec { add_global_input_register($2); }
;
init_end: INIT_END ';' {
old_identifier:
IDENTIFIER
| MELODIC_REQUEST_IDENTIFIER
- | CHORD_IDENTIFIER
- | VOICE_IDENTIFIER
| POST_REQUEST_IDENTIFIER
| SCRIPT_IDENTIFIER
- | STAFF_IDENTIFIER
| REAL_IDENTIFIER
| SCORE_IDENTIFIER
| REQUEST_IDENTIFIER
- | REGS_IDENTIFIER
;
declaration:
$$ = new Score_id(*$1, $3, SCORE_IDENTIFIER);
delete $1;
}
- | declarable_identifier '=' staff_block {
- $$ = new Staff_id(*$1, $3, STAFF_IDENTIFIER);
- delete $1;
- }
- | declarable_identifier '=' init_music_voice {
- $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
- delete $1;
- }
- | declarable_identifier '=' init_lyrics_voice {
- $$ = new M_voice_id(*$1, $3, VOICE_IDENTIFIER);
- delete $1;
- }
| declarable_identifier '=' script_definition {
$$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER);
delete $1;
}
- | declarable_identifier '=' init_music_chord {
- $$ = new M_chord_id(*$1, $3, CHORD_IDENTIFIER);
+ | declarable_identifier '=' init_music {
+ $$ = new Music_id(*$1, $3, MUSIC_IDENTIFIER);
delete $1;
}
| declarable_identifier '=' symtables {
delete $1;
}
- | declarable_identifier '=' pure_post_request {
+ | declarable_identifier '=' post_request {
$$ = new Request_id(*$1, $3, POST_REQUEST_IDENTIFIER);
delete $1;
}
$$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER);
delete $1;
}
- | declarable_identifier '=' input_regs {
- $$ = new Input_regs_id(*$1, $3, REGS_IDENTIFIER);
- delete $1;
- }
;
-input_regs:
- INPUT_REGS
- { THIS->remember_spot(); }
- '{' input_regs_body '}'
- {
- $$ = $4;
- $$->set_spot(THIS->pop_spot());
- }
+
+input_register_spec:
+ REQUESTREGISTER '{' input_register_spec_body '}'
+ { $$ = $3; }
;
-input_regs_body:
- REGS_IDENTIFIER {
- $$ = $1->iregs(true);
+input_register_spec_body:
+ STRING {
+ $$ = new Input_register;
+ $$->name_str_ =*$1;
+ delete $1;
}
- |STRING {
- $$ = new Input_register;
- $$->name_str_ = *$1;
+ | input_register_spec_body ALIAS STRING ';' {
+ $$-> alias_str_arr_.push(*$3);
+ delete $3;
}
- | input_regs_body input_regs {
- $$->add($2);
+ | input_register_spec_body CONSISTS STRING ';' {
+ $$-> consists_str_arr_.push(*$3);
+ delete $3;
+ }
+ | input_register_spec_body CONTAINS input_register_spec {
+ $$->add($3);
}
;
-
/*
SCORE
*/
;
score_body: {
- $$ = new Input_score;
+ $$ = new Score;
}
| SCORE_IDENTIFIER {
$$ = $1->score(true);
}
- | score_body staff_block { $$->add($2); }
- | score_body paper_block { $$->set($2); }
- | score_body midi_block { $$->set($2); }
+ | score_body init_music {
+ $$->music_p_ = $2;
+ }
+ | score_body paper_block {
+ $$->paper_p_ = $2;
+ }
+ | score_body midi_block {
+ $$->midi_p_ = $2;
+ }
| score_body error {
}
}
;
-/*
- STAFFs
-*/
-staff_block:
- STAFF { THIS->remember_spot(); }
-/*cont*/ '{' staff_body '}' {
- $$ = $4;
- $$-> set_spot(THIS->pop_spot());
- }
- | { THIS->remember_spot(); }
-/*cont*/ STAFF_IDENTIFIER {
- $$ = $2->staff(true);
- $$-> set_spot(THIS->pop_spot());
- }
- ;
-
-staff_init:
- STAFF_IDENTIFIER {
- $$ = $1->staff(true);
- }
- | REGS_IDENTIFIER {
- $$ = new Input_staff;
- $$->ireg_p_ = $1->iregs(true);
- }
- | input_regs {
- $$ = new Input_staff;
- $$->ireg_p_ = $1;
- }
- ;
-
-staff_body:
- staff_init
- | staff_body init_music {
- $$ = $1;
- $2->set_default_group( "staff_music" + String($$->music_.size()));
- $$->add($2);
- }
- | staff_body error {
- }
- ;
-
/*
let the lexer switch mode.
*/
init_music:
- init_music_voice { $$ = $1; }
- | init_music_chord { $$ = $1; }
- | init_lyrics_voice { $$ = $1; }
- | VOICE_IDENTIFIER {
- $$ = $1->mvoice(true);
- }
+ init_melodic { $$ = $1; }
+ | init_lyrics { $$ = $1; }
;
-init_lyrics_voice:
- LYRIC { THIS->lexer_p_->push_lyric_state(); }
- horizontal_music { $$ = $3; THIS->lexer_p_->pop_state(); }
+init_lyrics:
+ LYRIC
+ { THIS->lexer_p_->push_lyric_state(); }
+ Music
+ { $$ = $3; THIS->lexer_p_->pop_state(); }
;
-init_music_voice:
- MELODIC { THIS->lexer_p_->push_note_state(); }
- /* cont*/ horizontal_music
+init_melodic:
+ MELODIC
+ { THIS->lexer_p_->push_note_state(); }
+ Music
{ $$=$3; THIS->lexer_p_->pop_state(); }
;
-init_music_chord:
- { THIS->lexer_p_->push_note_state(); }
- /* cont*/ music_chord
- { $$=$2; THIS->lexer_p_->pop_state(); }
- ;
/*
MUSIC
*/
-horizontal_music:
- '{' horizontal_music_body '}' {
+Voice:
+ '{' Voice_body '}' {
$$ = $2;
}
;
-horizontal_music_body:
- simple_horizontal_music {
- $$ = $1;
+Voice_body:
+ /**/ {
+ $$ = new Voice;
}
- | horizontal_music_body CONCAT simple_horizontal_music {
- $$->add($3);/* niet echt */
- }
- ;
-
-
-simple_horizontal_music:
- TRANSPOSE '{' transposed_music_voice '}' {
- $$ = $3;
- }
- | VOICE_IDENTIFIER {
- $$ = $1->mvoice(true);
+ | Voice_body ID STRING STRING ';' {
+ $$ = new Voice;
+ $$->type_str_ = *$3;
+ $$->id_str_ = *$4;
+ delete $3;
+ delete $4;
}
- | music_voice_body {
- $$ = $1;
+ | Voice_body Music {
+ $$->add($2);
}
;
+Music:
+ full_element { $$ = $1; }
+ | Voice { $$ = $1; }
+ | Chord { $$ = $1; }
+ | transposed_music { $$ = $1; }
+ | MUSIC_IDENTIFIER { $$ = $1->music(true); }
+ ;
-transposed_music_voice:
- steno_melodic_req horizontal_music {
- $$ = $2;
- $$->transpose(*$1);
- delete $1;
- }
+Chord:
+ '<' Chord_body '>' { $$ = $2; }
;
-
-music_voice_body:
- /* */ {
- $$ = new Music_voice;
+Chord_body:
+ /**/ {
+ $$ = new Chord;
+ $$-> multi_level_i_ = 1;
}
- | music_voice_body full_element {
- $$->add_elt($2);
+ | Chord_body MULTI INT ';' {
+ $$->multi_level_i_=$3;
}
- | music_voice_body voice_command ';' {
+ | Chord_body ID STRING STRING ';' {
+ $$->type_str_ = *$3;
+ $$->id_str_ = *$4;
+ delete $4;
+ delete $3;
}
- | music_voice_body music_chord {
+ | Chord_body Music {
$$->add($2);
}
- | music_voice_body error {
- }
- | music_voice_body '>' {
- THIS->fatal_error_i_ = 1;
- THIS->parser_error("Confused by errors: bailing out");
- }
;
-music_chord: '<' music_chord_body '>' { $$ = $2; }
- ;
-
-music_chord_body:
- CHORD_IDENTIFIER {
- $$=$1->mchord(true);
- }
- | /* */ {
- $$ = new Voice_group_chord;
- }
- | MULTIVOICE {
- $$ = new Multi_voice_chord;
- }
- | music_chord_body horizontal_music {
- $$->add($2);
- }
- | music_chord_body full_element {
- $$ ->add_elt($2);
- }
- | music_chord_body '}' {
- THIS->fatal_error_i_ = 1;
- THIS->parser_error("Confused by errors: bailing out");
- }
- | music_chord_body error {
+transposed_music:
+ TRANSPOSE steno_melodic_req Music {
+ $$ = $3;
+ $$ -> transpose($2);
+ delete $2;
}
;
+
/*
VOICE ELEMENTS
*/
-full_element: pre_requests voice_elt post_requests {
- THIS->add_requests($2);
- $$ = $2;
- }
- | pre_requests lyrics_elt post_requests {
- THIS->add_requests($2);
+full_element:
+ pre_requests simple_element post_requests {
+ THIS->add_requests((Chord*)$2);//ugh
$$ = $2;
- }
- | command_elt
+ }
+ | voice_command ';' { $$ = 0; }
;
+simple_element:
+ music_elt
+ | lyrics_elt
+ | command_elt
+ ;
+
command_elt:
/* empty */ {
$$ = new Voice_element;
/* cont: */
command_req {
$2-> set_spot( THIS->here_input());
- $$->add($2);
+ ((Chord*)$$) ->add($2);//ugh
}
+ | GROUP STRING ';' { // ugh ugh ugh
+ Change_reg *chr_p = new Change_reg;
+ $$ = chr_p;
+ chr_p-> type_str_ = "Voice_group_registers"; //ugh
+ chr_p-> id_str_ = *$2;
+ delete $2;
+ }
;
command_req:
}
| SKIP duration_length {
Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = *$2;
+ skip_p->duration_ = Duration(1,0);
+ skip_p->duration_.set_plet($2->numerator().as_long(),
+ $2->denominator().as_long());
+
delete $2;
$$ = skip_p;
}
| GROUPING intastint_list {
$$ = get_grouping_req(*$2); delete $2;
}
- | GROUP STRING {
- $$ = new Group_change_req;
- $$ -> command()->groupchange()->newgroup_str_ = *$2;
- delete $2;
- }
+
;
post_requests:
}
;
-post_request:
- pure_post_request
- | POST_REQUEST_IDENTIFIER {
- $$ = $1->request(false)->clone();
- }
- ;
-pure_post_request:
- pure_post_request_choice {
- $$ = $1;
- $$->set_spot( THIS->here_input());
+post_request:
+ POST_REQUEST_IDENTIFIER {
+ $$ = (Request*)$1->request(true);
}
- ;
-
-pure_post_request_choice:
- close_request_parens {
+ |close_request_parens {
$$ = THIS->get_parens_request($1);
}
| script_req
- | textscript_req
| dynamic_req
;
$$ = ']';
}
| close_plet_parens {
+ $$ = ']';
}
| E_SMALLER {
$$ = '<';
$$ = '>';
}
;
-
+
open_plet_parens:
'[' INT '/' INT {
$$ = '[';
script_body:
STRING int int int int {
- $$ = new Script_def;
- $$->set_from_input(*$1,$2, $3,$4,$5);
+ Script_def *s = new Script_def;
+ s->set_from_input(*$1,$2, $3,$4,$5);
+ $$ = s;
delete $1;
}
;
-textscript_req:
- script_dir mudela_text { $$ = get_text_req($1,$2); }
+script_req:
+ script_dir gen_script_def {
+ Musical_script_req *m = new Musical_script_req;
+ $$ = m;
+ m-> scriptdef_p_ = $2;
+ m-> set_spot ( THIS->here_input() );
+ m-> dir_i_ = $1;
+ }
;
-mudela_text:
- STRING {
- $$ = new Text_def;
- $$->text_str_ = *$1;
- delete $1;
- $$->style_str_ = THIS->textstyle_str_;
- }
+gen_script_def:
+ text_def { $$ = $1; }
+ | mudela_script
;
-script_req:
- script_dir mudela_script {
- $$ = get_script_req($1, $2);
+text_def:
+ STRING {
+ Text_def *t = new Text_def;
+ $$ = t;
+ t->text_str_ = *$1;
+ delete $1;
+ t->style_str_ = THIS->textstyle_str_;
+ $$->set_spot( THIS->here_input() );
}
;
+
script_abbreviation:
'^' { $$ = get_scriptdef('^'); }
| '+' { $$ = get_scriptdef('+'); }
| '|' { $$ = get_scriptdef('|'); }
| 'o' { $$ = get_scriptdef('o'); }
| '>' { $$ = get_scriptdef('>'); }
- | DOTS {
- if ( $1 > 1 )
- THIS->here_input().warning( "too many staccato dots" );
+ | '.' {
$$ = get_scriptdef('.');
}
;
;
duration_length:
- {
+ {
$$ = new Moment(0,1);
}
| duration_length explicit_duration {
}
;
+dots:
+ '.' { $$ = 1; }
+ | dots '.' { $$ ++; }
+ ;
+
notemode_duration:
/* */ {
$$ = new Duration(THIS->default_duration_);
}
- | DOTS {
+ | dots {
$$ = new Duration(THIS->default_duration_);
- $$->dots_i_ = $1;
+ $$->dots_i_ = $1;
}
| explicit_duration {
THIS->set_last_duration($1);
$$->set_plet(THIS->default_duration_);
}
}
- | explicit_duration DOTS {
- $$->dots_i_ = $2;
+ | explicit_duration '.' {
+ $$->dots_i_ ++;
}
| explicit_duration '*' int {
$$->plet_.iso_i_ *= $3;
;
-voice_elt:
+music_elt:
steno_note_req notemode_duration {
if (!THIS->lexer_p_->note_state_b())
THIS->parser_error("have to be in Note mode for notes");
;
lyrics_elt:
- mudela_text notemode_duration {
+ text_def notemode_duration {
if (!THIS->lexer_p_->lyric_state_b())
THIS->parser_error("Have to be in Lyric mode for lyrics");
$$ = THIS->get_word_element($1, $2);
;
int:
- real {
- $$ = int($1);
- if ( distance($1,Real(int($$)) ) > 1e-8)
- yyerror( "integer expected" );
+ INT {
+ $$ = $1;
+ }
+ | INT_IDENTIFIER {
+ $$ = * $1->intid(0);
}
;
+
real:
- INT {
- $$ = Real($1);
- }
- | REAL {
+ REAL {
$$ = $1;
}
| REAL_IDENTIFIER {
+++ /dev/null
-/*
- pulk-voices.cc -- implement Pulk_voice
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "pulk-voice.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "voice-element.hh"
-
-Pulk_voice::Pulk_voice(Voice*voice_l, int idx)
- : cur_(voice_l->elts_)
-{
- elt_mom_ = voice_l->start_;
- staff_idx_= idx;
- set_subtle();
-}
-
-Array<Request*>
-Pulk_voice::get_req_l_arr()
-{
- Array<Request*> req_l_arr;
- Moment w = when();
- do {
- Moment sub = subtle_moment_priorities_[subtle_idx_];
- for (PCursor<Request*> i(cur_->req_p_list_); i.ok(); i++) {
- Musical_req* m_l = i->musical();
- if (!sub) {
- if (!(m_l && m_l->subtle() && m_l->subtle()->subtime_ ))
- req_l_arr.push(i);
- } else {
- if (m_l && m_l->subtle() && m_l->subtle()->subtime_ == sub)
- req_l_arr.push(i);
- }
- }
- next();
- } while ( ok() && when () == w);
- return req_l_arr;
-}
-
-void
-Pulk_voice::set_subtle()
-{
- subtle_idx_ =0;
-
- subtle_moment_priorities_.set_size(0);
- if (!cur_.ok())
- return;
- for (PCursor<Request*> i(cur_->req_p_list_); i.ok(); i++) {
- Musical_req* m_l = i->musical();
- if (m_l&&m_l->subtle()){
- Moment sub = m_l->subtle()->subtime_;
- subtle_moment_priorities_.insert(sub);
- } else {
- subtle_moment_priorities_.insert(0);
- }
- }
-}
-
-void
-Pulk_voice::next()
-{
- assert(ok());
- subtle_idx_++;
- if (subtle_idx_ == subtle_moment_priorities_.size()) {
- elt_mom_ += cur_->duration_;
- cur_ ++;
- set_subtle();
- }
-}
-
-Moment
-Pulk_voice::when()const
-{
- return elt_mom_ + subtle_moment_priorities_[subtle_idx_];
-}
+++ /dev/null
-/*
- pulk-voices.cc -- implement Pulk_voices
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "pulk-voice.hh"
-#include "pulk-voices.hh"
-#include "staff.hh"
-#include "voice.hh"
-#include "request-column.hh"
-#include "debug.hh"
-
-Pulk_voices::Pulk_voices(Link_list<Staff*> const& l)
- : staff_l_list_(l)
-{
- int staff_i = 0;
- last_= 0;
- Moment min_staff_last_mom=1e8; // ugh
- for (iter_top(l, i); i.ok(); i++, staff_i++) {
- Moment staff_last=0;
- for (iter_top(i->voice_list_,j); j.ok(); j++) {
- if (j->elts_.size()) {
- staff_last = staff_last >? j->last();
- voice_pq_.insert(Voice_l(j, staff_i));
- }
- }
- min_staff_last_mom = min_staff_last_mom <? staff_last;
- last_ = last_ >? staff_last;
- }
- next_mom_ = voice_pq_.front().l_->start_;
- time_arr_.set_size(staff_i);
-
- if (last_ != min_staff_last_mom)
- warning("Not all staffs end simultaneously");
-
-}
-
-void
-Pulk_voices::get_aligned_request(Request_column* col_l)
-{
- while (voice_pq_.size() && voice_pq_.front().l_->start_ == next_mom_) {
- Voice_l v = voice_pq_.get();
- pulk_p_list_.bottom().add( new Pulk_voice ( v.l_, v.staff_idx_ ));
- }
-
- /* hairy. #i# is a cursor which points to Pulk_voice (which a
- cursor, essentially)
-
-
- At the same time bookkeeping of measures is done.
- */
-
- Moment new_next_mom = last_;
- iter(pulk_p_list_.top() , i);
- while ( i.ok() ) {
- mtor << "considering staff"<< i->staff_idx_ << "at " << i->when() << "\n";
- assert (i->when() >= next_mom_);
- if (i->when() == next_mom_) {
- col_l->add_reqs(i->staff_idx_, i->get_req_l_arr() );
- Time_description &t_r = time_arr_[i->staff_idx_];
- col_l->update_time(i->staff_idx_, t_r);
-
- if (! t_r.cadenza_b_ && t_r.next_bar_moment() > next_mom_) {
- mtor << "next bar at: " << t_r.next_bar_moment();
- new_next_mom = new_next_mom <? t_r.next_bar_moment();
- }
-
- if (!i->ok()) {
- i.del();
- continue;
- }
- }
- assert( i->when() > next_mom_);
- /* no need to call i->next(), since this is done automatically */
- new_next_mom = new_next_mom <? i->when();
-
- i++;
-
- }
-
- if (voice_pq_.size() )
- new_next_mom = new_next_mom <? voice_pq_.front().l_->start_;
-
- for (int j=0; j < time_arr_.size(); j++)
- time_arr_[j].add( new_next_mom - next_mom_ );
-
- if (pulk_p_list_.size())
- assert( new_next_mom > next_mom_);
- next_mom_ = new_next_mom;
-}
-
-
-bool
-Pulk_voices::ok() const
-{
- return pulk_p_list_.size() || voice_pq_.size();
-}
-
-int
-compare(Voice_l const& v1, Voice_l const& v2)
-{
- return sign(v1.l_->start_ - v2.l_->start_);
-}
-
-Moment
-Pulk_voices::next_mom()const
-{
- return next_mom_;
-}
-
-bool
-Pulk_voices::time_checks_failed_b()const
-{
- bool b = false;
- for (int i=0; !b && i < time_arr_.size(); i++)
- b|=time_arr_[i].error_b_;
- return b;
-}
#include "plist.hh"
#include "register-group.hh"
#include "register.hh"
+#include "debug.hh"
+#include "p-score.hh"
+#include "score-elem.hh"
+#include "input-register.hh"
-bool
-Register_group_register::acceptable_request_b(Request* r)const
+
+Register_group_register::Register_group_register()
{
- for (iter_top(reg_list_, i); i.ok(); i++) {
- if (i->acceptable_request_b(r))
- return true;
- }
- return false;
+ ireg_l_ =0;
}
void
}
void
-Register_group_register::pre_move_processing()
+Register_group_register::do_pre_move_processing()
{
iter_top(reg_list_, i);
while (i.ok()) {
- // this construction to ensure clean deletion
+
Request_register *reg_l = i++;
reg_l->pre_move_processing();
}
}
void
-Register_group_register::process_requests()
+Register_group_register::do_process_requests()
{
iter_top(reg_list_, i);
while (i.ok()) {
- // this construction to ensure clean deletion
+
Request_register *reg_l = i++;
reg_l->process_requests();
}
}
+
void
-Register_group_register::post_move_processing()
+Register_group_register::do_post_move_processing()
{
iter_top(reg_list_, i);
while (i.ok()) {
- // this construction to ensure clean deletion
+ // this construction to ensure clean deletion
Request_register *reg_l = i++;
reg_l->post_move_processing();
}
}
-void
-Register_group_register::acknowledge_element(Score_elem_info info)
-{
- Request_register* origin = info.origin_reg_l_arr_[0];
- if (!contains_b(origin) && !origin->contains_b(this)) // am i sure?
- return;
-
- for (iter_top(reg_list_, i); i.ok(); i++)
- i->acknowledge_element(info);
-}
bool
Register_group_register::contains_b(Request_register* reg_l)const
bool
-Register_group_register::try_request(Request*req_l)
-{
- iter_top(reg_list_, i);
- while (i.ok()) {
-
-
- // this construction to ensure clean deletion
- Request_register *reg_l = i++;
- if (reg_l->try_request( req_l ))
- return true;
- }
- return false;
-}
-void
-Register_group_register::add(Array<Request_register*> p_arr)
+Register_group_register::do_try_request(Request*req_l)
{
- for (int i =0; i<p_arr.size(); i++)
- add(p_arr[i]);
+ bool hebbes_b =false;
+ for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++)
+ hebbes_b =nongroup_l_arr_[i]->try_request(req_l);
+ if (!hebbes_b)
+ hebbes_b = daddy_reg_l_->try_request(req_l);
+ return hebbes_b ;
}
void
{
reg_list_.bottom().add(reg_p);
reg_p->daddy_reg_l_ = this;
-}
-
-Register_group_register::~Register_group_register()
-{
-
+ if (reg_p->is_type_b(Register_group_register::static_name())) {
+ group_l_arr_.push((Register_group_register*)reg_p);
+ } else {
+ nongroup_l_arr_ .push(reg_p);
+ }
}
+
Request_register *
-Register_group_register::get_register_p(Request_register*reg_l)
+Register_group_register::remove_register_p(Request_register*reg_l)
{
+ group_l_arr_.substitute((Register_group_register*)reg_l,0);
+ nongroup_l_arr_.substitute(reg_l,0);
iterator(reg_list_) reg_cur= reg_list_.find(reg_l);
- assert(reg_cur.ok());
+
return reg_cur.remove_p();
}
void
Register_group_register::terminate_register(Request_register*r_l)
{
- delete get_register_p(r_l);
+ Request_register * reg_p =remove_register_p(r_l);
+ reg_p->do_removal_processing();
+ delete reg_p;
}
+IMPLEMENT_IS_TYPE_B1(Register_group_register,Request_register);
IMPLEMENT_STATIC_NAME(Register_group_register);
ADD_THIS_REGISTER(Register_group_register);
Register_group_register::do_print()const
{
#ifndef NPRINT
+ mtor << "ID: " << id_str_ << "\n";
for (iter_top(reg_list_, i); i.ok(); i++)
i->print();
#endif
}
+
+
+Register_group_register*
+Register_group_register::find_register_l(String n, String id)
+{
+ if (name() == n && id_str_ == id)
+ return this;
+ Register_group_register * r = 0;
+ for (int i =0; !r && i< group_l_arr_.size(); i++) {
+ r = group_l_arr_[i]->find_register_l(n,id);
+ }
+
+ return r;
+}
+
+Register_group_register*
+Register_group_register::find_get_reg_l(String n,String id)
+{
+ Register_group_register * ret=0;
+ if (ireg_l_-> find_ireg_l( n )) {
+ ret = find_register_l(n,id);
+ if (!ret) {
+ ret = ireg_l_-> find_ireg_l(n) -> get_group_register_p();
+ add ( ret );
+ ret ->id_str_ = id;
+ }
+ } else if (daddy_reg_l_)
+ ret =daddy_reg_l_->find_get_reg_l(n,id);
+ else {
+ warning("Can't find or create `" + n + "' called `" + id + "'\n");
+ ret =0;
+ }
+ return ret;
+}
+
+int
+Register_group_register::depth_i()const
+{
+ return daddy_reg_l_->depth_i() + 1;
+}
+
+Register_group_register*
+Register_group_register::ancestor_l(int l)
+{
+ if (!l || !daddy_reg_l_)
+ return this;
+
+ return daddy_reg_l_->ancestor_l(l-1);
+}
+
+void
+Register_group_register::announce_element(Score_elem_info info)
+{
+ announce_info_arr_.push(info);
+ Request_register::announce_element(info);
+}
+
+void
+Register_group_register::do_announces()
+{
+ for (int i=0; i < group_l_arr_.size(); i++) {
+ group_l_arr_[i]->do_announces();
+ }
+
+ Request dummy_req;
+
+ for (int j =0; j < announce_info_arr_.size(); j++){
+ Score_elem_info info = announce_info_arr_[j];
+ mtor << "Announcing " << info.elem_l_->name()<<"\n";
+
+ if (!info.req_l_)
+ info.req_l_ = &dummy_req;
+ for (int i=0; i < nongroup_l_arr_.size(); i++) {
+ if (nongroup_l_arr_[i] != info.origin_reg_l_arr_[0])
+ nongroup_l_arr_[i]->acknowledge_element(info);
+ }
+ }
+ announce_info_arr_.set_size(0);
+}
+
+
+void
+Register_group_register::do_removal_processing()
+{
+ for (iter( reg_list_.top(), i); i.ok(); i++)
+ i->do_removal_processing();
+}
+
+Staff_info
+Register_group_register::get_staff_info()const
+{
+ Staff_info inf = Request_register::get_staff_info();
+
+ for (int i=0; i < nongroup_l_arr_.size(); i++)
+ nongroup_l_arr_[i]->fill_staff_info(inf);
+
+ return inf;
+}
+
+Register_group_register*
+Register_group_register::get_default_interpreter()
+{
+ if ( interpreter_l() )
+ return daddy_reg_l_->get_default_interpreter();
+
+ Register_group_register *reg_p= ireg_l_->
+ get_default_ireg_l()->get_group_register_p();
+ add(reg_p );
+ if (reg_p->interpreter_l())
+ return reg_p;
+ else
+ return reg_p->get_default_interpreter();
+}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "voice.hh"
+#include "music-list.hh"
#include "musical-request.hh"
#include "register.hh"
-#include "note-head.hh"
-#include "complex-walker.hh"
-#include "local-key-item.hh"
#include "register-group.hh"
#include "debug.hh"
+void
+Request_register::post_move_processing()
+{
+
+ if (status < CREATION_INITED) {
+ do_creation_processing();
+ status = CREATION_INITED;
+ }
+ if (status >= MOVE_INITED)
+ return;
+
+ do_post_move_processing();
+ status = MOVE_INITED;
+}
+
+bool
+Request_register::try_request(Request * r)
+{
+ if (status < MOVE_INITED)
+ post_move_processing();
+
+ return do_try_request(r);
+}
+
+void
+Request_register::process_requests()
+{
+ if (status < PROCESSED_REQS)
+ post_move_processing();
+ else if (status >= PROCESSED_REQS)
+ return;
+
+ status = PROCESSED_REQS;
+ do_process_requests();
+}
+
+void
+Request_register::pre_move_processing()
+{
+ do_pre_move_processing();
+ status = CREATION_INITED;
+}
+
+void
+Request_register::fill_staff_info(Staff_info&)
+{
+
+}
+
Scalar
Request_register::get_feature(String t)
{
}
bool
-Request_register::try_request(Request*)
+Request_register::do_try_request(Request*)
{
return false;
}
Request_register::Request_register()
{
+ status = VIRGIN;
daddy_reg_l_ = 0;
}
}
void
-Request_register::typeset_breakable_item(Item * pre_p , Item * nobreak_p,
- Item * post_p)
+Request_register::typeset_breakable_item(Item * nobreak_p)
{
- daddy_reg_l_->typeset_breakable_item(pre_p, nobreak_p, post_p);
-}
-
-bool
-Request_register::acceptable_request_b(Request*)const
-{
- return false;
+ daddy_reg_l_->typeset_breakable_item(nobreak_p);
}
bool
}
Staff_info
-Request_register::get_staff_info()
+Request_register::get_staff_info() const
{
return daddy_reg_l_->get_staff_info();
}
}
IMPLEMENT_STATIC_NAME(Request_register);
+IMPLEMENT_IS_TYPE_B(Request_register);
void
Request_register::do_print()const
{
}
+
+
+++ /dev/null
-/*
- request-column.cc -- implement Request_column
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "score-column.hh"
-#include "request-column.hh"
-#include "staff-column.hh"
-#include "staff.hh"
-
-Moment
-Request_column::when()
-{
- if (command_column_l_ || musical_column_l_)
- when_ = (command_column_l_)? command_column_l_->when()
- : musical_column_l_->when();
-
- return when_;
-}
-
-void
-Request_column::add_reqs(int idx , Array<Request*> const & req_l_arr)
-{
- staff_col_l_arr_[idx]->add_reqs(req_l_arr);
-}
-
-Request_column::Request_column(Link_list<Staff*> const& list )
-{
- musical_column_l_ = command_column_l_ =0;
- iter(list.top(), j);
- for (int i=0; i < list.size(); i++,j++) {
- Staff_column * col_p = new Staff_column;
- col_p->set_req_col(this);
- staff_col_l_arr_.push(col_p);
- staff_cols_.bottom().add(col_p);
- j->add_col(col_p);
- }
- when_ = 0;
-}
-
-void
-Request_column::set_score_cols(Score_column* c1, Score_column *c2)
-{
- command_column_l_ = c1;
- musical_column_l_ = c2;
-}
-bool
-Request_column::used_b() const
-{
- bool b = false;
- if (command_column_l_)
- b |= command_column_l_->used_b();
- if (musical_column_l_)
- b |= command_column_l_->used_b();
- return b;
-}
-void
-Request_column::update_time(int idx, Time_description&t)
-{
- staff_col_l_arr_[idx]->update_time(t, 0);
-}
--- /dev/null
+#include "request.hh"
+#include "debug.hh"
+
+IMPLEMENT_STATIC_NAME(Request);
+IMPLEMENT_IS_TYPE_B1(Request,Music);
+
+void
+Request::do_print() const
+{
+}
+
+MInterval
+Request::time_int() const
+{
+ return MInterval(0, duration());
+}
+
+void
+Request::print() const
+{
+#ifndef NPRINT
+ mtor << name() << " {";
+ do_print();
+ mtor << "}\n";
+#endif
+}
+
}
void
-Rest_collision_register::pre_move_processing()
+Rest_collision_register::do_pre_move_processing()
{
if (rest_collision_p_) {
typeset_element(rest_collision_p_);
}
IMPLEMENT_STATIC_NAME(Rest_collision_register);
+IMPLEMENT_IS_TYPE_B1(Rest_collision_register, Request_register);
ADD_THIS_REGISTER(Rest_collision_register);
#endif
}
IMPLEMENT_STATIC_NAME(Rest_collision);
+IMPLEMENT_IS_TYPE_B1(Rest_collision,Item);
+
+
void
Rest_collision::do_substitute_dependency(Score_elem*o,Score_elem*n)
{
Rest_column::translate_y(Real dy_f)
{
for (int i=0; i < head_l_arr_.size(); i++)
- head_l_arr_[i]->translate(Offset(0,dy_f));
+ head_l_arr_[i]->translate_y(dy_f);
}
IMPLEMENT_STATIC_NAME(Rest_column);
+IMPLEMENT_IS_TYPE_B1(Rest_column,Item);
Rest_column::Rest_column()
{
--- /dev/null
+/*
+ score-align-reg.cc -- implement Score_align_register
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "elem-group-item.hh"
+#include "score-align-reg.hh"
+#include "item.hh"
+
+Score_align_register::Score_align_register(const char *nm)
+{
+ type_ch_C_ = nm;
+ priority_i_ =0;
+ align_p_=0;
+}
+
+void
+Score_align_register::do_pre_move_processing()
+{
+ if (align_p_) {
+ typeset_breakable_item( align_p_);
+ align_p_ =0;
+ }
+}
+
+void
+Score_align_register::acknowledge_element(Score_elem_info inf)
+{
+ if (inf.elem_l_->name() == type_ch_C_ ) {
+ if (! align_p_ ) {
+ align_p_ = new Horizontal_group_item;
+ announce_element(Score_elem_info(align_p_,0));
+ }
+
+ align_p_->add_element(inf.elem_l_);
+ }
+}
+
+IMPLEMENT_STATIC_NAME(Score_align_register)
+IMPLEMENT_IS_TYPE_B1(Score_align_register,Request_register);
--- /dev/null
+/*
+ score-align-regs.cc -- implement different alignment registers.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "key-item.hh"
+#include "clef-item.hh"
+#include "meter.hh"
+#include "bar.hh"
+#include "score-align-reg.hh"
+
+#define IMPLEMENT_ALIGN_REG(C,T,p)\
+class C ## _align_register : public Score_align_register \
+{ \
+public: \
+ NAME_MEMBERS(); \
+ C ## _align_register() : Score_align_register(T::static_name()) {\
+ priority_i_ = p;} \
+}; \
+IMPLEMENT_STATIC_NAME(C ## _align_register) ; \
+ADD_THIS_REGISTER(C ## _align_register); \
+IMPLEMENT_IS_TYPE_B1(C ## _align_register, Score_align_register) ;
+
+
+IMPLEMENT_ALIGN_REG(Key,Key_item,3);
+IMPLEMENT_ALIGN_REG(Clef,Clef_item,2);
+IMPLEMENT_ALIGN_REG(Meter,Meter,4);
+IMPLEMENT_ALIGN_REG(Bar, Bar,0);
+
#include "dimen.hh"
#include "spanner.hh"
#include "scoreline.hh"
+#include "item.hh"
+#include "p-col.hh"
Score_elem*
Score_elem::dependency(int i)const
Score_elem::TeX_string() const
{
assert( status > POSTCALCED);
+ if (transparent_b_ )
+ return "";
String s("\\placebox{%}{%}{%}");
Array<String> a;
a.push(print_dimen(offset_.y));
Score_elem::Score_elem(Score_elem const&s)
{
+ transparent_b_ = s.transparent_b_;
+ empty_b_ = s.empty_b_;
/* 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;
+ x_group_element_i_ = 0;
+ y_group_element_i_ = 0;
status = s.status;
assert(!s.output);
output = 0;
delete output;
status = DELETED;
output = 0;
- assert(!group_element_i_ );
+ assert(!x_group_element_i_ && !y_group_element_i_);
}
+void
+Score_elem::translate_x(Real x)
+{
+ offset_.x += x;
+}
+
+
+
+void
+Score_elem::translate_y(Real y)
+{
+ offset_.y += y;
+}
+
+
void
Score_elem::translate(Offset O)
{
- offset_ += O;
+ translate_y(O.y);
+ translate_x(O.x);
}
Interval
Score_elem::do_width() const
{
Interval r;
-
+
if (!output){
Molecule*m = brew_molecule_p();
r = m->extent().x;
Interval
Score_elem::width() const
{
- Interval r=do_width();
+ Interval r=(empty_b_)?Interval(0,0):do_width();
if (!r.empty_b()) // float exception on DEC Alpha
r+=offset_.x;
Interval
Score_elem::height() const
{
- Interval r=do_height();
+ Interval r=(empty_b_)?Interval(0,0): do_height();
if (!r.empty_b())
r+=offset_.y;
{
#ifndef NPRINT
mtor << name() << "{\n";
- mtor << "deps: " << dependent_size() << "depts: \n" <<
+ mtor << "dets: " << dependent_size() << "dependencies: " <<
dependency_size() << "\n";
do_print();
if (output)
Score_elem::Score_elem()
{
- group_element_i_ = 0;
+ transparent_b_ = empty_b_ = false;
+ x_group_element_i_ = 0;
+ y_group_element_i_ =0;
pscore_l_=0;
offset_ = Offset(0,0);
output = 0;
status = PRECALCED;
}
+void
+Score_elem::breakable_col_processing()
+{
+ if (status >= PREBROKEN )
+ return;
+
+ assert(status != PREBREAKING); // cyclic dependency
+ status = PREBREAKING;
+
+ for (int i=0; i < dependency_size(); i++)
+ dependency(i)->breakable_col_processing();
+
+
+ do_breakable_col_processing();
+ status = PREBROKEN;
+}
+
void
Score_elem::break_processing()
{
for (int i=0; i < dependency_size(); i++)
dependency(i)->molecule_processing();
+ if (transparent_b_)
+ return ;
output= brew_molecule_p();
}
{
}
+void
+Score_elem::do_breakable_col_processing()
+{
+ handle_prebroken_dependencies();
+}
+
void
Score_elem::do_pre_processing()
{
IMPLEMENT_STATIC_NAME(Score_elem);
+IMPLEMENT_IS_TYPE_B(Score_elem);
Molecule*
Score_elem::brew_molecule_p()const
Directed_graph_node::add(e);
}
-bool
-Score_elem::is_type_b(char const *s)
-{
- return s == static_name();
-}
void
Score_elem::handle_broken_dependencies()
Spanner * broken = sp->find_broken_piece(line);
do_substitute_dependency(sp, broken);
add_dependency(broken);
- remove_us_arr.push(sp);
+ } else if (elt->item() && elt->item()->pcol_l_->breakpoint_b()
+ && elt->item()->break_status_i() == 0) {
+ Item * my_item = elt->item()->find_prebroken_piece(line);
+ do_substitute_dependency( elt, my_item);
+ if (my_item)
+ add_dependency( my_item);
}
remove_us_arr.push(elt);
}
for (int i=0; i <remove_us_arr.size(); i++)
remove_dependency(remove_us_arr[i]);
+ /* Reset this. If we are a (broken) copy of a spanner, then
+ break_processing() was not called on us (and we are not breaking). */
if (status < BROKEN)
status = BROKEN;
}
+/*
+ This sux.
+
+ unlike with spanners, the number of items can increase
+
+ span: item1
+
+ becomes
+
+ span: item1 item2 item3
+
+ How to let span (a derived class) know that this happened?
+ */
+void
+Score_elem::handle_prebroken_dependencies()
+{
+ Link_array<Score_elem> remove_us_arr;
+ for (int i=0; i < dependency_size(); i++) {
+ Score_elem * elt = dependency(i);
+ Item *it_l = elt->item();
+ if (it_l && it_l->pcol_l_->breakable_b())
+ if (item()) {
+ Score_elem *new_l = it_l->find_prebroken_piece(item()->pcol_l_);
+ if (new_l != elt ) {
+ do_substitute_dependency( elt, new_l);
+ remove_us_arr.push(elt);
+
+ add_dependency(new_l);
+ }
+ }else {
+ add_dependency(it_l->broken_to_a_[0]);
+ add_dependency(it_l->broken_to_a_[1]);
+ }
+
+ }
+
+ 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]);
+
+ /*
+ see comment at handle_broken_dependencies()
+ */
+ if (status < PREBROKEN)
+ status = PREBROKEN;
+}
+
+
void
Score_elem::unlink_all()
for (int i=0; i < dependency_size(); i++)
dependency(i)->unlink_all();
junk_links();
- group_element_i_ = 0;
+ y_group_element_i_ = 0;
+ x_group_element_i_ = 0;
}
void
--- /dev/null
+/*
+ score-halign-reg.cc -- implement Score_horizontal_align_register
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "break-align-item.hh"
+#include "score-halign-reg.hh"
+#include "score-align-reg.hh"
+
+Score_horizontal_align_register::Score_horizontal_align_register()
+{
+ halign_p_ =0;
+}
+
+void
+Score_horizontal_align_register::do_pre_move_processing()
+{
+ if (halign_p_) {
+ typeset_breakable_item(halign_p_);
+ halign_p_ =0;
+ }
+
+}
+
+void
+Score_horizontal_align_register::acknowledge_element(Score_elem_info i)
+{
+ Request_register* reg = i.origin_reg_l_arr_[0];
+ if (reg->is_type_b(
+ Score_align_register::static_name()) )
+ {
+ if (!halign_p_) {
+ halign_p_ = new Break_align_item;
+ announce_element(Score_elem_info(halign_p_,0));
+ }
+ halign_p_->add(i.elem_l_->item(),
+ ((Score_align_register*)reg)->priority_i_ );
+ }
+}
+IMPLEMENT_STATIC_NAME(Score_horizontal_align_register);
+IMPLEMENT_IS_TYPE_B1(Score_horizontal_align_register,Request_register);
+ADD_THIS_REGISTER(Score_horizontal_align_register);
--- /dev/null
+/*
+ score-reg.cc -- implement Score_register
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "super-elem.hh"
+#include "scoreline.hh"
+#include "debug.hh"
+#include "score-elem.hh"
+#include "bar.hh" // needed for Bar::static_name
+#include "staffline.hh"
+#include "score-reg.hh"
+#include "p-col.hh"
+#include "p-score.hh"
+#include "score.hh"
+#include "musical-request.hh"
+#include "score-column.hh"
+
+int
+Score_register::depth_i()const
+{
+ return 0;
+}
+
+void
+Score_register::set_score(Score *s)
+{
+ score_l_ = s;
+ scoreline_l_ = s->pscore_p_->super_elem_l_->line_of_score_l_;
+ last_mom_ = score_l_->music_p_->time_int().max();
+ extra_mom_pq_.insert(last_mom_);
+}
+
+Score_register::Score_register()
+{
+ score_l_ = 0;
+ scoreline_l_ =0;
+ command_column_l_ =0;
+ musical_column_l_ =0;
+}
+
+
+
+void
+Score_register::do_creation_processing()
+{
+ scoreline_l_->left_col_l_ = get_staff_info().command_pcol_l();
+ scoreline_l_->left_col_l_ ->set_breakable();
+ Register_group_register::do_creation_processing();
+}
+
+void
+Score_register::set_cols(Score_column*c1,Score_column*c2)
+{
+ command_column_l_ = c1;
+ musical_column_l_ = c2;
+}
+
+void
+Score_register::do_removal_processing()
+{
+ Register_group_register::do_removal_processing();
+ scoreline_l_->right_col_l_ = get_staff_info().command_pcol_l();
+ scoreline_l_->right_col_l_ ->set_breakable();
+ typeset_all();
+}
+
+
+void
+Score_register::announce_element(Score_elem_info info)
+{
+ info.origin_reg_l_arr_.push(this);
+ if (info.elem_l_->name() == Bar::static_name()) {
+ get_staff_info().command_pcol_l()->set_breakable();
+ } else if ( info.elem_l_->is_type_b( Line_of_staff::static_name() ) &&
+ !scoreline_l_->contains_b( info.elem_l_) )
+
+ scoreline_l_->add(info.elem_l_);
+
+ announce_info_arr_.push(info);
+}
+void
+Score_register::do_announces()
+{
+ /* All elements are propagated to the top upon announcement. If
+ something was created during one run of
+ Register_group_register::do_announces, then
+ announce_info_arr_.size() will be nonzero again
+
+ */
+ while (announce_info_arr_.size()) {
+ for (int i=0; i <announce_info_arr_.size(); i++)
+ /*
+ TODO
+
+ More subtle spacing
+ */
+ if (announce_info_arr_[i].req_l_) {
+ Musical_req *m = announce_info_arr_[i].req_l_->musical();
+ if (m&&m->rhythmic()) {
+ musical_column_l_->add_duration( m->duration());
+ }
+ }
+ Register_group_register::do_announces();
+ }
+}
+
+
+void
+Score_register::typeset_element(Score_elem *elem_p)
+{
+ musical_item_p_arr_.push(elem_p);
+}
+
+void
+Score_register::typeset_breakable_item(Item * nobreak_p)
+{
+ if (nobreak_p) {
+ nobreak_item_p_arr_.push(nobreak_p);
+ }
+}
+void
+Score_register::typeset_all()
+{
+ PCol * c= get_staff_info().command_pcol_l();
+ PScore *ps_l = score_l_->pscore_p_;
+
+ for (int i =0; i < nobreak_item_p_arr_.size(); i++) {
+ ps_l->typeset_item(nobreak_item_p_arr_[i], c, 0);
+ scoreline_l_->add(nobreak_item_p_arr_[i]);
+ }
+ nobreak_item_p_arr_.set_size(0);
+
+ for (int i=0; i < musical_item_p_arr_.size(); i++) {
+ PCol* m = get_staff_info().musical_pcol_l();
+ Score_elem *elem_p = musical_item_p_arr_[i];
+
+ scoreline_l_->add(elem_p);
+ if (elem_p->spanner()) {
+ ps_l->typeset_unbroken_spanner(elem_p->spanner());
+ } else if (elem_p->item()) {
+ ps_l->typeset_item(elem_p->item(), m, 0);
+ } else
+ assert(false);
+ }
+ musical_item_p_arr_.set_size(0);
+}
+
+
+void
+Score_register::do_pre_move_processing()
+{
+ // this generates all items.
+ Register_group_register::do_pre_move_processing();
+
+ typeset_all();
+}
+
+
+Staff_info
+Score_register::get_staff_info()const
+{
+ Staff_info inf;
+
+ inf.command_l_ = command_column_l_;
+ inf.musical_l_ = musical_column_l_;
+ return inf;
+}
+
+Paper_def*
+Score_register::paper()const
+{
+ return score_l_->paper_p_;
+}
+
+
+
+bool
+Score_register::do_try_request(Request*r)
+{
+ bool gotcha = false;
+ for (int i =0; !gotcha && i < nongroup_l_arr_.size() ; i++)
+ gotcha = nongroup_l_arr_[i]->try_request(r);
+
+ return gotcha;
+}
+
+IMPLEMENT_IS_TYPE_B1(Score_register,Register_group_register);
+IMPLEMENT_STATIC_NAME(Score_register);
+ADD_THIS_REGISTER(Score_register);
+
+void
+Score_register::add_moment_to_process(Moment m)
+{
+ if (m > last_mom_)
+ return;
+
+ for (int i=0; i < extra_mom_pq_.size(); i++)
+ if (extra_mom_pq_[i] == m)
+ return;
+ extra_mom_pq_.insert(m);
+}
+++ /dev/null
-/*
- score-walker.cc -- implement Score_walker
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "score-walker.hh"
-#include "score.hh"
-#include "staff-walker.hh"
-#include "staff.hh"
-#include "score-column.hh"
-
-Score_walker::Score_walker(Score *s)
- :PCursor<Score_column *> (s->cols_)
-{
- score_l_ = s;
- for (iter_top(s->staffs_,i); i.ok(); i++) {
- Staff_walker* w_p=i->get_walker_p();
- w_p->score_walk_l_ =this;
- walker_p_arr_.push(w_p);
- }
-
- reinit();
- breaks_i_=0;
-}
-
-
-void
-Score_walker::reinit()
-{
- disallow_break_walk_l_arr = walker_p_arr_;
- disallow_break_count_ = disallow_break_walk_l_arr.size();
-}
-
-
-/** Advance the cursor, and all Staff_walkers contained in this. Reset
- runtime fields */
-void
-Score_walker::operator ++(int )
-{
- Moment last = ptr()->when();
-
- PCursor<Score_column *>::operator++(0);
- if (ok() && ptr()->when() == last)
- PCursor<Score_column *>::operator++(0);
- reinit();
- bool last_b = (!ok()); // ughh
- for (int i=0; i< walker_p_arr_.size(); i++) {
- if (walker_p_arr_[i]->ok() &&
- (last_b || walker_p_arr_[i]->when() < when())) {
-
- walker_p_arr_[i]->operator++(0);
- }
- }
-}
-
-/** Allow the command_column to be breakable for one staff. If all
- staffs allow, then allow a break here. */
-void
-Score_walker::allow_break(Staff_walker*w)
-{
- for (int i=0; i < disallow_break_walk_l_arr.size(); i++) {
- if (w == disallow_break_walk_l_arr[i]) {
- disallow_break_count_ --;
- disallow_break_walk_l_arr[i] =0;
-
- if (!disallow_break_count_) {
- PCursor<Score_column*> col_cursor = *this;
- if (ptr()->musical_b())
- col_cursor --;
- col_cursor->set_breakable();
- }
- }
- }
-}
-
-bool
-Score_walker::break_allowed_b()
-{
- return !disallow_break_count_;
-}
-
-Moment
-Score_walker::when()
-{
- return ptr()->when();
-}
-
-void
-Score_walker::process()
-{
- for (int i=0; i < walker_p_arr_.size(); i++) {
- Staff_walker *w = walker_p_arr_[i];
- if ( w->ok() && w->when() == when() ) {
- walker_p_arr_[i]->process();
- }
- }
- if (break_allowed_b()){
- breaks_i_ ++;
- if (! (breaks_i_ % 8))
- *mlog << "[" <<breaks_i_<<"]"<<flush;
- }
-}
-
-Score_walker::~Score_walker()
-{
- *mlog << "[" <<breaks_i_<<"]"<<flush;
- for (int i=0; i < walker_p_arr_.size(); i++)
- delete walker_p_arr_[i];
-}
-
-
#include "score.hh"
#include "score-column.hh"
#include "p-score.hh"
-#include "staff.hh"
#include "debug.hh"
#include "paper-def.hh"
#include "main.hh"
#include "source.hh"
#include "source-file.hh"
-#include "score-walker.hh"
#include "midi-output.hh"
#include "midi-def.hh"
-#include "pulk-voices.hh"
-#include "request-column.hh"
#include "p-col.hh"
+#include "score-reg.hh"
+#include "music-iterator.hh"
+#include "music.hh"
+#include "music-list.hh"
+#include "input-register.hh"
extern String default_out_fn;
+Score::Score(Score const &s)
+{
+ assert(!pscore_p_);
+ music_p_ = s.music_p_->clone();
+ midi_p_ = new Midi_def(*s.midi_p_);
+ paper_p_ = new Paper_def(*s.paper_p_);
+}
+
void
Score::setup_music()
{
*mlog << "\nSetting up requests..." << flush;
- Pulk_voices pulk(staffs_);
-
- Moment l_mom = pulk.last_;
- if (l_mom == Moment(0)) {
- errorlevel_i_ |= 1;
- input_.error("Need to have music in a score.");
- }
-
- Moment previous_mom = -1;
- while (pulk.ok()) {
+ Score_register * score_reg =
+ (Score_register*)lookup_reg("Score_register")->get_group_register_p();
+
+ score_reg->set_score (this);
+ Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_,
+ score_reg);
+ iter->construct_children();
+
+ while ( iter->ok() || score_reg->extra_mom_pq_.size() ) {
+ Moment w = INFTY;
+ if (iter->ok() )
+ w = iter->next_moment();
+
+ if (score_reg->extra_mom_pq_.size() &&
+ score_reg->extra_mom_pq_.front() <= w)
+
+ w = score_reg->extra_mom_pq_.get();
- Moment w= pulk.next_mom();
- assert(w > previous_mom);
- Request_column* rcol_p = new Request_column( staffs_ );
+ mtor << "processing moment " << w << "\n";
Score_column* c1 = new Score_column(w);
Score_column* c2 = new Score_column(w);
- if (w == Moment(0) || w == l_mom) {
- c1->set_breakable();
- }
-
+
c1->musical_b_ = false;
c2->musical_b_ = true;
cols_.bottom().add(c1);
cols_.bottom().add(c2);
- rcol_p->set_score_cols(c1, c2);
- rcols_.bottom().add(rcol_p);
- pulk.get_aligned_request( rcol_p );
- previous_mom =w;
+ score_reg->set_cols(c1,c2);
+
+ score_reg->post_move_processing();
+ iter->next( w );
+
+ score_reg->process_requests();
+ score_reg->do_announces();
+ score_reg->pre_move_processing();
}
-
- errorlevel_i_ |= pulk.time_checks_failed_b();
-}
-
-void
-Score::process_music()
-{
- *mlog << "Processing requests ..." << flush;
- for (Score_walker w(this); w.ok(); w++) {
- w.process();
- }
+ delete iter;
+ score_reg->do_removal_processing();
+ delete score_reg;
}
void
Score::process()
{
- setup_music();
-
paper();
- midi();
}
void
{
if (!paper_p_)
return;
+
if( errorlevel_i_){
// should we? hampers debugging.
warning("Errors found, /*not processing score*/");
// return;
}
pscore_p_ = new PScore(paper_p_);
+ setup_music();
do_cols();
- for (iter_top(staffs_,i); i.ok(); i++)
- i->set_output(pscore_p_);
-
-
- process_music();
clean_cols(); // can't move clean_cols() farther up.
print();
calc_idealspacing();
Score::clean_cols()
{
#if 1
- for (iter_top(staffs_,i); i.ok(); i++)
- i->clean_cols();
-
- for (iter_top(rcols_,i); i.ok(); i++) {
- i->when(); // update cache, ugh
- if (!i->command_column_l_->used_b()) {
- i->command_column_l_ = 0;
- }
- if (!i->musical_column_l_->used_b())
- i->musical_column_l_ = 0;
- }
-
for (iter_top(cols_,c); c.ok(); ) {
if (!c->pcol_l_->used_b()) {
delete c.remove_p();
Score::last() const
{
Moment l = 0;
- for (iter_top(staffs_,i); i.ok(); i++) {
- l = l>? i->last();
- }
+ // TODO
return l;
}
Score::OK() const
{
#ifndef NDEBUG
- for (iter_top(staffs_,i); i.ok(); i++) {
- i->OK();
- assert(i->score_l_ == this);
- }
- staffs_.OK();
cols_.OK();
for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) {
assert(cc->when() <= (cc+1)->when());
{
#ifndef NPRINT
mtor << "score {\n";
- for (iter_top(staffs_,i); i.ok(); i++) {
- i->print();
- }
+ music_p_->print();
for (iter_top(cols_,i); i.ok(); i++) {
i->print();
}
Score::~Score()
{
+ delete music_p_;
delete pscore_p_;
delete paper_p_;
delete midi_p_;
Tex_stream the_output(paper_p_->outfile);
the_output << "% outputting Score, defined at: " <<
- input_.location_str() << "\n";
+ location_str() << "\n";
pscore_p_->output(the_output);
}
void
Score::midi()
{
+#if 0
if (!midi_p_)
return;
*mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";
Midi_output(this, midi_p_);
+#endif
}
-void
-Score::add(Staff*s)
-{
- s->score_l_ = this;
- staffs_.bottom().add(s);
-}
}
-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);
+IMPLEMENT_IS_TYPE_B2(Line_of_score,Spanner,Vertical_align_elem);
void
-Line_of_score::add_line(Spanner_elem_group*e)
+Line_of_score::add(Score_elem*e)
{
- add_element(e);
- line_arr_.push(e);
+ if (e->is_type_b( Line_of_staff::static_name())
+ && ! Vertical_align_elem::contains_b( e) )
+
+ Vertical_align_elem::add(e);
+ else {
+ add_dependency(e);
+ }
}
bool
return cols.find_l((PCol*)c);
}
-void
-Line_of_score::do_pre_processing()
-{
- 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 i=0; i < errors.size(); i++)
errors[i]->error_mark_b_ = true;
- Line_of_score *line_p = (Line_of_score*)clone();
+ Line_of_score *line_l=0;
+ Line_of_score *line_p =0;
+
+ if (breaking.size() >1) {
+ line_p = (Line_of_score*)clone()->spanner();
+ line_l = line_p;
+ } else
+ line_l = this;
+
+ ((Array<PCol*> &)line_l->cols) = curline;
+ line_l->left_col_l_ = curline[0];
+ line_l->right_col_l_= curline.top();
+
+ if (line_p) {
+ pscore_l_->typeset_broken_spanner(line_p);
+ broken_into_l_arr_.push(line_p);
+ }
+
for (int i=0; i < curline.size(); i++){
curline[i]->hpos = config[i];
- curline[i]->line_l_ = (Line_of_score*)line_p;
+ curline[i]->line_l_ = (Line_of_score*)line_l;
}
- ((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]);
- }
+
+ if(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]);
+ }
+ else
+ ret.push((Line_of_score*)this); // ugh
+
return ret;
}
+
+void
+Line_of_score::do_print()const
+{
+ Spanner::do_print();
+}
+
+Interval
+Line_of_score::do_width()const
+{
+ return Spanner::do_width();
+}
+
+void
+Line_of_score::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Spanner::do_substitute_dependency(o,n);
+ Vertical_align_elem::do_substitute_dependency(o,n);
+}
+/*
+ scores.cc -- implement some globals
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "main.hh"
-#include "input-score.hh"
#include "score.hh"
#include "string.hh"
#include "paper-def.hh"
#include "debug.hh"
-static Array<Input_score*> score_array_global;
+static Array<Score*> score_array_global;
String default_out_fn = "lelie";
void
do_scores()
{
for (int i=0; i < score_array_global.size(); i++) {
- Input_score* &is_p = score_array_global[i];
- if (is_p->errorlevel_i_) {
- is_p->warning("Score contains errors. Will not process it. ");
- delete is_p;
- continue;
- }
+ Score *&is_p = score_array_global[i];
if (only_midi) {
delete is_p->paper_p_;
is_p->paper_p_ = 0;
}
-
- Score * s_p = is_p->parse();
+
+ if (is_p->errorlevel_i_) {
+ is_p->warning("Score contains errors. Will not process it. ");
+
+ } else {
+
+ is_p->print ();
+ is_p->process();
+ }
delete is_p;
- s_p->print ();
- s_p->process();
- delete s_p;
+ is_p =0;
+
}
score_array_global.set_size(0);
}
void
-add_score(Input_score * s)
+add_score(Score * s)
{
score_array_global.push(s);
}
#include "stem.hh"
IMPLEMENT_STATIC_NAME(Script_column);
+IMPLEMENT_IS_TYPE_B1(Script_column,Horizontal_vertical_group_item);
void
mtor << "scripts: " << script_l_arr_.size() << '\n';
}
-
void
Script_column::do_pre_processing()
{
if (!script_l_arr_.size())
return;
+
/* up+outside, up+inside, down+outside, down+inside */
Array<Script*> placed_l_arr_a[4];
for (int i=0; i < script_l_arr_.size(); i++) {
void
Script_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
{
- Element_group::do_substitute_dependency(o,n);
+ Horizontal_vertical_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));
}
IMPLEMENT_STATIC_NAME(Script_def);
+IMPLEMENT_IS_TYPE_B1(Script_def,General_script_def);
int
Script_def::priority_i()const
#include "script-reg.hh"
#include "script.hh"
#include "musical-request.hh"
-#include "complex-walker.hh"
#include "stem.hh"
#include "staff-sym.hh"
Script_register::Script_register()
{
- post_move_processing();
+ do_post_move_processing();
}
bool
-Script_register::try_request(Request *r_l)
+Script_register::do_try_request(Request *r_l)
{
if (!r_l->musical() || ! r_l->musical()->musicalscript())
return false ;
}
void
-Script_register::process_requests()
+Script_register::do_process_requests()
{
for (int i=0; i < script_req_l_arr_.size(); i++){
Script_req* l=script_req_l_arr_[i];
}
void
-Script_register::pre_move_processing()
+Script_register::do_pre_move_processing()
{
Staff_symbol* s_l = get_staff_info().staff_sym_l_;
for (int i=0; i < script_p_arr_.size(); i++) {
}
void
-Script_register::post_move_processing()
+Script_register::do_post_move_processing()
{
script_req_l_arr_.set_size(0);
}
IMPLEMENT_STATIC_NAME(Script_register);
+IMPLEMENT_IS_TYPE_B1(Script_register,Request_register);
ADD_THIS_REGISTER(Script_register);
Real dy = paper()->internote_f();
Molecule*out = new Molecule(specs_l_->get_atom(paper(), dir_i_));
- out->translate(Offset(0,dy * pos_i_));
+ out->translate_y(dy * pos_i_);
return out;
}
IMPLEMENT_STATIC_NAME(Script);
+IMPLEMENT_IS_TYPE_B2(Script,Item,Staff_side);
int
Script::compare(Script *const&l1, Script *const&l2)
#include "proto.hh"
#include "plist.hh"
#include "musical-request.hh"
-#include "complex-walker.hh"
#include "slur-reg.hh"
#include "slur.hh"
#include "debug.hh"
#include "note-column.hh"
bool
-Slur_register::acceptable_request_b(Request*req_l)
-{
- Musical_req *mus_l = req_l->musical();
-
- return mus_l && mus_l->slur();
-}
-
-bool
-Slur_register::try_request(Request *req_l)
+Slur_register::do_try_request(Request *req_l)
{
Musical_req *mus_l = req_l->musical();
if(!mus_l || !mus_l->slur())
dir_i_ =0;
}
void
-Slur_register::process_requests()
+Slur_register::do_process_requests()
{
Array<Slur*> start_slur_l_arr_;
for (int i=0; i< new_slur_req_l_arr_.size(); i++) {
}
void
-Slur_register::pre_move_processing()
+Slur_register::do_pre_move_processing()
{
for (int i = 0; i < end_slur_l_arr_.size(); i++) {
if (dir_i_)
}
void
-Slur_register::post_move_processing()
+Slur_register::do_post_move_processing()
{
new_slur_req_l_arr_.set_size(0);
}
}
}
IMPLEMENT_STATIC_NAME(Slur_register);
+IMPLEMENT_IS_TYPE_B1(Slur_register,Request_register);
ADD_THIS_REGISTER(Slur_register);
right_pos_i_ += dir_i_;
}
IMPLEMENT_STATIC_NAME(Slur);
+IMPLEMENT_IS_TYPE_B1(Slur,Spanner);
/*
- spanner-elem-group.cc -- implement
+ spanner-elem-group.cc -- implement Spanner_elem_group
source file of the GNU LilyPond music typesetter
IMPLEMENT_STATIC_NAME(Spanner_elem_group);
+IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group);
Interval
Spanner_elem_group::do_width() const
void
Spanner_elem_group::do_print() const
{
- Element_group::do_print();
+ Horizontal_vertical_group::do_print();
}
#include "p-score.hh"
IMPLEMENT_STATIC_NAME(Spanner);
+IMPLEMENT_IS_TYPE_B1(Spanner,Score_elem);
void
Spanner::do_print()const
break_cols.push(right);
for (int i=1; i < break_cols.size(); i++) {
- Spanner* span_p = clone();
+ Spanner* span_p = clone()->spanner();
left = break_cols[i-1];
right = break_cols[i];
if (!right->line_l_)
+++ /dev/null
-/*
- staff-column.cc -- implement Staff_column
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-#include "proto.hh"
-#include "plist.hh"
-#include "staff.hh"
-#include "voice.hh"
-#include "time-description.hh"
-#include "score-column.hh"
-#include "staff-column.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
-#include "interval.hh"
-#include "p-score.hh"
-#include "item.hh"
-#include "p-col.hh"
-#include "request-column.hh"
-#include "grouping.hh"
-
-void
-Staff_column::OK() const
-{
-#ifndef NDEBUG
-
-#endif
-}
-
-Moment
-Staff_column::when() const
-{
- return req_col_l_->when();
-}
-
-void
-Staff_column::add_reqs(Array<Request*> req_l_arr)
-{
- for (int i=0; i < req_l_arr.size(); i++) {
- Request * j = req_l_arr[i];
- if (j->command()) {
- Command_req * c_l = j->command();
- if (c_l->timing()) {
- timing_req_l_arr_.push(j->command()->timing());
- }
- if (c_l->groupchange())
- creationreq_l_arr_.push(c_l);
- else if (!c_l->barcheck() && !c_l->partial() &&
- !c_l->measuregrouping())
- setup_one_request(j);
- } else {
- if (j->musical()) {
-
- Musical_req*m = j->musical();
- if (m->rhythmic()) {
- req_col_l_->musical_column_l_->add_duration(m->rhythmic()->duration());
- }
- if(m->skip())
- continue;
- }
- setup_one_request(j);
- }
- }
-}
-
-Staff_column::Staff_column()
-{
- staff_l_ = 0;
-}
-
-
-
-
-Staff_column::~Staff_column()
-{
-}
-
-void
-Staff_column::set_req_col(Request_column *col_l)
-{
- req_col_l_ = col_l;
-}
-
-void
-Staff_column::setup_one_request(Request * j)
-{
- if (j->command()) // ugh
- commandreq_l_arr_.push(j);
- else if (j->musical())
- musicalreq_l_arr_.push(j);
-}
-
-void
-Staff_column::typeset_musical_item(Item*i)
-{
- 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_);
-}
-
-/**
- align items in #item_l_arr#,
-
- @return the width of the items after aligning.
- */
-Interval
-align_items(Array<Item*> item_l_arr)
-{
- Interval wid(0,0);
- for (int i =0; i < item_l_arr.size(); i++) {
- Interval item_width= item_l_arr[i]->width();
- if (item_width.empty_b()) {
- item_width = Interval(0,0);
- }
- Real dx =wid.right - item_width.left;
- item_width += dx;
- item_l_arr[i]->translate(Offset(dx ,0));
- wid.unite(item_width);
- }
- return wid;
-}
-
-void
-translate_items(Real x, Array<Item*> item_l_arr)
-{
- for (int i =0; i < item_l_arr.size(); i++)
- item_l_arr[i]->translate(Offset(x, 0));
-}
-/**
- TODO:
- Write a "horizontal align" item, which aligns the pres, nobreaks, posts, etc.
-
- */
-void
-Staff_column::typeset_breakable_items(Array<Item *> &pre_p_arr,
- Array<Item *> &nobreak_p_arr,
- Array<Item *> &post_p_arr)
-{
- Score_column * scol_l= req_col_l_->command_column_l_;
- PCol * c= scol_l->pcol_l_;
- PScore *ps_l=scol_l->pcol_l_->pscore_l_;
-
- if (!c->breakable_b()) {
- 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++) {
- 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,0);
- }
- for (int i =0; i < nobreak_p_arr.size(); i++) {
- 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, 2);
- }
-
- Interval pre_wid= align_items(pre_p_arr);
- translate_items( -pre_wid.right, pre_p_arr);
- align_items(nobreak_p_arr);
- Interval post_wid =align_items(post_p_arr);
- translate_items (-post_wid.left , post_p_arr);
-
- pre_p_arr.set_size(0);
- post_p_arr.set_size(0);
- nobreak_p_arr.set_size(0);
-}
-
-Score_column*
-Staff_column::command_column_l()
-{
- return req_col_l_->command_column_l_;
-}
-
-Score_column*
-Staff_column::musical_column_l()
-{
- return req_col_l_->musical_column_l_;
-}
-
-void
-Staff_column::update_time(Time_description &time_,
- Rhythmic_grouping *default_grouping)
-{
- // first all meter changes
- for (int i=0; i < timing_req_l_arr_.size(); i++) {
- Timing_req * tr_l = timing_req_l_arr_[i];
- if (tr_l->meterchange()) {
- int b_i=tr_l->meterchange()->beats_i_;
- int o_i = tr_l->meterchange()->one_beat_i_;
- if (! time_.allow_meter_change_b() )
- tr_l->warning("Meter change not allowed here");
- else{
- time_.set_meter(b_i, o_i);
- if (default_grouping)
- *default_grouping =
- Rhythmic_grouping(MInterval(0,Moment(b_i, o_i)), b_i);
- }
- }
- }
-
- // then do the rest
- for (int i=0; i < timing_req_l_arr_.size(); i++) {
- Timing_req * tr_l = timing_req_l_arr_[i];
- if (tr_l->partial()) {
- Moment m = tr_l->partial()->duration_;
- String error = time_.try_set_partial_str(m);
- if (error != "") {
- tr_l->warning(error);
- } else
- time_.setpartial(m);
- } else if (tr_l->barcheck() && time_.whole_in_measure_) {
- tr_l ->warning( "Barcheck failed");
-
- time_.whole_in_measure_ = 0; // resync
- time_.error_b_ = true;
- } else if (tr_l->cadenza()) {
- time_.set_cadenza(tr_l->cadenza()->on_b_);
- } else if (tr_l->measuregrouping()) {
- if (default_grouping)
- *default_grouping = parse_grouping(
- tr_l->measuregrouping()->beat_i_arr_,
- tr_l->measuregrouping()->elt_length_arr_);
- }
- }
- time_.OK();
-}
-
staff-info.cc -- implement Staff_info
source file of the GNU LilyPond music typesetter
+
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "proto.hh"
#include "plist.hh"
-#include "staff.hh"
#include "staff-info.hh"
#include "score-column.hh"
-#include "complex-walker.hh"
-#include "staff-column.hh"
-
-Staff*
-Staff_info::staff_l()
-{
- return walk_l_->staff_l_;
-}
Score*
Staff_info::score_l()
{
- return staff_l()->score_l_;
+ return score_l_;
}
Staff_info::Staff_info()
{
+ score_l_ =0;
c0_position_i_l_ = 0;
- walk_l_ = 0;
time_C_ = 0;
rhythmic_C_ =0;
break_allowed_b_ = 0;
}
-Staff_column*
-Staff_info::column_l()
-{
- return walk_l_->ptr();
-}
-
Score_column*
Staff_info::musical_l()
{
- return column_l() -> musical_column_l();
+ return musical_l_;
}
Score_column*
Staff_info::command_l()
{
- return column_l() -> command_column_l();
+ return command_l_;
}
PCol*
Staff_info::command_pcol_l()
{
return command_l()->pcol_l_;
}
+PCol*
+Staff_info::musical_pcol_l()
+{
+ return musical_l()->pcol_l_;
+}
Moment
Staff_info::when()
{
- return walk_l_->when();
+ return command_l()->when();
}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "staff-sym.hh"
#include "voice-group-regs.hh"
#include "voice-regs.hh"
#include "bar.hh"
#include "debug.hh"
#include "input-register.hh"
+#include "meter-reg.hh"
+#include "staffline.hh"
-Staff_info
-Staff_registers::get_staff_info()
-{
- Staff_info inf;
- inf = Request_register::get_staff_info();
- inf.staff_sym_l_=staff_sym_l_;
- inf.c0_position_i_l_ = &c0_position_i_;
- return inf;
-}
-Staff_registers::Staff_registers(Input_register const*ireg_C)
+Staff_registers::Staff_registers()
{
- staff_sym_l_ =0;
- c0_position_i_ = 0;
- base_position_i_ =0;
- add( ireg_C->get_nongroup_p_arr());
- ireg_C_ =ireg_C;
+ staffline_p_ =0;
}
-/** Magic function which takes a Voice_registers out of one of its own
- children, and puts it in another. This also handles the push and
- popgroup feature. */
void
-Staff_registers::change_group(Group_change_req * greq_l,
- Voice_registers *voice_regs_l,
- Voice_group_registers * old_group)
+Staff_registers::typeset_element(Score_elem *elem_p)
{
-
- Voice_registers *regs_p = (old_group)
- ? (Voice_registers*) old_group->get_register_p(
- voice_regs_l)
- : new Voice_registers(
- greq_l->voice_l(), ireg_C_->get_ireg_l("Voice_group_registers")
- ->get_ireg_l("Voice_registers"));
-
- String new_str = greq_l->newgroup_str_;
- String old_str;
- if (old_group)
- old_str = old_group->group_id_str_;
- if ( new_str[0] == '+') {
- new_str = old_str + new_str;
- } else if (new_str[0] == '-') {
- int idx = old_str.index_last_i('+');
- if (idx >=0)
- new_str = old_str.left_str ( idx );
- }
- Voice_group_registers * new_group_l = get_group(new_str);
- new_group_l->add(regs_p);
- regs_p->sync_features();
- mtor << "processed change_group " << get_staff_info().when()<<"\n";
- print();
+ staff_elem_l_arr_.push(elem_p);
+ Register_group_register::typeset_element(elem_p);
}
-Voice_group_registers *
-Staff_registers::get_group(String id)
+void
+Staff_registers::typeset_breakable_item( Item * nobreak_p)
{
- for (int i=0; i < group_l_arr_.size(); i++) {
- if (group_l_arr_[i]->group_id_str_ == id)
- return group_l_arr_[i];
- }
- Voice_group_registers *group_p =
- new Voice_group_registers(id, ireg_C_->get_ireg_l("Voice_group_registers"));
- group_l_arr_.push(group_p);
- add(group_p);
- return group_p;
+ staff_elem_l_arr_.push(nobreak_p);
+ Register_group_register::typeset_breakable_item(nobreak_p);
}
-
void
-Staff_registers::terminate_register(Request_register * reg)
+Staff_registers::do_pre_move_processing()
{
- for (int i=0; i < group_l_arr_.size(); i++) {
- if (group_l_arr_[i] == reg) {
- group_l_arr_.del(i);
- Register_group_register::terminate_register(reg);
- return;
- }
- }
- assert(false);
+ Register_group_register::do_pre_move_processing();
+ group_staff_elems();
}
-bool
-Staff_registers::try_request(Request * r)
+void
+Staff_registers::group_staff_elems()
{
- bool b = Register_group_register::try_request(r);
- if (!b) {
- Command_req * cr_l = r->command() ;
-
- if (cr_l && cr_l->groupchange()) {
- change_group(cr_l->groupchange(), 0, 0);
- b = true;
- } else
- b= false;
- }
- return b;
+ for (int i=0; i <staff_elem_l_arr_.size(); i++)
+ staffline_p_->add_element(staff_elem_l_arr_[i]);
+ staff_elem_l_arr_.set_size(0);
}
-IMPLEMENT_STATIC_NAME(Staff_registers);
-
-bool
-Staff_registers::acceptable_request_b(Request*r)const
+void
+Staff_registers::do_removal_processing()
{
- return Register_group_register::acceptable_request_b(r) ||
- (r->command() && r->command()->groupchange());
+ /* this is a "destructor type function", first do children, then self. */
+ Register_group_register::do_removal_processing();
+ group_staff_elems();
+
+ staffline_p_->right_col_l_ = get_staff_info().command_pcol_l();
+ Request_register::typeset_element(staffline_p_);
+ staffline_p_ = 0;
}
void
-Staff_registers::acknowledge_element(Score_elem_info i)
+Staff_registers::do_creation_processing()
{
- Register_group_register::acknowledge_element(i);
- if ( i.elem_l_->name() == Staff_symbol::static_name())
- staff_sym_l_ = (Staff_symbol*)i.elem_l_->item();
+ staffline_p_ = new Line_of_staff;
+ staffline_p_->left_col_l_ = get_staff_info().command_pcol_l();
+
+ // don't broadcast to self.
+ Request_register::announce_element(Score_elem_info(staffline_p_,0));
+ Register_group_register::do_creation_processing();
}
+
+
+IMPLEMENT_STATIC_NAME(Staff_registers);
+IMPLEMENT_IS_TYPE_B1(Staff_registers,Register_group_register);
+ADD_THIS_REGISTER(Staff_registers);
+
if (staff_sym_l_ == o)
staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
}
+
+IMPLEMENT_STATIC_NAME(Staff_side);
+IMPLEMENT_IS_TYPE_B1(Staff_side, Score_elem);
#include "p-col.hh"
const NO_LINES = 5;
+void
+Staff_sym_register::fill_staff_info(Staff_info&i)
+{
+ i.staff_sym_l_ = span_p_;
+}
Staff_sym_register::Staff_sym_register()
{
span_p_ = 0;
- last_mom_ =0;
}
void
-Staff_sym_register::post_move_processing()
+Staff_sym_register::do_creation_processing()
{
- if (!span_p_ && !last_mom_) {
- span_p_= new Staff_symbol(NO_LINES);
- span_p_->left_col_l_ =
- get_staff_info().command_pcol_l()->postbreak_p_; // ugh
- }
- if (!last_mom_) {
- last_mom_ = get_staff_info().score_l()->last();
- }
+ span_p_ = new Staff_symbol(NO_LINES);
+ span_p_->left_col_l_ = get_staff_info().command_pcol_l(); // ugh
}
void
-Staff_sym_register::process_requests()
+Staff_sym_register::do_removal_processing()
{
- announce_element(Score_elem_info(span_p_, 0));
+ span_p_->right_col_l_ = get_staff_info().command_pcol_l();
+ typeset_element(span_p_);
+ span_p_ =0;
}
void
-Staff_sym_register::pre_move_processing()
+Staff_sym_register::do_process_requests()
{
- Staff_info i=get_staff_info();
- if ( span_p_ && i.when() == last_mom_) {
- span_p_->right_col_l_ = i.command_pcol_l()->prebreak_p_;
- typeset_element(span_p_);
- span_p_ =0;
- }
+ announce_element(Score_elem_info(span_p_, 0));
}
+
IMPLEMENT_STATIC_NAME(Staff_sym_register);
+IMPLEMENT_IS_TYPE_B1(Staff_sym_register,Request_register);
ADD_THIS_REGISTER(Staff_sym_register);
-Staff_sym_register::~Staff_sym_register()
-{
- assert(!span_p_);
- delete span_p_;
-}
}
IMPLEMENT_STATIC_NAME(Staff_symbol);
+IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner);
void
Staff_symbol::do_print()const
+++ /dev/null
-/*
- staff-walker.cc -- implement Staff_walker
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "grouping.hh"
-#include "staff.hh"
-#include "musical-request.hh"
-#include "staff-walker.hh"
-#include "staff-column.hh"
-#include "score-column.hh"
-#include "debug.hh"
-#include "time-description.hh"
-#include "command-request.hh"
-#include "grouping.hh"
-#include "score-walker.hh"
-
-Staff_walker::~Staff_walker()
-{
- do_pre_move();
-}
-
-Staff_walker::Staff_walker(Staff_walker const &s)
- :PCursor<Staff_column*> (s)
-{
- assert(false);
-}
-
-Staff_walker::Staff_walker(Staff * s, PScore*ps )
- : PCursor<Staff_column*> (s->cols_)
-{
- staff_l_ = s;
- pscore_l_ = ps;
-
- // should be in tdes. TODO
- default_grouping = new Rhythmic_grouping(MInterval(0, 1), 4);
- score_walk_l_ = 0;
-}
-
-Moment
-Staff_walker::when() const
-{
- return ptr()->when();
-}
-
-void
-Staff_walker::process_timing_reqs()
-{
- ptr()->update_time(time_, default_grouping);
-}
-
-void
-Staff_walker::operator++(int i)
-{
- Moment last = when();
-
- do_pre_move();
- PCursor<Staff_column*>::operator++(i);
- if (ok() ) {
- Moment delta_t = when() - last;
- assert(delta_t >Moment(0));
- time_.add( delta_t );
- }
- do_post_move();
-}
-
-void
-Staff_walker::process()
-{
- process_timing_reqs();
- process_requests();
-}
-
-void
-Staff_walker::allow_break()
-{
- score_walk_l_->allow_break(this);
-}
-
+++ /dev/null
-/*
- staff.cc -- implement Staff
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "input-register.hh"
-#include "staff.hh"
-#include "score.hh"
-#include "voice.hh"
-#include "staff-column.hh"
-#include "score-column.hh"
-#include "voice-element.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)
-{
- for (iter_top(l,i); i.ok(); i++)
- voice_list_.bottom().add(i);
-}
-
-Paper_def *
-Staff::paper() const
-{
- return score_l_->paper_p_;
-}
-
-void
-Staff::clean_cols()
-{
-#if 0 // TODO
- iter_top(cols_,i);
- for(; i.ok(); ){
- if (!i->musical_column_l_->used_b())
- i->musical_column_l_ = 0;
- if (!i->command_column_l_->used_b())
- i->command_column_l_ =0;
-
- if (!i->command_column_l_&& !i->musical_column_l_)
- delete i.remove_p();
- else
- i++;
- }
-#endif
-}
-
-
-void
-Staff::OK() const
-{
-#ifndef NDEBUG
- cols_.OK();
- voice_list_.OK();
- assert(score_l_);
-#endif
-}
-
-
-Moment
-Staff::last() const
-{
- Moment l = 0;
- for (iter_top(voice_list_,i); i.ok(); i++) {
- l = l >? i->last();
- }
- return l;
-}
-
-void
-Staff::print() const
-{
-#ifndef NPRINT
- mtor << "Staff {\n";
- for (iter_top(voice_list_,i); i.ok(); i++) {
- i->print();
- }
- ireg_p_->print();
- mtor <<"}\n";
-#endif
-}
-
-Staff::~Staff()
-{
- delete ireg_p_;
-}
-
-Staff::Staff()
-{
- ireg_p_ =0;
- score_l_ =0;
- pscore_l_ =0;
-}
-
-void
-Staff::add_col(Staff_column*c_l)
-{
- 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);
-}
+/*
+ staffline.cc -- implement Line_of_staff
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "staffline.hh"
#include "scoreline.hh"
#include "dimen.hh"
IMPLEMENT_STATIC_NAME(Line_of_staff);
+IMPLEMENT_IS_TYPE_B2(Line_of_staff,Spanner,Horizontal_vertical_group);
void
Line_of_staff::add_element(Score_elem*elem_l)
{
- if (!elem_l->group_element_i_)
- Element_group::add_element(elem_l);
+ if (!elem_l->y_group_element_i_)
+ Horizontal_vertical_group::add_element(elem_l);
}
#include "stem.hh"
#include "grouping.hh"
#include "text-spanner.hh"
-#include "complex-walker.hh"
#include "debug.hh"
#include "grouping.hh"
#include "note-head.hh"
+#include "time-description.hh"
Stem_beam_register::Stem_beam_register()
{
- post_move_processing();
+ do_post_move_processing();
current_grouping = 0;
beam_p_ = 0;
}
bool
-Stem_beam_register::try_request(Request*req_l)
+Stem_beam_register::do_try_request(Request*req_l)
{
Musical_req* mus_l = req_l->musical();
}
void
-Stem_beam_register::process_requests()
+Stem_beam_register::do_process_requests()
{
if (beam_req_l_) {
if (beam_req_l_->spantype == Span_req::STOP) {
} else {
beam_p_ = new Beam;
start_req_l_ = beam_req_l_;
-
+ beam_p_->left_col_l_ = get_staff_info().musical_pcol_l();
current_grouping = new Rhythmic_grouping;
if (beam_req_l_->nplet) {
Text_spanner* t = new Text_spanner();
}
}
void
-Stem_beam_register::pre_move_processing()
+Stem_beam_register::do_pre_move_processing()
{
if (stem_p_) {
if (default_dir_i_)
Rhythmic_grouping const * rg_C = get_staff_info().rhythmic_C_;
rg_C->extend(current_grouping->interval());
beam_p_->set_grouping(*rg_C, *current_grouping);
+ beam_p_->right_col_l_ = get_staff_info().musical_pcol_l();
typeset_element(beam_p_);
delete current_grouping;
current_grouping = 0;
end_beam_b_ = false;
}
void
-Stem_beam_register::post_move_processing()
+Stem_beam_register::do_post_move_processing()
{
stem_p_ = 0;
beam_req_l_ = 0;
}
IMPLEMENT_STATIC_NAME(Stem_beam_register);
+IMPLEMENT_IS_TYPE_B1(Stem_beam_register,Request_register);
ADD_THIS_REGISTER(Stem_beam_register);
+/*
+ stem.cc -- implement Stem
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "stem.hh"
#include "dimen.hh"
#include "debug.hh"
print_flag_b_=true;
stem_xoffset_f_ =0;
-
}
IMPLEMENT_STATIC_NAME(Stem);
+IMPLEMENT_IS_TYPE_B1(Stem,Item);
void
Stem::do_print() const
{
return !head_l_arr_.size();
}
-bool
-Stem::chord_b() const
+
+// if dir_i_ is set we return fake values.
+
+int
+Stem::get_center_distance_from_top()
{
- return head_l_arr_.size() > 1;
+ if (dir_i_)
+ return (dir_i_ > 0) ? 0 : 1;
+
+ int staff_center = staff_size_i_ / 2;
+ int max = max_head_i() - staff_center;
+ return max >? 0;
}
-// if dir_i_ is set we return a fake value.
+// if dir_i_ is set we return fake values.
int
-Stem::get_center_distance()
+Stem::get_center_distance_from_bottom()
{
if (dir_i_)
- return -dir_i_;
+ return (dir_i_ > 0) ? 1 : 0;
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 min = staff_center - min_head_i();
+ return min >? 0;
}
int
Stem::get_default_dir()
{
if (dir_i_)
- return dir_i_;
- return -sign(get_center_distance());
+ return dir_i_;
+ return (get_center_distance_from_top() >=
+ get_center_distance_from_bottom()) ? -1 : 1;
}
set_default_extents();
set_noteheads();
flag_i_ = dir_i_*abs(flag_i_);
+ transparent_b_ = invisible_b();
+ empty_b_ = invisible_b();
}
Stem::brew_molecule_p()const
{
Molecule *out =0;
- if ( invisible_b() )
- return Score_elem::brew_molecule_p();
-
+
Real bot = stem_bottom_f_;
Real top = stem_top_f_;
assert(false);
}
- out->translate(Offset(stem_xoffset_f_,0));
+ out->translate_x(stem_xoffset_f_);
return out;
}
IMPLEMENT_STATIC_NAME(Super_elem);
+IMPLEMENT_IS_TYPE_B1(Super_elem,Score_elem);
#include "swallow-reg.hh"
IMPLEMENT_STATIC_NAME(Swallow_register);
+IMPLEMENT_IS_TYPE_B1(Swallow_register,Request_register);
ADD_THIS_REGISTER(Swallow_register);
-bool
-Swallow_register::acceptable_request_b(Request*) const
-{
- return true;
-}
bool
-Swallow_register::try_request(Request*)
+Swallow_register::do_try_request(Request*)
{
return true;
}
#include "item.hh"
#include "musical-request.hh"
#include "spanner.hh"
-#include "scoreline.hh"
-#include "staffline.hh"
#include "pcursor.tcc"
#include "plist.tcc"
#define IPLC_instantiate(a) IPL_instantiate(a); PL_instantiate(const a)
-IPLC_instantiate(Line_of_score);
-IPLC_instantiate(Line_of_staff);
IPLC_instantiate(Score_elem);
IPLC_instantiate(Spanner);
IPLC_instantiate(Idealspacing);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "music.hh"
-#include "symbol.hh"
-#include "voice.hh"
-#include "voice-element.hh"
-#include "musical-request.hh"
-#include "staff.hh"
#include "score-column.hh"
-#include "staff-column.hh"
-#include "spanner.hh"
#include "plist.tcc"
#include "pcursor.tcc"
-IPL_instantiate(Request);
IPL_instantiate(Score_column);
-IPL_instantiate(Staff_column);
-IPL_instantiate(Staff);
-IPL_instantiate(Voice_element);
-IPL_instantiate(Voice);
-
-
-IPL_instantiate(Music);
#include "symbol.hh"
#include "request.hh"
-#include "input-score.hh"
-#include "input-staff.hh"
-#include "input-music.hh"
#include "input-register.hh"
#include "molecule.hh"
-#include "voice-element.hh"
#include "plist.tcc"
#include "pcursor.tcc"
IPL_instantiate(Atom);
-IPL_instantiate(Input_staff);
-IPL_instantiate(Input_music);
IPL_instantiate(Input_register);
#include "proto.hh"
#include "plist.tcc"
#include "register.hh"
-#include "voice-group-regs.hh"
-#include "voice-regs.hh"
-
-IPL_instantiate(Voice_registers);
-IPL_instantiate(Voice_group_registers);
IPL_instantiate(Request_register);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "staff-column.hh"
-#include "request-column.hh"
#include "plist.tcc"
#include "pcursor.tcc"
-IPL_instantiate(Request_column);
+#include "music-list.hh"
+#include "music-iterator.hh"
+
+IPL_instantiate(Music);
+IPL_instantiate(Music_iterator);
-#include "pulk-voice.hh"
#include "plist.tcc"
#include "pcursor.tcc"
-
-IPL_instantiate(Pulk_voice);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
- a.translate(Offset(dx/2,0));
+ a.translate_x(dx/2);
s.tex = a.TeX_string();
return s;
s.tex = f;
Atom a(s);
- a.translate(Offset(dx/2,0));
+ a.translate_x(dx/2);
s.dim = a.extent();
s.tex = a.TeX_string();
return s;
Molecule mol;
mol.add(l);
Atom a(m);
- a.translate(Offset(0,slur_extra * internote_f()));
+ a.translate_y(slur_extra * internote_f());
mol.add_right(m);
mol.add_right(r);
- mol.translate(Offset(0, l_dy * internote_f()));
+ mol.translate_y( l_dy * internote_f());
Symbol s;
s.tex = mol.TeX_string();
s.dim = mol.extent();
{
Atom a = get_atom(p,0);
- Real guess_width_f = text_str_.length_i() * a.sym.dim.x.length(); // ugh
+ Real guess_width_f = text_str_.length_i() * a.sym_.dim.x.length(); // ugh
Interval i(0, guess_width_f);
i += - (align_i_ + 1)* i.center();
return i;
style_str_ << "align " << align_i_ << '\n';
}
IMPLEMENT_STATIC_NAME(Text_def);
+IMPLEMENT_IS_TYPE_B1(Text_def,General_script_def);
Molecule* mol_p = new Molecule(a);
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_f()));
+ mol_p->translate_y( -mol_p->extent().y.left );
+ mol_p->translate_y( pos_i_ * paper()->internote_f());
return mol_p;
}
IMPLEMENT_STATIC_NAME(Text_item);
+IMPLEMENT_IS_TYPE_B1(Text_item,Item);
{
text_p_ = 0;
dir_i_ =0;
- post_move_processing();
+ do_post_move_processing();
}
bool
-Text_register::try_request(Request*req_l)
+Text_register::do_try_request(Request*req_l)
{
- if (!req_l->text())
+ Musical_req *m = req_l->musical();
+ if (!m || ! m->text())
return false;
if (text_req_l_ &&
- Text_req::compare(*req_l->text(), *text_req_l_))
+ Text_req::compare(*m->text(), *text_req_l_))
return false;
- text_req_l_ = req_l->text();
+ text_req_l_ = m->text();
return true;
}
void
}
}
void
-Text_register::process_requests()
+Text_register::do_process_requests()
{
if (text_req_l_) {
text_p_ = new Text_item(text_req_l_->tdef_p_, text_req_l_->dir_i_); // ugh
}
}
void
-Text_register::pre_move_processing()
+Text_register::do_pre_move_processing()
{
if (text_p_) {
if (dir_i_ && !text_p_->dir_i_)
dir_i_ = i.value_;
}
void
-Text_register::post_move_processing()
+Text_register::do_post_move_processing()
{
text_req_l_ = 0;
}
IMPLEMENT_STATIC_NAME(Text_register);
+IMPLEMENT_IS_TYPE_B1(Text_register,Request_register);
ADD_THIS_REGISTER(Text_register);
}
IMPLEMENT_STATIC_NAME(Text_spanner);
+IMPLEMENT_IS_TYPE_B1(Text_spanner,Spanner);
void
Text_spanner::do_print() const
#include "tie.hh"
#include "note-head.hh"
#include "musical-request.hh"
-#include "voice-element.hh"
+#include "music-list.hh"
Tie_register::Tie_register()
{
void
-Tie_register::post_move_processing()
+Tie_register::do_post_move_processing()
{
if (tie_p_ && get_staff_info().when() == end_mom_) {
end_tie_p_ = tie_p_;
}
bool
-Tie_register::try_request(Request*r)
+Tie_register::do_try_request(Request*r)
{
if(!acceptable_request_b(r))
return false;
return false;
}
req_l_ = r->musical()->tie();
- end_mom_ = r->elt_l_->duration_ + get_staff_info().when();
+ end_mom_ = r->parent_music_l_->time_int().length()
+ + get_staff_info().when();
return true;
}
void
-Tie_register::process_requests()
+Tie_register::do_process_requests()
{
if (req_l_ && ! tie_p_) {
tie_p_ = new Tie;
}
void
-Tie_register::pre_move_processing()
+Tie_register::do_pre_move_processing()
{
if (end_tie_p_) {
if (dir_i_)
}
IMPLEMENT_STATIC_NAME(Tie_register);
+IMPLEMENT_IS_TYPE_B1(Tie_register,Request_register);
ADD_THIS_REGISTER(Tie_register);
IMPLEMENT_STATIC_NAME(Tie);
+IMPLEMENT_IS_TYPE_B1(Tie,Bow);
--- /dev/null
+/*
+ vertical-align-item.cc -- implement Vertical_align_elem
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "vertical-align-elem.hh"
+#include "interval.hh"
+
+void
+Vertical_align_elem::add(Score_elem*el_l)
+{
+ assert( ! contains_b(el_l));
+ elem_l_arr_.push(el_l);
+ add_dependency(el_l);
+}
+
+void
+Vertical_align_elem::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ int i;
+ while((i = elem_l_arr_.find_i(o))>=0)
+ if (n)
+ elem_l_arr_[i] = n;
+ else
+ elem_l_arr_.del(i);
+}
+void
+Vertical_align_elem::do_post_processing()
+{
+ Array<Interval> dims;
+ for (int i=elem_l_arr_.size(); i--; ) {
+ Interval y = elem_l_arr_[i]->height() ;
+ if (y.empty_b())
+ y = Interval(0,0);
+
+ dims.push(y);
+ }
+
+ Real where_f=0;
+ for ( int i=0 ; i < elem_l_arr_.size(); i++) {
+ elem_l_arr_[i]->translate_y( - dims[i][1] - where_f);
+ where_f += dims[i].length();
+ }
+}
+
+bool
+Vertical_align_elem::contains_b(Score_elem const *e)const
+{
+ return elem_l_arr_.find_l(e);
+}
+
+Vertical_align_elem::Vertical_align_elem()
+{
+ transparent_b_ = true;
+ empty_b_ =true;
+}
+
+IMPLEMENT_STATIC_NAME(Vertical_align_elem);
+IMPLEMENT_IS_TYPE_B1(Vertical_align_elem, Score_elem);
+
+++ /dev/null
-/*
- voice-elt.cc -- implement Voice_element
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "voice.hh"
-#include "voice-element.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-
-
-void
-Voice_element::transpose(Melodic_req const&d)const
-{
- for (iter_top(req_p_list_,i); i.ok(); i++) {
- i->transpose(d);
- }
-}
-
-void
-Voice_element::print() const
-{
-#ifndef NPRINT
- mtor << "voice_element { dur :"<< duration_ <<"\n";
- mtor << "principal: " << principal_req_l_->name() << "\n";
- for (iter_top(req_p_list_,rc); rc.ok(); rc++) {
- rc->print();
- }
-
- mtor << "}\n";
-#endif
-}
-
-void
-Voice_element::add(Request*r)
-{
- if (! principal_req_l_ )
- principal_req_l_ = r;
-
- if (r->duration()) {
- assert (!duration_ || duration_ == r->duration());
- duration_ = r->duration();
- }
-
- r->elt_l_ = this;
- req_p_list_.bottom().add(r);
-}
-
-
-Voice_element::Voice_element()
-{
- principal_req_l_ = 0;
- voice_C_ = 0;
- duration_ = 0;
-}
-
-Voice_element::Voice_element(Voice_element const&src)
- : Input(src)
-{
- principal_req_l_ = 0;
- voice_C_=0;
- for (iter_top(src.req_p_list_, i); i.ok(); i++)
- add(i->clone());
-
-}
-
-void
-Voice_element::set_default_group(String s)
-{
- for (iter_top(req_p_list_, i); i.ok(); i++)
- if (i->command() &&i->command()->groupchange())
- return ;
- Group_change_req *greq = new Group_change_req;
- greq->newgroup_str_ = s;
- add(greq);
-}
-
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-#include "voice.hh"
+#include "music-list.hh"
#include "proto.hh"
#include "plist.hh"
#include "musical-request.hh"
#include "voice-regs.hh"
#include "voice-group-regs.hh"
#include "register.hh"
-#include "complex-walker.hh"
#include "command-request.hh"
#include "debug.hh"
#include "input-register.hh"
+#include "time-description.hh"
-static int temp_id_count;
-Voice_group_registers::Voice_group_registers(String id,
- Input_register const *ireg_C)
+Voice_group_registers::Voice_group_registers()
{
dir_i_ =0;
- ireg_C_ =ireg_C;
- Register_group_register::add(ireg_C->get_nongroup_p_arr());
- if (id=="") // ugh
- id = __FUNCTION__ + String(temp_id_count++);
- group_id_str_ = id;
- termination_mom_ = 0;
+ termination_mom_ = INFTY;
}
bool
-Voice_group_registers::try_request(Request*r_l)
+Voice_group_registers::do_try_request(Request*r_l)
{
- for (int i=0; i < voice_reg_l_arr_.size(); i++) {
- if (voice_reg_l_arr_[i]->voice_l_ == r_l->voice_l())
- goto gotcha; // yeah, yeah, I know
- }
- return false;
-gotcha:
Command_req* c_l = r_l->command();
if (c_l&& c_l->groupfeature()) {
Feature f;
set_feature(f);
return true;
}
- return Register_group_register::try_request(r_l);
+ return Register_group_register::do_try_request(r_l);
}
IMPLEMENT_STATIC_NAME(Voice_group_registers);
+IMPLEMENT_IS_TYPE_B1(Voice_group_registers,Register_group_register);
void
Voice_group_registers::do_print() const
{
#ifndef NPRINT
- mtor << "ID: " << group_id_str_<<"\n";
- mtor << "stopping at " << termination_mom_ << "\n";
Register_group_register::do_print();
#endif
}
-void
-Voice_group_registers::add(Request_register*r_l)
-{
- Register_group_register::add(r_l);
- if (r_l->name() == Voice_registers::static_name()) {
- Voice_registers * vregs_l = (Voice_registers*)r_l;
- voice_reg_l_arr_.push( vregs_l );
- Voice *v_l = vregs_l->voice_l_;
- termination_mom_ = termination_mom_ >? v_l -> last();
- mtor << "adding Voice_registers, now terminating at " <<
- termination_mom_<< "\n";
- }
- OK();
-}
void
-Voice_group_registers::post_move_processing()
+Voice_group_registers::do_post_move_processing()
{
if ( get_staff_info().time_C_ ->when_ > termination_mom_ ){
mtor << "Terminating voice_group\n";
daddy_reg_l_->terminate_register(this);
return ;
}
- Register_group_register::post_move_processing();
+ Register_group_register::do_post_move_processing();
}
-Request_register *
-Voice_group_registers::get_register_p(Request_register *reg_l)
-{
- if (reg_l->name() == Voice_registers::static_name()) {
- for (int i=0; i <voice_reg_l_arr_.size(); i++) {
- if (reg_l == voice_reg_l_arr_[i])
- voice_reg_l_arr_.del(i);
- }
- }
- Request_register*reg_p =Register_group_register::get_register_p(reg_l);
- OK();
-
- return reg_p;
-}
-void
-Voice_group_registers::OK() const
-{
- for (int i=0; i < voice_reg_l_arr_.size(); i++) {
- iter(reg_list_.find(voice_reg_l_arr_[i]), j);
- assert(j.ok());
- }
-}
-
-
-void
-Voice_group_registers::set_feature(Feature f)
-{
- if (f.type_ == "vdir")
- dir_i_ = f.value_;
- Register_group_register::set_feature(f);
-}
Scalar
Voice_group_registers::get_feature(String f)
return dir_i_;
Register_group_register::get_feature(f);
}
+
+ADD_THIS_REGISTER(Voice_group_registers);
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+
#include "proto.hh"
#include "plist.hh"
#include "command-request.hh"
#include "musical-request.hh"
#include "voice-regs.hh"
#include "register.hh"
-#include "staff-regs.hh" // needed because somebody has to delete us.
#include "debug.hh"
-#include "input-register.hh"
-#include "voice-group-regs.hh"
-Voice_registers::Voice_registers(Voice *v_p, Input_register const*ireg_C)
+Voice_registers::Voice_registers()
{
- terminate_b_ = false;
- ireg_C_ = ireg_C;
- voice_l_ = v_p;
- add(ireg_C->get_nongroup_p_arr());
}
-void
-Voice_registers::acknowledge_element(Score_elem_info i)
-{
- if (i.voice_l_ != voice_l_)
- return;
- Register_group_register::acknowledge_element(i);
-}
-
-bool
-Voice_registers::try_request(Request*r_l)
-{
- if (r_l->voice_l() !=voice_l_)
- return false;
-
- Command_req *c=r_l->command();
- if (c&&c->terminate()) {
- terminate_b_ = true;
- return true; // scary. We're deleted now..
- } else if (c&&c->groupchange()) {
- /* this is scary as well. The groupchange has to be handled by
- the Staff_registers, which are two levels up in the hierarchy
- */
-
- assert(daddy_reg_l_->name() == Voice_group_registers::static_name());
- ((Staff_registers*)daddy_reg_l_->daddy_reg_l_)-> // scary.
- change_group(c->groupchange(), this,
- (Voice_group_registers*)daddy_reg_l_); // ugh!
- return true;
- }
-
- return Register_group_register::try_request(r_l);
-}
-
-bool
-Voice_registers::acceptable_request_b(Request*r)
-{
- Command_req * c_l = r->command();
- return (c_l&&(c_l->terminate()||c_l->groupchange()))
- || Register_group_register::acceptable_request_b(r);
-}
-IMPLEMENT_STATIC_NAME(Voice_registers);
-
void
Voice_registers::do_print() const
{
#ifndef NPRINT
- mtor << "Voice= " << voice_l_<<'\n';
Register_group_register::do_print();
#endif
}
-void
-Voice_registers::pre_move_processing()
+ADD_THIS_REGISTER(Voice_registers);
+IMPLEMENT_IS_TYPE_B1(Voice_registers, Register_group_register);
+IMPLEMENT_STATIC_NAME(Voice_registers);
+
+bool
+Voice_registers::interpret_request_b(Request*r)
{
- if (terminate_b_)
- daddy_reg_l_->terminate_register(this);
- else
- Register_group_register::pre_move_processing();
+ return try_request(r);
}
+
+++ /dev/null
-/*
- voice.cc -- implement Voice
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-#include "proto.hh"
-#include "plist.hh"
-#include "debug.hh"
-#include "voice.hh"
-#include "musical-request.hh"
-#include "command-request.hh"
-#include "midi-item.hh"
-#include "midi-stream.hh"
-#include "voice-element.hh"
-
-void
-Voice::transpose(Melodic_req const & d)const
-{
- for (iter_bot(elts_, i); i.ok(); i--)
- i->transpose(d);
-}
-
-void
-Voice::set_default_group(String s)
-{
- elts_.top()->set_default_group(s);
-}
-
-Voice::Voice(Voice const&src)
-{
- for (iter_top(src.elts_, i); i.ok(); i++)
- add(new Voice_element(**i));
-
- start_ = src.start_;
-}
-
-Voice::Voice()
-{
- start_ = 0;
-}
-
-void
-Voice::add(Voice_element*v)
-{
- v->voice_C_ = this;
- elts_.bottom().add(v);
-}
-
-void
-Voice::print() const
-{
-#ifndef NPRINT
- mtor << "Voice { start_: "<< start_<<eol;
- for (iter_top(elts_,i); i.ok(); i++)
- i->print();
- mtor << "}\n";
-#endif
-}
-
-/**
- @return The moment at which last element stops.
- */
-Moment
-Voice::last() const
-{
- Moment l =0;
- if (elts_.size())
- l = start_;
-
- for (iter_top(elts_,i); i.ok(); i++)
- l += i->duration_;
- return l;
-}
-
+++ /dev/null
-/*
- walkregs.cc -- implement Walker_registers
-
- 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 "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)
-{
- walk_l_ = w;
- Input_register * ireg_l = w->staff_l_->ireg_p_;
- if (ireg_l->name_str_ == "Staff_registers")
- add(new Staff_registers(ireg_l));
- else {
- add(ireg_l->get_nongroup_p_arr());
- }
-}
-
-void
-Walker_registers::announce_element(Score_elem_info info)
-{
- if (info.elem_l_->name() == Bar::static_name()) {
- walk_l_->allow_break();
- }
- announce_info_arr_.push(info);
-}
-
-void
-Walker_registers::acknowledge_element(Score_elem_info )
-{
- assert(false);
-}
-
-void
-Walker_registers::do_announces()
-{
- Request dummy_req;
- for (int i = 0; i < announce_info_arr_.size(); i++){
- Score_elem_info info = announce_info_arr_[i];
- mtor << "Announcing " << info.elem_l_->name()<<"\n";
-
- if (!info.req_l_)
- info.req_l_ = &dummy_req;
- Register_group_register::acknowledge_element(info);
- }
- announce_info_arr_.set_size(0);
-}
-
-void
-Walker_registers::typeset_element(Score_elem *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) {
- prebreak_item_p_arr_.push(pre_p);
- walk_l_->staff_l_->staff_line_l_->add_element(pre_p);
- }
- if (nobreak_p) {
- nobreak_item_p_arr_.push(nobreak_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
-Walker_registers::pre_move_processing()
-{
- // this generates all items.
- Register_group_register::pre_move_processing();
- 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()
-{
- Register_group_register::post_move_processing();
-}
-
-
-Staff_info
-Walker_registers::get_staff_info()
-{
- Staff_info inf;
- if (walk_l_->score_walk_l_) // we get called ctors
- inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
- inf.walk_l_ = walk_l_;
- inf.time_C_ = &walk_l_->time_;
- inf.rhythmic_C_ = walk_l_->default_grouping;
- return inf;
-}
-
-Paper_def*
-Walker_registers::paper()const
-{
- return walk_l_->staff_l_->paper();
-}
# @configure_input@
INSTALL = @INSTALL@
-USER_CXXFLAGS =
+USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@
USER_LDFLAGS =
CXX = @CXX@
# dependency list of executable:
#
-$(EXECUTABLE): $(build) $(OFILES)
+$(EXECUTABLE): $(build) $(OFILES) $(outdir)/version.hh
$(MAKE) $(MODULE_LIBDEPS)
$(INCREASE_BUILD)
$(MAKE) -S $(OFILES) $(SILENT_LOG)
# RedHat rpm package:
#
-rpm: $(doc-dir)/$(outdir)/lelie_icon.xpm
+rpm: check-rpm-doc-deps
-cp $(depth)/lilypond-$(TOPLEVEL_VERSION).tar.gz $(rpm-sources)
-cp $< $(rpm-sources)
$(MAKE) -C $(make-dir) spec
rpm -ba $(makeout)/lilypond.spec
#
+check-rpm-doc-deps:
+ $(MAKE) -C $(depth)/Documentation/ xpms
+
installexe:
$(INSTALL) -d $(bindir)
Begin3
Title: LilyPond
-Version: 0.0.67
-Entered-date: 05/29/97
+Version: 0.0.68pre
+Entered-date: 06/26/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.67.tar.gz
+ 300k lilypond-0.0.68pre.tar.gz
Alternate-site:
Original-site:
Platform: unix/win32, GNU C++
Name: lilypond
-Version: 0.0.67
+Version: 0.0.68pre
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.67.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.68pre.tar.gz
Summary: A preprocessor to make TeX typeset music.
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>
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
+%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 Documentation/out/other-packages.text input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.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/convert-mudela
/usr/bin/lilypond
/usr/lib/libflower.so
localinstall:
$(INSTALL) -d $(lily-mfdir)
- $(INSTALL) -m 755 $(MFFILES) $(lily-mfdir)
+ $(INSTALL) -m 644 $(MFFILES) $(lily-mfdir)
localuninstall:
for i in $(MFFILES); do rm -f $(lily-mfdir)/$$i; done
localinstall:
$(INSTALL) -d $(TEXDIR)/lilypond
- $(INSTALL) -m 755 $(TEXFILES) $(TEXDIR)/lilypond/
+ $(INSTALL) -m 644 $(TEXFILES) $(TEXDIR)/lilypond/
localuninstall:
for i in $(TEXFILES) ; do rm -f $(TEXDIR)/lilypond/$$i; done
%
% A tex file to help determine dims.
%
-\font\musicfont=musix20
+\font\musicfont=opus20
\font\slurfont=xslu16
\def\thefont{\musicfont}
--- /dev/null
+%
+% Has to be fixed. Exercise for the reader.
+%
+
+
+\def\musixtwentyfonts{
+ \font\textfont=cmr10
+ \font\meterfont=cmbx12
+ \font\slurufont=oslu20
+ \font\slurdfont=osld20
+ \font\slurhfont=oslz20
+ \font\hslurufont=oslhu20
+ \font\hslurdfont=oslhd20
+ \font\hslurhfont=oslhz20
+ \font\musicfnt=opus20
+ \font\musicdraw=opussps
+ \font\italicfont=cmti10
+ \font\dynfont=cmbxti10 scaled \magstep1
+ \font\mathfont=cmsy10
+}
+
+
+\def\musixsixteenfonts{
+ \font\textfont=cmr8
+ \font\meterfont=cmbx12
+ \font\italicfont=cmti8
+ \font\slurufont=oslu16
+ \font\slurdfont=osld16
+ \font\slurhfont=oslz20 % sigh
+ \font\hslurufont=oslhu16
+ \font\hslurdfont=oslhd16
+ \font\hslurhfont=oslhz20
+ \font\musicfnt=opus16
+ \font\dynfont=cmbxti12
+ \font\musicdraw=opussps
+ \font\mathfont=cmsy8
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% provide interface to musixtex fonts
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mdef\quartball{26}
+\mdef\halfball{27}
+\mdef\wholeball{28}
+\mdef\halfrest{13}
+\mdef\wholerest{12}
+\mdef\quartrest{14}
+\mdef\eighthrest{15}
+\mdef\sixteenthrest{16}
+\mdef\thirtysecondrest{17}
+\mdef\sixtyfourthrest{18}
+%\mdef\hundredtwentyeighthrest{67}
+\mdef\sharp{93}
+\mdef\flat{91}
+\mdef\natural{95}
+\mdef\sharpsharp{94}
+\mdef\flatflat{92}
+
+\mdef\singledot{'00}
+\mdef\doubledot{'01}
+\mdef\tripledot{'02}
+\mdef\mussepline{155}
+
+\mdef\violinclef{65}
+\mdef\bassclef{67}
+\mdef\altoclef{69}
+\mdef\cviolinclef{66}
+\mdef\cbassclef{68}
+\mdef\caltoclef{70}
+
+\mdef\deighthflag{32}
+\mdef\dsixteenthflag{46}
+\mdef\dthirtysecondflag{47}
+\mdef\dsixtyfourthflag{48}
+\mdef\dhundredtwentyeighthflag{49}
+
+% pointing up
+\mdef\ueighthflag{40}
+\mdef\usixteenthflag{41}
+\mdef\uthirtysecondflag{42}
+\mdef\usixtyfourthflag{43}
+\mdef\uhundredtwentyeighthflag{44}
+
+\maccentdef\repeatcolon{55}{2/1}
+\def\eighthflag{\topalign{\ueighthflag}}
+\def\sixteenthflag{\topalign{\usixteenthflag}}
+\def\thirtysecondflag{\topalign{\uthirtysecondflag}}
+\def\sixtyfourthflag{\topalign{\usixtyfourthflag}}
+\def\hundredtwentyeighthflag{\topalign{\uhundredtwentyeighthflag}}
+
+\def\cquartrest{\vertcenter\quartrest}
+\def\ceighthrest{\vertcenter\eighthrest}
+\def\csixteenthrest{\vertcenter\sixteenthrest}
+\def\cthirtysecondrest{\vertcenter\thirtysecondrest}
+\def\csixtyfourthrest{\vertcenter\sixtyfourthrest}
+\def\chundredtwentyeighthrest{\vertcenter\hundredtwentyeighthrest}
+
+\def\lsingledot{\kern-\notewidth\singledot}
+\def\ldoubledot{\kern-\notewidth\doubledot}
+\def\ltripledot{\kern-\notewidth\tripledot}
+
+\maccentdef\sforzato{30}{-3/2}
+\maccentdef\marcato{20}{-1/1}
+\maccentdef\imarcato{21}{1/1}
+\maccentdef\staccato{24}{-1/3}
+\maccentdef\istaccato{25}{1/3}
+\maccentdef\staccatissimo{28}{-5/5}
+\maccentdef\istaccatissimo{29}{2/5}
+\maccentdef\portato{18}{-6/5}
+\maccentdef\iportato{19}{3/5}
+\maccentdef\tenuto{26}{-1/1}
+\maccentdef\itenuto{27}{1/1}
+\maccentdef\fermata{80}{-1/1}
+\maccentdef\ifermata{81}{1/1}
+
+\mdef\spicato{28}
+\mdef\ispicato{29}
+\mdef\upbow{23}
+\mdef\downbow{22}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set fonts and primary dimensions
\def\musixtwentydefs{
- \font\textfont=cmr10
- \font\meterfont=cmbx12
- \font\slurufont=xslu20
- \font\slurdfont=xsld20
- \font\slurhfont=xslz20
- \font\hslurufont=xslhu20
- \font\hslurdfont=xslhd20
- \font\hslurhfont=xslhz20
- \font\musicfnt=musix20
- \font\musicdraw=musixsps
- \font\italicfont=cmti10
- \font\dynfont=cmbxti10 scaled \magstep1
- \font\mathfont=cmsy10
\balkheight=20pt
\notewidth=6pt
\noteheight=5pt
\staffrulethickness=0.4pt
+ \musixtwentyfonts
\musixcalc
}
-
\def\musixsixteendefs{
- \font\textfont=cmr8
- \font\meterfont=cmbx12
- \font\italicfont=cmti8
- \font\slurufont=xslu16
- \font\slurdfont=xsld16
- \font\slurhfont=xslz20 % sigh
- \font\hslurufont=xslhu16
- \font\hslurdfont=xslhd16
- \font\hslurhfont=xslhz20
- \font\musicfnt=musix16
- \font\dynfont=cmbxti12
- \font\musicdraw=musixsps
- \font\mathfont=cmsy8
\balkheight=16pt
\staffrulethickness=0.4pt
\notewidth=5pt
\noteheight=4pt
+ \musixsixteenfonts
\musixcalc
}
% big fat marks, if errors are detected.
\def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
\def\scorelineerrormark{\placebox{0pt}{-10pt}{\bf L!}}
+\def\unknown{{\bf u}}
+\def\musixtwentyfonts{
+ \font\textfont=cmr10
+ \font\meterfont=cmbx12
+ \font\slurufont=xslu20
+ \font\slurdfont=xsld20
+ \font\slurhfont=xslz20
+ \font\hslurufont=xslhu20
+ \font\hslurdfont=xslhd20
+ \font\hslurhfont=xslhz20
+ \font\musicfnt=musix20
+ \font\musicdraw=musixsps
+ \font\italicfont=cmti10
+ \font\dynfont=cmbxti10 scaled \magstep1
+ \font\mathfont=cmsy10
+}
+
+
+\def\musixsixteenfonts{
+ \font\textfont=cmr8
+ \font\meterfont=cmbx12
+ \font\italicfont=cmti8
+ \font\slurufont=xslu16
+ \font\slurdfont=xsld16
+ \font\slurhfont=xslz20 % sigh
+ \font\hslurufont=xslhu16
+ \font\hslurdfont=xslhd16
+ \font\hslurhfont=xslhz20
+ \font\musicfnt=musix16
+ \font\dynfont=cmbxti12
+ \font\musicdraw=musixsps
+ \font\mathfont=cmsy8
+}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% provide interface to musixtex fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%