Matrix 1
+# flower lib
+File_path 0
-Atom 1
-Bar 1
-Beam 1
-Change_iterator 1
+Atom 0
+Bar 0
+Beam 0
+Change_iterator 0
Chord 0
-Chord_iterator 1
-Clef_item 1
-Col_configuration 1
-Colinfo 1
-Colinfo 1
-Collision 1
-Command 1
+Chord_iterator 0
+Clef_item 0
+Col_configuration 0
+Colinfo 0
+Colinfo 0
+Collision 0
# E l b e ment? search/replace typo.
# Yeah. kind of. Looks cute though
-Elbement_group 1
-Engraver 1
-Engraver_group_engraver 1
-File_path 1
-Group_change_req 1
-Head_column 1
-Idealspacing 1
-Ineq_constrained_qp 1
-Input_translator 1
-Item 1
-Key_item 1
-Lookup 1
-Line_spacer 1
+Elbement_group 0
+Engraver 0
+Engraver_group_engraver 0
+Group_change_req 0
+Head_column 0
+Idealspacing 0
+Ineq_constrained_qp 0
+Input_translator 0
+Item 0
+Key_item 0
+Lookup 0
+Line_spacer 0
Melodic_req 0
-Midi_def 1
-Mixed_qp 1
-Music 1
-Music_iterator 1
+Midi_def 0
+Mixed_qp 0
+Music 0
+Music_iterator 0
My_lily_lexer 1
-Note_head 1
-Note_performer 1
+Note_head 0
+Note_performer 0
Note_req 0
-PCol 1
-PScore 1
-Paper_def 1
-Paperdef 1
-Performer 1
-Performer_group_performer 1
-Request 1
-Request_iterator 1
-Rest_collision 1
-Rest_collision_engraver 1
-Rest_req 1
+PCol 0
+PScore 0
+Paper_def 0
+Paperdef 0
+Performer 0
+Performer_group_performer 0
+Request 0
+Request_iterator 0
+Rest_collision 0
+Rest_collision_engraver 0
+Rest_req 0
Rhythmic_req 0
-Score 1
-Score_column 1
-Score_elem 1
-Score_engraver 1
-Score_performer 1
-Script_column 1
-Script_def 1
-Script_req 1
-Slur 1
-Spacing_problem 1
-Spanner 1
-Spring_spacer 1
-Staff 1
-Staff_commands 1
-Stem 1
-Stem 1
-Stem_req 1
-Symtable 1
-Symtables 1
-Text_def 1
-Text_req 1
-Time_description 1
-Voice 1
-Voice_element 1
-Voice_element_iterator 1
-Voice_iterator 1
-Word_wrap 1
+Score 0
+Score_column 0
+Score_elem 0
+Score_engraver 0
+Score_performer 0
+Script_column 0
+Script_def 0
+Script_req 0
+Slur 0
+Spacing_problem 0
+Spanner 0
+Spring_spacer 0
+Staff 0
+Staff_commands 0
+Stem 0
+Stem 0
+Stem_req 0
+Symtable 0
+Symtables 0
+Text_def 0
+Text_req 0
+Time_description 0
+Voice 0
+Voice_element 0
+Voice_element_iterator 0
+Voice_iterator 0
+Word_wrap 0
delete_identifiers 1
parse_duration 1
parse_pitchmod 1
+Keywords: midi notation music typesetting gnu
Subject: LilyPond 0.1 released - The GNU Project music typesetter
BORN
(GNU LilyPond 0.1)
- daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy'
- Nienhuys
+ daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
Lily is a healthy, bouncing baby weighing 345 kilobytes
Thanks go out to Mats Bengtsson, Werner Lemberg and Richard Stallman
for comments and contributions.
+
+
+**** NOTE
+
+LilyPond might have a minor bug if you use glibc-2; we will look into it
+If you use glibc-2, please try 0.1.0 to see if it works and, download 0.1.1
+when it's available.
+
+LilyPond might exhibit a g++ bug on Solaris 1.5 (The stack frame gets corrupted
+by a constructor) if you compile with -O2. We don't know workarounds.
+
+ --- * ---
+
+ We would like to dedicate this program to all the friends that we
+ met through music.
+
+
+ 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!
+
+ HWN
+
+ That's a nice thought, Wendy. I've got a few too, to spread
+the credits a bit (Again, no particular order) Michelle, Illushka,
+Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique,
+Eva, Roos, Judith, Tim and, of course, Wendy!
+
+ JCN
+
+
+Of course, our other friends in the `Eindhovens Jongeren Ensemble'
+(http://www.stack.nl/~hanwen/eje.html) cannot go unmentioned either.
+
+
+ --- * ---
C\bC\bC\bCO\bO\bO\bON\bN\bN\bNT\bT\bT\bTR\bR\bR\bRI\bI\bI\bIB\bB\bB\bBU\bU\bU\bUT\bT\bT\bTO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
+\bo Mats Bengtsson <matsb@s3.kth.se>, parts of clef-
- reg.cc, clef-item.cc testing, general comments.
+ reg.cc, clef-item.cc swedish notenames, testing,
+ general comments.
+\bo Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
bugfixes, some Beam and Stem code.
- +\bo Alexandre Oliva <oliva@dcc.unicamp.br>
+ +\bo Alexandre Oliva <oliva@dcc.unicamp.br>, testing
+
+ +\bo Anthony Fok <foka@gpu.srv.ualberta.ca>, debian
+ package: make/debian/*
Your name could be here! If you want to help, then take a
look at the SMALLISH PROJECTS section of in the file _\bT_\bO_\bD_\bO.
-
-
-
-
-30/Jul/97 LilyPond 0.1.1 1
+12/Aug/97 LilyPond 0.1.7 1
+Document reintroduced deficiencies.
-[document reintroduced deficiencies.]
+* placement of bar-numbers
-*******************
- '.' -> lilypond: lexer.l:258: int My_lily_lexer::yylex(): Assertion `cnv == 1' failed.
+*
-***********************
+hw:~/musix/spacer/Documentation/out$ LILYINCLUDE=../../input lilypond -o wohltemperirt ../../input/wohltemperirt.ly
-
-\score { <
- \melodic { \id "Staff" ""; c'4 g'4 }
- \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
- \lyric { \id "Lyric" ""; bye4 hello4 }
- \melodic { \id "Staff" ""; c'4 g'4 }
- >
-}
-
-*******************
-
-Stack frame overwrite in on Solaris 2.5.
-Engraver_group_engraver::Engraver_group_engraver() called from
-Score_engraver::Score_engraver()
+GNU LilyPond 0.1.7 #10/FlowerLib 1.1.26 #1
+Parsing ... [/home/hw/share/lilypond/init//symbol.ly[/home/hw/share/lilypond/init//dynamic.ly][/home/hw/share/lilypond/init//dutch.ly][/home/hw/share/lilypond/init//script.ly][/home/hw/share/lilypond/init//paper16.ly[/home/hw/share/lilypond/init//table16.ly^[[B][/home/hw/share/lilypond/init//engraver.ly]][/home/hw/share/lilypond/init//midi.lySegmentation fault (core dumped)
+hw:~/musix/spacer/Documentation/out$
-This license applies to all files except:
- - the included input files which explicitly state a different
-copyright policy
+*** NOTE
+
+ This license applies to all files except the included input files
+ (which are in the subdirectory input/
+
+*** END NOTE
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
=item *
Mats Bengtsson <matsb@s3.kth.se>, parts of clef-reg.cc, clef-item.cc
-testing, general comments.
+swedish notenames, testing, general comments.
=item *
=item *
-Alexandre Oliva <oliva@dcc.unicamp.br>
+Alexandre Oliva <oliva@dcc.unicamp.br>, testing
+
+=item *
+
+Anthony Fok <foka@gpu.srv.ualberta.ca>, debian package: make/debian/*
=back
Your name could be here! If you want to help, then take a look at the
SMALLISH PROJECTS section of in the file F<TODO>. Some do not involve
coding C++
-
-
=item *
-Perl. Most scripts are written in Perl. Most documentation was created
-with the perl's Plain Old Documentation.
+Perl-5. Most scripts are written in Perl. Most documentation was created
+with the perl's Plain Old Documentation. (I use 5.003)
=item *
A Debian package is in the works
-=head1 WINDOZE
+=head1 WINDOWS NT/95
-Windows NT:
+So, you're stuck with Windows, eh? Well, don't worry, you just
+need (to get) Cygnus' windows32 port of gnu development stuff;
+have a look at http://www.cygnus.com/gnu-win32.
-you need the cygnus windows32 gnu port development stuff; have a look
-at http://www.cygnus.com/gnu-win32.
-
-to make GNU LilyPond under, brr, aargh, shudder.. windows32, well,
+To make GNU LilyPond under, brr, aargh, shudder... windows32, well,
simply type:
bash configure
- make windows32
+ make
=head1 AUTHORS
#
# list of distribution files:
#
-EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES)
+EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES)
+# $(wildcard Vocab*)
default: do-doc
$(depth)/%.text: $(outdir)/%.text
cp $< $@
-$(outdir)/%.html: %.pod
- $(pod2html) $<
+do_pod2html=$(pod2html) $<
+
+# do this for perl 5.004
+# $ make do_pod2html='$(pod2html) --infile $< --outfile=$@' html
+#
+$(outdir)/%.html: %.pod $(depth)/VERSION
+ $(do_pod2html)
mv $(notdir $@) $(outdir)/
$(outdir)/%.5: %.pod
$(outdir)/%.gz: $(outdir)/%
gzip -c9 $< > $@
-$(outdir)/%.dvi: $(depth)/input/%.ly $(lilyout)/lilypond
- (cd $(outdir); lilypond ../$< ;\
+name-stem= $(notdir $(basename $<))
+$(outdir)/%.dvi: $(depth)/input/%.ly
+ (cd $(outdir); \
+ rm lelie.midi ; \
+ lilypond -o $(name-stem) ../$< )
+ (cd $(outdir); \
if [ -f ../$(basename $< ).tex ]; \
then \
latex ../$(basename $< ) ;\
else \
- tex '\nonstopmode \input lelie' ;\
- mv lelie.dvi ../$@ ; \
+ tex $(name-stem) ;\
fi)
+
# generate the pixmap at twice the size, then rescale (for antialiasing)
$(outdir)/%.gif: $(outdir)/%.ps
gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $< -c quit |pnmscale 0.5| ppmtogif > $@
=head2 Miscellaneous
+Q: Do you support pop songs (chords, single staff, lyrics)?
+
+A: Yes, see the twinkle-pop example
+
+Q: Do you support guitar chord diagrams?
+
+A: No, not yet. We ourselves don't play guitar, and don't know the
+fine points of this notation. We would welcome anyone who could give
+this a try.
+
+Q: Do you support TAB notation
+
+A: No. The same as for the previous question goes, but TAB is a lot
+more work than diagrams (TAB needs modification of Parser, Lexer,
+Notehead, Stem, and stem-code. )
+
Q: How do I change the TeX layout?
A: See lilyponddefs.tex, it has some comments.
A.0: Reconsider. Try Linux. It's fun!
-A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles, links
-and runs on windhoos-nt, using the cygnus gnu port (release b17.1).
+A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles,
+links and runs on Windows-nt, using Cygnus' gnu port (release b17.1).
I (JCN) only had to make a minor workaround for missing library calls.
-Have a look at http://www.cygnus.com/gnu-win32. To make GNU LilyPond type
-C<make $OSTYPE>. (I am not promising to maintain this platform, it is just
-that when having to use doze, i-m sometimes too lazy to reboot.)
+Have a look at http://www.cygnus.com/gnu-win32. To make GNU LilyPond
+type C<make>. (I am not promising to maintain this platform, it is just
+that when forced into doze, i'm sometimes too lazy to reboot.)
A.2: I haven't had time to find a GCC crosscompiler (I<with> g++ and
-libg++, mind you) to DOS/win (in rpm, please :-)
+libg++, mind you) to DOS/Windows (in rpm, please :-)
-Q: I-m dozed enough to run the (sometimes bit stale) .exe-s you distribute.
+Q: I just love to blindly run the (sometimes bit stale) .exe's you distribute.
Why do i need cygwin.dll?
-A: It-s all in this cut-n-paste:
+A: It's all in this cut-n-paste:
Minimalist GNU-Win32 Readme
version 0.1.3
Random ranting about the GNU Music project.
-=head2 Note
+=head2 History of the GNU Music Project
-The GNU Music project was started by a few people (among others Robert Strandh,
-Robert.Strandh@labri.u-bordeaux.fr), who wanted to create free software
-for music printing and composing. After its initiation, its
-development efforts slowed down.
+Please note that this all happened when I wasn't around yet. If you
+think that I am a biased, unfair, predisposed hypocrite, then don't
+bother flaming me; I already know that.
-Independently, I started LilyPond. When I showed it to
+The GNU Music project is a project which aims to create free software
+for music printing and composing. It was started in november '92 by a
+core team of four members (Bryan Ford <baford@cs.utah.edu>, David Linn
+<drl@vuse.vanderbilt.edu>, Francois Pinard <pinard@iro.umontreal.ca>,
+Neil Jerram <nj104@cus.cam.ac.uk> and in January '93 Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> joined.
+
+After serious disputes with Robert Strandh
+<Robert.Strandh@labri.u-bordeaux.fr> and the FSF staff in '94, the
+project core team got divided. The development efforts of GMP stopped.
+
+Independently, I (HWN) started LilyPond. When I showed it to
RMS, he was very enthousiastic about having LilyPond in the GNU
project. I subsequently learned about the GNU Music project, and
-contacted them. We (the GNU Music project people and us, LilyPond
-people) agreed that cooperation would be desirable. Although merging
-of both efforts is technically infeasible at this point, we did decide
-that LilyPond should also be part of the GNU Music project (when it is
-really released).
-
-In summary, LilyPond is part of the GNU project, and part of the (yet
-to be created) GNU Music project. LilyPond 's existence does not mean
-that other efforts for free music tools have come to a halt. In
-particular, the following document is entirely mine, and is not meant
-to reflect anyone else's opinion.
+contacted them.
+
+What was left of the GMP (Robert Strandh) and us, LilyPond people,
+agreed that cooperation would be desirable. Although merging of both
+efforts was and is technically infeasible, we did decide that LilyPond
+should also be part of the GNU Music project.
+
+Only later did I discover the previous quarrels about the GMP-"take
+1". To show that I am aware of the history, and to make sure nobody
+gets me wrong or is angry at me because I stole a project or a
+project's name, I wrote this note.
+
+In summary, LilyPond is now the only substantial embodiment of the GNU Music
+Project, and it is part of the GNU project.
+
+For completeness' sake, I will mention the other efforts here:
+
+=over 4
+
+=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
+
+An alpha version notation editor for X in Scheme. Source available on
+request.
+
+=item GNU music,
+
+An alpha version of a music editing system with Musictex
+output. Pretest versions of GNU Music (v0.3) can still be obtained from
+Francois Pinard.
+
+=back
+
+This history note is probably biased in some way, because I wrote it.
+The rest of this document is also entirely mine, and is not meant to
+reflect anyone else's opinion.
=head1 GOAL
=back
-Music publishers make lots of money out of selling sheet music which
-is in the public domain (the composers died a long time ago). It is
-usually prohibited to xerox the sheet music. Publishers have two
-arguments to justify this policy: the high prices are there to guarantee
-diversity (keeping lots of stock is expensive), and to encourage new
-work being composed.
-
-LilyPond addresses the first issue: storing mudelas takes up almost no
-space at all. Other systems should address the other issue:
-encouraging laymen to take up composing, in the same way that GNU
-tools have created a whole new generation of programmers.
-
-The public deserves to get public domain music for free (zero cents).
+These systems should encourage laymen to take up composing, in the
+same way that GNU tools have created a whole new generation of
+programmers.
The public deserves free tools for composing and printing.
-In general, the same arguments as for software hold for music. See
-Stallmans articles on free software.
-
=head1 REQUIREMENTS
which can display clear notewriting in (say) an X-window
-G-Sharp is there, but far from finished. Ideally the system should
-cooperate with the typesetting engine
+Ideally the system should cooperate with the typesetting engine
=item An ASCII language
(difficult) A system to generate accompaniments, figured bass,
automatic accompaniment, etc.
-=item An internet archive of free music
-
-The complete works by Bach, Beethoven, and any other ancient composer
-should be electronically retrievable. This might be a separate
-project: the Free Music Project.
=back
visual or auditive output: it can typeset formatted sheet music to a
TeX file and and (mechanical) performances to MIDI files.
+This is not a Fanmail/Hype page. These pages were entirely created from
+the LilyPond package-sources
+
=head2 Examples
<a href=example_output.html
</a
>
+=item *
+<a href=mutopia.html
+>
+Mutopia -- Music To the People
+</a
+>
+
+
=item *
<a href=ANNOUNCE.txt
>
>
=item *
-<a href=lilygut.html
+<a href=internals.html
>
internal structures.
</a
=over 5
=item *
-<a href=lilyliterature.html
+<a href=literature.html
>
Papers, books and online-resources on music typesetting
</a
--- /dev/null
+=head1 NAME
+
+LilyGuts - doco to the internals of GNU LilyPond
+
+=head1 DESCRIPTION
+
+This page documents some aspects of the internals of GNU LilyPond. Some of
+this stuff comes from e-mail I wrote, some from e-mail others wrote,
+some are large comments taken away from the headers. This is why this
+page may be a little incoherent.
+
+You should use doc++ to take a peek at the sources.
+
+This should become a Hacking-HOWTO. If you find any confusing stuff
+here, let me know. I am a hacker, and don't spend enough time doccing
+what I write. (Most stuff here which refers to the code is slightly outdated)
+
+If you finally have mastered some internal piece of lily, your
+explanation could be added here.
+
+=head1 OVERVIEW
+
+GNU LilyPond is a "multi-pass" system. The different passes have been
+created so that they do not depend on each other. In a later stage
+some parts may be moved into libraries, or seperate programs, or they
+might be integrated in larger systems.
+
+=over 4
+
+=item Parsing:
+
+No difficult algorithms. The .ly file is read, and converted to a list
+of C<Scores>, which each contain C<Music> and paper/midi-definitions.
+
+=item Creating elements
+
+The music is walked column by column. The iterators which do the
+walking report the Request to Translators which use this information
+to create elements, either MIDI or "visual" elements. The translators
+form a hierarchy; the ones for paper output are Engravers, for MIDI
+Performers).
+
+The translators swallow requests, create elements, broadcast them to
+other translators on higher or same level in the hierarchy:
+
+The stem of a voice A is broadcast to the staff which contains A, but
+not to the noteheads of A, and not to the stems, beams and noteheads
+of a different voice (say B) or a different staff. The stem and
+noteheads of A are coupled, because the the Notehead_engraver
+broadcasts its heads, and the Stem catches these.
+
+The engraver which agrees to handle a request decides whether to to
+honor the request, ignore it, or merge it with other requests. Merging
+of requests is preferably done with other requests done by members of
+the same voicegroups (beams, brackets, stems). In this way you can put
+the voices of 2 instruments in a conductor's score so they make chords
+(the Stem_reqs of both instruments will be merged).
+
+=item Prebreaking
+
+Breakable stuff (eg. clefs and bars) are copied into pre and postbreaks.
+
+=item Preprocessing
+
+Some dependencies are resolved, such as the direction of stems, beams,
+and "horizontal" placement issues (the order of clefs, keys etc,
+placement of chords in multi-voice music),
+
+=item Break calculation:
+
+The lines and horizontal positions of the columns are determined.
+
+=item Breaking
+
+Through some magical interactions with Line_of_score and Super_elem
+(check out the source) the "lines" are produced.
+
+All other spanners can figure across which lines they are spread. If
+applicable, they break themselves into pieces. After this, each piece
+(or, if there are no pieces, the original spanner itself) throws out
+any dependencies which are in the wrong line.
+
+=item Postprocesing:
+
+Some items and all spanners need computation after the PCol positions
+are determined. Examples: slurs, vertical positions of staffs.
+
+=item Output paper
+
+=back
+
+=head1 INTERNALS
+
+This chapter deals with the internals of Mudela.
+
+=head2 Requests
+
+As you can see, most information is stored in the form of a request.
+In music typesetting, the user might want to cram a lot more symbols
+on the paper than actually fits. To reflect this idea (the user asks
+more than we can do), the container for this data is called Request.
+
+In a lot of other formats this would be called an 'Event'
+
+=over 4
+
+=item C<Barcheck_req>
+
+Checks during music processing if start of this voice element
+coincides with the start of a measure. Handy to check if you left out
+some voice elts.
+
+=item C<Note_req>
+
+LilyPond has to decide if the ball should be hanging left or
+right. This influences the horizontal dimensions of a column, and this
+is why request processing should be done before horizontal spacing.
+
+Other voices' frivolities may cause the need for accidentals, so this
+is also for the to decide. The engraver can decide on positioning based on
+ottava commands and the appropriate clef.
+
+=item C<Rest_req>
+
+Typeset a rest.
+
+=item C<Span_req>
+
+This type of request typically results in the creation of a C<Spanner>
+
+=item C<Beam_req>
+
+Start/stop a beam.
+
+Engraver has to combine this request with the stem_request, since the
+number of flags that a stem wants to carry will determine the
+number of beams.
+
+=item C<Dynamic>
+
+Each dynamic is bound to one note (a crescendo spanning multiple
+notes is thought to be made of two "dynamics": a start and a stop).
+Dynamic changes can occur in a smaller time than the length of its
+note, therefore fore each C<Dynamic> request carries a time, measured
+from the start of its note.
+
+=head2 Voice groups
+
+Voice group is a (time-dependent) collection of voices which share
+some characteristics (slurs, stems) at some time.
+
+=head1 Request_engraver
+
+In the previous section the idea of Request has been explained, but
+this only solves one half of the problem. The other half is
+deciding which requests should be honored, which should merged with
+other requests, and which should be ignored. Consider this (pseudo)input
+
+ < % chord
+ \music { [c() c] }
+ \music { [e() e] }
+ >
+
+Both the c and e are part of a chord (they are in the same
+Voice_group), so they should share the beams, and the two [ ] pairs
+should be merged. The slurs OTOH are specific for each voice, so they
+should not be shared.
+
+The judge in this "allocation" problem a set of broker. It uses the
+C<Request_engraver> to do most of the work. For each request
+C<Complex_staff> queries so-called C<Request_engraver>s if they want
+to accept a request eg, the C<Notehead_engraver> will accept
+C<Note_req>s, and turn down C<Slur_req>s. If the Music_iterator
+cannot find a engraver that wants the request, it is junked (with a
+warning message).
+
+After all requests have been either assigned, or junked, the Engraver
+will process the requests (which usually means creating an C<Item> or
+C<Spanner>). If a C<Request_engraver> creates something, it tells
+If all requests have been processed, then each Engraver is notified
+of any created Score_element, via a broadcasting system.
+
+=head2 example:
+
+ c4
+
+produces:
+
+ note_request (duration 1/4)
+ stem_request (duration 1/4)
+
+note_request will be taken by a C<Notehead_engraver>, stem_request
+will be taken by a C<Stem_beam_engraver>. C<Notehead_engraver> creates
+a C<Notehead>, C<Stem_beam_engraver> creates a C<Stem>. Both announce
+this to the Staff_engraver. Staff_engraver will tell
+C<Stem_beam_engraver> about the C<Notehead>, which will add the
+C<Notehead> to the C<Stem> it just created.
+
+To decide on merging, several engravers have been grouped. Please
+check F<init/engraver.ly>.
+
+
+=head1 ITEMS and SPANNERS
+
+The symbols that are printed, are generated by items and spanners
+(staff-elements). An item has one horizontal position, whereas a
+spanner spans several columns.
+
+=head1 DEPENDENCIES
+
+In music symbols depend on each other: the stems of a beam should
+point in the same direction as the beam itself, so the stems of a beam
+depend on the beam. In the same way do scripts depend on the direction
+of the stem. To reflect this, LilyPond has the notion of dependency.
+It works in the same fashion that C<make> uses to build programs: before
+a stem is calculated, its dependencies (the beam) should be
+calculated. Before a slur is calculated, its dependencies (stems, noteheads)
+should be calculated.
+
+=head1 BREAKING
+
+So what is this PREBREAK and POSTBREAK stuff?
+
+Let's take text as an example. In German some compound
+words change their spelling if they are broken: "backen" becomes
+"bak-ken". TeX has a mechanism to deal with this, you would define
+the spelling of "backen" in TeX in this way
+
+ \discretionary{bak-}{ken}{backen}
+
+These 3 arguments are called "prebreak", "postbreak" and "nobreak"
+text.
+
+The same problem exists when typesetting music. If a line of music is
+broken, the next line usually gets a clef. So in TeX terms, the clef
+is a postbreak. The same thing happens with meter signs: Normally the
+meter follows the bar. If a line is broken at that bar, the bar along
+with the meter stays on the "last" line, but the next line also gets a
+meter sign after the clef. Using the previous notation,
+
+ \discretionary{bar meter}{clef meter}{ bar meter }
+
+In GNU Lilypond, we have the same concepts (and the same
+terminology). Each (nonrhythmic) symbol is typeset in a nonrhythmic column
+At a breakpoint, multiple symbols are printed; symbols to be printed
+if the line is not broken, symbols to appear on the previous line, and
+on the next line if it is broken.
+
+=head1 SPACING
+
+
+Some terminology: I call a vertical group of symbols (notes) which
+start at the same time a "column". Each line of a score has notes in
+it, grouped in columns. The difference in starting time between those
+columns makes it possible to determine ideal distances between those
+columns.
+
+Example:
+
+ time ----->
+
+ cols: col1 col2 col3 col4
+
+
+ voice1 1 1
+
+ voice2 2 2 2 2
+
+
+ (1 is a whole note, 2 a half note.)
+
+ time_difference (col1 , col2) = 0.5 wholes,
+ time_difference (col1 , col3) = 1 wholes,
+ time_difference (col2 , col3) = 0.5 wholes,
+ etc.
+
+these differences are translated into ideal distances
+
+ distance (col1,col2) = 10 pt
+ distance (col1,col3) = 14.1 pt
+ distance (col2,col3) = 10 pt
+ etc.
+
+as you can see, these distance are conflicting. So instead of
+satisfying all those ideals simultaneously, a compromise is sought.
+
+This is Columbus' egg: GNU LilyPond attaches "springs" to each
+column-pair. each spring has an equilibrium-position which is equal to
+the above mentioned distance, so
+
+spring (col1, col2) and spring (col2,col3) try to push column 1
+and 3 away (to a distance of 20pt) from each other, whereas the spring
+between col 1 and col 3 tries to pull those two together (to a
+distance of 14.1 pt). The net result of this pushing and pulling is an
+equilibrium situation (the pushing cancels the pulling), which can be
+calculated as the solution of Quadratic program: it is the solution
+with minimum potential energy, for you physicists out there.
+
+This algorithm for doing one line, gives a "badness" parameter for
+each line (the potential energy). Now one can use TeX's algorithm for
+making paragraphs (using this new version of "badness"): one should
+try to minimise the overall badness of a paragraph. GNU LilyPond also
+uses the concept of pre- and post-breaks.
+
+(actually, it is a bit more complicated: each column also has a
+minimum distance to other columns, to prevent symbols from running
+into symbols of other columns.)
+
+
+=head1 SPACING 2
+
+
+This of course does not solve the problem of generating the
+springs. This is an area that needs a lot of work, and the optimal
+solution to find is not of a mathematical nature.
+
+Gourlay's solution is used.
+
+
+++ /dev/null
-=head1 NAME
-
-LilyGuts - doco to the internals of GNU LilyPond
-
-=head1 DESCRIPTION
-
-This page documents some aspects of the internals of GNU LilyPond. Some of
-this stuff comes from e-mail I wrote, some from e-mail others wrote,
-some are large comments taken away from the headers. This is why this
-page may be a little incoherent.
-
-You should use doc++ to take a peek at the sources.
-
-This should become a Hacking-HOWTO. If you find any confusing stuff
-here, let me know. I am a hacker, and don't spend enough time doccing
-what I write. (Most stuff here which refers to the code is slightly outdated)
-
-If you finally have mastered some internal piece of lily, your
-explanation could be added here.
-
-=head1 OVERVIEW
-
-GNU LilyPond is a "multi-pass" system. The different passes have been
-created so that they do not depend on each other. In a later stage
-some parts may be moved into libraries, or seperate programs, or they
-might be integrated in larger systems.
-
-=over 4
-
-=item Parsing:
-
-No difficult algorithms. The .ly file is read, and converted to a list
-of C<Scores>, which each contain C<Music> and paper/midi-definitions.
-
-=item Creating elements
-
-The music is walked column by column. The iterators which do the
-walking report the Request to Translators which use this information
-to create elements, either MIDI or "visual" elements. The translators
-form a hierarchy; the ones for paper output are Engravers, for MIDI
-Performers).
-
-The translators swallow requests, create elements, broadcast them to
-other translators on higher or same level in the hierarchy:
-
-The stem of a voice A is broadcast to the staff which contains A, but
-not to the noteheads of A, and not to the stems, beams and noteheads
-of a different voice (say B) or a different staff. The stem and
-noteheads of A are coupled, because the the Notehead_engraver
-broadcasts its heads, and the Stem catches these.
-
-The engraver which agrees to handle a request decides whether to to
-honor the request, ignore it, or merge it with other requests. Merging
-of requests is preferably done with other requests done by members of
-the same voicegroups (beams, brackets, stems). In this way you can put
-the voices of 2 instruments in a conductor's score so they make chords
-(the Stem_reqs of both instruments will be merged).
-
-=item Prebreaking
-
-Breakable stuff (eg. clefs and bars) are copied into pre and postbreaks.
-
-=item Preprocessing
-
-Some dependencies are resolved, such as the direction of stems, beams,
-and "horizontal" placement issues (the order of clefs, keys etc,
-placement of chords in multi-voice music),
-
-=item Break calculation:
-
-The lines and horizontal positions of the columns are determined.
-
-=item Breaking
-
-Through some magical interactions with Line_of_score and Super_elem
-(check out the source) the "lines" are produced.
-
-All other spanners can figure across which lines they are spread. If
-applicable, they break themselves into pieces. After this, each piece
-(or, if there are no pieces, the original spanner itself) throws out
-any dependencies which are in the wrong line.
-
-=item Postprocesing:
-
-Some items and all spanners need computation after the PCol positions
-are determined. Examples: slurs, vertical positions of staffs.
-
-=item Output paper
-
-=back
-
-=head1 INTERNALS
-
-This chapter deals with the internals of Mudela.
-
-=head2 Requests
-
-As you can see, most information is stored in the form of a request.
-In music typesetting, the user might want to cram a lot more symbols
-on the paper than actually fits. To reflect this idea (the user asks
-more than we can do), the container for this data is called Request.
-
-In a lot of other formats this would be called an 'Event'
-
-=over 4
-
-=item C<Barcheck_req>
-
-Checks during music processing if start of this voice element
-coincides with the start of a measure. Handy to check if you left out
-some voice elts.
-
-=item C<Note_req>
-
-LilyPond has to decide if the ball should be hanging left or
-right. This influences the horizontal dimensions of a column, and this
-is why request processing should be done before horizontal spacing.
-
-Other voices' frivolities may cause the need for accidentals, so this
-is also for the to decide. The engraver can decide on positioning based on
-ottava commands and the appropriate clef.
-
-=item C<Rest_req>
-
-Typeset a rest.
-
-=item C<Span_req>
-
-This type of request typically results in the creation of a C<Spanner>
-
-=item C<Beam_req>
-
-Start/stop a beam.
-
-Engraver has to combine this request with the stem_request, since the
-number of flags that a stem wants to carry will determine the
-number of beams.
-
-=item C<Dynamic>
-
-Each dynamic is bound to one note (a crescendo spanning multiple
-notes is thought to be made of two "dynamics": a start and a stop).
-Dynamic changes can occur in a smaller time than the length of its
-note, therefore fore each C<Dynamic> request carries a time, measured
-from the start of its note.
-
-=head2 Voice groups
-
-Voice group is a (time-dependent) collection of voices which share
-some characteristics (slurs, stems) at some time.
-
-=head1 Request_engraver
-
-In the previous section the idea of Request has been explained, but
-this only solves one half of the problem. The other half is
-deciding which requests should be honored, which should merged with
-other requests, and which should be ignored. Consider this (pseudo)input
-
- < % chord
- \music { [c() c] }
- \music { [e() e] }
- >
-
-Both the c and e are part of a chord (they are in the same
-Voice_group), so they should share the beams, and the two [ ] pairs
-should be merged. The slurs OTOH are specific for each voice, so they
-should not be shared.
-
-The judge in this "allocation" problem a set of broker. It uses the
-C<Request_engraver> to do most of the work. For each request
-C<Complex_staff> queries so-called C<Request_engraver>s if they want
-to accept a request eg, the C<Notehead_engraver> will accept
-C<Note_req>s, and turn down C<Slur_req>s. If the Music_iterator
-cannot find a engraver that wants the request, it is junked (with a
-warning message).
-
-After all requests have been either assigned, or junked, the Engraver
-will process the requests (which usually means creating an C<Item> or
-C<Spanner>). If a C<Request_engraver> creates something, it tells
-If all requests have been processed, then each Engraver is notified
-of any created Score_element, via a broadcasting system.
-
-=head2 example:
-
- c4
-
-produces:
-
- note_request (duration 1/4)
- stem_request (duration 1/4)
-
-note_request will be taken by a C<Notehead_engraver>, stem_request
-will be taken by a C<Stem_beam_engraver>. C<Notehead_engraver> creates
-a C<Notehead>, C<Stem_beam_engraver> creates a C<Stem>. Both announce
-this to the Staff_engraver. Staff_engraver will tell
-C<Stem_beam_engraver> about the C<Notehead>, which will add the
-C<Notehead> to the C<Stem> it just created.
-
-To decide on merging, several engravers have been grouped. Please
-check F<init/engraver.ly>.
-
-
-=head1 ITEMS and SPANNERS
-
-The symbols that are printed, are generated by items and spanners
-(staff-elements). An item has one horizontal position, whereas a
-spanner spans several columns.
-
-=head1 DEPENDENCIES
-
-In music symbols depend on each other: the stems of a beam should
-point in the same direction as the beam itself, so the stems of a beam
-depend on the beam. In the same way do scripts depend on the direction
-of the stem. To reflect this, LilyPond has the notion of dependency.
-It works in the same fashion that C<make> uses to build programs: before
-a stem is calculated, its dependencies (the beam) should be
-calculated. Before a slur is calculated, its dependencies (stems, noteheads)
-should be calculated.
-
-=head1 BREAKING
-
-So what is this PREBREAK and POSTBREAK stuff?
-
-Let's take text as an example. In German some compound
-words change their spelling if they are broken: "backen" becomes
-"bak-ken". TeX has a mechanism to deal with this, you would define
-the spelling of "backen" in TeX in this way
-
- \discretionary{bak-}{ken}{backen}
-
-These 3 arguments are called "prebreak", "postbreak" and "nobreak"
-text.
-
-The same problem exists when typesetting music. If a line of music is
-broken, the next line usually gets a clef. So in TeX terms, the clef
-is a postbreak. The same thing happens with meter signs: Normally the
-meter follows the bar. If a line is broken at that bar, the bar along
-with the meter stays on the "last" line, but the next line also gets a
-meter sign after the clef. Using the previous notation,
-
- \discretionary{bar meter}{clef meter}{ bar meter }
-
-In GNU Lilypond, we have the same concepts (and the same
-terminology). Each (nonrhythmic) symbol is typeset in a nonrhythmic column
-At a breakpoint, multiple symbols are printed; symbols to be printed
-if the line is not broken, symbols to appear on the previous line, and
-on the next line if it is broken.
-
-=head1 SPACING
-
-
-Some terminology: I call a vertical group of symbols (notes) which
-start at the same time a "column". Each line of a score has notes in
-it, grouped in columns. The difference in starting time between those
-columns makes it possible to determine ideal distances between those
-columns.
-
-Example:
-
- time ----->
-
- cols: col1 col2 col3 col4
-
-
- voice1 1 1
-
- voice2 2 2 2 2
-
-
- (1 is a whole note, 2 a half note.)
-
- time_difference (col1 , col2) = 0.5 wholes,
- time_difference (col1 , col3) = 1 wholes,
- time_difference (col2 , col3) = 0.5 wholes,
- etc.
-
-these differences are translated into ideal distances
-
- distance (col1,col2) = 10 pt
- distance (col1,col3) = 14.1 pt
- distance (col2,col3) = 10 pt
- etc.
-
-as you can see, these distance are conflicting. So instead of
-satisfying all those ideals simultaneously, a compromise is sought.
-
-This is Columbus' egg: GNU LilyPond attaches "springs" to each
-column-pair. each spring has an equilibrium-position which is equal to
-the above mentioned distance, so
-
-spring (col1, col2) and spring (col2,col3) try to push column 1
-and 3 away (to a distance of 20pt) from each other, whereas the spring
-between col 1 and col 3 tries to pull those two together (to a
-distance of 14.1 pt). The net result of this pushing and pulling is an
-equilibrium situation (the pushing cancels the pulling), which can be
-calculated as the solution of Quadratic program: it is the solution
-with minimum potential energy, for you physicists out there.
-
-This algorithm for doing one line, gives a "badness" parameter for
-each line (the potential energy). Now one can use TeX's algorithm for
-making paragraphs (using this new version of "badness"): one should
-try to minimise the overall badness of a paragraph. GNU LilyPond also
-uses the concept of pre- and post-breaks.
-
-(actually, it is a bit more complicated: each column also has a
-minimum distance to other columns, to prevent symbols from running
-into symbols of other columns.)
-
-
-=head1 SPACING 2
-
-
-This of course does not solve the problem of generating the
-springs. This is an area that needs a lot of work, and the optimal
-solution to find is not of a mathematical nature.
-
-Gourlay's solution is used.
-
-
+++ /dev/null
-=head1 NAME
-
-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.
-
-[Personal comments appear in brackets. What I (HWN) know, I've
-commented myself. They are just my personal comments, not to be taken
-too seriously]
-
-=head2 Music engraving: references
-
-Helene Wanske. ``Musiknotation --- Von der Syntax des Notenstichs 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 HWN]
-
-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.
-
-Ted Ross. ``Teach yourself the art of music engraving and processing''
-(3rd edition). Hansen House, Miami Beach, FLorida.
-
-[This is about I<engraving> i.e. professional music typesetting, and
-includes some good spacing tables MB]
-
-Gardner Read. ``Modern Rhythmic Notation.'' Indiana University Press,
-1978.
-
-Gardner Read. ``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. MB]
-
-K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle
-Verlag, Vienna 1948
-
-MPA. Standard music notation specifications for computer programming.
-December 1996
-
-[Pamphlet explaining some fine points in music font design HWN]
-
-
-=head2 Notation with computers
-
-Donald Byrd. ``Music Notation by Computer''. Dissertation Indiana
-University, 1985.
-
-Donald Byrd. ``A System for Music Printing by Computer.'' Computers
-and the Humanities, 8 (1974), 161-72.
-
-Leland Smith. ``Editing and Printing Music by Computer.'' Journal of
-Music Theory, 17 (1973), 292-309.
-
-[If I remember correctly, this was concerned more with an input
-language than with the typography. SP.]
-
-David A Gomberg. ``A Computer-Oriented System for Music Printing.''
-Dissertation Washington University. 1975.
-
-Walter B Hewlett. and Eleanor Selfridge-Field. ``Directory of Computer
-Assisted Research in Musicology''. Menlo Park, CA: Center for Computer
-Assisted Research in the Humanities.
-
-[Annual editions since 1985, many containing surveys of music
-typesetting technology. SP]
-
-David A. Gomberg; ``A Computer-oriented System for Music Printing.''
-Computers and the Humanities, Vol.11, pp 63-80.
-
-John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
-OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
-The Ohio State University, 1987.
-
-[Algorithm for generating spacing in one line of (polyphonic) music,
-tailored for use with MusiCopy. LilyPond uses a variant of it (as of
-pl 76) HWN]
-
-Allen Parish, Wael A. Hegazy, John S. Gourlay, Dean K. Roush and
-F. Javier Sola. ``MusiCopy: An automated Music Formatting System''.
-Technical Report OSU-CISRC-10/87-TR29, Department of Computer and
-Information Science, The Ohio State University, 1987.
-
-[A brief overview of MusiCopy HWN]
-
-John S. 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.
-
-[This paper discusses the development of algorithms for the formatting
-of musical scores (from abstract). It also appeared at PROTEXT III,
-Ireland 1986]
-
-Wael A. 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.
-
-[Describes the "parser" which converts MusiCopy MDL to MusiCopy
-Simultaneities & columns HWN]
-
-Wael A. Hegazy and John S. Gourlay. ``Optimal line breaking in
-music''. Technical Report OSU-CISRC-8/87-TR33, Department of Computer
-and Information Science, The Ohio State University, 1987
-
-[This generalizes TeX's breaking algorithm to music. It also appeared in
-Document Manipulation and Typography, J.C. van Vliet (ed) 1988. HWN]
-
-Dean K. Roush. ``Using MusiCopy''. Technical Report
-OSU-CISRC-18/87-TR31, Department of Computer and Information Science,
-The Ohio State University, 1987
-
-[User manual of MusiCopy. Includes an impressive example piece. HWN.]
-
-A. Parrish and John S. Gourlay. ``Computer Formatting of Musical
-Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department of
-Computer and Information Science, The Ohio State University, 1987.
-
-[Placement of balls, stems, dots which occur at the same moment
-("Simultaneity") HWN]
-
-D. Roush. ``Music Formatting Guidelines,'' Technical Report
-OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
-The Ohio State University, 1988.
-
-[Rules on formatting music formulated for use in computers HWN]
-
-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.
-
-[Overview of a procedure for generating slurs HWN]
-
-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.
-
-[Calculating beam slopes HWN]
-
-John. S. Gourlay. ``A language for music printing'', Communications
-of the ACM, Vol. 29(5), 388--401, 1986.
-
-[This paper describes the MusiCopy musicsetting system and an input
-language to go with it. HWN]
-
-Dorothea Blostein and Lippold 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 HWN]
-
-Lippold Haken and Dorothea 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 older (before
-0.0.68pre) LilyPond data structures somewhat) HWN]
-
-Lippold Haken and Dorothea 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. HWN]
-
-Dorothea Blostein and Lippold 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. HWN]
-
-Gary M. Rader. ``Creating Printed Music Automatically''. Computer Vol
-29(6), June 1996, pp 61--69.
-
-[Describes a system called MusicEase, and explains that it uses
-"constraints" (which go unexplained) to automatically position various
-elements. HWN]
-
-Stephen Dowland Page. ``Computer Tools for Music Information
-Retrieval''. Dissertation University of Oxford, 1988.
-
-[Don't ask Stephen for a copy. Write to the Bodleian Library, Oxford,
-or to the British Library, instead. SP]
-
-Ren\'e Roelofs. ``Een Geautomatiseerd Systeem voor het Afdrukken van
-Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
-universiteit Rotterdam, 1991. (``An automated system for printing
-music'' Master's Thesis Managerial Computer Science.)
-
-[This dutch thesis describes a simplistic (monophonic) typesetting system,
-and focuses on the breaking algorithm, which is taken from Hegazy &
-Gourlay HWN]
-
-Miguel Filgueiras and Jos\'e Paulo Leal. ``Representation and
-manipulation of music documents in SceX''. Electronic Publishing,
-vol. 6 (4), 507--518, 1993.
-
-Eric Foxley, Music --- A language for typesetting music scores.
-Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
-
-[A paper on a TROFF preprocessor to typeset music. The output shown is
-not very sophisticated, and contains some typographical atrocities HWN]
-
-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.
-
-=head2 Engraving: further reading
-
-Herbert Chlapik. ``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 HWN]
-
-The University of Colorado Music Engraving page.
-http://obenamots.cc.colorado.edu/Musicpress/engraving.html
-
-Anthony Donato. Preparing Music Manuscript. Englewood Cliffs:
-Prentice-Hall, 1963.
-
-Donemus. ``Uitgeven van muziek''. Donemus Amsterdam, 1900
-
-George Heussenstamm. The Norton Manual of Music Notation. New York:
-Norton, 1987.
-
-Erdhard Karkoshka. ``Notation in New Music. Trans. Ruth
-Koenig''. Praeger Publishers, New York, 1972. Out of print.
-
-C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
-(CA), 1973.
-
-Glen Rosecrans. Music Notation Primer. New York: Passantino, 1979.
-
-Kurt Stone. Music Notation in the Twentieth Century. New York: Norton,
-1980.
-
-
-=head2 Other stuff
-
-
-More on GNU Music:
-http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
-
-Peter S. Langston, ``Unix music tools at Bellcore''. Software ---
-Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
-
-[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 HWN]
-
-
-=head2 File formats
-
-Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
-
-Cindy Grande, NIFF6a Notation Interchange File Format. Grande
-Software Inc., 1995. ftp://blackbox.cartah.washington.edu/pub/,
-http://www.jtauber.com/music/encoding/niff/
-
-[Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN]
-
-SMDL, Standard Musical Description Language
-ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf
-
-MPDL,
-
-HMSL, Hierarchical Music Structured Language,
-
-DARMS,
-
-enigma,
-
-SCORE,
-
-
-=head1 AUTHORS
-
-References and comments contributed by Han-Wen Nienhuys (HWN), Miguel
-Filgueiras, Mark Basinski (MB), Dorothea Blostein, Stephen Page (SP),
-Jan Nieuwenhuizen, Peter Kerr.
-
-This should really be redone in BibTeX
-
GNU LilyPond is a program which converts music definition files into
visual or auditive output: it can typeset formatted sheet music to a
-TeX file and and (mechanical) performances to MIDI files.
+TeX file and play (mechanical) performances to MIDI files.
=head1 OPTIONS
=item B<-M,--midi>
-do midi output only
+do midi output only.
=item B<-d,--debug>,
-Turn debugging info. GNU LilyPond will read the file F<.dstreamrc>, which
-tells for what functions and classes may produce copious debugging
+Turn debugging info on. GNU LilyPond reads the file F<.dstreamrc>,
+which lists what functions and classes may produce copious debugging
output.
=item B<-w,--warranty>,
=item B<-h,--help>,
-Show a summary of usage
+Show a summary of usage.
=item B<-i,--init=>F<FILE>
-set init file to F<FILE> (default: F<symbol.ly>)
+set init file to F<FILE> (default: F<symbol.ly>).
=item B<--include, -I>=F<DIRECTORY>
=item B<--ignore-version, -V>
-make incompatible mudela version non-fatal
+make incompatible mudela version non-fatal.
=back
=head1 FEATURES
-This is an overview of the features that GNU LilyPond supports. For
-details on how to use them, you should consult mudela(5)
+This is an overview of the features that GNU LilyPond supports. For
+details on how to use them, you should consult mudela(5).
=over 5
=item *
ASCII script input, with identifiers (for music reuse),
-customizable notenames, customizable fontset
+customizable notenames, customisable fontset.
=item *
=item *
-Multiple staffs in one score. Each staff can have a different meters.
+Multiple staffs in one score. Each staff can have a different meters.
=item *
=item *
multiple voices within one staff; beams optionally shared
-between voices. Up to four voices is handled cleanly.
+between voices. Up to four voices is handled cleanly.
=item *
-multiple scores within one input file. Each score is output to
+multiple scores within one input file. Each score is output to
a different file.
=item *
=head1 DISCLAIMER & COPYING POLICY
-GNU LilyPond is copyright 1996,97 by its authors. GNU LilyPond is
-distributed under the terms of the GNU General Public
-License. GNU LilyPond is provided without any warranty what so ever.
-GNU LilyPond may be freely distributed. For further information consult
-the GNU General Public License, which is in the file F<COPYING>
+GNU LilyPond is copyright 1996, 1997 by its authors. GNU LilyPond is
+distributed under the terms of the GNU General Public License. GNU LilyPond
+is provided without any warranty what so ever.
+GNU LilyPond may be freely distributed. For further information consult
+the GNU General Public License, from the file F<COPYING>.
=head1 AUTHORS
=head1 PROBLEMS
-There is an extensive list of todoes and bugs. See F<TODO>. In
+There is an extensive list of todoes and bugs. See F<TODO>. In
general, try to find out
=over 4
=item *
send a description of the LilyPond version you use (with
-compile/config options please)
+compile/configure options please)
=item *
send a description of the bug itself.
It does help if you can find out where the bug comes from: if GNU
LilyPond bombs out, then please recompile using with debugging info
-turned on, and send gdb stacktrace of the crash. It also helps if you
-can print the values of the objects. So if your trace is
+turned on, and send gdb stacktrace of the crash. It also helps if you
+can print the values of the objects. So if your trace is
received SIGSEGV
(gdb) backtrace 12
=item F<symbol.ly>
-The initialisation file with symbol tables etc. It
+The initialisation file with symbol tables etc. It
includes files from the directory F<init/>.
=back
=item mudela-man
-On the input format. This is a LilyPond-enhanced LaTeX document.
+On the input format. This is a LilyPond-enhanced LaTeX document.
=item MANIFESTO
=item http://www.stack.nl/~hanwen/lilypond/index.html
GNU LilyPond has her own webpage. This webpage contains the MIDI, GIF
-and PS files for some standard music files. It also has the complete
+and PS files for some standard music files. It also has the complete
LilyPond documentation
=back
GNU LilyPond is
updated very frequently, the latest version is always available at:
ftp://pcnov095.win.tue.nl/pub/lilypond and
-ftp://alpha.gnu.ai.mit.edu/gnu/
+ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/
For programs which are part of the GNU music project, the following
=item help-gnu-music@vuse.vanderbilt.edu
-For help with programs from the GNU music project. To subscribe: send
+For help with programs from the GNU music project. To subscribe: send
mail with subject "subscribe" to
help-gnu-music-request@vuse.vanderbilt.edu
=item bug-gnu-music@vuse.vanderbilt.edu
-If you have bugreports, you should send them to this list. If you want
+If you have bugreports, you should send them to this list. If you want
to read all bugreports, you should subscribe to this list. To
subscribe: send mail with subject "subscribe" to
bug-gnu-music-request@vuse.vanderbilt.edu
(for a detailed changelog, see F<NEWS>)
GNU LilyPond's roots lie in MPP, a preprocessor to the rather arcane
-MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen
+MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen
wrote the first 44 versions (0.01 to 0.44), then his program caught my
attention, and I was slowly sucked in to the interesting problem of
-easily producing beautifully printed music. I contributed some
-code. We soon realised that MPP's design was too fundamentally broken
+easily producing beautifully printed music. I contributed some
+code. We soon realised that MPP's design was too fundamentally broken
to be repaired, so it was decided to rewrite MPP. We debated a lot about
-the requirements to an inputformat (fall 1995). I sat down and started
+the requirements to an inputformat (fall 1995). I sat down and started
with a parser-first, bottom-up rewrite called mpp95 (which totally
failed, obviously).
After long and hard thinking, I came up with an algorithm for the
horizontal spacing of multiple staffs (april 1996) I coded it (and did
-not test it). After starting with this fundamental piece, I slowly
+not test it). After starting with this fundamental piece, I slowly
added the stages which come before spacing, and after. A half year
later, I had a first working version, (october 1996). I announced
Patchlevel 0.0.7 (or 8) to the mutex list after asking some technical
got the hang of it, and in the subsequent two months, I coded until it
had doubled in size (pl 23).
-Most the other history is described in the NEWS file. The first large
+Most the other history is described in the NEWS file. The first large
scale release (0.1) was done after approximately 78 patchlevels on
August 1, 1997.
LilyPond is part of the GNU Project started by the Free Software
Foundation to create a system of free software for the world-community
+=item http://www.zib.de/Visual/software/doc++/index.html
+
+The documentation system for C++ sources, which the LilyPond sources use.
+
+
=back
=head2 Ftp
=item ftp://ftp.redhat.com/pub/contrib/
-RedHat Software develops and markets a GNU/Linux distribution (of
-which we are avid users)
+The FTP site of RedHat Software.
+
=back
=item ftp://pcnov095.win.tue.nl/pub/lilypond
-=item ftp://alpha.gnu.ai.mit.edu/gnu/
+=item ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/
=back
=item info-gnu-music@vuse.vanderbilt.edu
-For information on the GNU Music project, to subscribe: send mail with
-subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu
+A moderated list for information on the GNU Music project, to
+subscribe: send mail with subject "subscribe" to
+info-gnu-music-request@vuse.vanderbilt.edu
=item help-gnu-music@vuse.vanderbilt.edu
For discussions concerning the GNU Music project, to subscribe: send
mail with subject "subscribe" to
-gnu-music-discuss-request@vuse.vanderbilt.edu,
+gnu-music-discuss-request@vuse.vanderbilt.edu
=back
Transcriptions of the music of Thomas Ravenscroft, partly using
LilyPond
+=item http://www.redhat.com/
+
+develops and markets a GNU/Linux distribution (of
+which we are avid users)
+
+
=back
--- /dev/null
+=head1 NAME
+
+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.
+
+[Personal comments appear in brackets. What I (HWN) know, I've
+commented myself. They are just my personal comments, not to be taken
+too seriously]
+
+=head2 Music engraving: references
+
+Helene Wanske. ``Musiknotation --- Von der Syntax des Notenstichs 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 HWN]
+
+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.
+
+Ted Ross. ``Teach yourself the art of music engraving and processing''
+(3rd edition). Hansen House, Miami Beach, FLorida.
+
+[This is about I<engraving> i.e. professional music typesetting, and
+includes some good spacing tables MB]
+
+Gardner Read. ``Modern Rhythmic Notation.'' Indiana University Press,
+1978.
+
+Gardner Read. ``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. MB]
+
+K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle
+Verlag, Vienna 1948
+
+MPA. Standard music notation specifications for computer programming.
+December 1996
+
+[Pamphlet explaining some fine points in music font design HWN]
+
+
+=head2 Notation with computers
+
+Donald Byrd. ``Music Notation by Computer''. Dissertation Indiana
+University, 1985.
+
+Donald Byrd. ``A System for Music Printing by Computer.'' Computers
+and the Humanities, 8 (1974), 161-72.
+
+Leland Smith. ``Editing and Printing Music by Computer.'' Journal of
+Music Theory, 17 (1973), 292-309.
+
+[If I remember correctly, this was concerned more with an input
+language than with the typography. SP.]
+
+David A Gomberg. ``A Computer-Oriented System for Music Printing.''
+Dissertation Washington University. 1975.
+
+Walter B Hewlett. and Eleanor Selfridge-Field. ``Directory of Computer
+Assisted Research in Musicology''. Menlo Park, CA: Center for Computer
+Assisted Research in the Humanities.
+
+[Annual editions since 1985, many containing surveys of music
+typesetting technology. SP]
+
+David A. Gomberg; ``A Computer-oriented System for Music Printing.''
+Computers and the Humanities, Vol.11, pp 63-80.
+
+John S. Gourlay. ``Spacing a Line of Music,'' Technical Report
+OSU-CISRC-10/87-TR35, Department of Computer and Information Science,
+The Ohio State University, 1987.
+
+[Algorithm for generating spacing in one line of (polyphonic) music,
+tailored for use with MusiCopy. LilyPond uses a variant of it (as of
+pl 76) HWN]
+
+Allen Parish, Wael A. Hegazy, John S. Gourlay, Dean K. Roush and
+F. Javier Sola. ``MusiCopy: An automated Music Formatting System''.
+Technical Report OSU-CISRC-10/87-TR29, Department of Computer and
+Information Science, The Ohio State University, 1987.
+
+[A brief overview of MusiCopy HWN]
+
+John S. 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.
+
+[This paper discusses the development of algorithms for the formatting
+of musical scores (from abstract). It also appeared at PROTEXT III,
+Ireland 1986]
+
+Wael A. 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.
+
+[Describes the "parser" which converts MusiCopy MDL to MusiCopy
+Simultaneities & columns HWN]
+
+Wael A. Hegazy and John S. Gourlay. ``Optimal line breaking in
+music''. Technical Report OSU-CISRC-8/87-TR33, Department of Computer
+and Information Science, The Ohio State University, 1987
+
+[This generalizes TeX's breaking algorithm to music. It also appeared in
+Document Manipulation and Typography, J.C. van Vliet (ed) 1988. HWN]
+
+Dean K. Roush. ``Using MusiCopy''. Technical Report
+OSU-CISRC-18/87-TR31, Department of Computer and Information Science,
+The Ohio State University, 1987
+
+[User manual of MusiCopy. Includes an impressive example piece. HWN.]
+
+A. Parrish and John S. Gourlay. ``Computer Formatting of Musical
+Simultaneities,'' Technical Report OSU-CISRC-10/87-TR28, Department of
+Computer and Information Science, The Ohio State University, 1987.
+
+[Placement of balls, stems, dots which occur at the same moment
+("Simultaneity") HWN]
+
+D. Roush. ``Music Formatting Guidelines,'' Technical Report
+OSU-CISRC-3/88-TR10, Department of Computer and Information Science,
+The Ohio State University, 1988.
+
+[Rules on formatting music formulated for use in computers HWN]
+
+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.
+
+[Overview of a procedure for generating slurs HWN]
+
+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.
+
+[Calculating beam slopes HWN]
+
+John. S. Gourlay. ``A language for music printing'', Communications
+of the ACM, Vol. 29(5), 388--401, 1986.
+
+[This paper describes the MusiCopy musicsetting system and an input
+language to go with it. HWN]
+
+Dorothea Blostein and Lippold 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 HWN]
+
+Lippold Haken and Dorothea 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 older (before
+0.0.68pre) LilyPond data structures somewhat) HWN]
+
+Lippold Haken and Dorothea 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. HWN]
+
+Dorothea Blostein and Lippold 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. HWN]
+
+Gary M. Rader. ``Creating Printed Music Automatically''. Computer Vol
+29(6), June 1996, pp 61--69.
+
+[Describes a system called MusicEase, and explains that it uses
+"constraints" (which go unexplained) to automatically position various
+elements. HWN]
+
+Stephen Dowland Page. ``Computer Tools for Music Information
+Retrieval''. Dissertation University of Oxford, 1988.
+
+[Don't ask Stephen for a copy. Write to the Bodleian Library, Oxford,
+or to the British Library, instead. SP]
+
+Ren\'e Roelofs. ``Een Geautomatiseerd Systeem voor het Afdrukken van
+Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus
+universiteit Rotterdam, 1991. (``An automated system for printing
+music'' Master's Thesis Managerial Computer Science.)
+
+[This dutch thesis describes a simplistic (monophonic) typesetting system,
+and focuses on the breaking algorithm, which is taken from Hegazy &
+Gourlay HWN]
+
+Miguel Filgueiras and Jos\'e Paulo Leal. ``Representation and
+manipulation of music documents in SceX''. Electronic Publishing,
+vol. 6 (4), 507--518, 1993.
+
+Eric Foxley, Music --- A language for typesetting music scores.
+Software --- Practice and Experience, Vol. 17(8), 485--502, 1987.
+
+[A paper on a TROFF preprocessor to typeset music. The output shown is
+not very sophisticated, and contains some typographical atrocities HWN]
+
+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.
+
+=head2 Engraving: further reading
+
+Herbert Chlapik. ``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 HWN]
+
+The University of Colorado Music Engraving page.
+http://obenamots.cc.colorado.edu/Musicpress/engraving.html
+
+Anthony Donato. Preparing Music Manuscript. Englewood Cliffs:
+Prentice-Hall, 1963.
+
+Donemus. ``Uitgeven van muziek''. Donemus Amsterdam, 1900
+
+George Heussenstamm. The Norton Manual of Music Notation. New York:
+Norton, 1987.
+
+Erdhard Karkoshka. ``Notation in New Music. Trans. Ruth
+Koenig''. Praeger Publishers, New York, 1972. Out of print.
+
+C. Roemer, The Art of Music Copying. Roerick music co., Sherman Oaks
+(CA), 1973.
+
+Glen Rosecrans. Music Notation Primer. New York: Passantino, 1979.
+
+Kurt Stone. Music Notation in the Twentieth Century. New York: Norton,
+1980.
+
+
+=head2 Other stuff
+
+
+Peter S. Langston, ``Unix music tools at Bellcore''. Software ---
+Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990.
+
+[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 HWN]
+
+
+=head2 File formats
+
+Tablature: http://wabakimi.carleton.ca/~phacket2/guitar/tabfaq.html
+
+Cindy Grande, NIFF6a Notation Interchange File Format. Grande
+Software Inc., 1995. ftp://blackbox.cartah.washington.edu/pub/,
+http://www.jtauber.com/music/encoding/niff/
+
+[Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN]
+
+SMDL, Standard Musical Description Language,
+ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf. ISO/IEC DIS 10743.
+
+[An ISO defined SGML language. A much more thorough treatment of music
+definition than Mudela (but not suited for manual entry). It deals
+with notation and perfomance issues by (basically) saying "You can
+embed a MIDI or NIFF file" (sic) HWN]
+
+MPDL,
+
+HMSL, Hierarchical Music Structured Language,
+
+DARMS,
+
+enigma,
+
+SCORE,
+
+
+=head1 AUTHORS
+
+References and comments contributed by Han-Wen Nienhuys (HWN), Miguel
+Filgueiras, Mark Basinski (MB), Dorothea Blostein, Stephen Page (SP),
+Jan Nieuwenhuizen, Peter Kerr.
+
+This should really be redone in BibTeX
+
=head1
DISCLAIMER & COPYING POLICY
-Mi2mu is copyright 1996,97 by its authors. Mi2mu is distributed
+Mi2mu is copyright 1996, 1997 by its authors. Mi2mu is distributed
as part of GNU LilyPond, under the terms of the GNU General Public
License. Mi2mu is provided without any warranty what so ever.
Mi2mu may be freely distributed. For further information consult
-the GNU General Public License, which is in the file F<COPYING>.
+the GNU General Public License, from the file F<COPYING>.
=head1 AUTHORS
\begin[verbatim]{mudela}
\score {
\melodic { % {...} is a voice
- c'4 g'4 % c and g are pitches, 4 is the duration (quaver)
+ c'4 g'4 % c and g are pitches, 4 is the duration
+ % (crotchet/quarter note)
c''4 ''c4 % c' is 1 octave up, 'c 1 down.
<c'4 g'4> % <...> is a chord
}
arrogantly) The Musical Definition Language or Mudela, for
short.\footnote{If anybody comes up with a better name, we'd gladly
take this. Gourlay already uses Musical Description Language,
- G-Sharp Score Definition Language. We're not being original here}
+ G-Sharp Score Definition Language. ISO standard 10743 defines a
+ Standard Music Description 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
You enter a note by giving the name and the reciprocal of the duration:
\begin[fragment,verbatim]{mudela}
-a'4 % dutch names
+a'4 % Dutch names
\end{mudela}
-is a A-1 pitched quaver. The ' signifies an octave change. A-1 is 440
+is a A-1 pitched crotchet. The ' signifies an octave change. A-1 is 440
Hz concert-pitch. \verb+c'+ is also known as the central c. More examples:
\begin[fragment,verbatim]{mudela}
The last one is an A flat, (just below 110 Hz concert-pitch). The \verb+*2/3+
signifies that this note is part of a triplet (3 in stead of 2). The
-duration is one and a half quaver (\verb+4.+) times 2/3.
+duration is one and a half quarter note (\verb+4.+) times 2/3.
Notenames are just a special kind of identifiers, and can be declared
for any language appropriate (see \file{init/dutch.ly}). The default language
-for notenames is defined to be dutch. In dutch, the notenames are
+for notenames is defined to be Dutch. In Dutch, the notenames are
a,b,c,d,e,f and g. Sharps are formed by adding the extension "is",
flats by adding ``es''
Mudela defines the following dynamic identifiers:
\begin{verbatim}
-ppp pp p mp mf df ff fff % df iso f, f is a notename.
+ppp pp p mp mf f ff fff
\end{verbatim}
and the following abbreviations:
\begin{verbatim}
In this example, the two oboe voices share one staff and are initially
in the voicegroup called "oboes". They will share beams, dynamics etc.
-After two quavers, oboeI "pushes" its group: a new voicegroup is
+After two quarter notes, oboeI "pushes" its group: a new voicegroup is
created, called "oboes+solo". The \verb+\group "-"+ command makes the
voice enter "oboes" again.
\end{verbatim}
Make the piece start with a partial measure [english translation?]
-lasting 1 3/4 quaver.
+lasting 1 3/4 quarter notes.
These commands are also "voice elements", and constitute simple mudela
(consisting of stuff with duration 0).
--- /dev/null
+=head1 NAME
+
+Mutopia project - manifesto
+
+=head1 DESCRIPTION
+
+Random ranting about the Mutopia project, aka "Music To the People."
+[Not yet finished, so this is unpolished]
+
+=head1 WHY
+
+Music publishers make lots of money out of selling sheet music which
+is in the public domain (the composers died a long time ago). It is
+usually prohibited to xerox the sheet music. Publishers have two
+arguments to justify this policy: the high prices are there to guarantee
+diversity (keeping lots of stock is expensive), and to encourage new
+work being composed.
+
+This is bad. Storing a Mudela file takes almost no space at all, and
+if sheet music could be had for free, then it would be much easier
+obtain less famous music. These composers have died long ago, and not
+having their music available only discourages people from
+experimenting with it. You deserve to get public domain music for
+free (zero cents)
+
+=head1 WHAT
+
+For literature, the project Gutenberg has an archive of public domain
+literary works. For music, this does not exist yet.
+
+We also need an archive of public domain sheet music; this is what we
+call The Mutopia Project.
+
+
+
=head2 Free packages (with source)
-=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp
-
-An alpha version notation editor for X in Scheme. Source available on
-request.
-
=item Rosegarden, http://www.bath.ac.uk/~masjpf/rose.html
A Notation editor/Sequencer for X (windows95 port underway). Outputs musictex.
instrumental music by Daniel Taupin, Ross Mitchell and Andreas
Egler. It includes a full-featured set of fonts.
-=item ABC2MTeX, http://www.gmd.de/Misc/Music/
+=item ABC2MTeX, http://www.gre.ac.uk/~c.walshaw/abc
A preprocessor to MusixTeX by Chris Walshaw for transcribing folk and
traditional music.
-3/Aug/97 LilyPond 0.1.1 1
+8/Aug/97 LilyPond 0.1.7 1
Although not strictly necessary, these are recommended to
have.
- +\bo Perl. Most scripts are written in Perl. Most
+ +\bo Perl-5. Most scripts are written in Perl. Most
documentation was created with the perl's Plain
- Old Documentation.
+ Old Documentation. (I use 5.003)
+\bo GNU find
-3/Aug/97 LilyPond 0.1.1 2
+8/Aug/97 LilyPond 0.1.7 2
-3/Aug/97 LilyPond 0.1.1 3
+8/Aug/97 LilyPond 0.1.7 3
-3/Aug/97 LilyPond 0.1.1 4
+8/Aug/97 LilyPond 0.1.7 4
-3/Aug/97 LilyPond 0.1.1 5
+8/Aug/97 LilyPond 0.1.7 5
D\bD\bD\bDE\bE\bE\bEB\bB\bB\bBI\bI\bI\bIA\bA\bA\bAN\bN\bN\bN G\bG\bG\bGN\bN\bN\bNU\bU\bU\bU/\b/\b/\b/L\bL\bL\bLI\bI\bI\bIN\bN\bN\bNU\bU\bU\bUX\bX\bX\bX
A Debian package is in the works
-W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOZ\bZ\bZ\bZE\bE\bE\bE
- Windows NT:
+W\bW\bW\bWI\bI\bI\bIN\bN\bN\bND\bD\bD\bDO\bO\bO\bOW\bW\bW\bWS\bS\bS\bS N\bN\bN\bNT\bT\bT\bT/\b/\b/\b/9\b9\b9\b95\b5\b5\b5
+ So, you're stuck with Windows, eh? Well, don't worry, you
+ just need (to get) Cygnus' windows32 port of gnu
+ development stuff; have a look at
+ http://www.cygnus.com/gnu-win32.
- you need the cygnus windows32 gnu port development stuff;
- have a look at http://www.cygnus.com/gnu-win32.
-
- to make GNU LilyPond under, brr, aargh, shudder..
+ To make GNU LilyPond under, brr, aargh, shudder...
windows32, well, simply type:
bash configure
- make windows32
+ make
A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
-3/Aug/97 LilyPond 0.1.1 6
+8/Aug/97 LilyPond 0.1.7 6
+pl 7
+ - Audio_element as base for Audio_item and Audio_staff. fixes
+midi-lyric segfault
+ - added "Gallina a due violini"
+ - make MIDI files on website.
+ - Collision now also is an Element_group.
+ - bf: announce Collision when created
+
+********
+aug 13
+pl 6
+ - bf: 13 shift/reduce in parser fixed
+ - bf: plets in parser
+ - bf: main.o (again)
+ - german notenames (RM)
+ - Score_elem::offset_ now relative to its X/Y groups. Slight
+speed increase?
+
+********
+aug 12
+pl 5
+
+ - Wordwrap revert
+ - added LilyPond in WWW titles
+ - oops. A quaver is a 8th note, not a 4th
+ - bf: main.o remaking in lily/Makefile
+ - unhair Voice_iterator
+ - bf: error if no music in score
+ - bf: don't create translators if Chord element is empty
+ - bf: ctor of Tempo_req
+ - use virtual do_equal_b() for request comparison
+ - bf: turned off default plets: c4*2/3 c4*2/3 -> c4*2/3 c4*4/9
+ - bf: time_int() of an empty chord/voice
+ - more corrections to GMP Manifesto
+ - debian updates (AF)
+ - bf: g++ ICE in Performer_group_performer
+ - use fread() for reading in Simple_file_storage
+
+pl 0.1.3.jcn1
+ - mi2mu: simplification +bf lily_stream: indentation and wordwrap
+ - mi2mu: bf: blunt: non-alpha(num) chars from identifiers
+
+*********
+aug 11
+pl 4
+ - correction of GNU Music Manifesto
+ - moved lowlevel stuff of Source_file to Mapped_file_storage.
+Interface via File_storage. (Now using Simple_file_storage)
+ - bf: c4-"A"-"B"
+ - bf: exit status
+ - declarable keys
+ - Engraver_group_engraver::find_simple_engraver()
+ - bf: lily/Makefile
+ - bf: Midi_note_event ctor
+ - bf: tempo request
+ - popular twinkle twinkle (JV)
+ - mudela: parse tempo requests, \midi{ \tempo 4= 60;}
+
+******
+aug 8
+pl 3
+ - don't crash if no Clef_engraver.
+ - PScore -> Paper_score
+ - bf: Score_elem::extent() init of interval
+ - bfs: {Horizontal,Vertical}_group related
+ - bf: don't change original Item while doing making
+ multiple copies
+ - bf: configure DATADIR
+ - bf: type of spanbar.
+
+pl 0.1.2.jcn1
+ - minor doco fixes
+ - revived Midi_walker
+ - moved midi out of performer-* to audio-*
+ - Audio_staff
+ - removed all <ugh> members from performers
+
+*******
+aug 7
+pl 2
+ - junked Line_of_staff
+ - bf: --output
+ - bf: . in lexer
+ - bf: mi2mu version number.
+ - bf: in mudela-book
+ - bf: don't forget to make mi2mu
+ - Bar_number_grav: measure numbers (experimental)
+ - Bar_column_engraver, Bar_column: scripts on bars
+ - rewrite of {Horizontal,Vertical}_group. Yes, again.
+Now neatly integrated into class hierarchy
+ - Axis, Axis_group
+ - Debian rules (AF)
+
pl 0.1.1.jcn1
- Audio{column,score,item,...}, more generic audio
- bf: Makefiles
- - added empty flower/aclocal.m4?
- bf: mi2mu mudela version
+*********
+aug 5
pl 0.1.1
- - {Horizontal, Vertical}_group. A score_element may be in at most one.
+ - {Horizontal, Vertical}_group. A score_element may be in at most one.
- This means Horizontal_group_item and Vertical_group_spanner need special support.
- This also means a big speed increase
- configure cleanup
audio output: it can typeset formatted sheet music in TeX and
and (mechanical) perfomances to MIDI files.
+
1. VERSIONING
if you have downloaded a
LilyPond is a long way from finished and polished. I do appreciate
criticism, comments, bugreports, patches, etc. Please send e-mail to
-the mailing lists
-
-
- info-gnu-music@vuse.vanderbilt.edu
- help-gnu-music@vuse.vanderbilt.edu
- bug-gnu-music@vuse.vanderbilt.edu
- gnu-music-discuss@vuse.vanderbilt.edu,
-
-See the man page on what to use for what. Or you can send it directly
-to us: hanwen@stack.nl, jan@digicash.com.
-
-
-
+the mailing lists. See Documentation/links.pod for more info
-Have fun!
6. DOZE
If you have received this file as part of a DOS/Window32 distribution
(lilypond-*.zip ), then it is advisable to also download the source
-package, since it contains the complete documentation
+package, since it might contain more documentation
ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe)
- ftp://alpha.gnu.ai.mit.edu/gnu/ (US)
+ ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/ (US)
The website also contains the complete documentation
+7. CAVEATS
+
+Solaris
+
+Stack frame overwrite on Solaris 2.x (this will produce a seg
+fault, signal 11). Stacktrace
+
+ Engraver_group_engraver::Engraver_group_engraver(int)
+ Score_engraver::Score_engraver( )
+ get_group_engraver_p()
+
+We don't know a fix or workaround, but compiling without optimisation
+might help (Without -O2 optimisation, my execs run fine on Solaris;
+without -O2, but with purify, it dumps core)
+
Most of the items are marked in the code as well, with full explanation.
grep for TODO and ugh/ugr
+ * Generate TeX titles from MudelaHeader
- * generate stuff in out/default, out/sun5-irix etc iso out/
-and out-sun5/
+ * integrate midi-elts from mi2mu and lily
+
+ * virtualise PCols to make encapsulated spacing problems
+
+ * fix spacing: standchen: distance bar-note,
+ strange stretching and compressing of 8's
+
+ * Doc Mutopia (Music To The People)
+
+ * context in spring-spacer.
- * derive dstream, texstream from ostream?
+ * don't count bars which are not on first beat.
- * A typical pop-music example.
+ * generate stuff in out/default, out/sun5-irix etc iso out/
+ and out-sun5/
+
+ * derive lily_stream, Dstream, texstream from ostream?
* check libtool, automake
* get rid of gif files.
- * set_midi_channel/staff() out of performer.
-
* dots into separate item.
* use String iso Text_def for lyrics.
* use position 0 for center of staff iso bottom.
+ * Klavarskribo?
+
* return status on exit
* lyrics in chords still fuck up.
* rewire acknowledge_element() logic with a process_acknowledged()
- * Global type registration.
+ * Global type registration.
My_class * p = create_object( My_class )
Type t = get_type ( *p );
3RD PARTY BUGS:
+ * collision.cc: 138, g++ errors
+
* bugreport to doc++ devel: struct not in class hier; public
virtual baseclasses
- * DOC++ bugs/ newer version?
+ * DOC++ bugs/newer version?
* Rational infty(HUGE_VAL) on glibc / w32
yy_scan_buffer in C++..
* (where are the) gcc compile warnings on linux
-
+
+LILY BUGS
+
+ \score { <
+ \melodic { \id "Staff" ""; c'4 g'4 }
+ \lyric { \id "Lyric" ""; hello4 bye4 < a chord > }
+ \lyric { \id "Lyric" ""; bye4 hello4 }
+ \melodic { \id "Staff" ""; c'4 g'4 }
+ > }
PROJECTS
+ * emacs-mode for mudela
+
* input converters
- NIFF?
- ABC?
besides lists of flats/sharps, possibly via declaration
- key transposition.
- key undo: \key bes; .. . \key; should print natural
- - special key: \key 'b bes bis';
+ - special key: \key bes 'b bis';
- spacing, national styles?
-PARSER
- * Duration -> Musical_duration, typedef Rational Duration?
+ * Support for TAB
+ - redo Notehead to allow digits as heads
+ - add a \tablature {} lexer mode for easy entering
-BUGS
* should adjust stemlength for flag number.
- * lilypond - -> crash
+ * breaking:
+ - caching breakpoints
+ - saving them
+ - allowing users to set them.
+ - penalties
+ - specify number of lines
+ - set linelength per line
SEVERELY LACKING:
* centered whole rest
- * caching breakpoints / saving them.
-
* use dstream feature in mi2mu
* qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
* configure idealspacing: arithmetic spacing
- * LilyPond .deb. Other packaging methods?
-
- * detect -pipe
-
DOC
* Score_elem structure.
* volta
IDEAS
- * check out CORBA for Score_elems?
* derive PCol from Score_elem? More in Score_elems? Spacing?
% fingering: footing:
< a-4 c-2 g-1 > < c-\ltoe e-\lheel >
- * parameterised scripts for fingering and footing:
+ * stackparameterised scripts for fingering and footing:
% toe to bheel four to five
% ^_u 4_5
TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 1
+TOPLEVEL_PATCH_LEVEL = 7
# use to send patches, always empty for released version:
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
+TOPLEVEL_MY_PATCH_LEVEL =
#!@PERL@ -w
+# -*-perl-*-
=head1 TODO
}
+sub convert_0_1_0_to_0_1_1
+{
+ s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g
+}
###############################################################
sub last_conversion
"0.0.58" => \&convert_0_0_57_to_0_0_58,
"0.0.59" => \&convert_0_0_58_to_0_0_59,
"0.0.60" => \&convert_0_0_59_to_0_0_60,
- "0.0.61" => \&convert_0_0_60_to_0_0_61
+ "0.0.61" => \&convert_0_0_60_to_0_0_61,
+ "0.1.1" => \&convert_0_1_0_to_0_1_1
);
sub versions
{
- return (sort keys %minor_conversions);
+ return (sort { cmpver; } (keys %minor_conversions));
}
-sub show_rules
+sub show_rules
{
- print "Rules: ", join(", ", sort keys %minor_conversions), "\n";
+ my (@v) = versions;
+
+ print "Rules: ", join(", ", @v), "\n";
}
my @applicable_conversion;
my @mudela_levels;
-# die "This is too old to convert " if $from < 50;
my @v = versions;
foreach $ver (@v) {
if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){
cat $versionfile| sed 's/#.*$//g'|sed 's/\([^ ]*\)[\t ]*=[ \t]*\([^ ]*\)$/#define \1 \"\2\"/g'
echo
-if [ -z $CXX ]
-then
- COMPILER=unknown
-else
- COMPILER="$CXX `$CXX --version`"
-fi
-
-echo "#define COMPILER "\"$COMPILER\"
+
#!@PERL@ -w
-# stupid script to generate WWW site.
+# stupid script to generate WWW site. -*-Perl-*-
use FileHandle;
use Getopt::Long;
my $lily_version;
my $footstr;
my $mw_id = "<!make_website!>";
-my $id_str = "make-website 0.3";
+my $id_str = "make-website 0.4";
my $TAR="tar";
my $MAKE="make";
my $username=$pw[6];
$footstr =
- "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
+ "\n<hr>Please take me <a href=index.html>back to the LilyPond index</a>\n<hr>
<font size=-1>
-This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
+This page was built using <code>" . $id_str . "</code> from lilypond-$lily_version by
<p>
<address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
-<p>" . `date` . "
<p></font>";
}
local $base="lilypond/";
local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
- "scsii-menuetto", "collisions", "cadenza", "scales");
+ "scsii-menuetto", "collisions", "cadenza", "scales", "twinkle-pop");
# rhythm, scales,
{
print "generating TeX doco list\n";
open HTMLLIST, ">tex_manuals.html";
- print HTMLLIST "<HTML><TITLE>LilyPond manuals</title>\n" ;
+ print HTMLLIST "<HTML><TITLE>PostScript Manuals</TITLE>\n" ;
print HTMLLIST "<BODY><h1>LilyPond manuals (in PostScript)</h1>";
print HTMLLIST "<ul>\n";
my @todo=();
{
print "generating HTML list\n";
open HTMLLIST, ">example_output.html";
- print HTMLLIST "<html><body><title>LilyPond examples</title>\n
+ print HTMLLIST "<html><body><TITLE>Rendered Examples</TITLE>\n
These example files are taken from the LilyPond distribution.\n
LilyPond currently only outputs TeX and MIDI. The pictures and\n
PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
$subst .= $back if (! $a =~ /index.html/ );
$file =~ s/$sep/$subst$sep/g ;
$file =~ s/\.gif/\.$image/g;
+ $file =~ s!<TITLE>(.*)</TITLE>!<TITLE>LilyPond WWW: $1</TITLE>!g;
open H, ">$a";
print H $mw_id;
+
print H $file;
close H;
}
sub copy_files
{
print "copying files\n";
- print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
+ my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ;
my_system "cp $depth/TODO ./TODO.txt",
"cp $depth/ANNOUNCE ./ANNOUNCE.txt",
"cp $depth/NEWS ./NEWS.txt",
sub docxx_update
{
- my_system "$MAKE -C $depth doc++";
+ open BANNER, ">/tmp/lilybanner.html";
+ my $ban = $footstr;
+ $ban =~ s!index.html!../index.html!g;
+ print BANNER $ban;
+ close BANNER;
+ my_system "$MAKE -C $depth docxx-opts=\"-p -S -k -B /tmp/lilybanner.html\" doc++";
+ # should add a cute header.
}
sub do_tar
if (! $opt_noexamples) {
gen_examples;
gen_list;
+ gen_manuals;
}
- gen_manuals;
set_images;
edit_html;
my $mudcount = 0;
my $mudela_b = 0;
my $outname = "-";
+my $outdir;
use Getopt::Long;
sub gen_mufile
if (defined ($opt_outdir)) {
$outdir = $opt_outdir . "/";
} else {
- $outdir = "";
+ $outdir = ".";
}
if (defined ($ARGV[0])) {
if (defined ($opt_outname)) {
$outname = $opt_outname ;
} else {
- die "Need to have an output name, use --outname" if ( $infile == "-");
+ die "Need to have an output name, use --outname" if ( $infile eq "-");
$outname = "$infile.tex";
}
-
+
+ my $openout ="$outdir$outname";
+ if ( $infile eq $openout ) {
+ die "The input can't be the output\n";
+ }
+
open INFILE, "<$infile";
- open BOOK, ">$outdir$outname";
+ open BOOK, ">$openout";
while (<INFILE>) {
if ($mudela_b) {
if (end_b "mudela") {
echo Please look in the INSTALL instructions for
echo directions for multi-architecture building
- { echo "configure: error: This package does not support --srcdir." 1>&2; exit 1; }
+
+ echo "configure: warning: This package does not support --srcdir!" 1>&2
+ warn_b=yes
+
fi
# if given here, these vars are initted at the checking point.
debug_b=yes
optimise_b=no
profile_b=no
-warn_b=no
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
# 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:688: checking for $ac_word" >&5
+echo "configure:690: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:719: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:721: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 729 "configure"
+#line 731 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:753: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:755: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:758: checking whether we are using GNU C++" >&5
+echo "configure:760: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:782: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:784: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:812: checking for $ac_word" >&5
+echo "configure:814: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:868: checking for a BSD compatible install" >&5
+echo "configure:870: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# 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:922: checking for $ac_word" >&5
+echo "configure:924: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_TAR'+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:956: checking for $ac_word" >&5
+echo "configure:958: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
test -n "$FIND" || FIND="error"
-if test FIND = error; then
-
- echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2
+
+ if test $FIND = "error"
+ then
+
+ echo "configure: warning: can't find \`find\'. Please use --enable-tex-dir. " 1>&2
warn_b=yes
-fi
+ fi
+
+
# 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:1024: 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:1052: checking for $ac_word" >&5
+echo "configure:1058: 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:1086: checking for $ac_word" >&5
+echo "configure:1092: 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 "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1118: checking for $ac_word" >&5
+echo "configure:1124: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+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:1152: checking for $ac_word" >&5
+echo "configure:1158: 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:1188: checking TeX/MF root dir directory" >&5
+echo "configure:1194: checking TeX/MF root dir directory" >&5
find_root_prefix="$prefix"
echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1229: checking TeX input directory" >&5
+echo "configure:1235: checking TeX input directory" >&5
find_dirdir=`(cd $find_texprefix;
$FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
fi
-
+
+
+
if test $MAKE = "error"
fi
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1330: checking how to run the C++ preprocessor" >&5
+echo "configure:1338: 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 1343 "configure"
+#line 1351 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1356: \"$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:1368: checking for FlexLexer.h" >&5
+echo "configure:1376: 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 1373 "configure"
+#line 1381 "configure"
#include "confdefs.h"
#include <FlexLexer.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
-for a in `find -type d -and -not -name 'out*'`; do
+for a in `find . -type d -and -not -name 'out*' -print`; do
if test ! -d $a/$OUTDIR_NAME; then
mkdir $a/$OUTDIR_NAME
fi
subdirs="flower"
-# ugh
-eval "DIR_DATADIR=$datadir/lilypond"
trap '' 1 2 15
cat > confcache <<\EOF
ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
- lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
Makefile:make/Toplevel.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
- lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
Makefile:make/Toplevel.make.in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
END
-if test $warn_b = "yes" ; then
+if test x$warn_b = "xyes" ; then
cat <<EOF
**************************************************
echo Please look in the INSTALL instructions for
echo directions for multi-architecture building
- AC_MSG_ERROR(This package does not support --srcdir.)
+ AC_LILY_WARN(This package does not support --srcdir!)
fi
# if given here, these vars are initted at the checking point.
debug_b=yes
optimise_b=no
profile_b=no
-warn_b=no
AC_LANG_CPLUSPLUS
AC_CHECK_PROGS(FIND, find, error)
dnl should check out -print
-if test FIND = error; then
- AC_LILY_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
-fi
+AC_CHECK_SEARCH_RESULT($FIND, \`find\'. Please use --enable-tex-dir)
+
AC_SUBST(OUTDIR_NAME)
AC_SUBST(CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_TEX_SUBDIR(TEXDIR)
fi
-dnl if test "x$MFDIR" = xauto; then
-dnl AC_MF_SUBDIR(MFDIR)
-dnl fi
-
+
+AC_JUNK_ARGS( [if test "x$MFDIR" = xauto; then
+ AC_MF_SUBDIR(MFDIR)
+ fi]
+)
AC_CHECK_SEARCH_RESULT($MAKE, GNU make, You should install GNU make)
AC_CHECK_SEARCH_RESULT( $BISON, bison, Please install Bison, 1.25 or better)
AC_CHECK_HEADER(FlexLexer.h, true,
AC_LILY_WARN(can't find flex header. Please install Flex headers correctly))
-for a in `find -type d -and -not -name 'out*'`; do
+for a in `find . -type d -and -not -name 'out*' -print`; do
if test ! -d $a/$OUTDIR_NAME; then
mkdir $a/$OUTDIR_NAME
fi
AC_CONFIG_SUBDIRS(flower)
-# ugh
-eval "DIR_DATADIR=$datadir/lilypond"
AC_OUTPUT(make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
- lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
Makefile:make/Toplevel.make.in)
touch make/$OUTDIR_NAME/Site.make
END
-if test $warn_b = "yes" ; then
+if test x$warn_b = "xyes" ; then
cat <<EOF
**************************************************
#
SCRIPTS =
README_FILES = ONEWS NEWS README TODO
-EXTRA_DISTFILES= configure config.hh.in configure.in aclocal.m4 VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in
+EXTRA_DISTFILES= aclocal.m4 configure config.hh.in configure.in VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in
#
+pl 26
+ - Getopt_long : command -- and command -
+ - Getopt_long: cosmetics
pl 25
- unordered_substitute and unordered_del
This library contains some general purpose routines which aren't
-standardised libraries yet. It may be replaced by STL in time
+standardised libraries yet. It may be replaced by STL in time.
It was written by:
Jan Nieuwenhuizen <jan@digicash.com>
-It is licensed under the GNU GPL.
\ No newline at end of file
+It is licensed under the GNU GPL.
MAJOR_VERSION = 1
MINOR_VERSION = 1
-PATCH_LEVEL = 25
+PATCH_LEVEL = 26
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = # include separator: "-1" or ".a"
#
--- /dev/null
+
+dnl this file intentionally left blank :)
#include "text-db.hh"
#include "string-convert.hh"
#include "assoc-iter.hh"
+
/// indent of each level
const INDTAB = 2;
return (*silent_assoc_p_)[s];
}
-/** Output a string via the Dstream. This is the only output
- interface. It delegates all conversion to String class. */
Dstream &
Dstream::operator<<(String s)
{
for (Assoc_iter<String, bool> i(*silent_assoc_p_); i.ok(); i++) {
i.val() = 0;
}
-
}
template<class K,class V>
struct Assoc;
-/** debug stream.
+/** Debug stream.
a class for providing debug output of nested structures,
with indents according to \{\}()[].
/**
if rcfile == 0, then do not read any rc file.
*/
-
Dstream(ostream *r, char const * rcfile);
virtual ~Dstream();
Dstream &identify_as(String s);
+/** Output a string via the Dstream. This is the only output
+ interface. It delegates all conversion to String class. */
Dstream &operator << (String s);
/**
Output memory locations.
char const * longname;
char shortname;
- ostream &printon(ostream &errorout);
+ void printon(ostream &errorout)const ;
};
argument reordering
*/
class Getopt_long {
-public:
- /** errorcodes: no error, argument expected, no argument expected,
- unknown option, illegal argument (eg. int expected). */
- enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
- E_ILLEGALARG } ;
-
-
-private:
/// the option info.
- Long_option_init *the_opts;
- int table_len;
+ const Long_option_init *option_a_;
+ int table_len_i_;
- /// if doing short option, argv[optind][optindind] is processed next.
- int optindind;
+ /// if doing short option, arg_value_ch_a_a_[optind][optindind] is processed next.
+ int argument_index_i_;
/// the option found
- Long_option_init *beet;
+ const Long_option_init *found_option_l_;
- /// get ready for processing next error.
- bool next();
- Long_option_init *parselong();
- Long_option_init *parseshort();
-
- ostream *errorout;
- /// report an error and abort
- void report(Errorcod c);
-public:
+public:
+ /** errorcodes: no error, argument expected, no argument expected,
+ unknown option, illegal argument (eg. int expected). */
+ enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
+ E_ILLEGALARG } ;
/// argument. Set to 0 if not present
- char* optarg;
+ char const * optional_argument_ch_C_;
/// current error status
- Errorcod error;
+ Errorcod error_;
- /// return an integer (with err. detect)
- long intarg();
- /// argv[optind] will be processed next.
- int optind;
+ /// arg_value_ch_a_a_[array_index_i_] will be processed next.
+ int array_index_i_;
/// the arguments
- char **argv;
+ char **arg_value_ch_a_a_;
/// the arg. count
- int argc;
-
- /* *************** */
+ int argument_count_i_;
+
+ ostream *error_ostream_l_;
+
+public:
+ /// get ready for processing next error.
+ void next();
+ const Long_option_init *parselong();
+ const Long_option_init *parseshort();
+ void OK()const;
+ bool ok() const;
+
+ /// report an error and abort
+ void report(Errorcod c);
+
+
+ /// return an integer (with err. detect)
+ long argument_to_i();
+
/**
What to do with errors.
@return pointer to next option found.
0 if error occurred, or next argument is no option.
*/
- Long_option_init *operator()();
+ const Long_option_init *operator()();
- char *current_arg();
- char * get_next_arg();
+ char const *current_arg();
+ char const * get_next_arg();
};
#endif
#include "lgetopt.hh"
long
-Getopt_long::intarg()
+Getopt_long::argument_to_i()
{
long l;
- if (sscanf(optarg, "%ld", &l) != 1)
+ if (!optional_argument_ch_C_
+ || sscanf(optional_argument_ch_C_, "%ld", &l) != 1)
report(E_ILLEGALARG);
return l;
}
-Long_option_init *
+const Long_option_init *
Getopt_long::parselong()
{
- char const *optnm = argv[optind] + 2 ;
+ char const *optnm = arg_value_ch_a_a_[array_index_i_] + 2 ;
assert(*optnm);
- char *endopt = strchr(optnm, '=');
+ char const *endopt = strchr(optnm, '=');
int searchlen = (endopt) ? endopt - optnm : strlen(optnm);
- beet=0;
- for (int i=0; i< table_len; i++) {
- char const *ln = the_opts[i].longname;
+ found_option_l_=0;
+ for (int i=0; i< table_len_i_; i++) {
+ char const *ln = option_a_[i].longname;
if (ln && !strncmp(ln, optnm, searchlen)) {
- beet = the_opts+i;
+ found_option_l_ = option_a_+i;
break;
}
}
- if (!beet) {
+ if (!found_option_l_) {
report(E_UNKNOWNOPTION);
return 0;
}
- optind++;
- optindind = 0;
+ array_index_i_++;
+ argument_index_i_ = 0;
- if (beet->take_arg) {
+ if (found_option_l_->take_arg) {
if (endopt)
- optarg = endopt +1; // a '='
+ optional_argument_ch_C_ = endopt +1; // a '='
else {
- optarg = argv[optind];
- optind++;
+ optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+ array_index_i_++;
}
- if (!optarg)
+ if (!optional_argument_ch_C_)
report(E_ARGEXPECT);
} else {
- optarg = 0;
+ optional_argument_ch_C_ = 0;
if (endopt)
report(E_NOARGEXPECT);
}
- return beet;
+ return found_option_l_;
}
-ostream &
-Long_option_init::printon(ostream &errorout)
+void
+Long_option_init::printon(ostream &errorout)const
{
if (shortname)
errorout <<"-" << shortname;
errorout << ", ";
if (longname)
errorout << "`--" << longname << "'";
- return errorout;
}
// report an error, GNU style.
void
Getopt_long::report(Errorcod c)
{
- error = c;
- if (!errorout)
+ error_ = c;
+ if (!error_ostream_l_)
return;
- *errorout << argv[0] << ": ";
+ *error_ostream_l_ << arg_value_ch_a_a_[0] << ": ";
switch (c) {
case E_ARGEXPECT:
- *errorout<< "option ";
- beet->printon(*errorout);
- *errorout << "requires an argument"<<endl;
+ *error_ostream_l_<< "option ";
+ found_option_l_->printon(*error_ostream_l_);
+ *error_ostream_l_ << "requires an argument"<<endl;
break;
case E_NOARGEXPECT:
- *errorout << "option `--" <<
- beet->longname << "' does not allow an argument"<<endl;
+ *error_ostream_l_ << "option `--" <<
+ found_option_l_->longname << "' does not allow an argument"<<endl;
break;
case E_UNKNOWNOPTION:
- *errorout << "unrecognized option ";
- if (optindind)
- *errorout << "-" << argv[optind][optindind] << endl;
+ *error_ostream_l_ << "unrecognized option ";
+ if (argument_index_i_)
+ *error_ostream_l_ << "-" << arg_value_ch_a_a_[array_index_i_][argument_index_i_] << endl;
else
- *errorout << argv[optind] << endl;
+ *error_ostream_l_ << arg_value_ch_a_a_[array_index_i_] << endl;
break;
case E_ILLEGALARG:
- *errorout << "illegal argument `" << optarg << "\'to option ";
- beet->printon(*errorout);
- *errorout << '\n';
+ *error_ostream_l_ << "illegal argument `" << optional_argument_ch_C_ << "\'to option ";
+ found_option_l_->printon(*error_ostream_l_);
+ *error_ostream_l_ << '\n';
default:
assert(false);
}
exit(2);
}
-Long_option_init *
+const Long_option_init *
Getopt_long::parseshort()
{
- char c=argv[optind][optindind];
- beet=0;
+ char c=arg_value_ch_a_a_[array_index_i_][argument_index_i_];
+ found_option_l_=0;
assert(c);
- for (int i=0; i < table_len; i++)
- if (the_opts[i].shortname == c) {
- beet = the_opts+i;
+ for (int i=0; i < table_len_i_; i++)
+ if (option_a_[i].shortname == c) {
+ found_option_l_ = option_a_+i;
break;
}
- if (!beet){
+ if (!found_option_l_){
report(E_UNKNOWNOPTION);
return 0;
}
- optindind++;
- if (!beet->take_arg){
- optarg = 0;
- return beet;
+ argument_index_i_++;
+ if (!found_option_l_->take_arg){
+ optional_argument_ch_C_ = 0;
+ return found_option_l_;
}
- optarg = argv[optind] + optindind;
+ optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_] + argument_index_i_;
- optind ++;
- optindind = 0;
+ array_index_i_ ++;
+ argument_index_i_ = 0;
- if (!optarg[0]) {
- optarg = argv[optind];
- optind ++;
+ if (!optional_argument_ch_C_[0]) {
+ optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_];
+ array_index_i_ ++;
}
- if (!optarg) {
+ if (!optional_argument_ch_C_) {
report(E_ARGEXPECT);
}
- return beet;
+ return found_option_l_;
}
-Long_option_init *
+const Long_option_init *
Getopt_long::operator()()
{
- if (!next())
+ if (!ok())
return 0;
- if (optindind)
- return parseshort();
+ next();
+
+ if (argument_index_i_)
+ return parseshort();
+
+ const char * argument_C = arg_value_ch_a_a_[array_index_i_];
- if (argv[optind][0] != '-')
+ if (argument_C[0] != '-')
return 0;
- if (argv[optind][1] == '-') {// what to do with "command -- bla"
- return parselong();
+ if (argument_C[1] == '-') {// what to do with "command -- bla"
+ if ( argument_C[2] )
+ return parselong();
+ else
+ return 0;
} else {
- optindind = 1;
- return parseshort();
+ if (argument_C[ 1 ]) {
+ argument_index_i_ = 1;
+ return parseshort();
+ } else {
+ return 0;
+ }
}
}
-Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
+Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo)
{
- the_opts = lo;
- errorout = &cerr;
- argv = v;
- argc = c;
- optind = 1;
- optindind = 0;
+ option_a_ = lo;
+ error_ostream_l_ = &cerr;
+ arg_value_ch_a_a_ = v;
+ argument_count_i_ = c;
+ array_index_i_ = 1;
+ argument_index_i_ = 0;
// reached end of option table?
- int i;
- for (i = 0; the_opts[i].longname ||the_opts[i].shortname; i++)
- ;
- table_len = i;
+ table_len_i_ =0;
+ for (int i = 0; option_a_[i].longname ||option_a_[i].shortname; i++)
+ table_len_i_ ++;
}
bool
-Getopt_long::next()
+Getopt_long::ok()const
{
+ return array_index_i_ < argument_count_i_;
+}
- error = E_NOERROR;
- while (optind < argc && !argv[optind][optindind]) {
- optind++;
- optindind = 0;
+void
+Getopt_long::next()
+{
+ error_ = E_NOERROR;
+ while (array_index_i_ < argument_count_i_
+ && !arg_value_ch_a_a_[array_index_i_][argument_index_i_]) {
+ array_index_i_++;
+ argument_index_i_ = 0;
}
- return (optind < argc);
}
-char *
+char const *
Getopt_long::current_arg()
{
- if (optind >= argc)
+ if (array_index_i_ >= argument_count_i_)
return 0;
- char * a = argv[optind];
- return a + optindind;
+ char const * a = arg_value_ch_a_a_[array_index_i_];
+ return a + argument_index_i_;
}
-char *
+char const *
Getopt_long::get_next_arg()
{
- char * a = current_arg();
- if ( a) {
- optind ++;
- optindind = 0;
+ char const * a = current_arg();
+ if (a) {
+ array_index_i_ ++;
+ argument_index_i_= 0;
}
return a;
}
path+= String(path.length_i()? "/":"")+nm;
fdebug << path << "? ";
- FILE *f = fopen(path, "r"); // ugh!
+ FILE *f = fopen(path.ch_C(), "r"); // ugh!
if (f) {
fdebug << "found\n";
fclose(f);
eisis = \melodic_request { -1 2 2 }
feses = \melodic_request { -1 3 -2 }
fes = \melodic_request { -1 3 -1 }
- "f" = \melodic_request { -1 3 0 }
+ f = \melodic_request { -1 3 0 }
fis = \melodic_request { -1 3 1 }
fisis = \melodic_request { -1 3 2 }
geses = \melodic_request { -1 4 -2 }
}
+
+
+
+keyCminor = \key \bes \es \as;
staff_engraver = \requesttranslator {
Engraver "Engraver_group_engraver"
\alias "Staff";
- \consists "Line_group_engraver";
\consists "Bar_engraver";
\consists "Clef_engraver";
\consists "Key_engraver";
\consists "Staff_sym_engraver";
\consists "Collision_engraver";
\consists "Rest_collision_engraver";
+
+ \consists "Line_group_engraver";
\contains \requesttranslator {
Engraver "Voice_group_engravers"
\alias "Voice_group";
\alias "Hoenoemjedat";
\consists "Span_bar_engraver";
\consists "Vertical_align_engraver";
- \consists "Line_group_engraver";
\consists "Piano_bar_engraver";
+
+ % This should come last
+ \consists "Line_group_engraver";
\contains\requesttranslator { \staff_engraver }
}
\consists "Line_group_engraver";
\contains\requesttranslator { \staff_engraver }
}
+
lyric_engraver = \requesttranslator {
Engraver "Engraver_group_engraver"
\alias "Lyric";
Engraver Score_engraver
\alias "Score";
+ \consists "Bar_column_engraver";
+ \consists "Bar_number_grav";
+
\consists "Bar_align_engraver";
\consists "Clef_align_engraver";
\consists "Key_align_engraver";
\consists "Vertical_align_engraver";
\consists "Span_score_bar_engraver";
+
\contains \requesttranslator { \staff_group_engraver }
\contains \requesttranslator { \lyric_engraver }
\contains \requesttranslator { \piano_staff_engraver }
-
-
}
--- /dev/null
+%
+% common german names for notes. "es" means flat, "is" means sharp
+%
+% by Roland Meier <meier@informatik.th-darmstadt.de>
+% based on swedish.ly by Mats Bengtsson.
+
+
+%
+% Please note that, while these names are used to enter *notes*, they
+% actually are *melodic*s, i.e. they represent a pitch solely. Notes
+% have a rhythmic part too. This is the reason that we don't write 'note { .. }'
+%
+\notenames {
+ ceses = \melodic_request { -1 0 -2 }
+ ces = \melodic_request { -1 0 -1 }
+ c = \melodic_request { -1 0 0 }
+ cis = \melodic_request { -1 0 1 }
+ cisis = \melodic_request { -1 0 2 }
+ deses = \melodic_request { -1 1 -2 }
+ des = \melodic_request { -1 1 -1 }
+ d = \melodic_request { -1 1 0 }
+ dis = \melodic_request { -1 1 1 }
+ disis = \melodic_request { -1 1 2 }
+ eses = \melodic_request { -1 2 -2 }
+ es = \melodic_request { -1 2 -1 }
+ e = \melodic_request { -1 2 0 }
+ eis = \melodic_request { -1 2 1 }
+ eisis = \melodic_request { -1 2 2 }
+ feses = \melodic_request { -1 3 -2 }
+ fes = \melodic_request { -1 3 -1 }
+ f = \melodic_request { -1 3 0 }
+ fis = \melodic_request { -1 3 1 }
+ fisis = \melodic_request { -1 3 2 }
+ geses = \melodic_request { -1 4 -2 }
+ ges = \melodic_request { -1 4 -1 }
+ g = \melodic_request { -1 4 0 }
+ gis = \melodic_request { -1 4 1 }
+ gisis = \melodic_request { -1 4 2 }
+ ases = \melodic_request { -1 5 -2 }
+ as = \melodic_request { -1 5 -1 }
+ a = \melodic_request { -1 5 0 }
+ ais = \melodic_request { -1 5 1 }
+ aisis = \melodic_request { -1 5 2 }
+ heses = \melodic_request { -1 6 -2 }
+ b = \melodic_request { -1 6 -1 }
+ h = \melodic_request { -1 6 0 }
+ his = \melodic_request { -1 6 1 }
+ hisis = \melodic_request { -1 6 2 }
+
+
+ %
+ % upper case: 1 octave lower.
+ %
+
+
+ Ceses = \melodic_request { -2 0 -2 }
+ Ces = \melodic_request { -2 0 -1 }
+ C = \melodic_request { -2 0 0 }
+ Cis = \melodic_request { -2 0 1 }
+ Cisis = \melodic_request { -2 0 2 }
+ Deses = \melodic_request { -2 1 -2 }
+ Des = \melodic_request { -2 1 -1 }
+ D = \melodic_request { -2 1 0 }
+ Dis = \melodic_request { -2 1 1 }
+ Disis = \melodic_request { -2 1 2 }
+ Eses = \melodic_request { -2 2 -2 }
+ Es = \melodic_request { -2 2 -1 }
+ E = \melodic_request { -2 2 0 }
+ Eis = \melodic_request { -2 2 1 }
+ Eisis = \melodic_request { -2 2 2 }
+ Feses = \melodic_request { -2 3 -2 }
+ Fes = \melodic_request { -2 3 -1 }
+ F = \melodic_request { -2 3 0 }
+ Fis = \melodic_request { -2 3 1 }
+ Fisis = \melodic_request { -2 3 2 }
+ Geses = \melodic_request { -2 4 -2 }
+ Ges = \melodic_request { -2 4 -1 }
+ G = \melodic_request { -2 4 0 }
+ Gis = \melodic_request { -2 4 1 }
+ Gisis = \melodic_request { -2 4 2 }
+ Ases = \melodic_request { -2 5 -2 }
+ As = \melodic_request { -2 5 -1 }
+ A = \melodic_request { -2 5 0 }
+ Ais = \melodic_request { -2 5 1 }
+ Aisis = \melodic_request { -2 5 2 }
+ Heses = \melodic_request { -2 6 -2 }
+ B = \melodic_request { -2 6 -1 }
+ H = \melodic_request { -2 6 0 }
+ His = \melodic_request { -2 6 1 }
+ Hisis = \melodic_request { -2 6 2 }
+
+
+}
\include "performer.ly"
default_midi = \midi {
- \tempo 4:60;
+ \tempo 4=60;
\requesttranslator{ \default_midi_perf }
}
rfheel = \script { "fheel" 0 0 1 0 0 }
lftoe = \script { "ftoe" 0 0 -1 0 0 }
rftoe = \script { "ftoe" 0 0 1 0 0 }
+turn = \script { "turn" 0 0 1 0 0 }
+
%
% left toe: right heel:
%
eississ = \melodic_request { -1 2 2 }
fessess = \melodic_request { -1 3 -2 }
fess = \melodic_request { -1 3 -1 }
- "f" = \melodic_request { -1 3 0 }
+ f = \melodic_request { -1 3 0 }
fiss = \melodic_request { -1 3 1 }
fississ = \melodic_request { -1 3 2 }
gessess = \melodic_request { -1 4 -2 }
-\version "0.1.0";
+\version "0.1.1";
\include "dynamic.ly"
\include "dutch.ly"
% ugh
\include "midi.ly"
+% declarations for standard directions
left = -1
right = 1
up = 1
"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
+ "turn" "\turn" -2.0\pt 7.0\pt 0.0\pt 4.0\pt
}
"style" = \table {
description:
composer(s): heu
entered-by: jcn
- copyright: GPL
+ copyright: PD
Tested Features: beams and beamflags
EndMudelaHeader
%{MudelaHeader
- title:
- description:Cadenza to Mozart Horn concerto 3
- composer(s):unknown
- entered-by:HWN
+ filename: cadenza.ly
+ title: Cadenza ad libitum
+ description: Cadenza to Mozart Horn concerto 3
+ composer(s): unknown
+ entered-by: HWN
copyright: public domain
Tested Features: cadenza mode
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
cad = \melodic {\id "Staff" "french horn";
r8 'a ['b cis]
\duration 16; [d cis d e]
f4~ [f e d c]
- 'b4
+ 'b4-\turn
\octave c'; [2/3 d'8 c'8 a8]1/1
g2
\bar "" ;
\bar "" ;
[g8.(_"a tempo" e g8. )e]
a4. g8 [f8 e8 d8 c8]
- 'g2 d2^"tr"
+ 'g2 d2^"\tr"
c4
}
\score {
\melodic { \cad }
\paper {
- unitspace= 14.0\mm;
+ unitspace= 16.0\mm;
geometric= 1.4;
}
- \midi { \tempo 4:90; }
+ \midi { \tempo 4 = 90; }
}
Tested Features:test the Collision resolution
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
% (maybe even sooner :-)
%
-\version "0.0.58";
+\version "0.1.1";
alto = \melodic{
--- /dev/null
+%{
+From mats.bengtsson@s3.kth.seThu Aug 14 02:11:19 1997
+Date: Wed, 13 Aug 1997 18:24:53 +0200
+From: Mats Bengtsson <mats.bengtsson@s3.kth.se>
+To: Han-Wen Nienhuys <hanwen@stack.nl>
+Subject: Re: brevis?
+
+[snip]
+
+Here comes a sample score where I've tried to fiddle around with different
+spacing parameters to get a decent layout, but it still looks quite strange.
+For example is the second half of the bar more spread out than the first
+half in many cases.
+Hopefully it could be useful input to future improvements. I've entered the
+music directly from the 1637 manuscript and intend to publish it public
+domain on for example ftp.gmd.de when finished. You could include it as an
+example in the distribution, but in that case I could add a LaTeX title file.
+There were no beams in the manuscript so I didn't use them in this edition
+either.
+
+ /Mats
+
+--------------------------------------------------
+%}
+%{
+ title: La Gallina a 2 violini
+ date: 1637
+ source: the manuscript of Canzoni overo Sonate Concertate
+ libro terzo, opera duodecima
+ composer(s): Tarquinio Merula (?-?)
+ entered-by: Mats Bengtsson
+ copyright: Public Domain
+
+
+ Tested Features: Note placement, multipart score, figured base
+
+%}
+
+vi1=\melodic{
+ \meter 4/4;
+ \octave c'';
+
+ d8 d d d d4 A16 B c A |
+ B8 G G G16 A B8 G G G16 A |
+ B8 G G A16 B c4 B |
+ A8 D G4. Fis16 E Fis4 |
+ G2 r2 |
+ r1 |
+ d8 d d d d4 A16 B c A |
+ B8 G G G16 A B8 G G G16 A |
+ B8 G G A16 B c8 e d c |
+ B G c2 B4 |
+ c2 r |
+ r1 |
+ g8 g g g g4 d16 e f d |
+ e8 c c c16 d e8 c c c16 d |
+ e8 c c d16 e f4 e |
+ d8 G c2 B4 |
+ c8 G G G16 A B4 G |
+ r8 G G G16 A B4 G |
+ r8 E16 Fis G8 G Fis G G Fis|
+ G2 r |
+ r1 |
+ r16 d c B A G Fis E D8 d d d16 c |
+ B8 d d d16 c B8 d d d16 e |
+ fis4 g2 fis4 |
+ r16 g f e d c B A G8 g g g16 f |
+ e8 g g g16 f e8 g g g16 a |
+ b4 c'2 b4 |
+ c'8 g g g16 f e4 d |
+ r8 g g g16 f e4 d |
+ r8 d16 A B8 B16 c A2 |
+ B1 |
+ \meter 3/2;
+ r4 d d d d d |
+ e1. |
+ r4 c c c c c |
+ d1. |
+ r4 d8 c B4 c8 d G4 A8 B |
+ E1. |
+ r4 e8 d cis4 d8 e A4 B8 cis |
+ Fis1. |
+ r4 d d d d d |
+ e e8 d c4 d8 e A4 B8 c |
+ Fis4 fis8 e d4 e8 fis B4 c8 d |
+ G4 g g g g g |
+ a4 c'8 b a4 b8 c' f4 g8 a |
+ d4 g g g g g |
+ a d8 c B4 c8 d A2 |
+ \meter 4/4;
+ B1 |
+ d8 d d d d4 A16 B c A |
+ B8 G G G16 A B8 G G G16 A |
+ B8 G c2 B4 |
+ c2 r |
+ g8 g g g g4 d16 e f d |
+ e8 G G G16 A B8 d d d16 e |
+ fis4 g2 fis4 |
+ r16 g f e d c B A G8 g g g16 f |
+ e2 r8 d d d16 e |
+ fis a g fis e d c B A8 d d d16 e |
+ fis4 g2 fis4 |
+ g1
+ \bar "|.";
+}
+
+vi2=\melodic{
+ \meter 4/4;
+ \octave c'';
+
+ r1 | r | r |
+ d8 d d d d4 A16 B c A |
+ B8 G G G16 A B8 G G G16 A |
+ B8 G G A16 B c4 B |
+ A8 D G4. Fis16 E Fis4 |
+ G2 r2 |
+ r1 |
+ g8 g g g g4 d16 e f d |
+ e8 c c c16 d e8 c c c16 d |
+ e8 c c d16 e f4 e |
+ d8 G c2 B4 |
+ c2 r |
+ r1 |
+ g8 g g g g4 d16 e f d |
+ e2 r8 G G G16 A |
+ B4 G r8 G G A16 B
+ c4 B A2 |
+ G r16 d c B A G Fis E |
+ D8 d d d16 c B8 d d d16 e |
+ fis4 g g4. fis8 |
+ g2 r |
+ r16 d c B A G Fis E D8 d d d16 c |
+ B4 c2 B4 |
+ c d G2 |
+ r16 g f e d c B A G8 g g g16 f |
+ e4 d r8 g g g16 f |
+ e4 d r8 c16 G B8 B16 c |
+ A4 G2 Fis4 |
+ G1 |
+ \meter 3/2;
+ r1. |
+ r4 g8 f e4 f8 g c4 d8 e |
+ A1. |
+ r4 a8 g fis4 g8 a d4 e8 fis |
+ B1. |
+ r4 g g g g g |
+ a1. |
+ r4 a a a a a |
+ b d8 c B4 c8 d G4 A8 B |
+ E4 g8 f e4 f8 g c4 d8 e |
+ A4 a8 g fis4 g8 a d4 e8 fis |
+ B4 b8 a g4 a8 b e4 fis8 g |
+ c4 A A A A A |
+ B d8 c B4 c8 d D4 E |
+ Fis2 G Fis |
+ \meter 4/4;
+ G1 |
+ r1 | r1 |
+ g8 g g g g4 d16 e f d |
+ e8 c c c16 d e8 G G G16 A |
+ B8 G c2 B4 |
+ c2 r |
+ r16 d c B A G Fis E D8 d d d16 c |
+ B4 c2 B4 |
+ c8 G G G16 A B d c B A G Fis E |
+ D8 d d d16 e fis16 a g fis e d c B |
+ A d c B A G Fis E D4 d |
+ B1
+ \bar "|.";
+}
+
+bc=\melodic{
+ \clef "bass";
+ \meter 4/4;
+ \octave c;
+
+ G2 d^"4 3" | G1 |
+ g2 c4 G | d1^"3 4 3" |
+ G1 | g2 c4 G |
+ d1^"3 4 3" | G |
+ g2 c4 d | G1^"3 4 3" |
+ c1 | c2 F4 c |
+ G1^"3 4 3" | c |
+ c2 F4 c | G1^"3 4 3" |
+ c2 G | g G |
+ c4 G d2^"3 4 3" | G g |
+ fis g | d1^"3 4 3" |
+ G2 B | d1^"3 4 3" |
+ G^"3 4 3" | c4 B c2 |
+ G1^"3 4 3" | c4 B c g |
+ c B c G | d1^"3 4 3" |
+ G1 |
+ \meter 3/2;
+ g1. | c |
+ f | d^"\sharp" |
+ g | c |
+ A | d^"\sharp" |
+ G | c |
+ d^"\sharp" | e |
+ f | g1 B2 |
+ d1.^"3 4 3" |
+ \meter 4/4;
+ G1 |
+ g2 fis | g G |
+ g1^"3 4 3" | c |
+ G^"3 4 3" | c2 G |
+ d1^"3 4 3" | G^"3 4 3" |
+ c2 G | d1^"\sharp" ( |
+ ) d^"3 4 3" | G |
+ \bar "|.";
+}
+
+\score{
+ < \multi 3;
+ \vi1
+ \vi2
+ \bc
+ >
+ \paper{
+ geometric=1.2;
+ unitspace=8.\mm;
+ linewidth=18.\cm;
+ gourlay_maxmeasures=4.;
+ gourlay_energybound = 70000.;
+ basicspace = 2.8\pt;
+ }
+}
+
+
+
+
+
filename:
title:
+ date:
description:
+ opus:
+ source:
composers:
entered-by:
copyright:
-
+ remarks:
Tested Features:
+
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
Tested Features: local key, key, forced accidentals
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
blah = \melodic{
description: bare bones version. (written down from memory :-)
composers: Mozart, KV 265
entered-by: HWN
- copyright: none
+ copyright: PD
Tested Features: example file with comments
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
% the % is a comment.
%}
-\version "0.1.0";
+\version "0.1.1";
\score{
\melodic
% \lbheel \lbheel \lfheel \lftoe
% \rbheel \rbtoe \rfheel \rftoe
-\version "0.1.0";
+\version "0.1.1";
\score{
\melodic {
-\version "0.1.0";
+\version "0.1.1";
ritme = \melodic{ %\octave ;
\partial 8;
+++ /dev/null
-
-mel = \melodic {
- [c8 c32 c16]
-}
% scales with accents.
%
-\version "0.1.0";
+\version "0.1.1";
blah = \melodic {
\meter 6/8;
\octave 'c ;
Tested Features: scripts, text.
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
blah = \melodic {
filename: scsii-menuetto.ly
title: Solo Cello Suites, Suite II part V, Menuetto I
description: Cello suite transcribed for Viola
+ source: ?
+ opus: BWV 1008 no. 5
composers: Johann Sebastian Bach (1685-1750)
entered-by: JCN
copyright: public domain
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
%% Stuff from MPP version
% \lefttitle{Menuetto}
\output "scsii-menuetto.out";
}
\midi{
- \tempo 4:120;
+ \tempo 4 = 120;
\output "scsii-menuetto.midi";
}
}
description:
composer(s): HWN
entered-by: HWN
- copyright: GPL
+ copyright: PD
Tested Features: test slurs and ties
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
\score{
\melodic{\octave c';
filename: standchen.ly
title: St\"andchen (Serenade) "Leise flehen meine Lieder"
- description: D.957 No.4
+ opus: D. 957 No. 4
composers: Franz Schubert (1797-1828)
Text by Ludwig Rellstab (1799-1860)
entered-by:JCN
- copyright:
+ copyright: public domain
Tested Features: multivoice, accents, lyrics, chords, piano music
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
commands = \melodic{
\skip 2.*4;
%%48
\textstyle "italic";
<
- { fis2.~ \group "+1"; \stem \down; f2. }
- { d'2. ~ \stem \up; d'4 r4_"decresc." d'4 }
+ { fis2.~
+ %\group "+1";
+ \stem \down; f2. }
+ { d'2. ~ \stem \up;
+ d'4 r4_"decresc." d'4 }
>
\textstyle "roman"; |
%%50
\output "standchen.out";
}
\midi{
- \tempo 4:54;
+ \tempo 4 = 54;
}
}
%{MudelaHeader
filename: toccata-fuga-E.ly
- title: toccata and fuga in E-major bwv 566
- description:
+ title: toccata and fuga in E-major
+ opus: BWV 566
toccata: 3 bar excerpt
2nd fuga: transposed subject --- 4 bar excerpt
composers: Johann Sebastian Bach (1685-1750)
entered-by: JCN
- copyright:
+ copyright: public domain
Tested Features:
purpose of this file is testing:
%}
-\version "0.1.0";
+\version "0.1.1";
toccata_commands = \melodic{
\meter 4/4;
fuga2_right = \melodic{
\$fuga2_commands
+ \clef violin;
% 15
\octave c';
<\multi 2;
>
\paper{}
\midi{
- \tempo 4:96;
+ \tempo 4 = 96;
}
}
--- /dev/null
+%{MudelaHeader
+
+ filename: twinkle.ly
+ title: Ah, vous dirais-je, maman
+ description: twinkle twinkle in pop-song-settings
+ composers: traditional
+
+ entered-by: HWN, chords by Johan Vromans
+ copyright: public domain
+
+ Tested Features: lyrics and chords
+EndMudelaHeader
+%}
+
+\version "0.1.1";
+
+melodie = \melodic {
+ \clef"violin";
+ \meter 2/4 ;
+ \octave c';
+
+ c4^"C" c | g g | a^"F" a | g2^"C" |
+ f4^"F" f | e^"C" e | d^"G7" d | c2^"C" |
+ g4^"G" g | f^"F" f | e^"C" e | d^"G7" d |
+ g^"G" g | f^"F" f | e^"C" e | d^"G7" d |
+ c4^"C" c | g g | a^"F" a | g2^"C" |
+ f4^"F" f | e^"C" e | d^"G7" d | c2^"C" |
+}
+
+texte = \lyric{
+
+ \textstyle "italic";
+ Ah!4 vous dir- ai_- je ma man2
+ Ce4 qui cau- se mon tour- ment2
+ Pa-4 pa veut que je rai- so- nne
+ Comme4 un- e grand- e per- so- nne
+ Moi4 je dis que les bon- bons2
+ Val-4 ent mieux que la rai- son2
+
+}
+
+\score {
+ < \melodic < \id "Piano" ""; \melodie >
+ \lyric < \id "Lyric" ""; \texte >
+ >
+ \paper { unitspace= 2.5\cm; }
+}
filename: twinkle.ly
title: twinkle twinkle little star
description:
+ traditional song in various languages.
"Ah, vous dirais-je, maman"
"Altijd is Kortjakje ziek"
"Twinkle twinkle little star"
- composers: ?
+ composers: Traditional
entered-by: HWN & JCN
copyright: public domain
Tested Features: lyrics
EndMudelaHeader
%}
-\version "0.1.0";
+\version "0.1.1";
melody = \melodic{
\clef violin;
accompany = \melodic {
\clef "bass";
- \octave'c;
+ \octave 'c;
\duration 4;
c4 c' | e' c' | f' c' | e' c' |
d' b | c' a | f g | c2 |
midden4 in_de week maar s'_zon- dags niet.2
}
+%{
+
+Ja inderdaad. Dit is geen educatieve danwel muzikaal verantwoorde
+tekst. Mogen wij ook af en toe ergens op afgeven?
+
+%}
hegedraagjetekst = \lyric{
Al-4 tijd zuigt Bill Gates mijn piek,2
"\TeX"4 is slecht- ser dan mu- ziek.2
% ugh
\lyric < \id "Lyric" "1";
- \global \tekst \hegedraagjetekst >
+ \global \tekst >
\lyric < \id "Lyric" "2"; \global
\texte >
\lyric < \id "Lyric" "3"; \global
unitspace= 2.5\cm;
}
\midi{
- \tempo 4:120 ;
+ \tempo 4 = 120 ;
}
}
%{
- title: Das Wohltemperirte Clavier I, Fuga II (c-minor)
- description: following Henle's Urtext
- composer(s): J.S. Bach
+ filename: wohltemperirt.ly
+ title: Fuga a 3
+ description: Das Wohltemperirte Clavier I, Fuga II (c-minor)
+ Opus: BWV ?
+ source: Henle's Urtext
+ composer(s): Johann Sebastian Bach (1685-1750)
entered-by: HWN and Werner Lemberg
copyright: Public Domain
%}
-\version "0.1.0";
+\version "0.1.1";
% should add \need{dutch.ini} for
% correct parsing of note names
global =
\melodic {
\meter 4/4; % should be \meter C
- \key bes es as;
+ \keyCminor
}
dux =
>
>
- \paper{
-% castingalgorithm=0.;
- }
+ \paper{}
\midi {
- \tempo 4:84;
+ \tempo 4 = 84;
}
}
# MAINTARGET = $(bindir)/$(EXECUTABLE)# huh?
MAINTARGET = $(outdir)/$(LIBRARY)# huh?
-default: $(MAINTARGET)
+default: configheader $(MAINTARGET)
#
localclean:
-include $(DEPFILES)
#
+.PHONY: configheader
+
+configheader: $(outdir)/config.hh
+
+# Ugh ugh
+$(outdir)/config.hh: config.hh.in
+ sed 's!@datadir@!$(datadir)!'< $< > $@
return "";
char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_C();
- char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_off();
+ char const* end_ch_c_l = pos_ch_c_l + 7 <? ch_C() + length_i();
String pre_str( (Byte const*)begin_ch_c_l, pos_ch_c_l - begin_ch_c_l );
pre_str = String_convert::bin2hex_str( pre_str );
/* @configure_input@ */
#ifndef CONFIG_HH
#define CONFIG_HH
-#define DIR_DATADIR "@DIR_DATADIR@"
+#define DIR_DATADIR "@datadir@/lilypond"
#endif
source file of the LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
*/
#include <assert.h>
#include "duration-convert.hh"
// if ( !dur_array_s.length_i() )
if ( !dur_array_s.size() )
set_array();
-// assert( dur_array_s.length_i() );
assert( dur_array_s.size() );
-// for ( int i = 0; i < dur_array_s.length_i() - 1; i++ ) {
for ( int i = 0; i < dur_array_s.size() - 1; i++ ) {
Moment lower_mom = dur2_mom( dur_array_s[ i ] );
if ( mom <= lower_mom ) {
// kinda ok
if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) )
return dur_array_s[ i ];
- else
- return Duration( 0 );
+ else {
+ Duration d;
+ d.type_i_ = 0;
+ return d;
+ }
}
Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] );
-#if 0 // % deviation of upper/lower from mom, perhaps it's better to use
- if ( ( mom < upper_mom )
- && ( ( mom - lower_mom ) / mom
- < ( upper_mom - mom ) / mom ) )
-#else // % deviation of mom from lower/upper?
if ( ( mom < upper_mom )
&& ( ( mom - lower_mom ) / lower_mom
< ( upper_mom - mom ) / upper_mom ) )
-#endif
return dur_array_s[ i ];
}
-// return dur_array_s[ dur_array_s.length_i() ];
return dur_array_s[ dur_array_s.size() - 1 ];
}
source file of the LilyPond music typesetter
- copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+ Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "proto.hh"
int Duration::division_1_i_s = 384 * 4;
-Duration::Duration( int type_i, int dots_i = 0)
+Duration::Duration()
{
-// this breaks mi2mu quite effectively
-// assert(duration_type_b(type_i));
- type_i_ = type_i;
- dots_i_ = dots_i;
+ type_i_ = 1;
+ dots_i_ = 0;
ticks_i_ = 0;
}
iso_i_ = 1;
}
-Plet::Plet( int iso_i, int type_i )
-{
- iso_i_ = iso_i;
- type_i_ = type_i;
-}
-
Moment
Plet::mom()const
{
--- /dev/null
+/*
+ file-storage.cc -- implement Mapped_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+*/
+#include <sys/types.h> // open, mmap
+#include <sys/stat.h> // open
+#include <sys/mman.h> // mmap
+#include <limits.h> // INT_MAX
+#include <fcntl.h> // open
+#include <unistd.h> // close, stat
+#include <stdio.h> // fdopen
+#include <string.h> // strerror
+#include <errno.h> // errno
+
+
+
+#include "string.hh"
+#include "proto.hh"
+#include "warn.hh"
+#include "file-storage.hh"
+
+Mapped_file_storage::Mapped_file_storage(String s)
+{
+ data_caddr_ = 0;
+ fildes_i_ = 0;
+ size_off_ = 0;
+ open(s);
+}
+
+char const*
+Mapped_file_storage::ch_C()const
+{
+ return (char const*)data_caddr_;
+}
+
+void
+Mapped_file_storage::map()
+{
+ if ( fildes_i_ == -1 )
+ return;
+
+ data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
+
+ if ( (int)data_caddr_ == -1 )
+ warning( String( "can't map: error no: " ) + strerror( errno ));
+}
+
+
+void
+Mapped_file_storage::open(String name_str)
+{
+ fildes_i_ = ::open( name_str, O_RDONLY );
+
+ if ( fildes_i_ == -1 ) {
+ warning( String( "can't open: " ) + name_str + String( ": " ) + strerror( errno ));
+ return;
+ }
+
+ struct stat file_stat;
+ fstat( fildes_i_, &file_stat );
+ size_off_ = file_stat.st_size;
+ map();
+}
+
+void
+Mapped_file_storage::unmap()
+{
+ if ( data_caddr_ ) {
+ munmap( data_caddr_, size_off_ );
+ data_caddr_ = 0;
+ size_off_ = 0;
+ }
+}
+
+void
+Mapped_file_storage::close()
+{
+ unmap();
+ if ( fildes_i_ ) {
+ ::close( fildes_i_ );
+ fildes_i_ = 0;
+ }
+}
+
+int
+Mapped_file_storage::length_i()const
+{
+ return size_off_;
+}
+
+Mapped_file_storage::~Mapped_file_storage()
+{
+ close();
+}
// ugh, to get me in lily lib
extern bool no_triplets_bo_g;
-/** (plet)
- The type and replacement value of a plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3
+/**
+ The type and replacement value of a plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3.
+
+ (plet)
*/
struct Plet {
- Plet( int replace_i, int type_i );
Plet();
Moment mom()const;
bool unit_b()const;
/**
Ctor of Duration. type_i should be a power of 2.
*/
- Duration( int type_i = 1, int dots_i = 0);
+ Duration();
/// is the "plet factor" of this note != 1 ?
bool plet_b();
String str()const;
--- /dev/null
+/*
+ file-storage.hh -- declare File_storage, Mapped_file_storage, Simple_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef FILE_STORAGE_HH
+#define FILE_STORAGE_HH
+
+#include "proto.hh"
+
+/**
+ store a file in-memory.
+ */
+class File_storage
+{
+public:
+ virtual char const* ch_C()const=0;
+ virtual int length_i()const=0;
+ virtual ~File_storage(){}
+};
+
+/**
+ Use mmap to "copy" a file into memory
+ */
+class Mapped_file_storage:public File_storage
+{
+public:
+ Mapped_file_storage(String);
+protected:
+ virtual char const* ch_C()const;
+ virtual int length_i()const;
+ virtual ~Mapped_file_storage();
+private:
+ void open(String name);
+ void close();
+
+ void map();
+ void unmap();
+ int fildes_i_;
+ off_t size_off_;
+ caddr_t data_caddr_;
+};
+
+/**
+ read file char by char and copy into a malloc array.
+ */
+class Simple_file_storage : public File_storage
+{
+ char * data_p_;
+ int len_i_;
+protected:
+ virtual char const*ch_C()const;
+ virtual int length_i()const;
+ virtual ~Simple_file_storage();
+public:
+ Simple_file_storage(String);
+};
+#endif // FILE_STORAGE_HH
struct Duration_iterator;
struct Source_file;
struct Sources;
+struct File_storage;
+struct Mapped_file_storage;
+struct Simple_file_storage;
#endif // PROTO_HH
#ifndef SOURCE_FILE_HH
#define SOURCE_FILE_HH
-#include "fproto.hh"
+
+#include "proto.hh"
#include "string.hh"
+
class istream;
+
+
/// class for reading and mapping a file.
class Source_file
{
Source_file( String filename_str_r );
virtual ~Source_file();
- char const* ch_C();
- virtual String error_str( char const* pos_ch_c_l );
+ char const* ch_C()const;
+ virtual String error_str( char const* pos_ch_c_l )const;
istream * istream_l();
- bool in_b( char const* pos_ch_c_l );
- off_t length_off();
- virtual int line_i( char const* pos_ch_c_l );
- String name_str();
- String file_line_no_str( char const* ch_c_l );
+ bool in_b( char const* pos_ch_c_l )const;
+ int length_i()const;
+ virtual int line_i( char const* pos_ch_c_l )const;
+ String name_str()const;
+ String file_line_no_str( char const* ch_c_l )const;
private:
- void close();
- void map();
- void open();
- void unmap();
-
- istream* istream_p_;
- int fildes_i_;
String name_str_;
- off_t size_off_;
- caddr_t data_caddr_;
+ istream* istream_p_;
+ File_storage * storage_p_;
};
#endif // SOURCE_FILE_HH //
void set_path(File_path*p_C);
Sources();
void set_binary(bool);
+ ~Sources();
private:
const File_path * path_C_;
void add( Source_file* sourcefile_p );
--- /dev/null
+/*
+ simple-file-storage.cc -- implement Simple_file_storage
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include <stdio.h>
+
+#include "file-storage.hh"
+#include "varray.hh"
+#include "string.hh"
+#include "warn.hh"
+
+/**
+ Stupid but foolproof way of opening files.
+
+ TODO
+ Should use obstack. Should check IO status
+
+ This is of course a build it yourself version of mmap, so we should
+ have been using that... (see Mapped_file_storage) But we noticed
+ some problems with this (unexplained lexer crashes)
+
+ */
+
+Simple_file_storage::Simple_file_storage(String s)
+{
+ data_p_ =0;
+ FILE * f = fopen ( s.ch_C(), "r");
+ if ( !f ) {
+ warning("can't open file\n");
+ return ;
+ }
+
+ int ret = fseek( f, 0, SEEK_END);
+ len_i_ = ftell(f);
+ rewind(f);
+ data_p_ = new char[len_i_+1];
+ data_p_[len_i_] = 0;
+ ret = fread(data_p_, sizeof(char), len_i_, f);
+ assert (ret==len_i_);
+ fclose(f);
+}
+
+char const*
+Simple_file_storage::ch_C() const
+{
+ return data_p_;
+}
+
+int
+Simple_file_storage::length_i()const
+{
+ return len_i_;
+}
+
+
+Simple_file_storage::~Simple_file_storage()
+{
+ delete []data_p_;
+}
-//
-// source-file.cc
-//
-
-#include <sys/types.h> // open, mmap
-#include <sys/stat.h> // open
-#include <sys/mman.h> // mmap
-#include <limits.h> // INT_MAX
-#include <fcntl.h> // open
-#include <unistd.h> // close, stat
-#include <stdio.h> // fdopen
-#include <string.h> // strerror
-#include <errno.h> // errno
+/*
+ source-file.cc -- implement
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+ & Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
#include <assert.h>
#include <strstream.h>
#include "string.hh"
#include "proto.hh"
#include "plist.hh"
-
-
#include "warn.hh"
#include "windhoos-suck-suck-suck-thank-you-cygnus.hh"
-
#include "source-file.hh"
+#include "file-storage.hh"
Source_file::Source_file( String filename_str )
{
- data_caddr_ = 0;
- fildes_i_ = 0;
- size_off_ = 0;
name_str_ = filename_str;
istream_p_ = 0;
-
- open();
- if ( fildes_i_ > 0 )
- map();
+ storage_p_ = new Simple_file_storage(filename_str);
}
istream*
Source_file::istream_l()
{
- if ( !fildes_i_ )
+ if ( !name_str_.length_i())
return &cin;
+
if ( !istream_p_ ) {
- if ( size_off_ ) // can-t this be done without such a hack?
- istream_p_ = new istrstream( ch_C(), size_off_ );
+ if ( length_i() ) // can-t this be done without such a hack?
+ istream_p_ = new istrstream( ch_C(), length_i() );
else {
istream_p_ = new istrstream( "", 0 );
istream_p_->set(ios::eofbit);
return istream_p_;
}
-Source_file::~Source_file()
+String
+Source_file::file_line_no_str(char const *ch_C )const
{
- delete istream_p_;
- istream_p_ = 0;
- unmap();
- close();
+ return name_str() + ": "
+ + String( line_i( ch_C ) );
}
-char const*
-Source_file::ch_C()
+String
+Source_file::name_str()const
{
- assert( this );
- return (char const*)data_caddr_;
+ return name_str_;
}
-
-void
-Source_file::close()
+Source_file::~Source_file()
{
- if ( fildes_i_ ) {
- ::close( fildes_i_ );
- fildes_i_ = 0;
- }
+ delete istream_p_;
+ istream_p_ = 0;
+ delete storage_p_;
}
-
String
-Source_file::error_str( char const* pos_ch_C )
+Source_file::error_str( char const* pos_ch_C )const
{
char const* data_ch_C = ch_C();
- char const * eof_C_ = data_ch_C + size_off_;
+ char const * eof_C_ = data_ch_C + length_i();
if ( !in_b( pos_ch_C ) )
return "(position unknown)";
}
bool
-Source_file::in_b( char const* pos_ch_C )
+Source_file::in_b( char const* pos_ch_C )const
{
- return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + size_off_ ) );
+ return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + length_i() ) );
}
-off_t
-Source_file::length_off()
-{
- return size_off_;
-}
int
-Source_file::line_i( char const* pos_ch_C )
+Source_file::line_i( char const* pos_ch_C )const
{
if ( !in_b( pos_ch_C ) )
return 0;
return i;
}
-void
-Source_file::map()
-{
- if ( fildes_i_ == -1 )
- return;
-
- data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 );
-
- if ( (int)data_caddr_ == -1 )
- warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ));
-}
-
-String
-Source_file::name_str()
-{
- return name_str_;
-}
-
-void
-Source_file::open()
+int
+Source_file::length_i()const
{
- if ( !name_str_.length_i() || ( name_str_ == "-" ) ) {
- fildes_i_ = 0;
- return;
- }
-
- fildes_i_ = ::open( name_str_, O_RDONLY );
-
- if ( fildes_i_ == -1 ) {
- warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ));
- return;
- }
-
- struct stat file_stat;
- fstat( fildes_i_, &file_stat );
- size_off_ = file_stat.st_size;
+ return storage_p_->length_i();
}
-void
-Source_file::unmap()
+char const *
+Source_file::ch_C()const
{
- if ( data_caddr_ ) {
- munmap( data_caddr_, size_off_ );
- data_caddr_ = 0;
- size_off_ = 0;
- }
-}
-String
-Source_file::file_line_no_str(char const *ch_C )
-{
- return name_str() + ": "
- + String( line_i( ch_C ) );
+ return storage_p_->ch_C();
}
return *sourcefile_l_pcur;
return 0;
}
+
+Sources::~Sources()
+{}
# list of custom libraries:
#
-MODULE_LIBDEPS= check-flower-deps check-lily-deps
+MODULE_LIBDEPS= check-flower-deps check-lib-deps
MODULE_LIBES= -llily -lflower
#
localuninstall: uninstallexe
$(outdir)/lily-version.o: $(outdir)/version.hh
+
+# make config.hh. Ugh
+$(outdir)/main.o: $(libout)/config.hh
+
+$(libout)/config.hh: check-lib-deps
# kept in dist bo stripping stable stuff, still to copy...
# a bit of a hack to keep exec size under control.
-stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \
+stablecc=atom.cc bar.cc boxes.cc \
keyword.cc leastsquares.cc \
lookup.cc meter.cc\
- parser.cc \
+ parser.cc notename-table.cc lexer.cc\
qlp.cc qlpsolve.cc\
- template*.cc template6.cc version.cc tex-stream.cc tex.cc\
+ template*.cc version.cc tex-stream.cc tex.cc\
identifier.cc note.cc
MAJOR_VERSION = 0
MINOR_VERSION = 1
-PATCH_LEVEL = 1
+PATCH_LEVEL = 7
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
#include "varray.hh"
#include "debug.hh"
-
-
void
Atom::print() const
{
+#ifndef NPRINT
mtor << "texstring: " <<sym_.tex<<"\n";
+#endif
}
Box
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(print_dimen(off_.y()));
+ a.push(print_dimen(off_.x()));
a.push(sym_.tex);
return substitute_args(s, a);
}
--- /dev/null
+/*
+ audio-element.cc -- implement Audio_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "audio-element.hh"
+
+IMPLEMENT_IS_TYPE_B(Audio_element);
+Audio_element::~Audio_element()
+{}
#include "audio-item.hh"
#include "midi-item.hh"
-#if 0
Audio_instrument::Audio_instrument( String instrument_str )
: Audio_item( 0 )
{
+ str_ = instrument_str;
+}
+
+Midi_item*
+Audio_instrument::midi_item_p()
+{
+ return new Midi_instrument( 0, str_ );
}
-#endif
Audio_item::Audio_item( Request* req_l )
{
}
-Audio_note::Audio_note( Request* req_l, bool on_b )
+Audio_note::Audio_note( Request* req_l )
: Audio_item( req_l )
{
- on_b_ = on_b;
}
Midi_item*
return new Midi_text( this );
}
+
+IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element);
(c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
+#include <time.h>
#include "debug.hh"
+#include "string.hh"
+#include "string-convert.hh"
+#include "main.hh"
#include "midi-def.hh"
+#include "midi-item.hh"
+#include "midi-stream.hh"
#include "audio-column.hh"
+#include "audio-staff.hh"
#include "audio-score.hh"
+#include "score.hh"
-Audio_score::Audio_score( Midi_def* l )
+Audio_score::Audio_score( Score* l )
{
- midi_l_ = l;
+ score_l_ = l;
}
void
-Audio_score::play( Audio_item* i, Audio_column* c )
+Audio_score::add( Audio_column* p )
{
- assert( c );
- assert( i );
+ p->audio_score_l_ = this;
+ audio_column_p_list_.bottom().add(p);
+}
- c->add( i );
-// typeset_element( i );
+void
+Audio_score::output( Midi_stream& midi_stream_r )
+{
+ int tracks_i = audio_staff_l_list_.size() + 1;
+ // ugh
+ int clocks_per_4_i = 384;
+ midi_stream_r << Midi_header( 1, tracks_i, clocks_per_4_i );
+ output_header_track( midi_stream_r );
+ int n = 1;
+ for ( PCursor<Audio_staff*> i( audio_staff_l_list_ ); i.ok(); i++ )
+ i->output( midi_stream_r, n++ );
}
void
-Audio_score::add( Audio_column* p )
+Audio_score::output_header_track( Midi_stream& midi_stream_r )
{
- p->audio_score_l_ = this;
- audio_column_p_list_.bottom().add(p);
+ Midi_track midi_track;
+
+ time_t t = time( 0 );
+
+ // perhaps multiple text events?
+ String str = String( "Creator: " ) + get_version_str() + "\n";
+
+ Midi_text creator( Midi_text::TEXT, str );
+ midi_track.add( Moment( 0 ), &creator );
+
+ str = "Automatically generated at ";
+ str += ctime( &t );
+ str = str.left_str( str.length_i() - 1 );
+ str += "\n";
+ Midi_text generate( Midi_text::TEXT, str );
+ midi_track.add( Moment( 0 ), &generate );
+
+ str = "from musical definition: ";
+
+ str += score_l_->location_str();
+ Midi_text from( Midi_text::TEXT, str );
+ midi_track.add( Moment( 0 ), &from );
+
+ Midi_text track_name( Midi_text::TRACK_NAME, "Track "
+ + String_convert::i2dec_str( 0, 0, '0' ) );
+ midi_track.add( Moment( 0 ), &track_name );
+
+ Midi_tempo tempo( score_l_->midi_p_->get_tempo_i( Moment( 1, 4 ) ) );
+ midi_track.add( Moment(0), &tempo);
+
+ midi_stream_r << midi_track;
+}
+
+void
+Audio_score::add_staff( Audio_staff* l )
+{
+ audio_staff_l_list_.bottom().add( l );
}
-#if 0
void
-Audio_score::output(Tex_stream &ts)
+Audio_score::add(Audio_element *p)
{
- ts << "\n "<< midi_l_->lookup_l()->texsetting << "%(Tex id)\n";
- ts<< super_elem_l_->TeX_string();
- ts << "\n\\EndLilyPondOutput";
+ audio_elem_p_list_.bottom().add( p);
}
-#endif
void
Audio_score::print() const
{
#ifndef NPRINT
mtor << "Audio_score { ";
- midi_l_->print();
+ score_l_->midi_p_->print();
mtor << "\ncolumns: ";
for ( PCursor<Audio_column*> i( audio_column_p_list_ ); i.ok(); i++ )
i->print();
void
Audio_score::process()
{
-#if 0
- clean_cols();
- print();
- *mlog << "Preprocessing elements... " <<flush;
- preprocess();
- *mlog << "\nCalculating column positions ... " <<flush;
- calc_breaking();
- *mlog << "\nPostprocessing elements..." << endl;
- postprocess();
-#endif
}
--- /dev/null
+/*
+ axis-item.cc -- implement Axis_group_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "axis-group-item.hh"
+#include "p-col.hh"
+
+IMPLEMENT_IS_TYPE_B2(Axis_group_item, Axis_group_element, Item);
+
+void
+Axis_group_item::OK() const
+{
+ Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
+ for (int i=0; i < elems.size(); i++) {
+ Item * it_l = elems[i]->item();
+ assert(it_l);
+
+ // somebody probably broke it in pieces
+ assert (it_l->pcol_l_ == pcol_l_ );
+ }
+}
+
+void
+Axis_group_item::do_breakable_col_processing()
+{
+ if (!pcol_l_->breakable_b())
+ return;
+ OK();
+ copy_breakable_items();
+
+
+ Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
+ for (int i=0; i < elems.size(); i++) {
+ Item* it_l = elems[i]->item();
+ for ( int j=0; j < 2; j++) {
+ Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
+ ((Axis_group_item*)broken_to_a_[j])->add_element( new_l );
+ }
+ }
+ Item::do_breakable_col_processing();
+}
+
+void
+Axis_group_item::do_print() const
+{
+ Axis_group_element::do_print();
+}
--- /dev/null
+/*
+ axis-group-spanner.cc -- implement Axis_group_spanner
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "axis-group-spanner.hh"
+#include "item.hh"
+#include "p-col.hh"
+
+/** Do stuff if we're not broken. In this case the last and first
+ columns usually are pre- and postbreak respectively,
+ so the items from these columns need adjusting.
+ */
+void
+Axis_group_spanner::do_break_processing_if_unbroken()
+{
+ Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
+ Line_of_score *my_line = line_l();
+ for (int i=0; i < elems.size(); i++) {
+ if (!elems[i]->line_l()) {
+ Item * item_l = elems[i]->item();
+ if (item_l
+ && item_l->breakable_b_
+ && item_l->break_status_i() == 0) {
+ // last two checks are paranoia
+ Item * broken_item_l =
+ item_l->find_prebroken_piece( my_line );
+ add_element( broken_item_l );
+ }
+ remove_element( elems[i] );
+ }
+ }
+
+}
+void
+Axis_group_spanner::do_break_processing()
+{
+ set_my_columns();
+ bool breaking_self_b = ! Spanner::line_l();
+ if (!breaking_self_b) {
+ do_break_processing_if_unbroken();
+ Spanner::do_break_processing();
+ return;
+ }
+
+ break_into_pieces( true );
+ Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
+ remove_all();
+
+ for (int i=0; i < loose_elems.size(); i++) {
+ Score_elem * elt = loose_elems[i];
+ Line_of_score *elt_line = elt->line_l();
+
+ if ( ! elt_line ){
+ /* this piece doesn't know where it belongs.
+ Find out if it was broken, and use the broken remains
+ */
+ if (elt->spanner()) {
+ Spanner * sp = elt->spanner();
+
+ for (int j =0; j < broken_into_l_arr_.size(); j++) {
+ Axis_group_spanner * my_broken_l
+ = (Axis_group_spanner*)broken_into_l_arr_[j];
+
+ Spanner * broken_span_l
+ = sp->find_broken_piece(
+ ((Score_elem*)my_broken_l)->line_l());
+
+ if (broken_span_l)
+ my_broken_l->add_element(broken_span_l );
+
+ }
+ } else if (elt->item()
+ && elt->item()->breakable_b_
+ && elt->item()->break_status_i() == 0) {
+
+ // broken items
+ for (int j =0; j < 2; j++) {
+ Item * my_item = elt->item()->broken_to_a_[j];
+ Line_of_score * item_line_l = my_item->line_l() ;
+ if ( ! item_line_l )
+ continue;
+
+ Axis_group_spanner * v
+ = (Axis_group_spanner*)find_broken_piece( item_line_l );
+ if (v)
+ v->add_element( my_item );
+ }
+
+ }
+ } else {
+ /* this piece *does* know where it belongs.
+ Put it in appropriate piece of this spanner
+ */
+ Axis_group_spanner * my_broken_l
+ = (Axis_group_spanner*)find_broken_piece( elt->line_l() );
+ my_broken_l->add_element( elt );
+ }
+ }
+
+ Spanner::do_break_processing();
+}
+
+void
+Axis_group_spanner::do_print() const
+{
+ Axis_group_element::do_print();
+}
+
+
+
+IMPLEMENT_IS_TYPE_B2(Axis_group_spanner, Spanner, Axis_group_element);
--- /dev/null
+/*
+ axis-group.cc -- implement Axis_group_administration
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "interval.hh"
+#include "axis-group.hh"
+#include "score-elem.hh"
+#include "debug.hh"
+
+/** don't copy anything: an element can only be in one
+ Axis_group_element at one time. */
+Axis_group_administration::Axis_group_administration(
+ Axis_group_administration const&)
+{
+}
+
+bool
+Axis_group_administration::contains_b(Score_elem const *e)const
+{
+ return elem_l_arr_.find_l(e);
+}
+
+Interval
+Axis_group_administration::extent(Axis axis)const
+{
+ Interval r;
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ r.unite(elem_l_arr_[i]->extent(axis));
+ return r;
+}
+
+void
+Axis_group_administration::add_element(Score_elem*e,
+ Axis_group_element*g, Axis a1, Axis a2)
+{
+ assert( ! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2] );
+ e->axis_group_l_a_[a1] = g;
+ e->axis_group_l_a_[a2] = g;
+ elem_l_arr_.push ( e);
+}
+
+
+
+void
+Axis_group_administration::remove_element(Score_elem*e, Axis a1, Axis a2)
+{
+ assert( contains_b( e));
+ elem_l_arr_.unordered_substitute(e,0);
+
+ e->axis_group_l_a_[a1] = 0;
+ e->axis_group_l_a_[a2] = 0;
+}
+
+void
+Axis_group_administration::remove_all(Axis a1, Axis a2)
+{
+ for (int i=0; i < elem_l_arr_.size(); i++) {
+ Score_elem*e=elem_l_arr_[i];
+ e->axis_group_l_a_[a1] = 0;
+ e->axis_group_l_a_[a2] = 0;
+ }
+ elem_l_arr_.clear();
+}
+
+
+void
+Axis_group_administration::print() const
+{
+#ifndef NPRINT
+ for (int i=0; i < elem_l_arr_.size(); i++)
+ mtor << elem_l_arr_[i]->name() << ' ';
+#endif
+}
--- /dev/null
+/*
+ axis.cc -- implement Axis
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "axes.hh"
+#include "string.hh"
+
+String
+axis_name_str(Axis a)
+{
+ return String (a + 'x');
+}
--- /dev/null
+/*
+ bar-column-grav.cc -- implement Bar_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "bar-column-grav.hh"
+#include "bar-column.hh"
+#include "request.hh"
+#include "script.hh"
+#include "bar.hh"
+
+Bar_column_engraver::Bar_column_engraver()
+{
+ bar_l_ =0;
+ barcol_p_ =0;
+}
+
+
+void
+Bar_column_engraver::acknowledge_element(Score_elem_info info)
+{
+ if (info.elem_l_->is_type_b(Script::static_name())
+ && info.req_l_->command()
+ && info.origin_grav_l_arr_.size() == 1) {
+ script_l_arr_.push( (Script*)info.elem_l_->item());
+ } else {
+ if (info.origin_grav_l_arr_.size() == 1
+ && info.elem_l_->is_type_b(Bar::static_name()))
+ bar_l_ = (Bar*)info.elem_l_->item();
+ }
+
+ if ( bar_l_ && !barcol_p_ ) {
+ barcol_p_ = new Bar_column;
+ barcol_p_->breakable_b_ =true;
+ barcol_p_->set_bar( bar_l_ );
+ announce_element(Score_elem_info(barcol_p_, 0));
+ }
+
+ if (barcol_p_ ) {
+ for (int i=0; i < script_l_arr_.size(); i++) {
+ script_l_arr_[i]->breakable_b_ = true;
+ barcol_p_->add(script_l_arr_[i]);
+ }
+ script_l_arr_.clear();
+ }
+}
+
+void
+Bar_column_engraver::do_pre_move_processing()
+{
+ if (barcol_p_) {
+ typeset_element( barcol_p_ );
+ barcol_p_ =0;
+ }
+}
+
+void
+Bar_column_engraver::do_post_move_processing()
+{
+ script_l_arr_.clear();
+ bar_l_ =0;
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_column_engraver, Engraver);
+ADD_THIS_ENGRAVER(Bar_column_engraver);
--- /dev/null
+/*
+ bar-column.cc -- implement Bar_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "bar.hh"
+#include "bar-column.hh"
+
+Bar_column::Bar_column()
+{
+ bar_l_ =0;
+ breakable_b_ = true;
+}
+
+void
+Bar_column::set_bar(Bar*b)
+{
+ Script_column::add_support( b );
+ bar_l_ = b;
+}
+
+void
+Bar_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
+{
+ Script_column::do_substitute_dependency(o,n);
+ if ( o == bar_l_ ) {
+ bar_l_ = n ? (Bar*)n->item() : 0;
+ }
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_column, Script_column);
+
if (!c_l|| !c_l->bar())
return false;
Bar_req * b= c_l->bar();
- if (bar_req_l_ && bar_req_l_->compare(*b))
+ if (bar_req_l_ && bar_req_l_->equal_b(b))
return false;
bar_req_l_ = b;
Bar_engraver::do_pre_move_processing()
{
if (bar_p_) {
- typeset_breakable_item(bar_p_);
+ typeset_element(bar_p_);
bar_p_ =0;
}
}
--- /dev/null
+/*
+ bar-number-grav.cc -- implement Bar_number_grav
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "bar-number-grav.hh"
+#include "script.hh"
+#include "text-def.hh"
+#include "command-request.hh"
+#include "bar.hh"
+
+Bar_number_grav::Bar_number_grav()
+{
+ number_i_ =1;
+ script_p_ =0;
+}
+
+static Command_script_req dummy;
+
+void
+Bar_number_grav::acknowledge_element(Score_elem_info i)
+{
+ if (i.origin_grav_l_arr_.size() == 1 &&
+ i.elem_l_->is_type_b( Bar::static_name()) && !script_p_) {
+
+ script_p_ = new Script;
+ Text_def *td_p =new Text_def;
+ td_p->text_str_ = number_i_++;
+ script_p_->specs_l_ = td_p;
+ script_p_->breakable_b_ = true;
+ script_p_->dir_i_ = 1;
+
+ announce_element(Score_elem_info( script_p_, &dummy));
+ }
+}
+
+void
+Bar_number_grav::do_pre_move_processing()
+{
+ if ( script_p_ ) {
+ typeset_element(script_p_);
+ script_p_ =0;
+ }
+}
+
+IMPLEMENT_IS_TYPE_B1(Bar_number_grav,Engraver);
+ADD_THIS_ENGRAVER(Bar_number_grav);
Bar::Bar()
{
+ breakable_b_ = true;
type_str_ = "|";
spanned_i_ = 0;
}
}
/**
+ Prescriptions for splitting bars.
TODO: parametrise this (input-settable)
*/
-char const *bar_breaks[][3] ={
+static char const *bar_breaks[][3] ={
{":|", ":|:", "|:"},
{"|", "|", ""},
{"", "|:", "|:"},
{"||.", "||.", ""},
+ {":|", ":|", ""},
{0,0,0}
};
type_str_ = bar_breaks[i][break_status_i()+1];
}
- // span_score_bar needs dims.
-// transparent_b_ = empty_b_ = (type_str_ == "");
+ /*
+ span_score_bar needs dims, so don't do
+
+ transparent_b_ = empty_b_ = (type_str_ == "");
+
+ */
}
a.translate(Offset (-w, -w * sl));
for (int j = 0; j < lhalfs; j++) {
Atom b(a);
- b.translate_y( -dir_i_ * dy * (lwholebeams+j));
+ b.translate( -dir_i_ * dy * (lwholebeams+j), Y_AXIS);
leftbeams.add( b );
}
}
int j = 0;
for (; j < rwholebeams; j++) {
Atom b(a);
- b.translate_y( -dir_i_ * dy * j);
+ b.translate( -dir_i_ * dy * j, Y_AXIS);
rightbeams.add( b );
}
for (; j < rwholebeams + rhalfs; j++) {
Atom b(a);
- b.translate_y( -dir_i_ * dy * j);
+ b.translate( -dir_i_ * dy * j, Y_AXIS);
rightbeams.add(b );
}
sb.translate(Offset(x, (x * slope + left_pos)* inter_f));
mol_p->add(sb);
}
- mol_p->translate_x(x0 - left_col_l_->hpos_f_);
+ mol_p->translate(x0 - left_col_l_->hpos_f_, X_AXIS);
return mol_p;
}
Box::Box(Interval ix, Interval iy)
{
- x = ix;
- y = iy;
+ x() = ix;
+ y() = iy;
}
}
void
-Break_algorithm::set_pscore(PScore*s)
+Break_algorithm::set_pscore(Paper_score*s)
{
pscore_l_ = s;
linelength = s->paper_l_->linewidth_f();
{
if (!clef_p_)
return;
- typeset_breakable_item(clef_p_);
+ typeset_element(clef_p_);
clef_p_ = 0;
}
Clef_item::Clef_item()
{
+ breakable_b_ =true;
default_b_ = false;
change_b_ = true;
read("violin");
t += "_change";
Symbol s = paper()->lookup_l()->clef(t);
Molecule*output = new Molecule(Atom(s));
- output->translate_y( paper()->internote_f() * y_off);
+ output->translate( paper()->internote_f() * y_off, Y_AXIS);
return output;
}
if (!(i.elem_l_->name() == Note_column::static_name()))
return;
- if (!col_p_)
+ if (!col_p_) {
col_p_ = new Collision;
-
+ announce_element(Score_elem_info(col_p_,0));
+ }
col_p_->add((Note_column*)i.elem_l_->item());
}
Collision::add(Note_column* ncol_l)
{
clash_l_arr_.push(ncol_l);
+ add_element( ncol_l );
add_dependency(ncol_l);
}
/**
do {
if (!clash_group_arr_a[idx(d, false)].size()){
clash_group_arr_a[idx(d, false)] = clash_group_arr_a[idx(d, true)];
- clash_group_arr_a[idx(d, true)].set_size(0);
+ clash_group_arr_a[idx(d, true)].clear();
}
} while ((d *= -1) != 1);
Real inter_f = paper()->internote_f();
Real wid_f = paper()->note_width();
for (int j=0; j < 4; j++) {
- if (col_l_a[j])
- col_l_a[j]->translate(Offset(x_off[j] * wid_f,
- y_off[j] * inter_f));
-
+ if (col_l_a[j]) {
+ /* collision.cc:138: request for method `translate' is ambiguous
+
+ (shaddup)
+ */
+ Offset o(x_off[j] * wid_f, y_off[j] * inter_f);
+ ((Score_elem*)col_l_a[j])->translate(o);
+ }
}
}
void
Command_script_req::do_print() const
{}
+Command_script_req::Command_script_req(){}
IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
void
Cadenza_req::do_print()const
{
+#ifndef NPRINT
mtor << on_b_;
+#endif
+}
+
+bool
+Cadenza_req::do_equal_b(Request*r)const
+{
+ Cadenza_req*cad = r->command()->timing()->cadenza();
+
+ return cad->on_b_ == on_b_;
}
Cadenza_req::Cadenza_req(bool b)
/* *************** */
-int
-Bar_req::compare(Bar_req const &c1)const
+bool
+Bar_req::do_equal_b(Request*r)const
{
- return type_str_ == c1.type_str_;
+ Bar_req * b = r->command()->bar();
+ return type_str_ == b->type_str_;
}
{
duration_ =m;
}
-/* *************** */
+
+bool
+Partial_measure_req::do_equal_b(Request* r)const
+{
+ Partial_measure_req *p = r->command()->timing()->partial();
+
+ return p->duration_ == duration_;
+}
IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
void
Barcheck_req::do_print() const{}
+bool
+Barcheck_req::do_equal_b(Request*)const
+{
+ return true;
+}
/* *************** */
IMPLEMENT_IS_TYPE_B1(Clef_change_req,Command_req);
void
Meter_change_req::do_print() const
{
+#ifndef NPRINT
mtor << beats_i_ << "/" << one_beat_i_;
+#endif
}
-int
-Meter_change_req::compare(Meter_change_req const &m)
+bool
+Meter_change_req::do_equal_b(Request * r)const
{
- return m.beats_i_ == beats_i_ && one_beat_i_ == m.one_beat_i_;
+ Meter_change_req * m = r->command()->timing()->meterchange();
+
+ return m->beats_i_ == beats_i_
+ && one_beat_i_ == m->one_beat_i_;
}
Meter_change_req::Meter_change_req()
one_beat_i_=o;
}
+
+Tempo_req::Tempo_req()
+{
+ metronome_i_ = 60;
+ dur_. type_i_ = 4;
+}
+
+void
+Tempo_req::do_print()const
+{
+ mtor << dur_.str() << " = " <<metronome_i_ ;
+}
+IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req);
+
+bool
+Tempo_req::do_equal_b(Request *r)const
+{
+ Tempo_req *t = r->command()->timing()->tempo();
+
+ return t->dur_.length()== dur_.length() && metronome_i_ == t->metronome_i_;
+}
+
/* *************** */
mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
}
}
+
+
+bool
+Measure_grouping_req::do_equal_b(Request*)const
+{
+ return false; // todo
+}
+
/* *************** */
void
Interval
Crescendo::symbol_height()const
{
- return get_symbol().dim.y;
+ return get_symbol().dim[Y_AXIS];
}
static Real absdyn_dim = 10 PT; // ugh
void
Dynamic_engraver::do_post_move_processing()
{
- dynamic_req_l_arr_.set_size(0);
+ dynamic_req_l_arr_.clear();
}
bool
void
Horizontal_vertical_group_item::do_print()const
{
- Horizontal_vertical_group::do_print();
+ Horizontal_vertical_group_element::do_print();
}
-IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group_element,Item);
/*
- elem-group.cc -- implement Horizontal_vertical_group
+ elem-group.cc -- implement Horizontal_vertical_group_element
source file of the GNU LilyPond music typesetter
#include "item.hh"
#include "debug.hh"
-bool
-Elbement_group::contains_b(Score_elem const*e)const
+void
+Axis_group_element::do_unlink()
{
- return elem_l_arr_.find_l(e);
+ remove_all();
}
-Elbement_group::Elbement_group(Elbement_group const &s)
- : Score_elem(s)
-{
-}
-Interval
-Vertical_group::do_height()const
-{
- Interval r;
- for (int i=0; i < elem_l_arr_.size(); i++)
- r.unite(elem_l_arr_[i]->height());
- return r;
-}
-
-Interval
-Horizontal_group::do_width()const
+bool
+Axis_group_element::contains_b(Score_elem const*e)const
{
- Interval r;
- for (int i=0; i < elem_l_arr_.size(); i++)
- if (elem_l_arr_[i]->item()) // makes no at preprocessing for spanners.
- r.unite(elem_l_arr_[i]->width());
- return r;
+ return axis_admin_.contains_b(e);
}
-
-IMPLEMENT_IS_TYPE_B1(Horizontal_group, Elbement_group);
-IMPLEMENT_IS_TYPE_B1(Vertical_group, Elbement_group);
-
-
-void
-Elbement_group::add_element(Score_elem*i_l)
+Link_array<Score_elem>
+Axis_group_element::get_extra_dependencies()const
{
- assert(i_l!= this);
- assert(! contains_b(i_l));
-
- elem_l_arr_.push(i_l);
- add_dependency(i_l);
+ return axis_admin_.elem_l_arr_;
}
void
-Horizontal_group::add_element(Score_elem*elt)
+Axis_group_element::do_print()const
{
- assert ( !elt->x_group_l_ );
- elt->x_group_l_ = this;
- Elbement_group::add_element(elt);
+ axis_admin_.print();
}
-void
-Vertical_group::add_element(Score_elem*e)
-{
- assert( ! e->y_group_l_ );
- e->y_group_l_ = this;
-
- Elbement_group::add_element(e);
-}
+// ****************
void
-Horizontal_group::translate_x(Real x)
+Vertical_group_element::add_element(Score_elem*e)
{
- for (int i=0; i < elem_l_arr_.size(); i++)
- elem_l_arr_[i]->translate_x(x);
+ axis_admin_.add_element(e, this, Y_AXIS, Y_AXIS);
}
void
-Vertical_group::translate_y(Real y)
+Vertical_group_element::remove_element(Score_elem*e)
{
- for (int i=0; i < elem_l_arr_.size(); i++)
- elem_l_arr_[i]->translate_y(y);
+ axis_admin_.remove_element(e, Y_AXIS, Y_AXIS);
}
-IMPLEMENT_IS_TYPE_B1(Elbement_group, Score_elem);
-
-void
-Elbement_group::do_print() const
+Interval
+Vertical_group_element::do_height() const
{
-#ifndef NPRINT
- for (int i=0; i < elem_l_arr_.size(); i++)
- mtor << elem_l_arr_[i]->name() << ' ';
-#endif
+ return axis_admin_.extent(Y_AXIS);
}
-
void
-Horizontal_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l)
+Vertical_group_element::remove_all()
{
- int i;
-
- while ((i=elem_l_arr_.find_i(old))>=0) {
- old->x_group_l_ =0;
-
- if (new_l){
- new_l->x_group_l_ = this;
- elem_l_arr_[i] = new_l;
- }else {
- elem_l_arr_.unordered_del(i);
- }
- }
+ axis_admin_.remove_all(Y_AXIS,Y_AXIS);
}
+// ****************
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_l_ =0;
-
- if (new_l){
- new_l->y_group_l_ =this;
- elem_l_arr_[i] = new_l;
- }else {
- elem_l_arr_.unordered_del(i);
- }
- }
-}
-
-Vertical_group::Vertical_group(Vertical_group
- const &s)
- : Elbement_group(s)
+Horizontal_group_element::remove_all()
{
+ axis_admin_.remove_all(X_AXIS,X_AXIS);
}
-Horizontal_group::Horizontal_group(Horizontal_group
- const &s)
- : Elbement_group(s)
+void
+Horizontal_group_element::add_element(Score_elem*e)
{
+ axis_admin_.add_element(e,this, X_AXIS,X_AXIS);
}
-Elbement_group::Elbement_group()
+void
+Horizontal_group_element::remove_element(Score_elem*e)
{
- transparent_b_ = true;
+ axis_admin_.remove_element(e,X_AXIS,X_AXIS);
}
-IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group);
-
-Horizontal_vertical_group::Horizontal_vertical_group()
+Interval
+Horizontal_group_element::do_width()const
{
+ return axis_admin_.extent(X_AXIS);
}
-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
+Horizontal_vertical_group_element::remove_all()
{
- Vertical_group::do_print();
+ axis_admin_.remove_all(X_AXIS,Y_AXIS);
}
-
void
-Vertical_group::do_print()const
+Horizontal_vertical_group_element::add_element(Score_elem *e)
{
- Elbement_group::do_print();
+ axis_admin_.add_element(e, this, X_AXIS, Y_AXIS);
}
void
-Horizontal_group::do_print() const
+Horizontal_vertical_group_element::remove_element(Score_elem*e)
{
- Elbement_group::do_print();
+ axis_admin_.remove_element(e, X_AXIS, Y_AXIS);
}
-void
-Vertical_group::remove_element(Score_elem*s)
-{
- remove_dependency( s );
-}
-
-void
-Horizontal_group::remove_element(Score_elem*s)
-{
- remove_dependency( s );
-}
+IMPLEMENT_IS_TYPE_B1(Axis_group_element, Score_elem);
+IMPLEMENT_IS_TYPE_B1(Horizontal_group_element, Axis_group_element);
+IMPLEMENT_IS_TYPE_B1(Vertical_group_element, Axis_group_element);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_element, Horizontal_group_element, Vertical_group_element);
Engraver* get_engraver_p(String);
+void
+Engraver_group_engraver::print()const
+{
+ Engraver::print();
+}
+
Engraver_group_engraver::~Engraver_group_engraver()
{
assert(removable_b());
Engraver_group_engraver::terminate_engraver(Engraver*r_l)
{
mtor << "Removing " << r_l->name() << " at " << get_staff_info().when() << "\n";
- r_l->do_removal_processing();
+ r_l->removal_processing();
Engraver * grav_p =remove_engraver_p(r_l);
delete grav_p;
#ifndef NPRINT
if ( !check_debug)
return ;
- mtor << "ID: " << id_str_ << "\n";
+ mtor << "ID: " << id_str_ ;
+ mtor << " iterators: " << iterator_count_<< "\n";
for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
i->print();
#endif
nongroup_l_arr_[i]->acknowledge_element(info);
}
}
- announce_info_arr_.set_size(0);
+ announce_info_arr_.clear();
}
Engraver_group_engraver::do_removal_processing()
{
for (PCursor<Engraver*> i(grav_list_.top()); i.ok(); i++)
- i->do_removal_processing();
+ i->removal_processing();
}
Staff_info
{
return !itrans_l_->get_default_itrans_l();
}
+
+Engraver*
+Engraver_group_engraver::get_simple_engraver(char const *type)const
+{
+ for (int i=0; i < nongroup_l_arr_.size(); i++) {
+ if (nongroup_l_arr_[i]->name() == type )
+ return nongroup_l_arr_[i];
+ }
+ if ( daddy_grav_l_ )
+ return daddy_grav_l_->get_simple_engraver(type);
+ return 0;
+}
+
status = MOVE_INITED;
}
+void
+Engraver::removal_processing()
+{
+ if ( status < CREATION_INITED )
+ do_creation_processing();
+
+ do_removal_processing();
+}
+
bool
Engraver::try_request(Request * r)
{
return daddy_grav_l_->paper();
}
-void
-Engraver::typeset_breakable_item(Item * nobreak_p)
-{
- daddy_grav_l_->typeset_breakable_item(nobreak_p);
-}
-
bool
Engraver::contains_b(Engraver *grav_l)const
{
if (name() != g.name())
return false;
- return do_equal_b(g);
+ return do_equal_b(&g);
}
bool
-General_script_def::do_equal_b(General_script_def const&)const
+General_script_def::do_equal_b(General_script_def const*)const
{
return true;
}
Array<int> final_breaks;
+ Array<Col_hpositions> lines;
/* skip 0-th element, since it is a "dummy" elt*/
for (int i = optimal_paths.size()-1; i> 0; ) {
final_breaks.push ( i );
assert ( i > optimal_paths[i].prev_break_i_);
+
+ // there was no "feasible path"
+ if (!optimal_paths[i].line_config_.config.size() )
+ return lines;
i = optimal_paths[i].prev_break_i_;
}
- Array<Col_hpositions> lines;
for (int i= final_breaks.size(); i--; )
lines.push ( optimal_paths[final_breaks[i]].line_config_ );
Rhythmic_grouping::init()
{
interval_ = 0;
- children.set_size(0);
+ children.clear();
}
void
#include "head-column.hh"
#include "note-head.hh"
#include "stem.hh"
+#include "script.hh"
Head_column::Head_column()
{
Head_column::set(Stem*stem_l)
{
stem_l_ = stem_l;
- add_dependency(stem_l);
+ Score_elem::add_dependency(stem_l);
+ for (int i=0; script_l_arr_.size(); i++)
+ script_l_arr_[i]->set_stem( stem_l );
}
+void
+Head_column::add(Script *script_l)
+{
+ Script_column::add(script_l) ;
+ if (stem_l_ )
+ script_l->set_stem( stem_l_ );
+}
void
Head_column::add(Note_head *n_l)
{
n_p->set_rhythmic(note_req_l_->rhythmic());
if (note_req_l_->note()) {
- n_p->position_i_ = note_req_l_->note()->height() +
- *get_staff_info().c0_position_i_l_;
+ n_p->position_i_ = note_req_l_->note()->height();
+ Staff_info inf = get_staff_info();
+ if (inf.c0_position_i_l_)
+ n_p->position_i_ += *inf.c0_position_i_l_;
} else if (note_req_l_->rest()) {
n_p->rest_b_ = true;
}
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);
+ item_l_arr_.clear();
+ priority_i_arr_.clear();
for (int i =0; i < content.size(); i++) {
item_l_arr_.push( content[i].item_l_ );
priority_i_arr_.push( content[i].priority_i_);
Real center_dx_f = 0;
for ( int i=0 ; i < item_l_arr_.size(); i++) {
Real dx = where_f -dims[i][-1];
- item_l_arr_[i]->translate_x( dx );
+ item_l_arr_[i]->translate( dx , X_AXIS);
if (item_l_arr_[i] == center_l_)
center_dx_f = where_f;
where_f += dims[i].length();
}
if (center_dx_f && !align_i_ )
for ( int i=0 ; i < item_l_arr_.size(); i++)
- item_l_arr_[i]->translate_x( - center_dx_f );
+ item_l_arr_[i]->translate( - center_dx_f , X_AXIS);
}
#include "p-col.hh"
#include "horizontal-group-item.hh"
-IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group_element, Axis_group_item);
void
-Horizontal_group_item::OK() const
-{
- for (int i=0; i < elem_l_arr_.size(); i++) {
- Item * it_l = elem_l_arr_[i]->item();
-
- assert(it_l&& it_l->pcol_l_ == pcol_l_ );
- }
-}
-
-void
-Horizontal_group_item::do_breakable_col_processing()
-{
- if (!pcol_l_->breakable_b())
- return;
- OK();
- copy_breakable_items();
-
- Link_array<Score_elem> elems = elem_l_arr_;
-
- for (int i=0; i < elems.size(); i++) {
- Item* it_l = elems[i]->item();
- for ( int j=0; j < 2; j++) {
- Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
- ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l );
- }
- }
+Horizontal_group_item::do_print() const
+{
+ Axis_group_item::do_print();
}
--- /dev/null
+/*
+ audio-element.hh -- declare Audio_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AUDIO_ELEMENT_HH
+#define AUDIO_ELEMENT_HH
+
+#include "virtual-methods.hh"
+
+struct Audio_element {
+ virtual ~Audio_element();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // AUDIO_ELEMENT_HH
#include "lily-proto.hh"
#include "string.hh"
+#include "audio-element.hh"
/**
Any piece of audio information.
We need virtual constructors,
let's try decentralised factory for specific audio implemenations.
+
+ TODO:
+
+ virtual Niff_item* niff_item_p() = 0;
+
+ virtual CSound_item* score_item_p() = 0;
*/
-struct Audio_item {
+struct Audio_item : public Audio_element {
Audio_item( Request* req_l );
/// Create a midi-item from myself.
virtual Midi_item* midi_item_p() = 0;
-#if 0
- /// Not implemented. Anyone?
- virtual Niff_item* niff_item_p() = 0;
-
- /// Not implemented. Anyone?
- virtual Cscore_item* score_item_p() = 0;
-#endif
-
Audio_column* audio_column_l_;
Request* req_l_;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
private:
Audio_item( Audio_item const& );
Audio_item& operator=( Audio_item const& );
virtual Midi_item* midi_item_p();
};
-#if 0
struct Audio_instrument : public Audio_item {
- Audio_instrument( Request* req_l );
+ Audio_instrument( String instrument_str );
+ virtual Midi_item* midi_item_p();
+ String str_;
};
-#endif
struct Audio_note : public Audio_item {
- Audio_note( Request* req_l, bool on_b );
+ Audio_note( Request* req_l );
virtual Midi_item* midi_item_p();
- bool on_b_;
};
struct Audio_text : Audio_item {
#ifndef AUDIO_SCORE_HH
#define AUDIO_SCORE_HH
-#include "proto.hh"
-#include "parray.hh"
+#include "lily-proto.hh"
#include "plist.hh"
/** all stuff which goes onto midi. notes, signs, symbols in a score
class Audio_score {
public:
- Audio_score( Midi_def* );
+ Audio_score( Score* l );
void add( Audio_column* );
+ void add_staff( Audio_staff* l );
+ void add(Audio_element*p);
-// void output(Tex_stream &ts);
+
+ void output( Midi_stream& midi_stream_r );
+ void output_header_track( Midi_stream& midi_stream_r );
- void play( Audio_item* i, Audio_column* c );
void print() const;
void process();
Pointer_list<Audio_column*> audio_column_p_list_;
- Midi_def *midi_l_;
+ Link_list<Audio_staff*> audio_staff_l_list_;
+ Pointer_list<Audio_element*> audio_elem_p_list_;
+ Score* score_l_;
};
#endif // AUDIO_SCORE_HH
--- /dev/null
+
+/*
+ axes.hh -- declare
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXES_HH
+#define AXES_HH
+
+enum Axis {
+ X_AXIS =0,
+ Y_AXIS =1,
+ NO_AXES=2,
+};
+
+class String;
+
+String axis_name_str(Axis);
+
+#endif // AXES_HH
--- /dev/null
+/*
+ axis-item.hh -- declare Axis_group_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXIS_ITEM_HH
+#define AXIS_ITEM_HH
+
+#include "axis-group.hh"
+#include "item.hh"
+
+/**
+ A grouping item. Its special support is in do_breakable_col_processing().
+ */
+
+class Axis_group_item : public virtual Axis_group_element, public Item {
+protected:
+ virtual void do_breakable_col_processing();
+ void OK()const;
+ virtual void do_print() const;
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+};
+
+#endif // AXIS_ITEM_HH
--- /dev/null
+/*
+ axis-group-spanner.hh -- declare Axis_group_spanner
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SPAN_AXIS_GROUP_HH
+#define SPAN_AXIS_GROUP_HH
+
+#include "spanner.hh"
+#include "axis-group.hh"
+
+/** An element which groups a line in a certain direction. The most
+ useful example of this is the Vertical_group_spanner */
+class Axis_group_spanner : public Spanner, public virtual Axis_group_element
+{
+ void do_break_processing_if_unbroken();
+protected:
+ virtual void do_break_processing();
+ virtual void do_print()const;
+
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // SPAN_AXIS_GROUP_HH
--- /dev/null
+/*
+axis-group.hh -- declare Axis_group_administration, Axis_group_element
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Axis_group_administration_HH
+#define Axis_group_administration_HH
+
+#include "parray.hh"
+#include "axes.hh"
+#include "real.hh"
+#include "lily-proto.hh"
+#include "score-elem.hh"
+/**
+ Do the dirty work for Axis_group_element.
+ */
+struct Axis_group_administration {
+ Link_array<Score_elem> elem_l_arr_;
+
+ Interval extent(Axis)const;
+ void print() const ;
+ Axis_group_administration(Axis_group_administration const&);
+ Axis_group_administration(){}
+ void remove_all(Axis a1,Axis a2);
+
+ bool contains_b(Score_elem const *)const;
+ void add_element(Score_elem*, Axis_group_element*, Axis a1, Axis a2);
+ void remove_element(Score_elem*, Axis a1, Axis a2);
+};
+
+/**
+ Treat a group of elements a unity in either or both axis sense .
+ This is a wrapper around Axis_group_administration
+ */
+class Axis_group_element : public virtual Score_elem {
+protected:
+ Axis_group_administration axis_admin_;
+ virtual void do_print()const;
+ virtual Link_array<Score_elem> get_extra_dependencies()const;
+ virtual void do_unlink();
+
+public:
+ virtual void remove_all()=0;
+ virtual void add_element(Score_elem*)=0;
+ virtual void remove_element(Score_elem*)=0;
+ virtual bool contains_b(Score_elem const *)const;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // Axis_group_administration_HH
--- /dev/null
+/*
+ bar-column-grav.hh -- declare Bar_column_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_COLUMN_GRAV_HH
+#define BAR_COLUMN_GRAV_HH
+
+#include "engraver.hh"
+
+/// couple bars and appropriate scripts
+class Bar_column_engraver :public Engraver {
+ Bar_column *barcol_p_;
+ Array< Script * > script_l_arr_;
+
+ Bar *bar_l_;
+
+protected:
+ virtual void acknowledge_element(Score_elem_info);
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+public:
+ Bar_column_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // BAR_COLUMN_GRAV_HH
--- /dev/null
+/*
+ bar-column.hh -- declare Bar_column
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_COLUMN_HH
+#define BAR_COLUMN_HH
+
+#include "script-column.hh"
+
+/**
+ The scripts over a and the bar itself.
+ */
+class Bar_column : public Script_column {
+ Bar * bar_l_;
+
+public:
+ Bar_column();
+ void set_bar( Bar*);
+protected:
+ SCORE_ELEM_CLONE(Bar_column);
+ void do_substitute_dependency(Score_elem*,Score_elem*);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+
+#endif // BAR_COLUMN_HH
--- /dev/null
+/*
+ bar-number-grav.hh -- declare Bar_number_grav
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef BAR_NUMBER_GRAV_HH
+#define BAR_NUMBER_GRAV_HH
+
+#include "engraver.hh"
+
+/**
+ catch bars, and put a number over them.
+ */
+class Bar_number_grav : public Engraver {
+ Script * script_p_;
+ int number_i_;
+protected:
+
+ void acknowledge_element(Score_elem_info);
+ void do_pre_move_processing();
+public:
+ Bar_number_grav();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+};
+#endif // BAR_NUMBER_GRAV_HH
#define BAR_HH
#include "item.hh"
/**
+ A vertical bar.
+
TODO: connections with pre and postbreak
*/
class Bar:public Item {
#include "real.hh"
#include "interval.hh"
#include "offset.hh"
+#include "axes.hh"
-/// a square subset of Real^2
struct Box {
- Interval x, y;
-
+ Interval interval_a_[NO_AXES];
+
+ Interval &x() {return interval_a_[X_AXIS]; }
+ Interval &y(){ return interval_a_[Y_AXIS]; }
+ Interval x()const{ return interval_a_[X_AXIS]; }
+ Interval y()const{return interval_a_[Y_AXIS]; }
+ Interval operator[](Axis a ) {
+ return interval_a_[a];
+ }
+
void translate(Offset o) {
- x.translate(o.x);
- y.translate(o.y);
+ x().translate(o.x());
+ y().translate(o.y());
}
+
/// smallest box enclosing #b#
void unite(Box b) {
- x.unite(b.x);
- y.unite(b.y);
+ x().unite(b.x());
+ y().unite(b.y());
}
Box();
Box(Interval ix, Interval iy);
class Break_algorithm {
protected:
- PScore *pscore_l_;
+ Paper_score *pscore_l_;
Real linelength;
/// search all pcols which are breakable.
Line_spacer* (*get_line_spacer)();
Break_algorithm();
- void set_pscore(PScore*);
+ void set_pscore(Paper_score*);
/// check if the spacing/breaking problem is well-stated
void problem_OK()const;
#ifndef COLLISION_HH
#define COLLISION_HH
#include "lily-proto.hh"
-#include "item.hh"
+#include "elem-group-item.hh"
-/** TODO
+/**
+ Resolve conflicts between various Note_columns (chords).
+
+ TODO
multistaff support (see Chlapik: equal noteheads should be on the
same hpos.)
*/
-class Collision : public Item {
+class Collision : public Horizontal_vertical_group_item {
protected:
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_pre_processing();
DECLARE_MY_RUNTIME_TYPEINFO;
void add (Note_column*ncol_l);
Collision();
-
};
#endif // COLLISION_HH
/*
- command-request.hh -- declare Non musical requests
+ command-request.hh -- declare non-musical requests
source file of the GNU LilyPond music typesetter
#include "request.hh"
#include "varray.hh"
+#include "duration.hh"
/** Request which are assumed to be "happening" before the
musical requests. */
class Command_script_req : public Command_req, public Script_req {
public:
+ // huh?
+ Command_script_req();
REQUESTMETHODS(Command_script_req, commandscript);
};
class Timing_req : public Command_req {
public:
REQUESTMETHODS(Timing_req, timing);
+ virtual Tempo_req * tempo(){return 0; }
+ Tempo_req();
};
+class Tempo_req : public Timing_req
+{
+public:
+ Duration dur_;
+ int metronome_i_;
+
+ Tempo_req();
+ REQUESTMETHODS(Tempo_req, tempo);
+ bool do_equal_b(Request *)const;
+};
+
class Partial_measure_req : public Timing_req {
public:
Moment duration_;
Partial_measure_req(Moment);
REQUESTMETHODS(Partial_measure_req, partial);
+ bool do_equal_b(Request*)const;
};
/**
public:
int beats_i_, one_beat_i_;
- int compare(Meter_change_req const&);
Meter_change_req();
void set(int,int);
+ bool do_equal_b(Request*)const;
REQUESTMETHODS(Meter_change_req, meterchange);
};
public:
/// turn on?
bool on_b_;
+ bool do_equal_b(Request*)const;
Cadenza_req(bool);
REQUESTMETHODS(Cadenza_req,cadenza);
};
/// check if we're at start of a measure.
class Barcheck_req : public Timing_req {
public:
-
+ bool do_equal_b(Request *)const;
REQUESTMETHODS(Barcheck_req,barcheck);
};
public:
Array<int> beat_i_arr_;
Array<Moment> elt_length_arr_;
-
+ bool do_equal_b(Request *)const;
REQUESTMETHODS(Measure_grouping_req, measuregrouping);
};
public:
String type_str_;
Bar_req(String);
- int compare(const Bar_req&)const;
+ bool do_equal_b(Request*)const;
+
REQUESTMETHODS(Bar_req,bar);
};
#ifndef ELEM_GROUP_ITEM_HH
#define ELEM_GROUP_ITEM_HH
+#include "axis-group-item.hh"
#include "elem-group.hh"
-#include "item.hh"
-class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group {
+
+/**
+ Treat a collection of items as a unity
+ */
+class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element {
+protected:
+ virtual void do_print() const;
+ virtual void remove_all() { Horizontal_vertical_group_element::remove_all(); }
public:
+ virtual void add_element(Score_elem*e) { Horizontal_vertical_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Horizontal_vertical_group_element::remove_element(e); }
+
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
-protected:
- virtual void do_print() const;
+
+
};
#endif // ELEM_GROUP_ITEM_HH
/*
- elem-group.hh -- declare Horizontal_vertical_group
+ elem-group.hh -- declare Horizontal_vertical_group_element
source file of the GNU LilyPond music typesetter
#define ELEM_GROUP_HH
#include "score-elem.hh"
+#include "axis-group.hh"
-class Elbement_group: public virtual Score_elem {
+
+
+/**
+ Treat a group of elements a unity in horizontal sense .
+ A column is a typical Vertical_group.
+ */
+class Horizontal_group_element : public virtual Axis_group_element {
protected:
- Link_array<Score_elem> elem_l_arr_;
-
- virtual void do_print() const ;
-public:
- Elbement_group(Elbement_group const&);
- Elbement_group();
- bool contains_b(Score_elem const *)const;
- void add_element(Score_elem*);
- DECLARE_MY_RUNTIME_TYPEINFO;
-};
+ virtual void remove_all();
+ virtual Interval do_width()const;
-class Horizontal_group : public Elbement_group {
public:
DECLARE_MY_RUNTIME_TYPEINFO;
- Horizontal_group(){}
- void add_element(Score_elem*);
- Horizontal_group(Horizontal_group const&);
- void remove_element(Score_elem*);
+ virtual void add_element(Score_elem*);
+ virtual void remove_element(Score_elem*);
-protected:
- virtual Horizontal_group * horizontal_group() { return this; }
- 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 {
+/**
+ Like Horizontal_group_element, but in X direction
+ */
+class Vertical_group_element : public virtual Axis_group_element {
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*);
- virtual Vertical_group * vertical_group() { return this; }
+ virtual void remove_all();
+
public:
- void add_element(Score_elem*);
- void remove_element(Score_elem*);
-
- Vertical_group(Vertical_group const &);
- Vertical_group(){}
+ virtual void add_element(Score_elem*);
+ virtual void remove_element(Score_elem*);
DECLARE_MY_RUNTIME_TYPEINFO;
};
dimensions are the unions of the dimensions of what it contains.
Translation means translating the contents.
*/
-class Horizontal_vertical_group : public Vertical_group,
- public Horizontal_group
+class Horizontal_vertical_group_element : public Vertical_group_element,
+ public Horizontal_group_element
{
protected:
- virtual Horizontal_vertical_group* elem_group() { return this; }
+ virtual void remove_all();
public:
- Horizontal_vertical_group();
- bool contains_b(Score_elem const *)const;
- DECLARE_MY_RUNTIME_TYPEINFO;
- virtual void do_substitute_dependency(Score_elem*,Score_elem*);
- virtual void do_print() const;
- void add_element(Score_elem*);
+ virtual void add_element(Score_elem*);
+ virtual void remove_element(Score_elem*);
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // ELEM_GROUP_HH
*/
class Engraver_group_engraver : public Engraver, public virtual Translator {
protected:
-
Pointer_list<Engraver*> grav_list_;
Link_array<Engraver_group_engraver> group_l_arr_;
Link_array<Engraver> nongroup_l_arr_;
Array<Score_elem_info> announce_info_arr_;
virtual void do_print()const;
-
virtual bool removable_b()const;
-
public:
- virtual void print() const { Engraver::print(); }
+ Engraver*get_simple_engraver(char const*typeinfo)const;
+ virtual void print() const ;
Input_translator * itrans_l_;
void check_removal();
*/
virtual void terminate_engraver(Engraver * grav_l);
- DECLARE_MY_RUNTIME_TYPEINFO;
+
+ DECLARE_MY_RUNTIME_TYPEINFO;
/**
Remove #grav_l# from the list, and return it.
*/
Translator * ancestor_l(int l=1);
int depth_i() const;
-
};
#endif // ENGRAVERGROUP_HH
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 * nobreak_p);
/**
Invoke walker method to typeset element. Default: pass on to daddy.
*/
bool is_bottom_engraver() const;
void post_move_processing();
+ void removal_processing();
Engraver_group_engraver * daddy_grav_l_;
virtual ~General_script_def() {}
protected:
- virtual bool do_equal_b(General_script_def const &)const;
+ virtual bool do_equal_b(General_script_def const *)const;
virtual void do_print()const;
};
#include "script-column.hh"
+/**
+ Scripts and rests/noteheads
+ */
class Head_column : public Script_column
{
public:
Stem* stem_l_;
void add(Note_head*);
- void add(Script*s) { Script_column::add(s) ; }
+ virtual void add(Script*s);
virtual void set(Stem*);
Head_column();
DECLARE_MY_RUNTIME_TYPEINFO;
#define HEADGRAV_HH
#include "engraver.hh"
-struct Note_head_engraver : Engraver {
+/**
+ make balls and rests
+ */
+class Note_head_engraver : public Engraver {
Note_head* note_p_;
Rhythmic_req * note_req_l_;
- /* *************** */
+public:
Note_head_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+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();
- DECLARE_MY_RUNTIME_TYPEINFO;
+
};
#define HORIZONTAL_GROUP_ITEM_HH
#include "elem-group.hh"
-#include "item.hh"
+#include "axis-group-item.hh"
-class Horizontal_group_item : public Item, public Horizontal_group {
+class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
+protected:
+ virtual void remove_all() { Horizontal_group_element::remove_all(); }
+ virtual void do_print() const;
+public:
+ virtual void add_element(Score_elem*e) { Horizontal_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Horizontal_group_element::remove_element(e); }
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_group_item);
-protected:
- virtual void do_breakable_col_processing();
- void OK()const;
- virtual void do_print() const { Elbement_group::do_print(); }
+
+
};
#endif // HORIZONTAL_GROUP_ITEM_HH
~Input_translator_list(){}
};
-struct Input_translator : Input {
+/** Define a intereter for music. This is an runtime interface to the
+ typesystem */
+class Input_translator : public Input {
+public:
Input_translator_list contains_itrans_p_list_;
Array<String> consists_str_arr_;
Array<String> alias_str_arr_;
#include "score-elem.hh"
/**
- a horizontally fixed size element of the score
+ A horizontally fixed size element of the score.
Item is the datastructure for printables whose width is known
before the spacing is calculated
Item * broken_to_a_[2];
- // nobreak = 0, pre =1, post = 2
+ /// should be put in a breakable col.
+ bool breakable_b_;
+ int break_status_i_;
+ /// nobreak = 0, pre = -1, post = 1
int break_status_i()const;
Item * find_prebroken_piece(PCol*)const;
Item * find_prebroken_piece(Line_of_score*)const;
virtual void do_print()const;
void copy_breakable_items();
-
};
#include "engraver.hh"
#include "key.hh"
-struct Key_engraver : Engraver {
+/**
+ Make the key signature.
+ */
+class Key_engraver : public Engraver {
+ void create_key();
+ void read_req(Key_change_req * r);
+
+public:
Key key_;
Key_change_req * keyreq_l_;
Key_item * kit_p_;
bool default_key_b_;
bool change_key_b_;
+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();
virtual void acknowledge_element(Score_elem_info);
+public:
Key_engraver();
DECLARE_MY_RUNTIME_TYPEINFO;
-private:
- void create_key();
-
- void read_req(Key_change_req * r);
};
#endif // KEYGRAV_HH
bool default_b_;
- /* *************** */
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Key_item);
void add(int pitch, int acc);
void read(const Key_engraver&);
void set_c_position(int);
+protected:
virtual void do_pre_processing();
Molecule* brew_molecule_p()const;
};
#define LILY_PROTO_HH
#include "proto.hh"
-struct My_lily_lexer;
+
struct Absolute_dynamic_req;
+struct Axis_group_element;
+struct Axis_group;
struct Translator;
+struct Audio_element;
struct Audio_column;
struct Audio_item;
struct Audio_key;
struct Audio_meter;
struct Audio_note;
+struct Audio_note_off;
struct Audio_score;
+struct Audio_staff;
struct Audio_tempo;
struct Atom;
struct Bar;
+struct Bar_column_engraver;
+struct Bar_column;
struct Bar_engraver;
struct Bar_req;
struct Barcheck_req;
struct Cresc_req;
struct Crescendo ;
struct Decresc_req;
+
struct Directional_spanner;
struct Disallow_break_req;
struct Durational_req;
struct Group_feature_req;
struct Head_column;
struct Horizontal_align_item;
-struct Horizontal_group;
+struct Horizontal_group_element;
struct Horizontal_group_item;
struct Horizontal_vertical_group;
struct Idealspacing;
struct Lookup;
struct Lyric_item;
struct Lyric_req;
+struct My_lily_lexer;
struct Measure_grouping_req;
struct Melodic_req;
struct Meter;
struct Midi_key;
struct Midi_meter;
struct Midi_note;
+struct Midi_note_event;
+struct Midi_note_off;
struct Midi_output;
struct Midi_score;
struct Midi_stream;
struct Midi_tempo;
struct Midi_track;
+struct Midi_walker;
struct Mixed_qp;
struct Molecule;
struct Music_general_chord;
struct Output;
struct Performer;
struct PCol;
-struct PScore;
+struct Paper_score;
struct Paper_def;
struct Partial_measure_req;
struct Plet;
struct Symtables;
struct Super_elem;
struct Terminate_voice_req;
+struct Tempo_req;
struct Tex_stream;
struct Text_def;
struct Text_gob;
struct Timing_req;
struct Vertical_brace;
struct Vertical_spanner;
-struct Vertical_group;
+struct Vertical_group_element;
struct Vertical_align_spanner;
struct Vertical_align_engraver;
struct Vertical_align_element;
TODO:
update item if Items are removed
+
+ TODO
+
+ figure out private/public
+
*/
-struct Local_key_item : Item {
+class Local_key_item : public Item {
+public:
DECLARE_MY_RUNTIME_TYPEINFO;
Array<Local_acc> accs;
Link_array<Item> support_items_;
int c0_position;
- /* *************** */
+
Local_key_item(int c0position);
void add_support(Item*);
void add(int oct, int pitch, int acc);
void add(Melodic_req*);
-public:
+protected:
virtual void do_pre_processing();
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual Molecule* brew_molecule_p()const;
String get_version_str();
extern Sources* source_l_g;
extern bool only_midi;
+extern int exit_status_i_;
extern String default_out_fn;
/**
+ definitions for midi output. Rather empty
*/
struct Midi_def {
// ugh!
/// output file name
String outfile_str_;
- Assoc<String, Real> *real_vars_p_;
Input_translator* itrans_p_;
/// duration of whole note
Real duration_to_seconds_f(Moment);
Global_translator* get_global_translator_p() const;
- Real get_var( String s ) const;
int get_tempo_i( Moment moment );
void print() const;
void set( Input_translator* itrans_p );
- void set_var( String s, Real r );
void set_tempo( Moment moment, int count_per_minute_i );
};
#include "string.hh"
#include "lily-proto.hh"
+#include "virtual-methods.hh"
+#include "moment.hh"
/**
Any piece of midi information.
Maybe use base classes for RIFF files?
*/
struct Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
Midi_item( Audio_item* audio_item_l );
static String i2varint_str( int i );
void output( Midi_stream* midi_stream_l ) const;
Midi_item& operator =( Midi_item const& );
};
-struct Midi_key : public Midi_item {
- Midi_key( Audio_item* audio_item_l );
-
+/**
+ variable sized MIDI data
+ */
+struct Midi_chunk : Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_chunk();
+
+ void add( String str );
+ void set( String header_str, String data_str, String footer_str );
+ virtual String str() const;
+
+private:
+ String data_str_;
+ String footer_str_;
+ String header_str_;
+};
+
+struct Midi_duration : public Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_duration( Real seconds_f );
+
virtual String str() const;
+ Real seconds_f_;
+};
+
+struct Midi_header : Midi_chunk {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ Midi_header( int format_i, int tracks_i, int clocks_per_4_i );
+
};
/**
Change instrument event
*/
struct Midi_instrument : public Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
Midi_instrument( int channel_i, String instrument_str );
virtual String str() const;
String instrument_str_;
};
-struct Midi_note : public Midi_item {
- /**
- Generate a note-event on a channel.
-
- @param #melreq_l# is the pitch.
- */
- Midi_note( Audio_item* audio_item_l );
+struct Midi_key : public Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_key( Audio_item* audio_item_l );
+
virtual String str() const;
-
- /* *************** */
- int const c0_pitch_i_c_ = 60;
- bool on_b_;
- Byte dynamic_byte_;
};
-struct Midi_duration : public Midi_item {
- Midi_duration( Real seconds_f );
+struct Midi_meter : Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_meter( Audio_item* audio_item_l );
+
virtual String str() const;
- /* *************** */
- Real seconds_f_;
+ int clocks_per_1_i_;
};
-struct Midi_chunk : Midi_item {
- Midi_chunk();
+/**
+ Turn a note on (blond).
+ */
+struct Midi_note : public Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_note( Audio_item* audio_item_l );
- void add( String str );
- void set( String header_str, String data_str, String footer_str );
+ Moment duration() const;
+ int pitch_i() const;
virtual String str() const;
-private:
- String data_str_;
- String footer_str_;
- String header_str_;
+
+ int const c0_pitch_i_c_ = 60;
+ Byte dynamic_byte_;
};
-struct Midi_header : Midi_chunk {
- /* *************** */
- Midi_header( int format_i, int tracks_i, int clocks_per_4_i );
+/**
+ Turn a note off (dark).
+ */
+struct Midi_note_off : public Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ Midi_note_off( Midi_note* midi_note_l );
+
+ int pitch_i() const;
+ virtual String str() const;
+
+ Byte aftertouch_byte_;
};
struct Midi_text : Midi_item {
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
enum Type {
TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC,
MARKER, CUE_POINT
};
-
- Midi_text( Audio_item* audio_item_l );
Midi_text( Midi_text::Type type, String text_str );
-
+ Midi_text( Audio_item* audio_item_l );
+
virtual String str() const;
Type type_;
};
struct Midi_tempo : Midi_item {
- Midi_tempo( Audio_item* audio_item_l );
+ DECLARE_MY_RUNTIME_TYPEINFO;
Midi_tempo( int per_minute_4_i );
-
+ Midi_tempo( Audio_item* audio_item_l );
+
virtual String str() const;
int per_minute_4_i_;
};
-struct Midi_meter : Midi_item {
- Midi_meter( Audio_item* audio_item_l );
-
- virtual String str() const;
- int clocks_per_1_i_;
-};
-
struct Midi_track : Midi_chunk {
+ DECLARE_MY_RUNTIME_TYPEINFO;
int number_i_;
- /* *************** */
+
Midi_track();
void add( int delta_time_i, String event );
+++ /dev/null
-/*
- midioutput.hh -- declare Midi_output
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
-*/
-
-
-#ifndef MIDIOUTPUT_HH
-#define MIDIOUTPUT_HH
-#include "lily-proto.hh"
-
-
-struct Midi_output {
- #if 0
- Midi_output(Score* score_l, Midi_def* );
-
- void do_staff(Staff*st_l, int count);
- void header();
- void staffs();
-
- Score* score_l_;
- Midi_def* midi_l_;
- Midi_stream* midi_stream_l_;
-#endif
-};
-
-#endif // MIDIOUTPUT_HH
-
-//
-// midistream.hh -- part of GNU LilyPond
-//
-// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+/*
+ midi-stream.hh -- declare Midi_stream
+
+ (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+ */
#ifndef MIDI_STREAM_HH
#define MIDI_STREAM_HH
#include <iostream.h>
#include "string.hh"
-/// Midi output
+/// Midi outputfile
struct Midi_stream {
- ostream* os_p_;
- String filename_str_;
- int clocks_per_4_i_;
- int tracks_i_;
-
- Midi_stream( String filename_str, int tracks_i, int clocks_per_4_i_ );
+ Midi_stream( String filename_str );
~Midi_stream();
Midi_stream& operator <<( String str );
Midi_stream& operator <<( Midi_item const& mitem_c_r );
Midi_stream& operator <<( int i );
- void header();
void open();
-//private:
-// Midi_stream(Midi_stream const&);
+ ostream* os_p_;
+ String filename_str_;
};
-#endif // MIDI_STREAM_HH //
+
+#endif // MIDI_STREAM_HH
--- /dev/null
+/*
+ midi-walker.hh -- declare Midi_walker
+
+ (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+ */
+
+#ifndef MIDI_WALKER_HH
+#define MIDI_WALKER_HH
+
+#include "proto.hh"
+#include "plist.hh"
+#include "pcursor.hh"
+#include "pqueue.hh"
+#include "lily-proto.hh"
+#include "moment.hh"
+
+struct Midi_note_event : PQueue_ent<Moment, Midi_note_off*>
+{
+ bool ignore_b_;
+ Midi_note_event();
+};
+
+int compare(Midi_note_event const& left, Midi_note_event const& right );
+
+/**
+ walk audio and output midi
+ */
+class Midi_walker : public PCursor<Audio_item*>
+{
+public:
+ Midi_walker( Audio_staff* audio_staff_l, Midi_track* midi_track_l );
+ ~Midi_walker();
+
+ void process();
+
+private:
+ void do_start_note( Midi_note* note_l );
+ void do_stop_notes( Moment now_mom );
+ void output_event( Moment now_mom, Midi_item* l );
+
+ Midi_track* track_l_;
+ PQueue<Midi_note_event> stop_note_queue;
+ Moment last_mom_;
+};
+
+
+#endif // MIDI_WALKER_HH
void add_bottom(const Molecule &m);
void add(Molecule const &m);
void translate(Offset);
- void translate_y(Real);
- void translate_x(Real);
+ void translate(Real,Axis);
void add(Atom const & a) ;
/// how big is #this#?
Box extent() const;
#include "moment.hh"
class Music_iterator {
+ Array<Translator *>report_to_l_arr_;
+ void push_translator(Translator*);
+ void pop_translator();
protected:
bool first_b_;
virtual void do_print()const;
-public:
- Music_iterator *daddy_iter_l_;
- DECLARE_MY_RUNTIME_TYPEINFO;
- Array<Translator *>report_to_l_arr_;
-
- Translator *report_to_l()const;
-
- static Music_iterator* static_get_iterator_p(Music*,Translator*);
+ virtual Translator * get_req_translator_l();
Music_iterator* get_iterator_p(Music*)const;
void set_translator(Translator*);
- void push_translator(Translator*);
- void pop_translator();
-
+ Music_iterator *daddy_iter_l_;
+public:
+ Translator *report_to_l()const;
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ static Music_iterator* static_get_iterator_p(Music*,Translator*);
Music_iterator();
virtual void process_and_next(Moment until);
virtual ~Music_iterator();
virtual void construct_children();
void print()const;
- virtual Translator * get_req_translator_l();
};
-class Change_iterator : public Music_iterator {
- Change_reg * change_l_;
-public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- virtual void process_and_next(Moment);
- Change_iterator(Change_reg*);
-};
class Chord_iterator : public Music_iterator
{
Moment here_mom_;
const Voice * voice_C_;
Music_iterator * iter_p_;
- void next_element();
+ void start_next_element();
+ void leave_element();
+ void set_voice_translator();
+
public:
Voice_iterator(Voice const*);
DECLARE_MY_RUNTIME_TYPEINFO;
#include "lily-proto.hh"
#include "string.hh"
-/** In Lily, everything that has a length and a pitch (which can be
- transposed) is considered "music",
+/**
+ Anything which has length or pitch.
+
+ In Lily, everything that can be thought to have a length and a pitch
+ (which has a duration which can be transposed) is considered "music",
Music is hierarchical:
- @seealso Music_list
+ @see Music_list
+
*/
class Music:public Input {
public:
Music_list * parent_music_l_;
- /** what kind of iterator needed to walk this music? This doesn't
+ /** The kind of iterator needed to walk this music. This doesn't
make sense for simple (ie non-list) music, but it does no harm
here. Yes, it did harm Music_list: you can forget to copy it.
/* *************** */
void set_duration(Duration);
- static int compare(const Rhythmic_req &, const Rhythmic_req &);
+ bool do_equal_b(Request*)const;
virtual Moment duration() const;
Rhythmic_req();
+ static int compare(Rhythmic_req const&,Rhythmic_req const&);
REQUESTMETHODS(Rhythmic_req, rhythmic);
};
Text_req(int d, Text_def*);
~Text_req();
Text_req(Text_req const&);
- static int compare(const Text_req&,const Text_req&);
+
REQUESTMETHODS(Text_req,text);
};
/// return pitch from central c (in halfnotes)
int pitch()const;
Melodic_req();
- static int compare(Melodic_req const&, Melodic_req const&);
-
+ bool do_equal_b(Request*)const;
+ static int compare( Melodic_req const&,Melodic_req const&);
REQUESTMETHODS(Melodic_req,melodic);
};
/// force/supress printing of accidental.
bool forceacc_b_;
Note_req();
+ bool do_equal_b(Request*)const;
Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); }
REQUESTMETHODS(Note_req, note);
};
enum {
NOSPAN, START, STOP
} spantype ;
- static int compare(const Span_req &r1, const Span_req &r2);
+ bool do_equal_b(Request*)const;
REQUESTMETHODS(Span_req,span);
Span_req();
public:
int default_octave_i_;
Duration default_duration_;
+ Plet plet_;
+
String textstyle_str_;
bool first_b_;
bool last_duration_mode_b_ ;
bool h_shift_b_;
int dir_i_;
- /* *************** */
+
bool acceptable_elem_b(Score_elem const*)const;
protected:
virtual void set_feature(Feature);
DECLARE_MY_RUNTIME_TYPEINFO;
Note_performer();
- ~Note_performer();
protected:
virtual void process_requests();
private:
Melodic_req * note_req_l_;
- Moment off_mom_;
};
#endif // NOTE_PERFORMER_HH
#ifndef OFFSET_HH
#define OFFSET_HH
+
#include "real.hh"
+#include "axes.hh"
+
/// 2d vector
struct Offset {
- Real x,y;
-
- Offset operator+(Offset o)const {
- Offset r(*this);
- r+=o;
- return r;
+ Real coordinate_a_[NO_AXES];
+
+ Real &y() { return coordinate_a_[Y_AXIS]; }
+ Real &x() { return coordinate_a_[X_AXIS]; }
+ Real y()const { return coordinate_a_[Y_AXIS]; }
+ Real x()const { return coordinate_a_[X_AXIS]; }
+
+ Real &operator[](Axis i) {
+ return coordinate_a_[i];
+ }
+ Real operator[](Axis i) const{
+ return coordinate_a_[i];
}
Offset operator+=(Offset o) {
- x+=o.x;
- y+=o.y;
+ x()+=o.x();
+ y()+=o.y();
return *this;
}
Offset(Real ix , Real iy) {
- x=ix;
- y=iy;
+ x()=ix;
+ y()=iy;
}
Offset() {
- x=0.0;
- y=0.0;
+ x()=0.0;
+ y()=0.0;
}
};
+inline Offset
+operator+(Offset o1, Offset const& o2)
+{
+ o1 += o2;
+ return o1;
+}
+
#endif // OFFSET_HH
class PCol {
public:
Link_list<Item *> its;
- Link_list<Spanner *> stoppers, starters;
+ Link_list<Spanner *> starters;
/** prebreak is put before end of line.
if broken here, then (*this) column is discarded, and prebreak
bool error_mark_b_;
bool used_b_ ; // manual override..
- PScore * pscore_l_;
+ Paper_score * pscore_l_;
/* *************** */
/// which one (left =0)
void set_rank(int);
void OK() const;
- void set_breakable();
+ void set_breakable();
virtual void do_set_breakable();
void print()const;
private:
/*
- p-score.hh -- declare PScore
+ p-score.hh -- declare Paper_score
source file of the GNU LilyPond music typesetter
#include "plist.hh"
/** all stuff which goes onto paper. notes, signs, symbols in a score
- #PScore# contains the items, the columns.
+ #Paper_score# contains the items, the columns.
*/
-class PScore {
+class Paper_score {
public:
Paper_def *paper_l_;
/* *************** */
/* CONSTRUCTION */
- PScore(Paper_def*);
+ Paper_score(Paper_def*);
/// add a line to the broken stuff. Positions given in #config#
void set_breaking(Array<Col_hpositions> const &);
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=0);
+ void typeset_item(Item *item_p, PCol *pcol_l);
- /// add to bottom of pcols
+ /// add to bottom of pcols
void add(PCol*);
/**
/* STANDARD ROUTINES */
void OK()const;
void print() const;
- ~PScore();
+ ~Paper_score();
void typeset_element(Score_elem*);
void typeset_broken_spanner(Spanner*);
/// add a Spanner
/**
- symbols, dimensions and constants
+ Symbols, dimensions and constants pertaining to visual output.
This struct takes care of all kinds of symbols, dimensions and
constants. Most of them are related to the point-size of the fonts,
/// height of the staff
Real standard_height()const;
- /// width of a quaver ball
+ /// width of a crotchet ball
Real note_width() const;
void print() const;
DECLARE_MY_RUNTIME_TYPEINFO;
Input_translator* itrans_l_;
- Performer_group_performer();
- ~Performer_group_performer();
-
virtual void add( Performer* perf_p );
- virtual void print()const { Performer::print() ; }
- virtual Moment get_mom() const;
virtual bool do_try_request( Request* req_l );
- virtual bool try_request(Request*r) { return Performer::try_request(r) ; }
-
- // <ugh>
- virtual void set_track( int& track_i_r );
- virtual int get_track_i() const;
- // </ugh>
+ virtual void print() const;
+ virtual bool try_request(Request* r);
+
protected:
-
+ virtual ~Performer_group_performer();
virtual Translator* find_get_translator_l( String name, String id );
virtual Translator* get_default_interpreter();
Performer();
virtual ~Performer();
-
void print() const;
virtual void process_requests();
- virtual void set( Moment mom );
- // <ugh>
- virtual void set_track( int& track_i_r );
- virtual int get_track_i() const;
- // </ugh>
-
virtual bool try_request( Request* req_l );
virtual void do_removal_processing();
protected:
virtual void do_creation_processing();
-
virtual bool do_try_request(Request*);
virtual int get_tempo_i() const;
virtual void do_print() const;
- virtual Moment get_mom() const;
- virtual void play( Audio_item* p );
- virtual void play( Midi_item* l );
+ virtual void play( Audio_element * elem_p );
};
#include "global-performers.hh"
virtual Blank_req * blank() { return 0; }
virtual Musical_req *musical() { return 0; }
virtual Command_req * command() { return 0; }
+ bool equal_b(Request*) const;
protected:
- virtual void do_print()const ;
+ virtual bool do_equal_b(Request*) const;
+ virtual void do_print()const;
};
#define REQUESTMETHODS(T,accessor) \
General_script_def *scriptdef_p_;
/* *************** */
- static int compare(const Script_req &, const Script_req &);
+ bool do_equal_b(Request*)const;
+
Script_req();
REQUESTMETHODS(Script_req,script);
~Script_req();
#include "script-column.hh"
#include "head-column.hh"
-/**
- struct to treat a set of rests as union (one voicegroup should
- only produce one rest.
- */
+/** struct to treat a set of rests as union (one voice should only
+ produce one rest. */
class Rest_column : public Head_column {
public:
DECLARE_MY_RUNTIME_TYPEINFO;
#include "engraver.hh"
+/**
+ Group a number of items across staffs
+ */
class Score_align_engraver: public Engraver
{
Horizontal_group_item * align_p_;
#include "p-col.hh"
/**
-
- When typesetting hasn't started on PScore yet, the columns which
- contain data have a rhythmical position. Score_column is the type
- with a rhythmical time attached to it. The calculation of
- idealspacing is done with data in these columns. (notably: the
- #durations# field)
-
- */
+ Column with durational info.
+
+ The columns which contain data have a rhythmical
+ position. Score_column is the type with a rhythmical time attached
+ to it. The calculation of idealspacing is done with data in these
+ columns. (notably: the #durations# field)
+
+ */
class Score_column : public PCol {
friend class Score;
#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
Stem. So the Beam has to be calculated *before* Stem. This is
Molecule *output; // should scrap, and use temp var?
- /**
- This is needed, because #output# may still be
- NULL.
- */
- Offset offset_;
/**
for administration of what was done already
Status status_;
+ Score_elem* dependency(int) const;
+ Score_elem* dependent(int) const;
+ int dependent_size() const;
+ int dependency_size() const;
public:
- PScore *pscore_l_;
- Vertical_group *y_group_l_;
- Horizontal_group *x_group_l_;
+ /**
+ This is needed, because #output# may still be
+ NULL.
+ */
+ Offset offset_;
+
+
+
+
+ Paper_score *pscore_l_;
+ Axis_group_element * axis_group_l_a_[2];
+
Score_elem(Score_elem const&);
virtual String TeX_string () const ;
+ String TeX_string_without_offset(Offset)const;
virtual void print() const;
Paper_def *paper() const;
Score_elem();
DECLARE_MY_RUNTIME_TYPEINFO;
+ Interval extent(Axis)const;
Interval width() const;
Interval height() const;
- virtual void translate_x(Real);
- virtual void translate_y(Real);
Status status() const;
/**
translate the symbol. The symbol does not have to be created yet.
*/
void translate(Offset);
- Offset offset()const;
+ /**
+ translate in one direction
+ */
+
+ void translate(Real, Axis);
+ Real relative_coordinate(Axis_group_element*, Axis)const;
+ Offset absolute_offset()const;
+ Real absolute_coordinate(Axis)const;
+ Axis_group_element*common_group(Score_elem const* s, Axis a)const;
void add_processing();
void OK() const;
void post_processing();
void molecule_processing();
+ /**
+ Remove all links (dependencies, dependents, Axis_group_elements.
+ */
void unlink();
void unlink_all();
void substitute_dependency(Score_elem*,Score_elem*);
/*
virtual accessors
*/
- virtual Vertical_group * vertical_group() { return 0; }
- virtual Horizontal_group * horizontal_group() { return 0; }
virtual Spanner* spanner() { 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);
- 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
virtual void do_print() const {}
/// generate the molecule
virtual Molecule* brew_molecule_p()const;
- ///executed directly after the item is added to the PScore
+ ///executed directly after the item is added to the Paper_score
virtual void do_add_processing();
/// do calculations before determining horizontal spacing
virtual void do_pre_processing();
virtual void do_break_processing();
virtual void handle_broken_dependencies();
virtual void handle_prebroken_dependencies();
-
-
-
+ virtual Link_array<Score_elem> get_extra_dependencies()const;
+ virtual void do_unlink();
};
#include "engraver-group.hh"
#include "global-translator.hh"
+/**
+ Top level engraver. Puts elements into appropriate columns.
+ */
class Score_engraver :
public Engraver_group_engraver, public Global_translator
{
Score_column* musical_column_l_;
friend class Score;
- void set_cols(Score_column*,Score_column*);
+ void set_columns(Score_column*,Score_column*);
void typeset_all();
public:
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;
#include "performer-group-performer.hh"
#include "global-translator.hh"
+/**
+ Top level performer. Completely takes care of MIDI output
+ */
class Score_performer:
public Performer_group_performer, public Global_translator
{
~Score_performer();
protected:
- virtual Translator* ancestor_l( int l );
+ virtual Translator* ancestor_l(int l);
virtual int depth_i() const;
virtual void finish();
- virtual Moment get_mom() const;
- virtual void prepare( Moment mom );
+ virtual void prepare(Moment mom);
virtual void process();
- virtual void set_score( Score* score_l );
+ virtual void set_score(Score* score_l);
virtual void start();
virtual int get_tempo_i() const;
- virtual void play(Audio_item*);
- virtual void play(Midi_item*);
+ virtual void play(Audio_element* p);
private:
void header(Midi_stream&);
- Midi_def* midi_l_;
-
- Moment prev_mom_;
Moment now_mom_;
Audio_column* audio_column_l_;
-
- Link_array<Midi_item> midi_item_l_arr_;
};
#endif // SCORE_PERFORMER_HH
Paper_def *paper_p_;
Midi_def *midi_p_;
Music * music_p_;
- PScore *pscore_p_;
+ Paper_score *pscore_p_;
Audio_score* audio_score_p_;
int errorlevel_i_;
/// output to file
void output(String fn);
-
///
void set(Midi_def* midi_p);
///
// utils:
PCursor<Score_column*> create_cols(Moment, PCursor<Score_column*> &last);
-
/**
make the pcol_l_ fields of each Score_column point to the correct PCol,
remove any unnecessary Score_column's
Link_array<Item> support_l_arr_;
DECLARE_MY_RUNTIME_TYPEINFO;
- void add(Script *);
+ virtual void add(Script *);
void add_support(Item*);
};
virtual Atom get_atom(Paper_def* p, int dir_i_)const;
DECLARE_MY_RUNTIME_TYPEINFO;
- virtual bool do_equal_b(General_script_def const &)const;
+ virtual bool do_equal_b(General_script_def const *)const;
virtual void do_print() const;
Script_def();
void set_from_input(String, bool, int, int ,bool,int );
Array<Script *> script_p_arr_;
Array<Script_req *> script_req_l_arr_;
- /* *************** */
- bool acceptable_elem_b(Score_elem*);
public:
DECLARE_MY_RUNTIME_TYPEINFO;
Script_engraver();
protected:
virtual bool do_try_request(Request*);
virtual void do_process_requests();
- virtual void acknowledge_element(Score_elem_info);
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
Stem *stem_l_;
- /* *************** */
protected:
Molecule *brew_molecule_p()const;
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual Interval symbol_height()const;
virtual void do_pre_processing();
virtual Interval do_width() const;
+ SCORE_ELEM_CLONE(Script);
private:
void set_default_dir();
#include "engraver.hh"
+/**
+
+ Make bars that span multiple "staffs". Catch bars, and span a
+ Span_bar over them if we find more than 2 bars
+
+ */
class Span_bar_engraver : public Engraver
{
Span_bar * spanbar_p_;
Link_array<Bar> spanning_l_arr_;
public:
+ Span_bar();
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Span_bar);
void add(Bar* );
protected:
virtual Interval do_width()const;
virtual void do_pre_processing();
- virtual void translate_y(Real y);
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual Molecule * brew_molecule_p()const;
#include "span-bar-grav.hh"
+/**
+
+ Make the bars that Span the entire score line (system). A
+ Span_bar_engraver which generates a special bar.
+
+ */
+
class Span_score_bar_engraver : public Span_bar_engraver
{
public:
#include "spanner.hh"
#include "elem-group.hh"
-class Spanner_elem_group : public Spanner, public Horizontal_vertical_group {
+class Spanner_elem_group : public Spanner, public Horizontal_vertical_group_element {
protected:
virtual Interval do_width()const;
#include "lily-proto.hh"
#include "score-elem.hh"
-/** a symbol which is attached between two columns. A spanner is a
+/** A symbol which is attached between two columns. A spanner is a
symbol which spans across several columns, so its final appearance
can only be calculated after the breaking problem is solved.
#include "colhpos.hh"
/**
- Determine positions of columns connected by springs and held apart by rods
+ Determine positions of columns connected by springs and held apart by rods.
Generate a spacing which
String instrument_str();
protected:
- virtual void play( Midi_item* l );
- virtual void play( Audio_item* l );
+ virtual void play( Audio_element* p );
virtual void do_removal_processing();
virtual void do_creation_processing();
- // <ugh>
- virtual void set_track( int& track_i_r );
- virtual int get_track_i() const;
- // </ugh>
private:
- void header();
-
- Moment midi_mom_;
- Midi_track* midi_track_p_;
- Pointer_list<Audio_item*> audio_item_p_list_;
- int track_i_;
+ Audio_staff* audio_staff_p_;
};
#endif // STAFF_PERFORMER_HH
#include "score-elem.hh"
#include "interval.hh"
-/** A symbol which sits along a staff
+/** A symbol which sits along a staff.
- Should override translate_y() ?
*/
class Staff_side : virtual Score_elem {
Link_array<Score_elem> support_l_arr_;
+++ /dev/null
-/*
- staffline.hh -- horizontal structures for broken scores.
-
- (c) 1996,97 Han-Wen Nienhuys
-*/
-
-#ifndef STAFFLINE_HH
-#define STAFFLINE_HH
-
-#include "spanner-elem-group.hh"
-
-/// one broken line of staff.
-struct Line_of_staff : public Spanner_elem_group{
-
- SCORE_ELEM_CLONE(Line_of_staff);
-public:
- DECLARE_MY_RUNTIME_TYPEINFO;
-
- /* *************** */
- /**
- Add an element. If it is a Element_group, only the dependency
- (otherwise, might translate doubly) */
- void add_element(Score_elem*);
-};
-
-#endif
#define SUPER_ELEM_HH
#include "score-elem.hh"
-/** The toplevel element. The PScore contains this element, and any
+/** The toplevel element. The Paper_score contains this element, and any
element shoud be a dependency for the super element.
*/
-class Super_elem : public virtual Score_elem {
+class Super_elem : public Score_elem {
public:
Link_array<Line_of_score> lines_arr_;
Line_of_score * line_of_score_l_;
void translate(Offset o) {
off_ += o;
}
- void translate_x(Real r){
- off_.x += r;
+ void translate(Real r,Axis a){
+ off_[a] += r;
}
- void translate_y(Real r) {
- off_.y += r;
- }
-
/// how big is #this#?
Box extent() const;
Atom(Symbol s);
String text_str_;
String style_str_;
- /* *************** */
virtual void do_print() const;
virtual ~Text_def() {};
- bool do_equal_b(const Text_def&)const;
+ virtual bool do_equal_b(const General_script_def*)const;
Text_def();
virtual void print() const;
Interval width(Paper_def*) const;
--- /dev/null
+/*
+ timing-grav.hh -- declare Timing_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef TIMING_GRAV_HH
+#define TIMING_GRAV_HH
+
+#include "engraver.hh"
+#include "time-description.hh"
+#include "grouping.hh"
+#include "parray.hh"
+
+/**
+ Do time bookkeeping
+ */
+class Timing_engraver : public Engraver
+{
+ Time_description time_;
+ Rhythmic_grouping default_grouping_;
+
+ Link_array<Timing_req> timing_req_l_arr_;
+
+ 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();
+ Timing_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+}
+
+#endif // TIMING_GRAV_HH
#define VERTICAL_ALIGN_ITEM_HH
#include "elem-group.hh"
+
/**
Order elements top to bottom.
*/
#ifndef SPAN_VERTICAL_GROUP_HH
#define SPAN_VERTICAL_GROUP_HH
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
#include "elem-group.hh"
-/** An element which groups a line. Due to technical problems, this
- cannot be used as a baseclass */
-class Vertical_group_spanner : public Spanner, public Vertical_group
+/** An element which groups a line.
+ */
+class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_element
{
protected:
- virtual void do_break_processing();
- virtual void do_print()const;
- VIRTUAL_COPY_CONS(Vertical_group_spanner, Score_elem);
-
-private:
- void remove_all();
- /// shouldn't be copied.
- Vertical_group_spanner(Vertical_group_spanner const&);
-
+ SCORE_ELEM_CLONE(Vertical_group_spanner);
+ virtual void remove_all() { Vertical_group_element::remove_all(); }
public:
- Vertical_group_spanner();
DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual void add_element(Score_elem*e) { Vertical_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Vertical_group_element::remove_element(e); }
+
};
#endif // SPAN_VERTICAL_GROUP_HH
Item::Item()
{
+ breakable_b_ = false;
+ break_status_i_ = 0;
pcol_l_ = 0;
- broken_to_a_[0]
- = broken_to_a_[1]=0;
+ broken_to_a_[0] = broken_to_a_[1]=0;
}
IMPLEMENT_IS_TYPE_B1(Item, Score_elem);
Real
Item::hpos_f()const
{
- return pcol_l_->hpos_f_ + offset().x;
+ return pcol_l_->hpos_f_ + absolute_coordinate(X_AXIS);
}
-
-
Line_of_score *
Item::line_l()const
{
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;
+ return break_status_i_;
}
void
Item::copy_breakable_items()
{
+ if ( broken_to_a_[0] || broken_to_a_[1] )
+ return;
+ Item *new_copies[2];
for (int i=0; i < 2; i++) {
Item * item_p = clone()->item();
item_p->copy_dependencies(*this);
- /* add our pre and postbreaks blondly to our own y_group
- Let Vertical_group_spanner figure out the mess.
- */
- if ( y_group_l_ )
- y_group_l_->add_element( item_p );
- pscore_l_->typeset_item(item_p, pcol_l_, -1+ 2*i);
+
+ item_p->break_status_i_ = -1+ 2*i;
+ pscore_l_->typeset_item(item_p, pcol_l_);
item_p->handle_prebroken_dependencies();
- broken_to_a_[i] = item_p;
+ new_copies[i] =item_p;
}
+ broken_to_a_= new_copies;
}
void
Item::do_breakable_col_processing()
{
- PCol * c = pcol_l_;
- if (!c->breakable_b())
+ if (!breakable_b_ || !pcol_l_->breakable_b())
return;
-
+
copy_breakable_items();
handle_prebroken_dependencies();
+
+ /*
+ Otherwise the broken items won't be pre_process()'ed.
+ */
+ add_dependency( broken_to_a_[0] );
+ add_dependency( broken_to_a_[1] );
+
}
Item*
void
Item::handle_prebroken_dependencies()
{
- if ( pcol_l_->breakable_b() || pcol_l_->daddy_l_ )
+ if ( breakable_b_ )
Score_elem::handle_prebroken_dependencies();
}
Key_engraver::create_key()
{
if (!kit_p_) {
- int c0_i= *get_staff_info().c0_position_i_l_;
+ int c0_i=0;
+
+ Staff_info inf = get_staff_info();
+ if (inf.c0_position_i_l_)
+ c0_i = *get_staff_info().c0_position_i_l_;
kit_p_ = new Key_item(c0_i);
announce_element(Score_elem_info(kit_p_,keyreq_l_));
void
Key_engraver::do_process_requests()
{
- if (key_.multi_octave_b_)
+ if (key_.multi_octave_b_) {
assert(false); // TODO .
- else if (keyreq_l_) {
+ } else if (keyreq_l_) {
create_key();
}
}
{
if (kit_p_) {
kit_p_->default_b_ = default_key_b_;
- typeset_breakable_item( kit_p_);
+ typeset_element( kit_p_);
kit_p_ = 0;
}
}
Key_engraver::read_req(Key_change_req * r)
{
key_.multi_octave_b_ = r->multi_octave_b_;
- accidental_idx_arr_.set_size(0);
+ accidental_idx_arr_.clear();
for (int i = 0; i < r->melodic_p_arr_.size(); i ++) {
Melodic_req * m_l =r->melodic_p_arr_[i];
int n_i =m_l->notename_i_;
+/*
+ key-item.cc -- implement Key_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+
+ keyplacement by Mats Bengtsson
+*/
+
#include "key-item.hh"
#include "key.hh"
#include "debug.hh"
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
-//#include "clef-grav.hh"
+
#include "key-grav.hh"
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
Key_item::Key_item(int c)
{
+ breakable_b_ =true;
default_b_ = false;
set_c_position(c);
}
for (int i =0; i < pitch.size(); i++) {
Symbol s= paper()->lookup_l()->accidental(acc[i]);
Atom a(s);
- a.translate_y((c_position + pitch[i]) * inter);
+ a.translate((c_position + pitch[i]) * inter, Y_AXIS);
Molecule m(a);
output->add_right(m);
}
assert( input.size() > 1 );
Real dx = 0.0;
for (int i=1; i < input.size(); i++)
- dx += abs (input[i-1].x - input[i].x);
+ dx += abs (input[i-1].x() - input[i].x());
assert(dx);
}
Real sxy = 0.0;
for (int i=0; i < input.size();i++) {
- Real x=input[i].x;
- Real y = input[i].y;
+ Real x=input[i].x();
+ Real y = input[i].y();
sx += x;
sy += y;
sqx += sqr(x);
WORD {A}{AN}*
ALPHAWORD {A}+
INT -?{N}+
-REAL {INT}?\.{N}*
+REAL ({INT}\.{N}*)|(-?\.{N}+)
KEYWORD \\{WORD}
WHITE [ \n\t\f]
BLACK [^ \n\t\f]
return INT;
}
- \+\+ {
- return CONCAT;
- }
\" {
start_quote();
}
/* ugr. This sux. */
String s (YYText());
int i = 0;
- while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
+ while ((i=s.index_i("_")) != -1) // change word binding "_" to " "
*(s.ch_l() + i) = ' ';
if ((i=s.index_i("\\,")) != -1) // change "\," to TeX's "\c "
{
yylval.id = id;
return id->token_code_i_;
}
+ if ( YYSTATE != notes ) {
+ Melodic_req * mel_l = lookup_melodic_req_l(str);
+ if (mel_l) {
+ mtor << "(notename)\n";
+ yylval.melreq = mel_l;
+ return NOTENAME_ID;
+ }
+ }
LexerError( "Unknown escaped string: `" + str + "'");
mtor << "(string)";
String *sp = new String( str);
return NOTENAME_ID;
}
}
-#if 0
- if (YYSTATE != notes) {
- // ugr. Should do this in note mode?
- // Identifier * id = lookup_identifier(str);
- if (id) {
- mtor << "(identifier)\n";
- yylval.id = id;
- return id->token_code_i_;
- }
- }
-#endif
yylval.string=new String( str );
return STRING;
#include "command-request.hh"
#include "bar.hh"
#include "debug.hh"
-#include "staffline.hh"
#include "line-group-grav.hh"
Line_group_engraver::Line_group_engraver()
void
Line_group_engraver::acknowledge_element(Score_elem_info elem)
{
- if ( !elem.elem_l_->y_group_l_ )
+ if ( !elem.elem_l_->axis_group_l_a_[Y_AXIS] )
staffline_p_->add_element(elem.elem_l_);
}
- if (!key_item_p)
- key_item_p = new Local_key_item(*get_staff_info().c0_position_i_l_);
+ if (!key_item_p) {
+ int c0_i=0;
+
+ Staff_info inf = get_staff_info();
+ if (inf.c0_position_i_l_)
+ c0_i = *get_staff_info().c0_position_i_l_;
+
+ key_item_p = new Local_key_item(c0_i);
+ }
key_item_p->add(note_l);
key_item_p->add_support(support_l);
local_key_.oct(note_l->octave_i_)
typeset_element(key_item_p);
}
- mel_l_arr_.set_size(0);
- tied_l_arr_.set_size(0);
- support_l_arr_.set_size(0);
- forced_l_arr_.set_size(0);
+ mel_l_arr_.clear();
+ tied_l_arr_.clear();
+ support_l_arr_.clear();
+ forced_l_arr_.clear();
}
-
+/*
+ whoah .. this looks hairy!
+ */
void
Local_key_engraver::acknowledge_element(Score_elem_info info)
{
Local_key_engraver::do_process_requests()
{
Time_description const * time_C_ = get_staff_info().time_C_;
- if (! time_C_->whole_in_measure_){
+ if (time_C_ && !time_C_->whole_in_measure_){
if (key_C_)
local_key_= *key_C_;
- else if(0&& time_C_->when_ >Moment(0))
- warning ("Help me! can't figure out current key");
}
}
if (accs[i].octave_i_ != lastoct) {
if (octmol){
Real dy =lastoct*7*paper()->internote_f();
- octmol->translate_y( dy);
+ octmol->translate( dy, Y_AXIS);
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_y(dy);
+ a.translate(dy, Y_AXIS);
octmol->add_right(a);
}
if (octmol){
Real dy =lastoct*7*paper()->internote_f();
- octmol->translate_y( dy);
+ octmol->translate( dy, Y_AXIS);
output->add(*octmol);
delete octmol;
}
Interval head_width=itemlist_width(support_items_);
- output->translate_x(-output->extent().x.right + head_width.left );
+ output->translate(-output->extent().x().right + head_width.left , X_AXIS);
return output;
}
a.push(print_dimen( h));
Symbol ret=(*symtables_)("bars")->lookup(s);;
ret.tex = substitute_args(ret.tex, a);
- ret.dim.y = Interval( 0, h);
+ ret.dim.y() = Interval( 0, h);
return ret;
}
Array<String> a;
a.push(idx);
ret.tex = substitute_args(ret.tex, a);
- ret.dim.x = Interval(0,wid);
+ ret.dim.x() = Interval(0,wid);
return ret;
}
{
Real internote_f = paper_l_ ->internote_f();
Symbol s;
- s.dim.x = Interval(0,wid);
Real dy = (lines >0) ? (lines-1)*internote_f : 0;
- s.dim.y = Interval(0,dy);
+ s.dim = Box(Interval(0,wid), Interval(0,dy));
Array<String> a;
a.push(lines);
Lookup::meter(Array<Scalar> a) const
{
Symbol s;
- s.dim.x = Interval( 0 PT, 10 PT);
- s.dim.y = Interval(0, 20 PT); // todo
+ s.dim.x() = Interval( 0 PT, 10 PT);
+ s.dim.y() = Interval(0, 20 PT); // todo
String src = (*symtables_)("param")->lookup("meter").tex;
s.tex = substitute_args(src,a);
return s;
}
Symbol s;
- s.dim.x = Interval(0,0);
- s.dim.y = Interval(y1,y2);
+ s.dim.x() = Interval(0,0);
+ s.dim.y() = Interval(y1,y2);
Array<String> a;
a.push(print_dimen(y1));
Array<String> a;
a.push(idx);
s.tex = substitute_args(s.tex,a);
- s.dim.y = Interval(0,y);
+ s.dim.y() = Interval(0,y);
}
{
Array<String> a;
if ( lreq_l_ ) {
lyric_item_p_ = new Text_item(lreq_l_->tdef_p_ );
- lyric_item_p_->translate_x( paper()->note_width()/2 );
+ lyric_item_p_->translate( paper()->note_width()/2 , X_AXIS);
lyric_item_p_->dir_i_ = -1;
lyric_item_p_->fat_b_ = true;
announce_element( Score_elem_info( lyric_item_p_, lreq_l_));
Sources* source_l_g = 0;
bool only_midi = false;
bool version_ignore_b_ = false;
+int exit_status_i_;
void destill_inname( String &name_str_r);
#ifdef STRING_UTILS_INLINED
"STRING_UTILS_INLINED "
#endif
- "datadir= " DIR_DATADIR "\n"
+ "datadir= " DIR_DATADIR
+
+ "\n";
+
;
{
cout <<
"\n"
- "GNU LilyPond, a music typesetter.\n"
- "Copyright (C) 1996,97 by\n"
+ "GNU LilyPond -- The GNU Project music typesetter.\n"
+ "Copyright 1996,97 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
" 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"
do_one_file(String init_str, String file_str)
{
if ( init_str != "" && "" == path.find( init_str ) ) {
- error ( "Can not find `" + init_str +"'");
+ error ( "Can not find `" + init_str +"\'");
return ;
}
if ( file_str!= "" && path.find( file_str ) == "" ) {
cout << get_version_str() << endl;
String init_str("symbol.ly");
- while (Long_option_init * opt = oparser()) {
+ while (Long_option_init const * opt = oparser()) {
switch ( opt->shortname){
case 'o':
- set_default_output(oparser.optarg);
+ set_default_output(oparser.optional_argument_ch_C_);
break;
case 'w':
notice();
exit(0);
break;
case 'I':
- path.push(oparser.optarg);
+ path.push(oparser.optional_argument_ch_C_);
break;
case 'i':
- init_str = oparser.optarg;
+ init_str = oparser.optional_argument_ch_C_;
break;
case 'h':
usage();
}
int p=0;
- char *arg ;
+ const char *arg ;
while ( (arg= oparser.get_next_arg()) ) {
String f(arg);
destill_inname(f);
do_one_file(init_str, "");
}
- return 0;
+ return exit_status_i_;
}
/// make input file name: add default extension. "" is stdin.
Meter_engraver::do_pre_move_processing()
{
if (meter_p_) {
- typeset_breakable_item(meter_p_);
+ typeset_element(meter_p_);
meter_p_ =0;
meter_req_l_ = 0;
}
Meter::Meter(Array<Scalar>a)
:args(a)
{
+ breakable_b_ = true;
}
Molecule*
// statics Midi_def
// ugh
+
int Midi_def::den_i_s = 4;
int Midi_def::num_i_s = 4;
Midi_def::Midi_def()
{
- outfile_str_ = "lelie.midi";
+ outfile_str_ = "";
itrans_p_ = 0;
- real_vars_p_ = new Assoc<String,Real>;
// ugh
set_tempo( Moment( 1, 4 ), 60 );
}
{
whole_seconds_f_ = s.whole_seconds_f_;
itrans_p_ = s.itrans_p_ ? new Input_translator( *s.itrans_p_ ) : 0;
- real_vars_p_ = new Assoc<String,Real> ( *s.real_vars_p_ );
outfile_str_ = s.outfile_str_;
}
Midi_def::~Midi_def()
{
delete itrans_p_;
- delete real_vars_p_;
}
Real
return itrans_p_->get_group_performer_p()->global_l();
}
-Real
-Midi_def::get_var( String s ) const
-{
- if ( !real_vars_p_->elt_b( s ) )
- error ( "unknown midi variable `" + s + "'" );
- return real_vars_p_->elem( s );
-}
-
int
Midi_def::get_tempo_i( Moment moment )
{
mtor << "Midi {";
mtor << "4/min: " << Real( 60 ) / ( whole_seconds_f_ * 4 );
mtor << "out: " << outfile_str_;
- for (Assoc_iter<String,Real> i( *real_vars_p_ ); i.ok(); i++) {
- mtor << i.key() << "= " << i.val() << "\n";
- }
mtor << "}\n";
#endif
}
whole_seconds_f_ = Moment( count_per_minute_i ) / Moment( 60 ) / moment;
}
-void
-Midi_def::set_var( String s, Real r )
-{
- real_vars_p_->elem( s ) = r;
-}
-
#include "midi-stream.hh"
#include "audio-item.hh"
+IMPLEMENT_IS_TYPE_B(Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_chunk, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_duration, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_header, Midi_chunk);
+IMPLEMENT_IS_TYPE_B1(Midi_instrument, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_key,Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_meter, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_note, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_note_off, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_tempo, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_text, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_track, Midi_chunk);
+
Midi_chunk::Midi_chunk()
: Midi_item( 0 )
{
String
Midi_instrument::str() const
{
- // ugh, does not work...
- return String( "" );
Byte program_byte = 0;
for ( int i = 0; instrument_name_sz_a_[i]; i++ )
if ( instrument_str_ == String(instrument_name_sz_a_[ i ] )) {
program_byte = (Byte)i;
break;
}
- if ( program_byte ) {
- String str = String( (char)( 0xc0 + channel_i_ ) );
- str += String( (char)program_byte );
- return str;
- }
- return String( "" );
+
+ if ( !program_byte )
+ return String( "" );
+
+ String str = String( (char)( 0xc0 + channel_i_ ) );
+ str += String( (char)program_byte );
+ return str;
}
Midi_item::Midi_item( Audio_item* audio_item_l )
return String_convert::hex2bin_str( str );
}
+Midi_meter::Midi_meter( Audio_item* audio_item_l )
+ : Midi_item( audio_item_l )
+{
+ clocks_per_1_i_ = 18;
+}
+
+String
+Midi_meter::str() const
+{
+ Meter_change_req* m = audio_item_l_->req_l_->command()->meterchange();
+ int num_i = m->beats_i_;
+ int den_i = m->one_beat_i_;
+
+ String str = "ff5804";
+ str += String_convert::i2hex_str( num_i, 2, '0' );
+ str += String_convert::i2hex_str( intlog2( den_i ) , 2, '0' );
+ str += String_convert::i2hex_str( clocks_per_1_i_, 2, '0' );
+ str += String_convert::i2hex_str( 8, 2, '0' );
+ return String_convert::hex2bin_str( str );
+}
+
Midi_note::Midi_note( Audio_item* audio_item_l )
: Midi_item( audio_item_l )
{
- // ugh
- dynamic_byte_ = 0x64;
- on_b_ = ( (Audio_note*)audio_item_l_ )->on_b_;
- if ( on_b_ ) // poor man-s staff dynamics:
- dynamic_byte_ -= 0x10 * channel_i_;
- else
- dynamic_byte_ += 0x32; // 0x64 is supposed to be neutral, but let-s try
+ dynamic_byte_ = 0x7f;
+}
+
+Moment
+Midi_note::duration() const
+{
+ return audio_item_l_->req_l_->musical()->rhythmic()->duration();
+}
+
+int
+Midi_note::pitch_i() const
+{
+ return audio_item_l_->req_l_->musical()->melodic()->pitch();
}
String
Midi_note::str() const
{
- Note_req* n = audio_item_l_->req_l_->musical()->melodic()->note();
- int pitch_i = n->pitch() + c0_pitch_i_c_;
- if ( pitch_i != INT_MAX ) {
- Byte status_byte = ( on_b_ ? 0x90 : 0x80 ) + channel_i_;
- String str = String( (char)status_byte );
- str += (char)pitch_i;
- // poor man-s staff dynamics:
- str += (char)dynamic_byte_;
- return str;
- }
- return String( "" );
+ if ( pitch_i() == INT_MAX )
+ return String( "" );
+
+ Byte status_byte = (char)( 0x90 + channel_i_ );
+
+ String str = String( (char)status_byte );
+ str += (char)( pitch_i() + c0_pitch_i_c_ );
+
+ // poor man's staff dynamics:
+ str += (char)( dynamic_byte_ - 0x10 * channel_i_ );
+
+ return str;
+}
+
+Midi_note_off::Midi_note_off( Midi_note* midi_note_l )
+ : Midi_item( midi_note_l->audio_item_l_ )
+{
+ // 0x64 is supposed to be neutral, but let's try
+ aftertouch_byte_ = 0x64;
+ channel_i_ = midi_note_l->channel_i_;
+}
+
+int
+Midi_note_off::pitch_i() const
+{
+ return audio_item_l_->req_l_->musical()->melodic()->pitch();
+}
+
+String
+Midi_note_off::str() const
+{
+ if ( pitch_i() == INT_MAX )
+ return String( "" );
+
+ Byte status_byte = (char)( 0x80 + channel_i_ );
+
+ String str = String( (char)status_byte );
+ str += (char)( pitch_i() + Midi_note::c0_pitch_i_c_ );
+ str += (char)aftertouch_byte_;
+ return str;
}
Midi_tempo::Midi_tempo( Audio_item* audio_item_l )
return String_convert::hex2bin_str( str );
}
-Midi_meter::Midi_meter( Audio_item* audio_item_l )
- : Midi_item( audio_item_l )
-{
- clocks_per_1_i_ = 18;
-}
-
-String
-Midi_meter::str() const
-{
- Meter_change_req* m = audio_item_l_->req_l_->command()->meterchange();
- int num_i = m->beats_i_;
- int den_i = m->one_beat_i_;
-
- String str = "ff5804";
- str += String_convert::i2hex_str( num_i, 2, '0' );
- str += String_convert::i2hex_str( intlog2( den_i ) , 2, '0' );
- str += String_convert::i2hex_str( clocks_per_1_i_, 2, '0' );
- str += String_convert::i2hex_str( 8, 2, '0' );
- return String_convert::hex2bin_str( str );
-}
-
Midi_text::Midi_text( Audio_item* audio_item_l )
: Midi_item( audio_item_l )
{
#include "midi-stream.hh"
#include "debug.hh"
-Midi_stream::Midi_stream( String filename_str, int tracks_i, int clocks_per_4_i )
+Midi_stream::Midi_stream( String filename_str )
{
filename_str_ = filename_str;
- tracks_i_ = tracks_i;
- clocks_per_4_i_ = clocks_per_4_i;
os_p_ = 0;
open();
- header();
}
Midi_stream::~Midi_stream()
return *this;
}
-void
-Midi_stream::header()
-{
-/*
- 4D 54 68 64 MThd
- String str = "MThd";
- 00 00 00 06 chunk length
- 00 01 format 1
- 00 01 one track
- 00 60 96 per quarter-note
-*/
- *this << Midi_header( 1, tracks_i_, clocks_per_4_i_ );
-}
-
void
Midi_stream::open()
{
source file of the GNU LilyPond music typesetter
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwenhuizen <jan@digicash.com>
-
- TODO
-
- Ideally this should also use a register system, to process slurs,
- dynamics, etc.
-
-*/
-
-/* reincluded for code jatting */
-#if 0
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+ */
-#include "command-request.hh"
-#include "musical-request.hh"
-#include "p-score.hh"
-#include "staff.hh"
#include "midi-walker.hh"
+#include "audio-column.hh"
+#include "audio-item.hh"
+#include "audio-staff.hh"
#include "midi-item.hh"
#include "midi-stream.hh"
#include "debug.hh"
-#include "staff-column.hh"
-Midi_walker::Midi_walker(Staff *st_l, Midi_track* track_l)
- : PCursor<Staff_column*>(st_l->cols_)
+Midi_note_event::Midi_note_event()
+{
+ ignore_b_ = false;
+}
+
+int
+compare( Midi_note_event const& left, Midi_note_event const& right )
{
- track_l_ = track_l;
- last_moment_= 0;
+ return sign( left.key - right.key );
}
-/**
- output notestop events for all notes which end before #max_moment#
- */
-void
-Midi_walker::do_stop_notes(Moment max_moment)
+Midi_walker::Midi_walker( Audio_staff* audio_staff_l, Midi_track* track_l )
+ : PCursor<Audio_item*>( audio_staff_l->audio_item_l_list_ )
{
- while (stop_notes.size() && stop_notes.front().key <= max_moment) {
- Note_event ent=stop_notes.get();
- if (ent.ignore_b_)
- continue;
-
- Moment stop_moment = ent.key;
- Melodic_req * req_l = ent.val;
-
- Midi_note note(req_l, track_l_->number_i_, false);
- output_event(note, stop_moment);
- }
+ track_l_ = track_l;
+ last_mom_ = 0;
}
+
+Midi_walker::~Midi_walker()
+{
+ // ugh
+ do_stop_notes( last_mom_ + Moment( 10, 1 ) );
+}
+
/**
- Find out if start_note event is needed, and do it if needed.
+ Find out if start_note event is needed, and do it if needed.
*/
void
-Midi_walker::do_start_note(Note_req*note_l)
+Midi_walker::do_start_note( Midi_note* note_l )
{
- Moment stop = note_l->duration() + ptr()->when();
- for(int i=0; i < stop_notes.size(); i++) {
- if (stop_notes[i].val->melodic()->pitch() ==
- note_l->pitch()) {
- if ( stop_notes[i].key < stop){
- stop_notes[i].ignore_b_=true;
- }
- else
- return; // skip the stop note
+ Moment stop_mom = note_l->duration() + ptr()->audio_column_l_->at_mom();
+ for ( int i=0; i < stop_note_queue.size(); i++ ) {
+ if ( stop_note_queue[ i ].val->pitch_i() == note_l->pitch_i() ) {
+ if ( stop_note_queue[ i ].key < stop_mom )
+ stop_note_queue[ i ].ignore_b_ = true;
+ else // skip the stopnote
+ return;
}
}
- Note_event e;
- e.val = note_l;
- e.key = stop;
-
- stop_notes.insert(e);
-
- Midi_note note(note_l, track_l_->number_i_, true);
- output_event(note, ptr()->when());
-}
-
-/** advance the track to #now#, output the item, and adjust current
- "moment". */
-void
-Midi_walker::output_event(Midi_item &i, Moment now)
-{
- Moment delta_t = now - last_moment_ ;
- last_moment_ += delta_t;
- track_l_->add(delta_t, &i );
+ Midi_note_event e;
+ e.val = new Midi_note_off( note_l );
+ e.key = stop_mom;
+ stop_note_queue.insert( e );
+
+ output_event( ptr()->audio_column_l_->at_mom(), note_l );
}
+/**
+ Output note events for all notes which end before #max_mom#
+ */
void
-Midi_walker::process_requests()
+Midi_walker::do_stop_notes( Moment max_mom )
{
- do_stop_notes(ptr()->when());
-
- for ( int i = 0; i < ptr()->commandreq_l_arr_.size(); i++ ) {
- Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
- Meter_change_req* meter_l = c_l->meterchange();
- if ( meter_l )
- output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), ptr()->when() );
- Key_change_req* key_l = c_l->keychange();
- if ( key_l ) {
- int sharps_i = key_l->sharps_i();
- int flats_i = key_l->flats_i();
- // midi cannot handle non-conventional keys
- if ( !( flats_i && sharps_i ) )
- output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), ptr()->when() );
- }
- }
-
- for ( int i = 0; i < ptr()->musicalreq_l_arr_.size(); i++ ) {
- Musical_req *m = ptr()->musicalreq_l_arr_[i]->musical();
- if (!m)
- return;
- Rhythmic_req *n = m->rhythmic();
- if ( !n)
- continue;
- Note_req * note_l = n->note();
- if (!note_l)
+ while ( stop_note_queue.size() && stop_note_queue.front().key <= max_mom ) {
+ Midi_note_event e = stop_note_queue.get();
+ if ( e.ignore_b_ )
continue;
- do_start_note(note_l);
+
+ Moment stop_mom = e.key;
+ Midi_note_off* note_l = e.val;
+
+ output_event( stop_mom, note_l );
}
}
-Midi_walker::~Midi_walker()
+/**
+ Advance the track to #now#, output the item, and adjust current "moment".
+ */
+void
+Midi_walker::output_event( Moment now_mom, Midi_item* l )
{
- do_stop_notes( last_moment_ + Moment(10,1)); // ugh
+ Moment delta_t = now_mom - last_mom_ ;
+ last_mom_ += delta_t;
+ track_l_->add( delta_t, l );
}
-
-int
-compare(Note_event const&e1, Note_event const&e2)
+void
+Midi_walker::process()
{
- return sign(e1.key - e2.key);
+ do_stop_notes( ptr()->audio_column_l_->at_mom() );
+
+ Midi_item* p = ptr()->midi_item_p();
+ p->channel_i_ = track_l_->number_i_;
+
+ if ( p->name() != Midi_note::static_name() )
+ output_event( ptr()->audio_column_l_->at_mom(), p );
+ else
+ do_start_note( (Midi_note*)p );
+
+ delete p;
}
-#endif
#include "debug.hh"
#include "tex.hh"
-
-/* *************** */
-
String
Molecule::TeX_string() const
{
}
void
-Molecule::translate_x(Real x)
-{
- translate(Offset(x,0));
-}
-
-void
-Molecule::translate_y(Real y)
+Molecule::translate(Real x,Axis a)
{
- translate(Offset(0,y));
+ for (iter_top(ats,c); c.ok(); c++)
+ c->translate(x,a);
}
void
add(m);
return;
}
- Real xof=extent().x.right - m.extent().x.left;
+ Real xof=extent().x().right - m.extent().x().left;
+
+
Molecule toadd(m);
toadd.translate(Offset(xof, 0.0));
add(toadd);
add(m);
return;
}
- Real xof=extent().x.left - m.extent().x.right;
+ Real xof=extent().x().left - m.extent().x().right;
+
Molecule toadd(m);
toadd.translate(Offset(xof, 0.0));
add(toadd);
add(m);
return;
}
- Real yof=extent().y.right - m.extent().y.left;
+ Real yof=extent().y().right - m.extent().y().left;
+
Molecule toadd(m);
- toadd.translate_y(yof);
+ toadd.translate(yof, Y_AXIS);
add(toadd);
}
add(m);
return;
}
- Real yof=extent().y.left- m.extent().y.right;
+ Real yof=extent().y().left- m.extent().y().right;
Molecule toadd(m);
- toadd.translate_y(yof);
+ toadd.translate(yof, Y_AXIS);
add(toadd);
}
void
Music_iterator::push_translator(Translator*t)
{
- if (t) {
- report_to_l_arr_.push(t);
- t->iterator_count_ ++;
- }
+ report_to_l_arr_.push(t);
+ t->iterator_count_ ++;
}
void
Music_iterator::pop_translator()
{
- if (report_to_l()) {
- report_to_l()->iterator_count_ --;
- report_to_l_arr_.pop();
- }
+ report_to_l()->iterator_count_ --;
+ assert (report_to_l()->iterator_count_ >=0);
+ report_to_l_arr_.pop();
}
Translator*
void
-Music_iterator::set_translator(Translator*reg)
+Music_iterator::set_translator(Translator*trans)
{
- if (report_to_l()==reg)
+ if (report_to_l()==trans)
return;
- pop_translator();
- push_translator(reg);
+ if ( report_to_l() )
+ pop_translator();
+ if (trans)
+ push_translator(trans);
}
void
Translator *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( Request_chord::static_name()))
+ if (m->is_type_b( Request_chord::static_name()))
p = new Request_chord_iterator( (Request_chord*) m);
else if (m->is_type_b( Chord::static_name()))
p = new Chord_iterator( (Chord*) m);
for(PCursor<Music*> i(chord_C_->music_p_list_.top()); //, int j = 0;
i.ok(); j++, i++) {
Music_iterator * mi = get_iterator_p( i.ptr());
- set_translator(mi->report_to_l()->ancestor_l( chord_C_->multi_level_i_ ));
- if ( mi->ok() )
+ if ( mi->ok() ) {
+ set_translator(mi->report_to_l()->ancestor_l(
+ chord_C_->multi_level_i_ ) );
children_p_list_.bottom().add( mi );
- else
+ } else
delete mi;
}
}
void
Voice_iterator::construct_children()
{
- if (ok()) {
- iter_p_ = Music_iterator::get_iterator_p( ptr() );
- if (iter_p_->report_to_l()->depth_i() > report_to_l()->depth_i())
- set_translator(iter_p_->report_to_l());
+ while (PCursor<Music*>::ok()) {
+ start_next_element();
+ if ( !iter_p_->ok()) {
+ leave_element();
+ } else {
+ set_voice_translator();
+ break;
+ }
}
}
-void
-Voice_iterator::next_element()
+void
+Voice_iterator::leave_element()
{
- delete iter_p_ ;
+ delete iter_p_;
iter_p_ =0;
- here_mom_ += ptr()->time_int().length();
+ MInterval elt_time = ptr()->time_int();
+ if (!elt_time.empty_b())
+ here_mom_ += elt_time.length();
PCursor<Music*>::next();
- construct_children();
+}
+
+void
+Voice_iterator::start_next_element()
+{
+ assert( !iter_p_);
+ iter_p_ = get_iterator_p( ptr());
+}
+
+void
+Voice_iterator::set_voice_translator()
+{
+ if (iter_p_->report_to_l()->depth_i() > report_to_l()->depth_i())
+ set_translator(iter_p_->report_to_l());
}
Voice_iterator::~Voice_iterator()
{
- delete iter_p_;
+ assert(! iter_p_);
}
void
Voice_iterator::process_and_next(Moment until)
{
- while (ok()) {
+ while (1) {
Moment local_until = until - here_mom_;
- while ( iter_p_ && iter_p_->ok() ) {
+ while ( iter_p_->ok() ) {
Moment here = iter_p_->next_moment();
if (here != local_until)
- return;
+ goto loopexit;
+
iter_p_->process_and_next(local_until);
}
- if (!iter_p_)
- iter_p_ = Music_iterator::get_iterator_p( ptr() );
- else if (!iter_p_->ok() )
- next_element();
+
+ if (!iter_p_->ok() ) {
+ leave_element();
+ if ( PCursor<Music*>::ok() ) {
+ start_next_element();
+ set_voice_translator();
+ } else {
+ goto loopexit;
+ }
+ }
}
+
+loopexit:
+
Music_iterator::process_and_next(until);
- assert(!ok() || next_moment() > until);
}
Moment
bool
Voice_iterator::ok()const
{
- return PCursor<Music*>::ok();
+ return iter_p_;
}
-/* ***************** */
-
-
-Change_iterator::Change_iterator(Change_reg * ch)
-{
- change_l_ = ch;
-}
-
-
-IMPLEMENT_IS_TYPE_B1(Change_iterator,Music_iterator);
-
-/*
- TODO: pop/pushgroup
- */
-void
-Change_iterator::process_and_next(Moment mom)
-{
-#if 0
- if ( id[0] == '-') {
-
-
- Engraver_group_engraver *group_l =
- report_to_l()->find_get_translator_l(change_l_->type_str_,
- change_l_->id_str_);
-
- report_to_l()->daddy_grav_l_->remove_engraver_p(report_to_l());
- group_l->add(report_to_l());
-#endif
- Music_iterator::process_and_next(mom);
-}
-
-
-
-/* ******************** */
-
IMPLEMENT_IS_TYPE_B1(Request_chord_iterator,Music_iterator);
MInterval m;
for (iter(music_p_list_.top(), i); i.ok(); i++)
m.unite(i->time_int());
+
return m;
}
Voice::time_int() const
{
Moment last=0;
- for (iter(music_p_list_.top(), i); i.ok(); i++)
- last += i->time_int().length();
+ for (iter(music_p_list_.top(), i); i.ok(); i++) {
+ MInterval interval = i->time_int();
+
+ /*
+ c4 <> c4
+ */
+ if ( !interval.empty_b() )
+ last += interval.length();
+ }
return offset_mom_ + MInterval(0,last);
}
Spacing_req::do_print();
}
/* *************** */
+
Melodic_req::Melodic_req()
{
notename_i_ = 0;
notename_i_ -= 7;
octave_i_ ++;
}
+
int new_pitch = pitch();
int delta_acc = new_pitch - old_pitch - delta_pitch;
}
}
-
IMPLEMENT_IS_TYPE_B1(Melodic_req,Musical_req);
+bool
+Melodic_req::do_equal_b(Request*r)const
+{
+ Melodic_req* m= r->musical()->melodic();
+ return !compare( *m, *this);
+}
+
int
-Melodic_req::compare(Melodic_req const&m1, Melodic_req const&m2)
-{
- if (m1.octave_i_ != m2.octave_i_)
- return m1.octave_i_ -m2.octave_i_;
- else if (m1.notename_i_ != m2.notename_i_)
- return m1.notename_i_ - m2.notename_i_;
- else if (m1.accidental_i_ != m2.accidental_i_)
- return m1.accidental_i_ - m2.accidental_i_;
+Melodic_req::compare(Melodic_req const &m1 , Melodic_req const&m2)
+{
+ int o= m1.octave_i_ - m2.octave_i_;
+ int n = m1.notename_i_ - m2.notename_i_;
+ int a = m1.accidental_i_ - m2.accidental_i_;
+
+ if (o)
+ return o;
+ if ( n)
+ return n;
+ if (a)
+ return a;
return 0;
}
Melodic_req::do_print() const
{
#ifndef NPRINT
- mtor << "notename: " << notename_i_ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
+ mtor << "notename: " << notename_i_
+ << " acc: " <<accidental_i_<<" oct: "<< octave_i_;
#endif
}
}
/*
- should be settable from input to allow "viola"-mode
+ should be settable from input to allow "viola"-mode
*/
-static Byte pitch_byte_a[ 7 ] = { 0, 2, 4, 5, 7, 9, 11 };
+static Byte pitch_byte_a[ ] = { 0, 2, 4, 5, 7, 9, 11 };
int
Melodic_req::pitch() const
int
Rhythmic_req::compare(Rhythmic_req const &r1, Rhythmic_req const &r2)
{
- return sign(r1.duration() - r2.duration());
+ return (r1.duration() - r2.duration());
+}
+
+bool
+Rhythmic_req::do_equal_b(Request*r)const
+{
+ Rhythmic_req* rh = r->musical()->rhythmic();
+
+ return !compare(*this, *rh);
}
void
}
/* *************** */
+bool
+Note_req::do_equal_b(Request*r)const
+{
+ return Rhythmic_req::do_equal_b(r) && Melodic_req::do_equal_b(r);
+}
+
+
Note_req::Note_req()
{
forceacc_b_ = false;
void
Slur_req::do_print()const{}
/* *************** */
-int
-Span_req:: compare(Span_req const &r1, Span_req const &r2)
+
+
+bool
+Span_req:: do_equal_b(Request*r)const
{
- return r1.spantype - r2.spantype;
+ Span_req * s = r->span();
+ return spantype - s->spantype;
}
Span_req::Span_req()
scriptdef_p_ = s.scriptdef_p_ ? s.scriptdef_p_->clone() : 0;
}
-int
-Script_req::compare(Script_req const &d1, Script_req const &d2)
+/*
+ don't check dirs?
+
+ (d1.dir_i_ == d2.dir_i_ )
+ */
+bool
+Script_req::do_equal_b(Request*r)const
{
- return !(d1.dir_i_ == d2.dir_i_ &&
- d1.scriptdef_p_->equal_b(*d2.scriptdef_p_));
+ Script_req * s = r->script();
+
+ return scriptdef_p_->equal_b(*s->scriptdef_p_);
}
Script_req::Script_req()
delete scriptdef_p_;
}
/* *************** */
-int
-Text_req:: compare(Text_req const &r1, Text_req const &r2)
-{
- bool b1 = (r1.dir_i_ == r2.dir_i_);
- bool b2 = (r1.tdef_p_ ->equal_b(*r2.tdef_p_));
- return b1 && b2;
-}
+
+
Text_req::~Text_req()
{
delete tdef_p_;
Text_req::do_print() const
{
#ifndef NPRINT
-
mtor << " dir " << dir_i_ ;
tdef_p_->print();
#endif
{"duration", DURATIONCOMMAND},
{"absdynamic", ABSDYNAMIC},
{"group", GROUP},
- {"geometric", GEOMETRIC},
{"hshift", HSHIFT},
{"id", ID},
{"in", IN_T},
- {"init_end", INIT_END},
{"requesttranslator", REQUESTTRANSLATOR},
{"lyric", LYRIC},
{"key", KEY},
{"midi", MIDI},
{"mm", MM_T},
{"multi", MULTI},
- {"note", NOTE},
{"notenames", NOTENAMES},
{"octave", OCTAVECOMMAND},
{"output", OUTPUT},
{"script", SCRIPT},
{"skip", SKIP},
{"staff", STAFF},
- {"start", START_T},
{"stem", STEM},
{"table", TABLE},
{"spandynamic", SPANDYNAMIC},
{"texid", TEXID},
{"textstyle", TEXTSTYLE},
{"transpose", TRANSPOSE},
- {"unitspace", UNITSPACE},
- {"width", WIDTH},
{"version", VERSION},
{"grouping", GROUPING},
{0,0}
case ']':
{
Beam_req*b = new Beam_req;
- int p_i=default_duration_.plet_.type_i_ ; // ugh . Should junk?
+ int p_i=plet_.type_i_ ; // ugh . Should junk?
if (p_i!= 1)
b->nplet = p_i;
req_p = b;
for (int i = 0; i < pre_reqs.size(); i++) {
v->add(pre_reqs[i]);
}
- pre_reqs.set_size(0);
+ pre_reqs.clear();
for (int i = 0; i <post_reqs.size(); i++) {
v->add(post_reqs[i]);
}
- post_reqs.set_size(0);
+ post_reqs.clear();
}
Input
char const*nC = i.elem_l_->name();
- if (nC == Script::static_name()) {
+ if (nC == Script::static_name() && i.req_l_ && i.req_l_->musical()) {
script_l_arr_.push((Script*)i.elem_l_->item());
} else if (nC == Note_head::static_name()) {
Note_head * h_l = (Note_head*)i.elem_l_->item();
ncol_p_->add(script_l_arr_[i]);
}
- script_l_arr_.set_size(0);
+ script_l_arr_.clear();
}
}
void
Note_column_engraver::do_post_move_processing()
{
- script_l_arr_.set_size(0);
+ script_l_arr_.clear();
stem_l_ =0;
}
Note_performer::Note_performer()
{
note_req_l_ = 0;
- off_mom_ = 0;
-}
-
-Note_performer::~Note_performer()
-{
}
void
#ifndef NPRINT
if ( note_req_l_ ) {
note_req_l_->print();
- mtor << ( off_mom_ ? "on" : "off" ) << "\n";
}
#endif
}
if ( !note_req_l_ || !note_req_l_->melodic() || !note_req_l_->rhythmic() )
return;
- // ugh! Midi specific
- Moment mom = get_mom();
- if ( !off_mom_ ) { // start note
- off_mom_ = mom + note_req_l_->duration();
- play( new Audio_note( note_req_l_, true ) );
- }
- else if ( mom == off_mom_ ) { // stop note
- play( new Audio_note( note_req_l_, false ) );
- note_req_l_ = 0;
- off_mom_ = 0;
- }
+ play( new Audio_note( note_req_l_ ) );
+ note_req_l_ = 0;
}
bool
if ( note_req_l_ )
return false;
- // huh?
-// if (req_l->musical() && (req_l->musical()->note() || req_l->musical()->rest()))
-// note_req_l_ = req_l->musical()->rhythmic();
- if ( req_l->musical() && req_l->musical()->note() )
-// huh?
- note_req_l_ = req_l->musical()->melodic();
- else
+ if ( !req_l->musical() || !req_l->musical()->note() )
return false;
+ note_req_l_ = req_l->musical()->melodic();
return true;
}
s = p->lookup_l()->rest(balltype_i_, streepjes_b);
}
out = new Molecule(Atom(s));
- out->translate_x( x_dir_i_ * s.dim.x.length() );
+ out->translate( x_dir_i_ * s.dim.x().length() , X_AXIS);
if (dots_i_) {
Symbol d = p->lookup_l()->dots(dots_i_ );
Molecule dm;
dm.add(Atom(d));
- dm.translate_y( inter_f * dot_delta_y_i_ );
+ dm.translate( inter_f * dot_delta_y_i_ , Y_AXIS);
out->add_right(dm);
}
Molecule sm;
sm.add(Atom(str));
if (position_i_ % 2)
- sm.translate_y(-inter_f* dir);
+ sm.translate(-inter_f* dir, Y_AXIS);
out->add(sm);
}
- out->translate_y(inter_f*position_i_);
+ out->translate(inter_f*position_i_, Y_AXIS);
return out;
}
/*
- p-score.cc -- implement PScore
+ p-score.cc -- implement Paper_score
source file of the GNU LilyPond music typesetter
#include "word-wrap.hh"
#include "gourlay-breaking.hh"
-PScore::PScore(Paper_def*p)
+Paper_score::Paper_score(Paper_def*p)
{
paper_l_ = p;
super_elem_l_ = new Super_elem;
typeset_element(super_elem_l_);
}
-PScore::~PScore()
+Paper_score::~Paper_score()
{
super_elem_l_->unlink_all();
}
void
-PScore::typeset_element(Score_elem * elem_p)
+Paper_score::typeset_element(Score_elem * elem_p)
{
elem_p_list_.bottom().add(elem_p);
elem_p->pscore_l_ = this;
}
void
-PScore::typeset_item(Item *i, PCol *c, int breakstat)
+Paper_score::typeset_item(Item *i, PCol *c)
{
assert(c && i);
+ int breakstat = i->break_status_i_;
if (breakstat == -1) {
- typeset_item(i, c->prebreak_p_);
- return;
- }
-
- if (breakstat == 1) {
- typeset_item(i, c->postbreak_p_);
- return;
+ c = c->prebreak_p_;
+ }else if (breakstat == 1) {
+ c = c->postbreak_p_;
}
c->add(i);
}
void
-PScore::typeset_broken_spanner(Spanner*span_p)
+Paper_score::typeset_broken_spanner(Spanner*span_p)
{
span_p->left_col_l_->starters.bottom().add (span_p);
- span_p->right_col_l_->stoppers.bottom().add(span_p);
assert(span_p->left_col_l_->line_l_ == span_p->right_col_l_->line_l_);
typeset_element(span_p);
void
-PScore::typeset_unbroken_spanner(Spanner*span_p)
+Paper_score::typeset_unbroken_spanner(Spanner*span_p)
{
span_p_list_.bottom().add(span_p);
span_p->pscore_l_=this;
void
-PScore::clean_cols()
+Paper_score::clean_cols()
{
int rank_i = 0;
for (iter_top(col_p_list_,c); c.ok(); )
}
void
-PScore::add(PCol *p)
+Paper_score::add(PCol *p)
{
p->pscore_l_ = this;
if (p->breakable_b()){
}
void
-PScore::output(Tex_stream &ts)
+Paper_score::output(Tex_stream &ts)
{
ts << "\n "<< paper_l_->lookup_l()->texsetting << "%(Tex id)\n";
ts<< super_elem_l_->TeX_string();
void
-PScore::OK()const
+Paper_score::OK()const
{
#ifndef NDEBUG
for (iter_top(col_p_list_,cc); cc.ok(); cc++)
cc->OK();
+ for (PCursor<Score_elem*> i( elem_p_list_.top()); i.ok(); i++)
+ i->OK();
#endif
}
void
-PScore::print() const
+Paper_score::print() const
{
#ifndef NPRINT
if ( !check_debug)
return ;
- mtor << "PScore { ";
+ mtor << "Paper_score { ";
paper_l_->print();
mtor << "\n elements: ";
for (iter_top(elem_p_list_,cc); cc.ok(); cc++)
}
void
-PScore::preprocess()
+Paper_score::preprocess()
{
super_elem_l_->breakable_col_processing();
super_elem_l_->pre_processing();
}
void
-PScore::postprocess()
+Paper_score::postprocess()
{
super_elem_l_->post_processing();
super_elem_l_->molecule_processing();
}
PCursor<PCol *>
-PScore::find_col(PCol const *c)const
+Paper_score::find_col(PCol const *c)const
{
PCol const *what = c;
if (what->daddy_l_ )
void
-PScore::set_breaking(Array<Col_hpositions> const &breaking)
+Paper_score::set_breaking(Array<Col_hpositions> const &breaking)
{
super_elem_l_->line_of_score_l_->set_breaking( breaking);
super_elem_l_->break_processing();
}
void
-PScore::calc_breaking()
+Paper_score::calc_breaking()
{
Break_algorithm *algorithm_p;
Array<Col_hpositions> sol;
sol = algorithm_p->solve();
delete algorithm_p;
if ( ! sol.size()) {
- error ( "Can not solve this casting problem exactly; revert to Word_wrap");
+ warning( "Can not solve this casting problem exactly; revert to Word_wrap");
try_wrap = true;
}
}
}
void
-PScore::process()
+Paper_score::process()
{
clean_cols();
print();
calc_breaking();
*mlog << "\nPostprocessing elements..." << endl;
postprocess();
+
+#ifndef NDEBUGA
+ for(PCursor<Score_elem*> i(elem_p_list_.top()); i.ok(); i++)
+ assert (i->status() >= 9);
+#endif
}
/** 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
+Paper_score::breakable_col_range(PCol*l,PCol*r)const
{
Link_array<PCol> ret;
return ret;
}
Link_array<PCol>
-PScore::col_range(PCol*l,PCol*r)const
+Paper_score::col_range(PCol*l,PCol*r)const
{
Link_array<PCol> ret;
}
Link_array<PCol>
-PScore::broken_col_range(PCol*l,PCol*r)const
+Paper_score::broken_col_range(PCol*l,PCol*r)const
{
Link_array<PCol> ret;
itrans_p_ = 0;
lookup_p_ = 0;
real_vars_p_ = new Assoc<String,Real>;
- outfile_str_ = "lelie.tex";
}
Paper_def::~Paper_def()
#include <iostream.h>
// mmm
-#define MUDELA_VERSION "0.1.0"
+#define MUDELA_VERSION "0.1.1"
#include "script-def.hh"
#include "symtable.hh"
Symtable * symtable;
Symtables * symtables;
Text_def * textdef;
+ Tempo_req *tempo;
char c;
const char *consstr;
int i;
%pure_parser
/* tokens which are not keywords */
-%token CONCAT
%token ALIAS
%token BAR
%token DURATIONCOMMAND
%token ABSDYNAMIC
%token END
-%token GEOMETRIC
%token GROUPING
%token GROUP
%token REQUESTTRANSLATOR
%token HSHIFT
%token IN_T
%token ID
-%token INIT_END
%token LYRIC
%token KEY
%token MELODIC
%token METER
%token MM_T
%token MULTI
-%token NOTE
%token NOTENAMES
%token OCTAVECOMMAND
%token OUTPUT
%token TEXID
%token TEXTSTYLE
%token TITLE
-%token UNITSPACE
-%token WIDTH
%token VERSION
/* escaped */
%token <id> VOICE_IDENTIFIER
%token <id> POST_REQUEST_IDENTIFIER
%token <id> SCRIPT_IDENTIFIER
-%token <id> STAFF_IDENTIFIER
+%token <id> COMMAND_IDENTIFIER
%token <id> REAL_IDENTIFIER
%token <id> INPUT_TRANS_IDENTIFIER
%token <id> INT_IDENTIFIER
%type <i> int
%type <i> script_dir
%type <id> declaration
-%type <duration> explicit_duration notemode_duration
+%type <duration> explicit_duration notemode_duration entered_notemode_duration
%type <interval> dinterval
%type <intvec> intastint_list
%type <lookup> symtables symtables_body
%type <symbol> symboldef
%type <symtable> symtable symtable_body
%type <itrans> input_translator_spec input_translator_spec_body
+%type <tempo> tempo_request
%left PRIORITY
'{' midi_body '}' { $$ = $3; }
;
-midi_body: /* empty */ {
- $$ = THIS->default_midi(); // midi / audio / perform
+midi_body: /* empty */ {
+ $$ = THIS->default_midi();
}
| midi_body OUTPUT STRING ';' {
$$->outfile_str_ = *$3;
delete $3;
}
- | midi_body TEMPO notemode_duration ':' int ';' {
- $$->set_tempo( $3->length(), $5 );
+ | midi_body tempo_request ';' {
+ $$->set_tempo( $2->dur_.length(), $2->metronome_i_ );
+ delete $2;
}
| midi_body input_translator_spec {
$$->set( $2 );
}
;
+tempo_request:
+ TEMPO entered_notemode_duration '=' int {
+ $$ = new Tempo_req;
+ $$->dur_ = *$2;
+ delete $2;
+ $$-> metronome_i_ = $4;
+ }
+ ;
+
/*
MUSIC
*/
THIS->add_requests((Chord*)$2);//ugh
$$ = $2;
}
+ | command_elt
| voice_command ';' { $$ = 0; }
;
simple_element:
music_elt
| lyrics_elt
- | command_elt
;
command_elt:
-/* empty */ {
+ command_req {
$$ = new Request_chord;
$$-> set_spot( THIS->here_input());
- }
-/* cont: */
- command_req {
- $2-> set_spot( THIS->here_input());
- ((Chord*)$$) ->add($2);//ugh
+ $1-> set_spot( THIS->here_input());
+ ((Chord*)$$) ->add($1);//ugh
}
- | GROUP STRING ';' { // ugh ugh ugh
- Change_reg *chr_p = new Change_reg;
- $$ = chr_p;
- chr_p-> type_str_ = "Voice_group_engravers"; //ugh
- chr_p-> id_str_ = *$2;
- delete $2;
- }
;
command_req:
'|' {
$$ = new Barcheck_req;
}
+ | COMMAND_IDENTIFIER {
+ $$ = $1->request(true);
+ }
;
verbose_command_req:
}
| SKIP duration_length {
Skip_req * skip_p = new Skip_req;
- skip_p->duration_ = Duration(1,0);
skip_p->duration_.set_plet($2->numerator().as_long(),
$2->denominator().as_long());
delete $2;
$$ = skip_p;
}
+ | tempo_request {
+ $$ = $1;
+ }
| CADENZA int {
$$ = new Cadenza_req($2);
}
| GROUPING intastint_list {
$$ = get_grouping_req(*$2); delete $2;
}
-
;
post_requests:
close_plet_parens:
']' INT '/' INT {
$$ = ']';
- THIS->default_duration_.set_plet($2,$4);
+ THIS->plet_.type_i_ = $4;
+ THIS->plet_.iso_i_ = $2;
}
;
open_plet_parens:
'[' INT '/' INT {
$$ = '[';
- THIS->default_duration_.set_plet($2,$4);
+ THIS->plet_.type_i_ = $4;
+ THIS->plet_.iso_i_ = $2;
}
;
THIS->set_duration_mode(*$2);
delete $2;
}
- | DURATIONCOMMAND notemode_duration {
+ | DURATIONCOMMAND entered_notemode_duration {
THIS->set_default_duration($2);
delete $2;
}
| dots '.' { $$ ++; }
;
-notemode_duration:
+entered_notemode_duration:
/* */ {
$$ = new Duration(THIS->default_duration_);
}
| dots {
- $$ = new Duration(THIS->default_duration_);
+ $$ = new Duration(THIS->default_duration_);
$$->dots_i_ = $1;
}
| explicit_duration {
}
;
+notemode_duration:
+ entered_notemode_duration {
+ $$ = $1;
+ $$->plet_.type_i_ *= THIS->plet_.type_i_;
+ $$->plet_.iso_i_ *= THIS->plet_.iso_i_;
+ }
+ ;
+
explicit_duration:
int {
$$ = new Duration;
THIS->parser_error("Not a duration");
else {
$$->type_i_ = $1;
- $$->set_plet(THIS->default_duration_);
}
}
| explicit_duration '.' {
#include "debug.hh"
IMPLEMENT_IS_TYPE_B2(Performer_group_performer,Performer, Translator);
-
ADD_THIS_PERFORMER(Performer_group_performer);
-Performer_group_performer::Performer_group_performer()
-{
-}
-
Performer_group_performer::~Performer_group_performer()
{
+
}
void
return daddy_perf_l_->depth_i() + 1;
}
+void
+Performer_group_performer::do_creation_processing()
+{
+ for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+ i->creation_processing();
+}
+
+void
+Performer_group_performer::do_print()const
+{
+#ifndef NPRINT
+ if ( !check_debug)
+ return ;
+ for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+ i->print();
+#endif
+}
+
+void
+Performer_group_performer::do_removal_processing()
+{
+ for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
+ i->do_removal_processing();
+}
+
+bool
+Performer_group_performer::do_try_request( Request* req_l )
+{
+ 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 && daddy_perf_l_ )
+ hebbes_b = daddy_perf_l_->try_request(req_l);
+ return hebbes_b ;
+}
+
Translator*
Performer_group_performer::find_get_translator_l( String n,String id )
{
return perf_p->get_default_interpreter();
}
-Moment
-Performer_group_performer::get_mom() const
-{
- Moment mom = Performer::get_mom();
-
- for ( int i = 0; i < nongroup_l_arr_.size(); i++ )
- nongroup_l_arr_[ i ]->set( mom );
-
- return mom;
-}
-
bool
Performer_group_performer::is_bottom_performer_b() const
{
return !itrans_l_->get_default_itrans_l();
}
-
-void
-Performer_group_performer::process_requests()
-{
- for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
- i->process_requests();
-}
-
-//<ugh>
-int
-Performer_group_performer::get_track_i() const
-{
- int track_i = Performer::get_track_i();
-
- for ( int i = 0; i < nongroup_l_arr_.size(); i++ )
- nongroup_l_arr_[ i ]->set_track( track_i );
-
- return track_i;
-}
-
-void
-Performer_group_performer::set_track( int& track_i_r )
-{
- for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
- i->set_track( track_i_r );
-}
-//</ugh>
-
-bool
-Performer_group_performer::do_try_request( Request* req_l )
-{
- 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 && daddy_perf_l_ )
- hebbes_b = daddy_perf_l_->try_request(req_l);
- return hebbes_b ;
-}
-
void
-Performer_group_performer::do_print()const
-{
-#ifndef NPRINT
- if ( !check_debug)
- return ;
- for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
- i->print();
-#endif
+Performer_group_performer::print() const
+{
+ Performer::print();
}
void
-Performer_group_performer::do_creation_processing()
+Performer_group_performer::process_requests()
{
for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
- i->creation_processing();
+ i->process_requests();
}
-void
-Performer_group_performer::do_removal_processing()
+bool
+Performer_group_performer::try_request( Request* r )
{
- for ( PCursor<Performer*> i( perf_p_list_.top() ); i.ok(); i++ )
- i->do_removal_processing();
+ return Performer::try_request( r );
}
{
}
-Moment
-Performer::get_mom() const
-{
- return daddy_perf_l_->get_mom();
-}
-
void
-Performer::play( Audio_item* p )
+Performer::play( Audio_element* p )
{
daddy_perf_l_->play( p );
}
-void
-Performer::play( Midi_item* l )
-{
- daddy_perf_l_->play( l );
-}
-
int
Performer::get_tempo_i()const
{
{
}
-void
-Performer::set( Moment )
-{
-}
-
-//<ugh>
-int
-Performer::get_track_i() const
-{
- return daddy_perf_l_->get_track_i();
-}
-
-void
-Performer::set_track( int& )
-{
-}
-//</ugh>
-
bool
Performer::do_try_request( Request* req_l )
{
Performer::creation_processing()
{
if (!init_b_) {
-/* if ( daddy_perf_l_ ) {
- init_b_ = true; // ugh. avoid recursion
- daddy_perf_l_->creation_processing();
- init_b_ = false;
- }
-
- */
do_creation_processing();
init_b_ = true;
}
}
+
void
Performer::do_creation_processing()
{
return MInterval(0, duration());
}
+
+bool
+Request::equal_b(Request *r)const
+{
+ if ( is_type_b ( r->name() ) )
+ return r->do_equal_b( (Request*)this );
+ if ( r->is_type_b( name ()))
+ return do_equal_b( r );
+
+ return false;
+}
+
+bool
+Request::do_equal_b(Request*)const
+{
+ return false;
+}
+
}
else if (nC == Note_column::static_name()) {
// what should i do, what should _engraver do?
- if (!rest_collision_p_)
+ if (!rest_collision_p_) {
rest_collision_p_ = new Rest_collision;
+ announce_element(Score_elem_info(rest_collision_p_, 0));
+ }
rest_collision_p_->add((Note_column*)i.elem_l_->item());
}
else if (nC == Rest_column::static_name()) {
Score_align_engraver::do_pre_move_processing()
{
if (align_p_) {
- typeset_breakable_item( align_p_);
+ typeset_element( align_p_);
align_p_ =0;
}
}
if (!align_p_ ) {
align_p_ = new Horizontal_group_item;
+ align_p_->breakable_b_ = true;
announce_element(Score_elem_info(align_p_,0));
}
-
- align_p_->add_element(inf.elem_l_);
+ Score_elem * unbound_elem = inf.elem_l_;
+ while ( unbound_elem->axis_group_l_a_[X_AXIS] )
+ unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
+ align_p_->add_element(unbound_elem );
}
}
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+/*
+ too big. Should split.
+ */
#include "p-score.hh"
#include "paper-def.hh"
#include "lookup.hh"
}
+
String
-Score_elem::TeX_string() const
+Score_elem::TeX_string_without_offset(Offset o)const
{
- assert( status_ > POSTCALCED);
if (transparent_b_ )
return "";
String s( "\\placebox{%}{%}{%}");
Array<String> a;
- a.push(print_dimen(offset_.y));
- a.push(print_dimen(offset_.x));
+ a.push( print_dimen(o.y() ));
+ a.push( print_dimen(o.x() ));
String t = output->TeX_string();
if (t == "")
return t;
r = String("\n%start: ") + name() + "\n";
r += substitute_args(s, a);;
return r;
-
+}
+
+String
+Score_elem::TeX_string() const
+{
+ assert( status_ > POSTCALCED);
+ return TeX_string_without_offset(offset_);
}
void
{
transparent_b_ = s.transparent_b_;
empty_b_ = s.empty_b_;
- x_group_l_ = 0;
- y_group_l_ = 0;
+ axis_group_l_a_[0] = axis_group_l_a_[1] =0;
status_ = s.status_;
assert(!s.output);
output = 0;
}
-void
-Score_elem::translate_x(Real x)
+/*
+ GEOMETRY
+ */
+Real
+Score_elem::absolute_coordinate(Axis a)const
{
- offset_.x += x;
+ Real r = offset_[a];
+ for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+ axis_group_l; axis_group_l = axis_group_l->axis_group_l_a_[a])
+
+ r += axis_group_l->offset_[a];
+ return r;
}
+
+Offset
+Score_elem::absolute_offset() const
+{
+ return Offset(absolute_coordinate(X_AXIS), absolute_coordinate(Y_AXIS));
+}
+ void
+Score_elem::translate(Real y, Axis a)
+{
+ offset_[a] += y;
+}
-void
-Score_elem::translate_y(Real y)
+Real
+Score_elem::relative_coordinate(Axis_group_element*e, Axis a)const
{
- offset_.y += y;
+ Real r =0.0;
+ for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+ axis_group_l != e;
+ axis_group_l = axis_group_l->axis_group_l_a_[a])
+ r += axis_group_l->offset_[a];
+
+ return r;
}
+Axis_group_element*
+Score_elem::common_group(Score_elem const* s, Axis a)const
+{
+ Link_array<Axis_group_element> my_groups;
+ for ( Axis_group_element * axis_group_l = axis_group_l_a_[a];
+ axis_group_l;
+ axis_group_l = axis_group_l->axis_group_l_a_[a])
+ my_groups.push( axis_group_l );
+
+ Axis_group_element* common_l=0;
+ for ( Axis_group_element * axis_group_l = s->axis_group_l_a_[a];
+ !common_l && axis_group_l;
+ axis_group_l = axis_group_l->axis_group_l_a_[a])
+ common_l = my_groups.find_l( axis_group_l );
+
+ return common_l;
+}
+
+
void
Score_elem::translate(Offset O)
{
- translate_y(O.y);
- translate_x(O.x);
+ offset_ += O;
}
Interval
if (!output){
Molecule*m = brew_molecule_p();
- r = m->extent().x;
+ r = m->extent().x();
delete m;
} else
- r = output->extent().x;
+ r = output->extent().x();
return r;
}
Interval
Score_elem::width() const
{
- Interval r=(empty_b_)?Interval(0,0):do_width();
+ return extent( X_AXIS);
+}
+Interval
+Score_elem::extent(Axis a)const
+{
+ Interval r;
+ if ( !empty_b_ ) {
+
+ r = (a == X_AXIS)? do_width(): do_height();
+ }
+
if (!r.empty_b()) // float exception on DEC Alpha
- r+=offset_.x;
+ r+=offset_[a];
return r;
}
Interval r;
if (!output){
Molecule*m = brew_molecule_p();
- r = m->extent().y;
+ r = m->extent().y();
delete m;
} else
- r = output->extent().y;
+ r = output->extent().y();
return r;
}
Interval
Score_elem::height() const
{
- Interval r=(empty_b_)?Interval(0,0): do_height();
-
- if (!r.empty_b())
- r+=offset_.y;
-
-
- return r;
+ return extent(Y_AXIS);
}
+/*
+ STANDARD METHS
+ */
void
Score_elem::print()const
{
mtor << name() << "{\n";
mtor << "dets: " << dependent_size() << "dependencies: " <<
dependency_size();
- if (offset_.x || offset_.y)
- mtor << "offset (" << offset_.x << ", " << offset_.y <<")";
+ if (offset_.x() || offset_.y())
+ mtor << "offset (" << offset_.x() << ", " << offset_.y() <<")";
mtor << "\n";
do_print();
#endif
}
-
-
Score_elem::Score_elem()
{
transparent_b_ = empty_b_ = false;
- x_group_l_ = 0;
- y_group_l_ =0;
+ axis_group_l_a_[0] = axis_group_l_a_[1] =0;
pscore_l_=0;
offset_ = Offset(0,0);
output = 0;
for (int i=0; i < dependency_size(); i++)
dependency(i)->pre_processing();
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->pre_processing();
do_pre_processing();
status_ = PRECALCED;
for (int i=0; i < dependency_size(); i++)
dependency(i)->breakable_col_processing();
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->breakable_col_processing();
+
do_breakable_col_processing();
status_ = PREBROKEN;
}
for (int i=0; i < dependency_size(); i++)
dependency(i)->break_processing();
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->break_processing();
+
+
do_break_processing();
status_ = BROKEN;
for (int i=0; i < dependency_size(); i++)
dependency(i)->post_processing();
+
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->post_processing();
+
+
do_post_processing();
status_=POSTCALCED;
}
for (int i=0; i < dependency_size(); i++)
dependency(i)->molecule_processing();
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->molecule_processing();
+
+
if (transparent_b_)
return ;
output= brew_molecule_p();
}
+/*
+
+ VIRTUAL STUBS
+
+ */
void
Score_elem::do_post_processing()
{
void
Score_elem::do_add_processing()
{
-
}
void
{
}
void
-Score_elem::do_substitute_dependent(Score_elem*o,Score_elem*n)
+Score_elem::do_substitute_dependent(Score_elem*,Score_elem*)
{
- if ( o== y_group_l_ ) {
- y_group_l_ = n ? n->vertical_group() : 0;
- } else if (o == x_group_l_ ) {
- x_group_l_ = n ? n->horizontal_group() : 0;
- }
}
-
+void
+Score_elem::do_unlink()
+{}
IMPLEMENT_IS_TYPE_B(Score_elem);
Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0))));
return new Molecule (a);
}
-Offset
-Score_elem::offset() const
-{
- return offset_;
-}
+
Line_of_score *
Score_elem::line_l()const
}
/*
+
DEPENDENCIES
- */
+
+ */
void
Score_elem::remove_dependency(Score_elem*e)
}
remove_us_arr.push(elt);
}
-
}
remove_us_arr.default_sort();
for (int i=0; i <remove_us_arr.size(); i++)
remove_dependency(remove_us_arr[i]);
+ status_ = BROKEN;
}
/*
void
Score_elem::handle_prebroken_dependencies()
{
- Link_array<Score_elem> remove_us_arr;
+ Link_array<Score_elem> old_arr, new_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 (it_l && it_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);
+ new_arr.push (new_l);
+ old_arr.push(elt);
}
}else {
- add_dependency(it_l->broken_to_a_[0]);
- add_dependency(it_l->broken_to_a_[1]);
+ new_arr.push(it_l->broken_to_a_[0]);
+ old_arr.push(0);
+ old_arr.push(0);
+ new_arr.push(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]);
-
+ for (int i=0; i < old_arr.size(); i++)
+ if (old_arr[i])
+ substitute_dependency( old_arr[i], new_arr[i] );
+
+
+ status_ = PREBROKEN;
}
{
for (int i=0; i < dependency_size(); i++)
dependency(i)->unlink_all();
+ Link_array<Score_elem> extra(get_extra_dependencies());
+ for (int i=0; i < extra.size(); i++)
+ extra[i]->unlink_all();
+
junk_links();
- y_group_l_ = 0;
- x_group_l_ = 0;
+ axis_group_l_a_[0] = axis_group_l_a_[1] =0;
}
void
Score_elem::unlink()
{
+ do_unlink();
while ( dependency_size()) {
do_substitute_dependency(dependency(0),0);
remove_edge_out_idx(0);
while ( dependent_size() ) {
dependent(0)->remove_dependency(this);
}
-}
-
+ for (int j=0; j < 2; j++)
+ if ( axis_group_l_a_[j])
+ axis_group_l_a_[j]->remove_element(this);
+}
void
Score_elem::OK()const
}
#endif
}
+
+Link_array<Score_elem>
+Score_elem::get_extra_dependencies()const
+{
+ Link_array<Score_elem> empty;
+ return empty;
+}
(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-grav.hh"
#include "p-col.hh"
#include "p-score.hh"
void
Score_engraver::prepare(Moment w)
{
- command_column_l_ = new Score_column(w);
- musical_column_l_ = new Score_column(w);
+ set_columns(new Score_column(w), new Score_column(w));
- command_column_l_->musical_b_ = false;
- musical_column_l_->musical_b_ = true;
- score_l_->pscore_p_->add(command_column_l_);
- score_l_->pscore_p_->add(musical_column_l_);
disallow_break_b_ = false;
post_move_processing();
}
*mlog << "[" << breaks_i_ << "]" << flush;
check_removal();
- do_removal_processing();
+ removal_processing();
}
void
scoreline_l_->right_col_l_ = get_staff_info().command_pcol_l();
scoreline_l_->right_col_l_ ->set_breakable();
typeset_all();
+ set_columns(0,0);
}
void
void
Score_engraver::typeset_element(Score_elem *elem_p)
{
- musical_item_p_arr_.push(elem_p);
-}
-
-void
-Score_engraver::typeset_breakable_item(Item * nobreak_p)
-{
- if (nobreak_p) {
- nobreak_item_p_arr_.push(nobreak_p);
- }
+ if ( elem_p->item() && elem_p->item()->breakable_b_ ) {
+ nobreak_item_p_arr_.push(elem_p->item());
+ } else
+ musical_item_p_arr_.push(elem_p);
}
void
Score_engraver::typeset_all()
{
PCol * c= get_staff_info().command_pcol_l();
- PScore *ps_l = score_l_->pscore_p_;
+ Paper_score *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);
+ ps_l->typeset_item(nobreak_item_p_arr_[i], c);
+
+ // should get rid of this.. .
scoreline_l_->add_dependency(nobreak_item_p_arr_[i]);
}
- nobreak_item_p_arr_.set_size(0);
+ nobreak_item_p_arr_.clear();
for (int i=0; i < musical_item_p_arr_.size(); i++) {
PCol* m = get_staff_info().musical_pcol_l();
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);
+ ps_l->typeset_item(elem_p->item(), m);
} else
assert(false);
}
- musical_item_p_arr_.set_size(0);
+ musical_item_p_arr_.clear();
}
typeset_all();
}
+void
+Score_engraver::set_columns(Score_column *new_command_l,
+ Score_column *new_musical_l)
+{
+ if ( command_column_l_ && command_column_l_->used_b() )
+ score_l_->pscore_p_->add(command_column_l_);
+ else {
+ delete command_column_l_ ;
+ command_column_l_ =0;
+ }
+ if (new_command_l) {
+ command_column_l_ = new_command_l;
+ command_column_l_->musical_b_ = false;
+ }
+ if ( musical_column_l_ && musical_column_l_->used_b())
+ score_l_->pscore_p_->add (musical_column_l_);
+ else {
+ delete musical_column_l_;
+ musical_column_l_ = 0;
+ }
+
+ if (new_musical_l) {
+ musical_column_l_ = new_musical_l;
+ musical_column_l_->musical_b_ = true;
+ }
+}
+
Staff_info
Score_engraver::get_staff_info()const
}
IMPLEMENT_IS_TYPE_B1(Score_engraver,Engraver_group_engraver);
-
ADD_THIS_ENGRAVER(Score_engraver);
Score_horizontal_align_engraver::do_pre_move_processing()
{
if (halign_p_) {
- typeset_breakable_item(halign_p_);
+ typeset_element(halign_p_);
halign_p_ =0;
}
Score_align_engraver * align_grav_l = (Score_align_engraver*) reg;
if (!halign_p_) {
halign_p_ = new Break_align_item;
+ halign_p_->breakable_b_ = true;
announce_element(Score_elem_info(halign_p_,0));
}
Item * it = i.elem_l_->item();
score-performer.cc -- implement Score_performer
source file of the GNU LilyPond music typesetter
-
+
(c) 1996, 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
-#include <time.h>
#include "score-performer.hh"
#include "input-translator.hh"
#include "midi-def.hh"
-#include "audio-item.hh"
#include "audio-column.hh"
+#include "audio-item.hh"
#include "audio-score.hh"
-#include "midi-item.hh"
#include "midi-stream.hh"
#include "string-convert.hh"
#include "debug.hh"
-#include "main.hh"
#include "score.hh"
#include "source-file.hh"
#include "source.hh"
+#include "audio-staff.hh"
IMPLEMENT_IS_TYPE_B1(Score_performer,Performer_group_performer);
+
ADD_THIS_PERFORMER(Score_performer);
+
Score_performer::Score_performer()
{
- midi_l_ = 0;
}
+
Score_performer::~Score_performer()
{
}
+
Translator*
-Score_performer::ancestor_l( int l )
+Score_performer::ancestor_l(int l)
{
- return Global_translator::ancestor_l( l );
+ return Global_translator::ancestor_l(l);
}
+
int
Score_performer::depth_i() const
{
return Global_translator::depth_i();
}
+
void
Score_performer::finish()
{
Performer_group_performer::do_removal_processing();
-
-
- Midi_stream output_stream( midi_l_->outfile_str_, midi_item_l_arr_.size() + 1, 384 );
- *mlog << "MIDI output to " << midi_l_->outfile_str_ << " ..." << endl;
-
- header( output_stream);
-// int track_i = 1;
- for (int i=0; i< midi_item_l_arr_.size(); i++) {
- Midi_item * it_p = midi_item_l_arr_[i];
-
-// if ( it_p->is_type_b( Midi_track::static_name()))
-// ((Midi_track*)it_p )->number_i_ = track_i ++;
- output_stream<< *it_p;
- }
- *output_stream.os_p_ << flush;
- *mlog << endl;
}
-void
-Score_performer::play( Audio_item* l )
-{
- l->audio_column_l_ = audio_column_l_;
- audio_column_l_->add( l );
-}
void
-Score_performer::play( Midi_item* l )
+Score_performer::play(Audio_element * p)
{
- midi_item_l_arr_.push( l );
-}
-
-Moment
-Score_performer::get_mom() const
-{
- return now_mom_;
+ if (p->is_type_b(Audio_item::static_name())) {
+ audio_column_l_->add( (Audio_item*)p);
+ } else if (p->is_type_b(Audio_staff::static_name())) {
+ score_l_->audio_score_p_->add_staff( (Audio_staff*)p );
+ }
+ score_l_->audio_score_p_->add(p);
}
-void
-Score_performer::header(Midi_stream &output_stream)
-{
- Midi_track midi_track;
-
- time_t t = time( 0 );
-
- // perhaps multiple text events?
- String str = String( "Creator: " ) + get_version_str() + "\n";
-
- Midi_text creator( Midi_text::TEXT, str );
- midi_track.add( Moment( 0 ), &creator );
-
- str = "Automatically generated at ";
- str += ctime( &t );
- str = str.left_str( str.length_i() - 1 );
- str += "\n";
- Midi_text generate( Midi_text::TEXT, str );
- midi_track.add( Moment( 0 ), &generate );
-
- str = "from musical definition: ";
-
- str += score_l_->location_str();
- Midi_text from( Midi_text::TEXT, str );
- midi_track.add( Moment( 0 ), &from );
-
- Midi_text track_name( Midi_text::TRACK_NAME, "Track "
- + String_convert::i2dec_str( 0, 0, '0' ) );
- midi_track.add( Moment( 0 ), &track_name );
-
- Midi_tempo tempo ( get_tempo_i() );
- midi_track.add( Moment(0), &tempo);
-
- output_stream << midi_track;
-}
void
-Score_performer::prepare( Moment m )
+Score_performer::prepare(Moment m)
{
now_mom_ = m;
- audio_column_l_ = new Audio_column( m );
-
- score_l_->audio_score_p_->add( audio_column_l_ );
+ audio_column_l_ = new Audio_column(m);
+ score_l_->audio_score_p_->add(audio_column_l_);
}
+
void
Score_performer::process()
{
process_requests();
- prev_mom_ = now_mom_;
}
+
void
-Score_performer::set_score(Score* score_l )
+Score_performer::set_score(Score* score_l)
{
- Global_translator::set_score( score_l );
- midi_l_ = score_l->midi_p_;
+ Global_translator::set_score(score_l);
}
+
void
Score_performer::start()
{
- //<ugh>
- int track_i = 1;
- Performer_group_performer::set_track( track_i );
- //</ugh>
-
- if ( midi_l_->outfile_str_ == "" )
- midi_l_->outfile_str_ = default_out_fn + ".midi";
}
int
Score_performer::get_tempo_i()const
{
- return midi_l_->get_tempo_i(Moment( 1, 4 ));
+ return score_l_->midi_p_->get_tempo_i(Moment(1, 4));
}
#include "main.hh"
#include "source.hh"
#include "source-file.hh"
-#include "midi-output.hh"
#include "midi-def.hh"
+#include "midi-stream.hh"
#include "audio-score.hh"
#include "p-col.hh"
#include "music-iterator.hh"
trans_l);
iter->construct_children();
+ if ( ! iter->ok() ) {
+ delete iter;
+ warning ("Need music in a score");
+ errorlevel_i_ =1;
+ return ;
+ }
+
trans_l->start();
+
while ( iter->ok() || trans_l->moments_left_i() ) {
Moment w = infinity_mom;
if (iter->ok() ) {
w = iter->next_moment();
+ mtor << w;
iter->print();
}
trans_l->modify_next( w );
return;
*mlog << "\nCreating MIDI elements ..." << flush;
- audio_score_p_ = new Audio_score( midi_p_ );
+ audio_score_p_ = new Audio_score( this );
Global_translator* score_trans= midi_p_->get_global_translator_p();
run_translator( score_trans );
// return;
}
*mlog << endl;
+
+ midi_output();
}
void
return;
*mlog << "\nCreating elements ..." << flush;
- pscore_p_ = new PScore(paper_p_);
+ pscore_p_ = new Paper_score(paper_p_);
Global_translator * score_trans= paper_p_->get_global_translator_p();
run_translator( score_trans );
// return;
}
- // debugging
*mlog << endl;
pscore_p_->process();
paper_output();
}
-
void
-Score::set(Paper_def *pap_p)
+Score::midi_output()
{
- delete paper_p_;
- paper_p_ = pap_p;
-}
-
-void
-Score::set(Midi_def* midi_p)
-{
- delete midi_p_;
- midi_p_ = midi_p;
-}
-
+ if ( midi_p_->outfile_str_ == "" )
+ midi_p_->outfile_str_ = default_out_fn + ".midi";
+ Midi_stream midi_stream( midi_p_->outfile_str_ );
+ *mlog << "MIDI output to " << midi_p_->outfile_str_ << " ..." << endl;
-void
-Score::print() const
-{
-#ifndef NPRINT
- mtor << "score {\n";
- music_p_->print();
- if (midi_p_)
- midi_p_->print();
-
- mtor << "}\n";
-#endif
+ audio_score_p_->output( midi_stream );
+ *mlog << endl;
}
void
Score::paper_output()
{
if (paper_p_->outfile_str_=="")
- paper_p_->outfile_str_ = default_out_fn + ".out";
+ paper_p_->outfile_str_ = default_out_fn + ".tex";
if ( errorlevel_i_ ) {
*mlog << "lilypond: warning: no output to: " << paper_p_->outfile_str_
the_output << "% outputting Score, defined at: " <<
location_str() << "\n";
pscore_p_->output(the_output);
-
}
void
-Score::midi_output()
+Score::print() const
{
-#if 0
- if (!midi_p_)
- return;
-
- if (midi_p_->outfile_str_ == "")
- midi_p_->outfile_str_ = default_out_fn + ".midi";
+#ifndef NPRINT
+ mtor << "score {\n";
+ music_p_->print();
+ if (midi_p_)
+ midi_p_->print();
- *mlog << "midi output to " << midi_p_->outfile_str_ << " ...\n";
- Midi_output(this, midi_p_);
+ mtor << "}\n";
#endif
}
+void
+Score::set(Paper_def *pap_p)
+{
+ delete paper_p_;
+ paper_p_ = pap_p;
+}
+
+void
+Score::set(Midi_def* midi_p)
+{
+ delete midi_p_;
+ midi_p_ = midi_p;
+}
+
*/
#include "scoreline.hh"
-#include "staffline.hh"
#include "dimen.hh"
#include "spanner.hh"
#include "symbol.hh"
/* To do:
+
take out hard coded TeX stuff.
-
*/
String
Line_of_score::TeX_string() const
PCol* col_l= cols[i];
// all items in the current line & staff.
String chunk_str;
- Real delta = col_l->hpos_f_ - lastpos;
+
+ Link_array<Score_elem> elems;
if (col_l->error_mark_b_) {
chunk_str += String("\\columnerrormark");
}
+
// now output the items.
for (iter_top(col_l->its,j); j.ok(); j++) {
- chunk_str += j->TeX_string();
+ elems.push(j);
}
+
// spanners.
for (iter_top(col_l->starters,j); j.ok(); j++) {
if (j->name() != name())
- chunk_str += j->TeX_string();
+ elems.push(j);
}
- if (chunk_str!="") {
- // moveover
- if (delta)
- s +=String( "\\kern ") + print_dimen(delta);
- s += chunk_str;
- lastpos = col_l->hpos_f_;
+
+ for (int j =0; j< elems.size(); j++) {
+ Offset o = elems[j]->absolute_offset();
+ o[X_AXIS] += cols[i]->hpos_f_;
+ s += elems[j]->TeX_string_without_offset(o);
}
}
s += "}";
void
Line_of_score::add(Score_elem*e)
{
- if( !e->dependent_size()) // avoid excess dependencies.
+ // avoid excess dependencies.
+ if(!( e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
add_dependency(e);
}
if (is_p->errorlevel_i_) {
is_p->warning("Score contains errors. Will not process it. ");
-
+ exit_status_i_ |= 1;
} else {
-
is_p->print ();
is_p->process();
}
is_p =0;
}
- score_array_global.set_size(0);
+ score_array_global.clear();
}
void
Script_column::add(Script*s_l)
{
script_l_arr_.push(s_l);
+ add_dependency(s_l);
add_element(s_l);
}
Script_column::add_support(Item*i_l)
{
support_l_arr_.push(i_l);
+ add_dependency( i_l);
add_element(i_l);
}
void
Script_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
{
- 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));
}
bool
-Script_def::do_equal_b(General_script_def const &g)const
+Script_def::do_equal_b(General_script_def const *g)const
{
- Script_def const & c = (Script_def const&) g;
- return (symidx_str_ == c.symidx_str_ &&
- rel_stem_dir_i_ == c.rel_stem_dir_i_&&
- staff_dir_i_ == c.staff_dir_i_&&
- invertsym_b_ == c.invertsym_b_);
+ Script_def const * c = (Script_def const*) g;
+ return (symidx_str_ == c->symidx_str_ &&
+ rel_stem_dir_i_ == c->rel_stem_dir_i_&&
+ staff_dir_i_ == c->staff_dir_i_&&
+ invertsym_b_ == c->invertsym_b_);
}
int
if (!r_l->musical() || ! r_l->musical()->musicalscript())
return false ;
- for (int i=0; i < script_req_l_arr_.size(); i++)
- if ( !Script_req::compare(*script_req_l_arr_[i], *r_l->script())) {
+ for (int i=0; i < script_req_l_arr_.size(); i++) {
+ if ( r_l->equal_b(script_req_l_arr_[i]))
return true;
- }
+ }
script_req_l_arr_.push( r_l->script());
return true;
}
}
-bool
-Script_engraver::acceptable_elem_b(Score_elem*s_l)
-{
- char const *nC = s_l->name();
- return (nC == Stem::static_name());
-}
-
-void
-Script_engraver::acknowledge_element(Score_elem_info info)
-{
- Score_elem *elem_l = info.elem_l_;
- if (!acceptable_elem_b(elem_l))
- return;
-
- for (int i=0; i < script_p_arr_.size(); i++) {
- Script*script_l = script_p_arr_[i];
- if (elem_l->name() == Stem::static_name())
- script_l->set_stem((Stem*)elem_l->item());
- }
-}
-
void
Script_engraver::do_pre_move_processing()
{
Staff_symbol* s_l = get_staff_info().staff_sym_l_;
for (int i=0; i < script_p_arr_.size(); i++) {
-
Script*script_p = script_p_arr_[i];
script_p->set_staffsym( s_l);
typeset_element(script_p);
}
- script_p_arr_.set_size(0);
+ script_p_arr_.clear();
}
void
Script_engraver::do_post_move_processing()
{
- script_req_l_arr_.set_size(0);
+ script_req_l_arr_.clear();
}
Interval
Script::do_width() const
{
- return specs_l_->get_atom(paper(), dir_i_).extent().x;
+ return specs_l_->get_atom(paper(), dir_i_).extent().x();
}
void
Script::do_pre_processing()
{
+ if (breakable_b_ && break_status_i() != 1) {
+ transparent_b_ = empty_b_ = true;
+ }
+
if (!dir_i_)
set_default_dir();
inside_staff_b_ = specs_l_->inside_b();
Interval
Script::symbol_height()const
{
- return specs_l_->get_atom(paper(), dir_i_).extent().y;
+ return specs_l_->get_atom(paper(), dir_i_).extent().y();
}
Molecule*
Real dy = paper()->internote_f();
Molecule*out = new Molecule(specs_l_->get_atom(paper(), dir_i_));
- out->translate_y(dy * pos_i_);
+ out->translate(dy * pos_i_, Y_AXIS);
return out;
}
end_slur_l_arr_[i]->dir_i_ = dir_i_;
typeset_element(end_slur_l_arr_[i]);
}
- end_slur_l_arr_.set_size(0);
+ end_slur_l_arr_.clear();
}
void
Slur_engraver::do_post_move_processing()
{
- new_slur_req_l_arr_.set_size(0);
+ new_slur_req_l_arr_.clear();
}
Slur_engraver::~Slur_engraver()
{
void
Span_bar_engraver::acknowledge_element(Score_elem_info i)
{
- if ( i.origin_grav_l_arr_.size() > 1 &&
- i.elem_l_->is_type_b( Bar::static_name() ) ) {
+ int depth = i.origin_grav_l_arr_.size();
+ if ( depth > 1
+ && i.elem_l_->is_type_b( Bar::static_name() ) )
+ {
bar_l_arr_.push( (Bar*)i.elem_l_->item() );
if (bar_l_arr_.size() >= 2 && !spanbar_p_) {
for (int i=0; i < bar_l_arr_.size() ; i++)
spanbar_p_->add(bar_l_arr_[i]);
spanbar_p_->set( valign_l_ );
- typeset_breakable_item(spanbar_p_);
+ typeset_element(spanbar_p_);
spanbar_p_ =0;
}
bar_l_arr_.set_size( 0);
spanning_l_arr_.substitute( bold , b);
}
-/*
- A no-op if not yet output: the span_bar slavish follows what it spans
- */
-void
-Span_bar::translate_y(Real y)
-{
- if (status() == OUTPUT)
- Score_elem::translate_y(y);
-}
void
Span_bar::set(Vertical_align_element *a)
Interval
Span_bar::do_width() const
{
- return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x; // ugh
+ return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x(); // ugh
}
void
Span_bar::do_pre_processing()
return paper()->lookup_l()->bar(type_str_, dy);
}
+
Molecule*
Span_bar::brew_molecule_p()const
{
- Interval y;
- for (int i=0; i < spanning_l_arr_.size(); i++)
- y.unite( spanning_l_arr_[i]->height() );
- Symbol s = get_bar_sym(y.length());
- Molecule*output = new Molecule(Atom(s));
- output->translate_y ( y[-1] );
+ Interval y_int;
+ for (int i=0; i < spanning_l_arr_.size(); i++) {
+ Axis_group_element *common =
+ common_group(spanning_l_arr_[i], Y_AXIS);
+
+ Real y = spanning_l_arr_[i]->relative_coordinate(common, Y_AXIS)
+ -relative_coordinate(common,Y_AXIS);
+
+ y_int.unite( y + spanning_l_arr_[i]->height() );
+ }
+ Symbol s = get_bar_sym(y_int.length());
+ Molecule*output = new Molecule(Atom(s));
+ output->translate ( y_int[-1], Y_AXIS );
return output;
}
IMPLEMENT_IS_TYPE_B1(Span_bar,Bar);
+
+Span_bar::Span_bar()
+{
+ type_str_ = "";
+}
IMPLEMENT_IS_TYPE_B1(Span_score_bar_engraver, Span_bar_engraver);
-
IMPLEMENT_IS_TYPE_B1(Piano_bar_engraver, Span_score_bar_engraver);
Span_bar*
-IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group);
+IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group_element);
Interval
Spanner_elem_group::do_width() const
{
#ifndef NPRINT
Spanner::do_print();
- Horizontal_vertical_group::do_print();
+ Horizontal_vertical_group_element::do_print();
#endif
}
void
Spanner::break_into_pieces(bool copy_deps_b)
{
+ if ( broken_into_l_arr_.size() )
+ return;
+
PCol * left = left_col_l_;
PCol * right = right_col_l_;
if(left->daddy_l_) left = left->daddy_l_;
{
return score_l_;
}
+
Staff_info::Staff_info()
{
score_l_ =0;
(c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
*/
-
#include "staff-performer.hh"
#include "translator.hh"
#include "input-translator.hh"
#include "debug.hh"
-#include "midi-def.hh"
#include "audio-column.hh"
#include "audio-item.hh"
-#include "midi-item.hh"
-#include "midi-stream.hh"
-#include "string.hh"
-#include "string-convert.hh"
-
+#include "audio-staff.hh"
IMPLEMENT_IS_TYPE_B1(Staff_performer,Performer_group_performer);
ADD_THIS_PERFORMER(Staff_performer);
Staff_performer::Staff_performer()
{
- midi_track_p_ = new Midi_track;
+ audio_staff_p_ = 0;
}
Staff_performer::~Staff_performer()
{
- delete midi_track_p_;
+ delete audio_staff_p_;
}
void
Staff_performer::do_creation_processing()
{
-}
+ audio_staff_p_ = new Audio_staff;
-void
-Staff_performer::do_removal_processing()
-{
- header();
+ // staff name
+ play(new Audio_text( Audio_text::TRACK_NAME, instrument_str()));
- Moment midi_mom = 0;
- for ( PCursor<Audio_item*> i( audio_item_p_list_ ); i.ok(); i++ ) {
- Audio_item* l = *i;
- Moment mom = l->audio_column_l_->at_mom();
- Moment delta_t = mom - midi_mom_ ;
- midi_mom_ += delta_t;
- Midi_item* p = l->midi_item_p();
- p->channel_i_ = track_i_;
- midi_track_p_->add( delta_t, p );
- delete p;
- }
+ // instrument description
+ play(new Audio_text( Audio_text::INSTRUMENT_NAME, instrument_str()));
- Performer::play( midi_track_p_ );
+ // tempo
+ play(new Audio_tempo(get_tempo_i()));
+
+ // instrument
+ play(new Audio_instrument(instrument_str()));
}
void
-Staff_performer::header()
+Staff_performer::do_removal_processing()
{
- // set track name
- Midi_text track_name( Midi_text::TRACK_NAME, instrument_str() );
- midi_track_p_->add( Moment( 0 ), &track_name );
-
- // set instrument description
- Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, instrument_str() );
- midi_track_p_->add( Moment( 0 ), &instrument_name );
-
- // set instrument :-)
- // lieve wendy, nu heb je mijn track_i_ / get_staff_i weggehaald...
- // zie ook note-performer: ugh
- // ugh, need to know channel (===track===staff) too
- int channel_i = track_i_;
- Midi_instrument instrument( channel_i, instrument_str() );
- midi_track_p_->add( Moment( 0 ), &instrument );
-
- Midi_tempo midi_tempo( get_tempo_i() );
- midi_track_p_->add( Moment( 0 ), &midi_tempo );
+ Performer::play( audio_staff_p_ );
+ audio_staff_p_ = 0;
}
String
}
void
-Staff_performer::play( Audio_item* p )
+Staff_performer::play( Audio_element* p )
{
- audio_item_p_list_.bottom().add( p );
- Performer::play( p );
-}
-
-// huh?
-void
-Staff_performer::play( Midi_item* p )
-{
- Performer::play( p );
-}
-
-
-//<ugh>
-int
-Staff_performer::get_track_i() const
-{
- return track_i_;
-}
-
-void
-Staff_performer::set_track( int& track_i_r )
-{
- track_i_ = track_i_r++;
+ if (p->is_type_b(Audio_item::static_name())) {
+ audio_staff_p_->add((Audio_item*)p);
+ }
+ Performer::play(p);
}
-//</ugh>
void
Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n)
{
- int i;
- while ((i=support_l_arr_.find_i(o) ) >=0)
- if (n)
- support_l_arr_[i] = n;
- else
- support_l_arr_.del(i);
-
+ support_l_arr_.unordered_substitute(o,n);
if (staff_sym_l_ == o)
staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
}
+++ /dev/null
-/*
- 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"
-#include "spanner.hh"
-#include "symbol.hh"
-#include "paper-def.hh"
-#include "molecule.hh"
-#include "p-col.hh"
-#include "p-score.hh"
-
-
-
-IMPLEMENT_IS_TYPE_B2(Line_of_staff,Spanner,Horizontal_vertical_group);
if (bool(beam_p_ ) == bool(mus_l->beam()->spantype == Span_req::START))
return false;
- if (beam_req_l_ && Beam_req::compare(*beam_req_l_ , *mus_l->beam()))
+ if (beam_req_l_ && beam_req_l_ ->equal_b(mus_l))
return false;
beam_req_l_ = mus_l->beam();
get_staff_info().time_C_->whole_in_measure_))
return false;
- if (stem_req_l_ && Stem_req::compare(*stem_req_l_, *mus_l->stem()))
+ if (stem_req_l_ && !stem_req_l_->equal_b( mus_l ) )
return false;
stem_req_l_ = mus_l->stem();
if (!print_flag_b_ || abs(flag_i_) <= 4)
return Interval(0,0); // TODO!
Paper_def*p= paper();
- Interval r(p->lookup_l()->flag(flag_i_).dim.x);
+ Interval r(p->lookup_l()->flag(flag_i_).dim.x());
r+= stem_xoffset_f_;
return r;
}
assert(false);
}
- out->translate_x(stem_xoffset_f_);
+ out->translate(stem_xoffset_f_, X_AXIS);
return out;
}
String
Symbol::str()const
{
- return "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
+ return "symbol(\'"+tex+"\', (" + dim.x().str() + ", " + dim.y().str() + "))";
}
#include "plist.hh"
#include "audio-column.hh"
#include "audio-item.hh"
-#include "cursor.tcc"
-#include "list.tcc"
+#include "audio-staff.hh"
#include "pcursor.tcc"
#include "plist.tcc"
-IPL_instantiate(Audio_item);
+IPL_instantiate(Audio_element);
IPL_instantiate(Audio_column);
+
bs.tex = substitute_args(bs.tex,args);
int w = 2 << widx;
Real width = w PT;
- bs.dim.x = Interval(0,width);
- bs.dim.y = Interval(0,width*slope);
+ bs.dim.x() = Interval(0,width);
+ bs.dim.y() = Interval(0,width*slope);
return bs;
}
args.push(print_dimen(height));
args.push(print_dimen(width));
bs.tex = substitute_args(bs.tex,args);
- bs.dim.x = Interval(0,width);
- bs.dim.y = Interval(0,height);
+ bs.dim.x() = Interval(0,width);
+ bs.dim.y() = Interval(0,height);
return bs;
}
Symbol ret;
ret.tex = m.TeX_string();
- ret.dim.y = Interval(0,width*slope);
- ret.dim.x = Interval(0,width);
+ ret.dim.y() = Interval(0,width*slope);
+ ret.dim.x() = Interval(0,width);
return ret;
}
Symbol s;
- s.dim.y = Interval(min(0,0), max(0,0)); // todo
- s.dim.x = Interval(0,dx);
+ s.dim.y() = Interval(min(0,0), max(0,0)); // todo
+ s.dim.x() = Interval(0,dx);
String f = String("\\hslurchar");
f += direction_char(0);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
- a.translate_x(dx/2);
+ a.translate(dx/2, X_AXIS);
s.tex = a.TeX_string();
return s;
}
Symbol s;
- s.dim.x = Interval(0,dx);
- s.dim.y = Interval(min(0,dy), max(0,dy));
+ s.dim.x() = Interval(0,dx);
+ s.dim.y() = Interval(min(0,dy), max(0,dy));
String f = String("\\hslurchar");
}
Symbol s;
- s.dim.x = Interval(0,dx);
- s.dim.y = Interval(min(0,dy), max(0,dy));
+ s.dim.x() = Interval(0,dx);
+ s.dim.y() = Interval(min(0,dy), max(0,dy));
String f = String("\\slurchar") + String( direction_char(y_sign) );
s.tex = f;
Atom a(s);
- a.translate_x(dx/2);
+ a.translate(dx/2, X_AXIS);
s.dim = a.extent();
s.tex = a.TeX_string();
return s;
Molecule mol;
mol.add(l);
Atom a(m);
- a.translate_y(slur_extra * internote_f);
+ a.translate(slur_extra * internote_f, Y_AXIS);
mol.add_right(m);
mol.add_right(r);
- mol.translate_y( l_dy * internote_f);
+ mol.translate( l_dy * internote_f, Y_AXIS);
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;
}
bool
-Text_def::do_equal_b(Text_def const &def)const
+Text_def::do_equal_b(General_script_def const *gdef) const
{
- return align_i_ == def.align_i_ && text_str_ == def.text_str_
- && style_str_ == def.style_str_;
+ Text_def const *def= (Text_def*)gdef;
+ return align_i_ == def->align_i_ && text_str_ == def->text_str_
+ && style_str_ == def->style_str_;
}
Atom
Musical_req *m = req_l->musical();
if (!m || ! m->text())
return false;
- if (text_req_l_ &&
- Text_req::compare(*m->text(), *text_req_l_))
-
+ if (text_req_l_ && text_req_l_->equal_b(m))
return false;
text_req_l_ = m->text();
Interval
Text_item::symbol_height()const
{
- return tdef_p_->get_atom(paper(), dir_i_).sym_.dim.y;
+ return tdef_p_->get_atom(paper(), dir_i_).sym_.dim.y();
}
Molecule*
Molecule* mol_p = new Molecule(a);
if(dir_i_<0 ) // should do something better anyway.
- mol_p->translate_y( -mol_p->extent().y.left );
- mol_p->translate_y( pos_i_ * paper()->internote_f());
+ mol_p->translate( -mol_p->extent().y().left , Y_AXIS);
+ mol_p->translate( pos_i_ * paper()->internote_f(), Y_AXIS);
return mol_p;
}
Interval
Text_spanner::height()const
{
- return brew_molecule_p()->extent().y;
+ return brew_molecule_p()->extent().y();
}
void
--- /dev/null
+/*
+ timing-grav.cc -- implement Timing_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#if 0
+
+#include "timing-grav.hh"
+#include "command-request.hh"
+
+
+Timing_engraver::Timing_engraver()
+{
+ default_grouping_ = Rhythmic_grouping(MInterval(0,4),4); // ugh
+}
+
+void
+Timing_engraver::fill_staff_info(Staff_info &inf)
+{
+ inf.time_C_ = &time_;
+ inf.rhythmic_C_ = &default_grouping_;
+}
+
+
+#endif
else
elem_l_arr_.del(i);
}
+
+/**
+ Align elements top to bottom.
+ The first element has its top at y =0.0 afterwards
+
+ TODO configurable, like Horizontal_align_item
+ */
void
Vertical_align_element::do_post_processing()
{
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);
+ elem_l_arr_[i]->translate( - dims[i][1] - where_f, Y_AXIS);
where_f += dims[i].length();
}
}
Vertical_align_engraver::acknowledge_element(Score_elem_info i)
{
if ( i.origin_grav_l_arr_.size() == 2 &&
- i.elem_l_->is_type_b(Vertical_group::static_name()) &&
- !i.elem_l_->y_group_l_ ) {
+ i.elem_l_->is_type_b(Vertical_group_element::static_name()) &&
+ !i.elem_l_->axis_group_l_a_[Y_AXIS] ) {
assert( !valign_p_->contains_b( i.elem_l_) );
valign_p_->add ( i.elem_l_ );
#include "item.hh"
#include "p-col.hh"
-/**
- Uncouple all elements of this Vertical_group. Ugh!
- */
-void
-Vertical_group_spanner::remove_all()
-{
- for (int i=0; i < elem_l_arr_.size(); i++){
- elem_l_arr_[i]->y_group_l_ = 0;
- }
- elem_l_arr_.set_size(0);
- junk_dependencies();
-}
-
-void
-Vertical_group_spanner::do_break_processing()
-{
- set_my_columns();
- if ( line_l() ) {
- return;
- }
- break_into_pieces( false );
-
- Link_array<Score_elem> elem_l_arr = elem_l_arr_;
- remove_all();
-
-
-
- for (int i=0; i < elem_l_arr.size(); i++) {
- Score_elem * elt = elem_l_arr[i];
- Line_of_score *elt_line = elt->line_l();
-
- if ( elt-> y_group_l_ )
- continue;
-
- if ( ! elt_line ){
- if (elt->spanner()) {
- Spanner * sp = elt->spanner();
-
- for (int j =0; j < broken_into_l_arr_.size(); j++) {
- Vertical_group_spanner * my_broken_l
- = (Vertical_group_spanner*)broken_into_l_arr_[j];
-
- Spanner * broken_span_l
- = sp->find_broken_piece(my_broken_l->line_l());
-
- if (broken_span_l) {
- my_broken_l->add_element(broken_span_l );
- }
- }
- } else if (elt->item() && elt->item()->pcol_l_->breakpoint_b()
- && elt->item()->break_status_i() == 0) {
- for (int j =0; j < 2; j++) {
- Item * my_item = elt->item()->broken_to_a_[j];
- Line_of_score * item_line_l_ = my_item->line_l() ;
- if ( ! item_line_l_ )
- continue;
-
- Vertical_group_spanner * v
- = (Vertical_group_spanner*)find_broken_piece( item_line_l_);
- if (v) {
- v->add_element( my_item );
- }
- }
- }
- } else {
- Vertical_group_spanner * my_broken_l
- = (Vertical_group_spanner*)find_broken_piece( elt->line_l() );
- my_broken_l->add_element( elt );
- }
- }
- for (int j =0; j < broken_into_l_arr_.size(); j++)
- broken_into_l_arr_[j]->break_processing();
-}
-
-Vertical_group_spanner::Vertical_group_spanner()
-{
-}
-
-void
-Vertical_group_spanner::do_print() const
-{
- Vertical_group::do_print();
-}
-
-
-
-IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Spanner, Vertical_group);
-
-Vertical_group_spanner::Vertical_group_spanner(Vertical_group_spanner const &s)
- : Spanner(s), Vertical_group(s)
-{
-}
+IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Axis_group_spanner, Vertical_group_element);
# identify module:
#
NAME = make
-
+SUBDIRS = debian
# list of distribution files:
# configure and make.
EXTRA_DISTFILES = Configure_variables.make.in lilypond.spec.in Toplevel.make.in \
lilypond.lsm.in $(outdir)/lilypond.spec $(outdir)/lilypond.lsm
+
#
# generic variables:
# so why does make still consider xx.y : RCS/xx.y,v ?
# there is no suffix ,v anymore!
-.SUFFIXES: .cc .o .hh .y .l .pod .text .1 .dep .html
+.SUFFIXES: .cc .o .hh .y .l .dep
# compile rules:
# Han-Wen Nienhuys <hanwen@stack.nl>
.PHONY : all clean config default dist doc doc++ dummy exe help lib TAGS html\
- check-flower-deps check-lily-deps check-doc-deps
+ check-flower-deps check-lib-deps check-doc-deps
# target all:
#
# doc++ documentation of classes
doc++: $(progdocs)
- doc++ -k -p -d $(DOCDIR) $^
+ $(docxx) $(docxx-opts) -d $(DOCDIR) $^
# ugh. should generate in out/
dist:
check-flower-deps:
$(MAKE) -C $(depth)/flower/ default
-check-lily-deps: check-flower-deps
+check-lib-deps: check-flower-deps
$(MAKE) -C $(depth)/lib
check-doc-deps:
DO_CXX_COMPILE=$(DODEP)\
$(CXX) -c $(CXXFLAGS) $(CXX_OUTPUT_OPTION)
-# "CC = $(CC)"
-# "CXX = $(CXX)"
-#
# linker:
#
# .hh should be first. Don't know why
# take some trouble to auto ignore sources and obsolete stuff.
-progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') $(shell $(FIND) ./ -name '*.cc'|egrep -v '$(OUTDIR_NAME)')
+progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v '$(OUTDIR_NAME)') \
+ $(shell $(FIND) ./ -name '*.cc' |egrep -v '$(OUTDIR_NAME)') \
pod2html=pod2html
# substitute $(STRIP) in Site.make if you want stripping
DO_STRIP=true
+
+docxx-opts=-S -k -p
+docxx=doc++
+
--- /dev/null
+depth = ../..
+
+NAME= debian
+
+# generic variables:
+#
+include ./$(depth)/make/Variables.make
+include ./$(depth)/make/Files.make
+#
+
+# generic targets and rules:
+#
+include ./$(depth)/make/Targets.make
+include ./$(depth)/make/Rules.make
+#
+
+
+EXTRA_DISTFILES = README.debian.ex changelog control\
+ copyright dirs diversions.ex docs examples info.ex menu.ex postinst\
+ postrm rules watch
--- /dev/null
+lilypond for DEBIAN
+-------------------
+
+Comments regarding the Package
+
+Anthony Fok <foka@gpu.srv.ualberta.ca>, Wed, 6 Aug 1997 02:14:59 -0600
--- /dev/null
+lilypond (0.1.0-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Anthony Fok <foka@gpu.srv.ualberta.ca> Wed, 6 Aug 1997 04:40:57 -0600
+
+Local variables:
+mode: debian-changelog
+add-log-mailing-address: "foka@gpu.srv.ualberta.ca"
+End:
--- /dev/null
+Source: lilypond
+Section: tex
+Priority: contrib/optional
+Maintainer: Anthony Fok <foka@gpu.srv.ualberta.ca>
+Standards-Version: 2.2.0.0
+
+Package: lilypond
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: tetex-base, musixtex | musixtex-fonts
+Description: GNU LilyPond -- A preprocessor to make TeX typeset music.
+ GNU 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 beams,
+ slurs, triplets, multiple voices.
+ .
+ Note: LilyPond uses the fonts from MusiXTeX. Please install the package
+ musixtex or musixtex-fonts when you install lilypond. :)
+ .
+ URL: http://www.stack.nl/~hanwen/lilypond/
+ Authors: Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
--- /dev/null
+This package was debianized by Anthony Fok foka@gpu.srv.ualberta.ca on
+Wed, 6 Aug 1997 04:30:28 -0600
+
+It was downloaded from
+ ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz
+
+It is also available from:
+ ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz
+
+For more informatino about GNU LilyPond, please visit:
+ http://www.stack.nl/~hanwen/lilypond/ for more information.
+
+
+Authors:
+ Han-Wen Nienhuys <hanwen@stack.nl>
+ Jan Nieuwenhuizen <jan@digicash.com>
+
+Copyright:
+
+ GNU LilyPond is Copyright (C) Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 dated June, 1991.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA.
+
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/doc/copyright/GPL.gz'.
--- /dev/null
+usr/bin
+usr/lib/texmf/doc
--- /dev/null
+<FILE> <Diverted to> <Packagename>
--- /dev/null
+Documentation/out/*.text
+Documentation/*.doc
+Documentation/lelie_logo.gif
--- /dev/null
+input/*.ly
+input/*.tex
--- /dev/null
+# This is a configuration files for installing a .info menu
+# The Description to be placed into the directory
+DESCR="Description"
+
+# The section this info file should be placed in (Regexp) followed by
+# the new section name to be created if the Regexp does not match
+# (Optional. If not given the .info will be appended to the directory)
+#SECTION_MATCH="Regexp"
+#SECTION_NAME="New Section Name"
+
+# The file referred to from the Info directory
+FILE=lilypond.info
+
+# Optional. The files to be copied to /usr/info
+#FILES=*.info
--- /dev/null
+text Apps/Misc lilypond none "lilypond Description" /usr/bin/lilypond
--- /dev/null
+#!/bin/bash
+set -e
+
+if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+ texhash
+fi
+
--- /dev/null
+#!/bin/bash
+
+set -e
+
+case "$1" in
+ remove)
+ if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+ texhash
+ fi
+ ;;
+
+ upgrade)
+ ;;
+
+ purge)
+ if [ -x /usr/bin/texhash -a -e /usr/lib/texmf/ls-R ]; then
+ texhash
+ fi
+ ;;
+
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
--- /dev/null
+#!/usr/bin/make -f
+# Made with the aid of debmake, by Christoph Lameter,
+# based on the sample debian/rules file for GNU hello by Ian Jackson.
+
+package=lilypond
+
+build:
+ $(checkdir)
+ ./configure --enable-checking --disable-debugging \
+ --enable-printing --prefix=/usr --enable-optimize \
+ --enable-shared
+ make all
+
+ touch build
+
+clean:
+ $(checkdir)
+ -rm -f build
+ -make distclean
+ -rm -f {,*/}out/{*,.build} flower/config.{log,status}
+ -rm -f `find . -name "*~"`
+ -rm -rf debian/tmp debian/files* core debian/substvars
+
+binary-indep: checkroot build
+ $(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package. If there were any they would be
+# made here.
+
+binary-arch: checkroot build
+ $(checkdir)
+ -rm -rf debian/tmp
+ install -d debian/tmp
+ cd debian/tmp && install -d `cat ../dirs`
+ make prefix=`pwd`/debian/tmp/usr install
+ ln -fs ../../../doc/lilypond debian/tmp/usr/lib/texmf/doc/lilypond
+# Must have debmake installed for this to work. Otherwise please copy
+# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
+ debstd -m BUGS TODO NEWS DEDICATION ANNOUNCE README
+ dpkg-gencontrol
+ chown -R root.root debian/tmp
+ chmod -R go=rX debian/tmp
+ dpkg --build debian/tmp ..
+
+define checkdir
+ test -f debian/rules
+endef
+
+# Below here is fairly generic really
+
+binary: binary-indep binary-arch
+
+checkroot:
+ $(checkdir)
+ test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
--- /dev/null
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site Directory Pattern Version Script
+pcnov095.win.tue.nl /pub/lilypond lilypond-*.tar.gz debian uupdate
Begin3
Title: LilyPond
-Version: 0.1.1
-Entered-date: 05AUG97
+Version: 0.1.7
+Entered-date: 14AUG97
Description: GNU LilyPond is a program which converts music
definition files into visual or auditive output: it can
typeset formatted sheet music to a TeX file and and
jan@digicash.com (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps
- 340k lilypond-0.1.1.tar.gz
+ 340k lilypond-0.1.7.tar.gz
Original-site: pcnov095.win.tue.nl /pub/lilypond/
- 340k lilypond-0.1.1.tar.gz
+ 340k lilypond-0.1.7.tar.gz
Copying-policy: GPL
End
Name: lilypond
-Version: 0.1.1
+Version: 0.1.7
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.1.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.7.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/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/links.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README
-%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/rock.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/mudela-course.doc Documentation/mudela-man.doc
+%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README
+%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/gallina.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-pop.ly input/twinkle.ly input/wohltemperirt.ly Documentation/mudela-course.doc Documentation/mudela-man.doc
%doc Documentation/lelie_logo.gif
/usr/bin/convert-mudela
/usr/bin/mudela-book
depth = ..
#
-# identify module:
-#
NAME = mi2mu
MODULE_NAME = mi2mu
-#
# generic variables:
#
include ./$(depth)/make/Files.make
#
-# versioning
+# identify module:
#
include $(mi2mu-dir)/VERSION
build = $(mi2mu-dir)/$(outdir)/.build
# list of custom libraries:
#
-MODULE_LIBDEPS=check-flower-deps check-lily-deps
+MODULE_LIBDEPS=check-flower-deps check-lib-deps
MODULE_LIBES=-llily -lflower
#
PROJECTS
+ * junk one in list vs. array
+
* write something interesting in mi2mu manual page
* check/use type 0 / 1 / 2 of midi file
MAJOR_VERSION = 0
MINOR_VERSION = 0
-PATCH_LEVEL = 18
+PATCH_LEVEL = 19
# use to send patches, always empty for released version:
MY_PATCH_LEVEL =
#
#define LILY_STREAM_HH
/// Lily output
-struct Lily_stream {
- ostream* os_p_;
- String filename_str_;
- int indent_i_;
- int column_i_;
- int wrap_column_i_;
- bool comment_mode_bo_;
-
+class Lily_stream {
+public:
Lily_stream( String filename_str );
~Lily_stream();
Lily_stream& operator <<( String str );
Lily_stream& operator <<( Midi_event& midi_event_r );
- void check_comment( String str );
+private:
void header();
- void indent();
- void newline();
void open();
- void tnedni();
+ void output( String str );
+ void output_wrapped( String str );
+
+ ostream* os_p_;
+ String filename_str_;
+ int indent_i_;
+ int column_i_;
+ int wrap_column_i_;
+ bool comment_mode_b_;
};
#endif // LILY_STREAM_HH
void add_event( Moment mom, Midi_event* midi_event_p );
Moment end_mom();
+ String id_str();
String name_str();
void output_mudela( Lily_stream& lily_stream_r );
Moment next_begin_mom( Moment now_mom );
filename_str_ = filename_str;
os_p_ = 0;
indent_i_ = 0;
- comment_mode_bo_ = false;
+ comment_mode_b_ = false;
column_i_ = 0;
wrap_column_i_ = 60;
open();
Lily_stream&
Lily_stream::operator <<( String str )
{
- static String nobreak_str = "\\`'_-.^<>*@";
+ static String word_sep_str = "{} \t\n";
while ( str.length_i() ) {
- int max_i = wrap_column_i_ - column_i_ - 1;
- int i = str.length_i() - 1 <? max_i;
- int nl_i = str.left_str( i + 1 ).index_i( '\n' );
- if ( nl_i != -1 ) {
- i = nl_i - 1;
- str = str.nomid_str( nl_i, 1 );
- }
-
- if ( ( i != str.length_i() - 1 ) && ( nl_i == -1 ) ) {
- while ( i && ( isalnum( str[ i ] )
- || ( nobreak_str.index_i( str[ i ] ) != -1 ) ) )
- i--;
-
- if ( !i ) { // no room left
- if ( column_i_ > 8 * indent_i_ ) {
- newline();
- if ( comment_mode_bo_ && ( str[ 0 ] != '%' ) )
- str = "%" + str;
- continue;
- }
- else { // cannot break neatly...
- i = max_i;
- }
- }
- }
-
- String line = str.left_str( i + 1 );
- str = str.mid_str( i + 1, INT_MAX );
- *os_p_ << line;
- column_i_ += line.length_i();
- if ( nl_i != -1 )
- newline();
- else
- check_comment( line );
- if ( ( str.length_i() && ( nl_i == -1 ) ) || ( column_i_ >= wrap_column_i_ ) ) {
- //brr.
- if ( comment_mode_bo_ )
- str = "%" + str;
- newline();
- }
- }
+ int i = str.index_any_i( word_sep_str ) + 1;
+ if ( !i )
+ i = str.length_i();
+ String word = str.left_str( i );
+ str = str.mid_str( i, str.length_i() );
+ output_wrapped( word );
+ }
return *this;
}
return *this;
}
-void
-Lily_stream::check_comment( String str )
-{
- int newline_i = str.index_last_i( '\n' );
- if ( newline_i != -1 ) {
- str = str.mid_str( newline_i +1, INT_MAX );
- comment_mode_bo_ = false;
- }
- if ( str.index_i( '%' ) != -1 )
- comment_mode_bo_ = true;
-}
-
void
Lily_stream::header()
{
// ugh
*os_p_ << "\\version \"0.1.0\";\n";
}
-/*
- snapnie: dit kan toch automaties? Zie ook dstream.
- */
-void
-Lily_stream::indent()
-{
- indent_i_++;
- newline();
-}
-
-void
-Lily_stream::newline()
-{
- *os_p_ << endl << String( '\t', indent_i_ );
- column_i_ = indent_i_ * 8;
- comment_mode_bo_ = false;
-}
void
Lily_stream::open()
}
void
-Lily_stream::tnedni()
+Lily_stream::output( String str )
+{
+ for ( int i = 0; i < str.length_i(); i++ ) {
+ char c = str[ i ];
+ switch ( c ) {
+ case '{' :
+ case '<' :
+ indent_i_++;
+ column_i_++;
+ *os_p_ << c;
+ break;
+ case '}' :
+ case '>' :
+ assert( indent_i_ );
+ indent_i_--;
+ column_i_++;
+ *os_p_ << c;
+ break;
+ case '%' :
+ comment_mode_b_ = true;
+ *os_p_ << c;
+ column_i_++;
+ break;
+ case '\t' :
+ column_i_ += 8;
+ *os_p_ << c;
+ break;
+ case '\n' :
+ *os_p_ << endl;
+ *os_p_ << String( '\t', indent_i_ );
+ column_i_ = indent_i_ * 8;
+ comment_mode_b_ = false;
+ break;
+ default :
+ column_i_++;
+ *os_p_ << c;
+ break;
+ }
+ }
+}
+
+void
+Lily_stream::output_wrapped( String str )
{
- assert( indent_i_ > 0 );
- indent_i_--;
- newline();
+ // enough room left -> doit
+ if ( column_i_ + str.length_i() <= wrap_column_i_ ) {
+ output( str );
+ return;
+ }
+
+ // we're at BOL already; this will never fit -> doit
+ if ( column_i_ == indent_i_ * 8 ) {
+ output( str );
+ return;
+ }
+
+ // ok, let's wrap
+ // preserve comment mode
+ if ( comment_mode_b_ )
+ output( String( "\n%" ) );
+ else
+ output( String( "\n" ) );
+
+ output( str );
}
+
Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a );
String output_str;
- while ( Long_option_init* long_option_init_p = getopt_long() )
+ while ( Long_option_init const* long_option_init_p = getopt_long() )
switch ( long_option_init_p->shortname ) {
case 'b':
Duration_convert::no_quantify_b_s = true;
Duration_convert::no_smaller_than_i_s = 32;
break;
case 'o':
- output_str = getopt_long.optarg;
+ output_str = getopt_long.optional_argument_ch_C_;
break;
case 'p':
Duration_convert::no_triplets_b_s = true;
level_ver = QUIET_ver;
break;
case 's': {
- int i = String_convert::dec2_i( getopt_long.optarg );
+ int i = String_convert::dec2_i( getopt_long.optional_argument_ch_C_ );
if ( !i ) {
identify();
usage();
// flag -q must be checked first
identify();
- char* arg_sz = 0;
+ char const* arg_sz = 0;
while ( ( arg_sz = getopt_long.get_next_arg() ) ) {
My_midi_parser midi_parser( arg_sz, & source );
midi_parser_l_g = &midi_parser;
|| ( text_str_.length_i() != (int)strlen( text_str_.ch_C() ) ) )
return "";
- return "% " + text_str_ + "\n\t";
+ return "% " + text_str_ + "\n";
}
Midi_time::Midi_time( int num_i, int den_i, int clocks_4_i, int count_32_i )
- : sync_dur_( 8 )
{
+ sync_dur_.type_i_ = 8;
+
sync_f_ = 1.0;
if ( count_32_i != 8 )
warning( String( "#32 in quarter: " ) + String( count_32_i ));
Moment
Midi_time::bar_mom()
{
- return Moment( num_i_ ) * Duration_convert::dur2_mom( Duration( 1 << den_i_ ) );
+ Duration d;
+ d.type_i_ = 1 << den_i_ ;
+ return Moment( num_i_ ) * Duration_convert::dur2_mom( d );
}
int
break;
case Midi_text::TRACK_NAME:
midi_parser_l_g->track_name_str_ = *$2;
- while ( midi_parser_l_g->track_name_str_.index_i( ' ' ) != -1 )
- *(midi_parser_l_g->track_name_str_.ch_l() + midi_parser_l_g->track_name_str_.index_i( ' ' ) ) = '_';
break;
case Midi_text::INSTRUMENT_NAME:
midi_parser_l_g->instrument_str_ = *$2;
for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush;
i->output_mudela( lily_stream );
- lily_stream.newline();
+ lily_stream << "\n";
tor( NORMAL_ver ) << endl;
}
- lily_stream << "\\score{";
- lily_stream.indent();
- lily_stream << " < \\multi 3;";
- lily_stream.indent();
- for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
- if ( ( midi_track_p_list_.size() != 1 )
- && ( i == midi_track_p_list_.top() ) )
- continue;
- lily_stream << "\\melodic{ ";
- lily_stream << "\\$" << i->name_str();
- lily_stream << " }";
- lily_stream.newline();
- }
- lily_stream.tnedni();
- lily_stream << ">";
- lily_stream.newline();
- lily_stream << "\\paper{";
- lily_stream.indent();
- lily_stream << "unitspace = 20.0\\mm;";
- lily_stream.tnedni();
- lily_stream << "}";
- lily_stream.newline();
- lily_stream << "\\midi{";
- lily_stream.indent();
- // not use silly 0 track
- midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
- lily_stream.tnedni();
- lily_stream << "}";
- lily_stream.tnedni();
+ lily_stream << "\\score{\n";
+ lily_stream << " < \\multi 3;\n";
+ for ( PCursor<Midi_track*> i( midi_track_p_list_.top() ); i.ok(); i++ ) {
+ if ( ( midi_track_p_list_.size() != 1 )
+ && ( i == midi_track_p_list_.top() ) )
+ continue;
+ lily_stream << "\\melodic{ ";
+ lily_stream << "\\$" << i->id_str();
+ lily_stream << " }\n";
+ }
+ lily_stream << ">\n";
+
+ lily_stream << "\\paper{";
+ lily_stream << "unitspace = 20.0\\mm;";
+ lily_stream << "}\n";
+
+ lily_stream << "\\midi{";
+ // not use silly 0 track
+ midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true );
+ lily_stream << "}\n";
- lily_stream << "}";
- lily_stream.newline();
+ lily_stream << "}\n";
return 0;
}
#endif
}
+String
+Midi_track::id_str()
+{
+ String str = name_str();
+ for ( int i = 0; i < str.length_i(); i++ )
+ if ( ( !i && !isalpha( str[ i ] ) )
+ || !isalnum( str[ i ] ) )
+ *( str.ch_l() + i ) = '_';
+ return str;
+}
+
String
Midi_track::name_str()
{
tor( DEBUG_ver ) << ":sdne" << endl;
}
-
void
Midi_track::output_mudela( Lily_stream& lily_stream_r )
{
- lily_stream_r << name_str() << " = \\melodic{";
- lily_stream_r.indent();
- lily_stream_r << "% midi copyright:" << copyright_str_;
- lily_stream_r.newline();
- lily_stream_r << "% instrument:" << instrument_str_;
- lily_stream_r.newline();
-
+ lily_stream_r << "$" << id_str() << " = \\melodic{\n";
+ lily_stream_r << "% midi copyright:" << copyright_str_ << "\n";
+ lily_stream_r << "% instrument:" << instrument_str_ << "\n";
// int bar_i = 1;
int bar_i = 0;
// bar_i++;
// tor( NORMAL_ver ) << '[' << bar_i << ']' << flush;
- lily_stream_r.tnedni();
- lily_stream_r << "} % " << name_str();
- lily_stream_r.newline();
+ lily_stream_r << "} % " << name_str() << "\n";
}
Moment into_bar_mom = now_mom - Moment( bar_i - 1 ) * bar_mom;
if ( bar_i > 1 ) {
if ( !into_bar_mom )
- lily_stream_r << "|";
- lily_stream_r.newline();
+ lily_stream_r << "|\n";
}
lily_stream_r << "% " << String_convert::i2dec_str( bar_i, 0, ' ' );
if ( into_bar_mom )
lily_stream_r << ":" << Duration_convert::dur2_str( Duration_convert::mom2_dur( into_bar_mom ) );
- lily_stream_r.newline();
+ lily_stream_r << "\n";
}
// running_i64_i64_a_[ channel_i ][ pitch_i ] = -1;
// assert( start_i64 != -1 ); // did we start?
- Duration dur( 0 );
+ Duration dur;
+ dur.type_i_ = 0;
if ( Duration_convert::no_quantify_b_s )
dur = Duration_convert::ticks2_dur( (I64)now_i64_ - start_i64 );
else {
% A tex file to help determine dims.
%
-\font\musicfont=musixsps
-\font\slurfont=xhslu16
+\font\musicfont=musix16
+\font\slurfont=xslu16
\font\specfont=musixspx
-% \def\thefont{\musicfont}
+\def\thefont{\musicfont}
%\def\thefont{\specfont}
-\def\thefont{\slurfont}
\def\mb#1{{\thefont\char#1}}
\divide\wid by 2
\here=-\wid
\loop\ifdim\here<\wid\advance\here by\inc
- \hbox to0pt{\kern\here\vrule width0.05pt height 4pt\hss}%
+ \hbox to0pt{\kern\here\vrule width0.05pt height 1pt depth 1pt\hss}%
\repeat%
}
\divide\wid by 2
\here=-\wid
\loop\ifdim\here<\wid\advance\here by\inc
- \vbox to0pt{\vskip\here\vrule width2pt height 0.05pt\vss}%
+ \hbox to0pt{\vbox to0pt{\vss\hrule width2pt height 0.05pt\kern\here}\hss}%
\repeat%
}
-\def\twhrul{\hbox to 0pt{\hbox{\hruler{20}\vrule
- width0.1pt height 3ptdepth 1pt}}}
-\def\twvrul{\hbox{\vbox to 20pt{\vruler{20}\vrule
- width3pt height 0.1pt}}}
+\def\twhrul{\hbox to 0pt{\hbox{\hruler{20}%
+ \vrule width0.1pt height 2pt depth 2pt}}}
+\def\twvrul{\vbox to0pt{\vss\hbox to0pt{\hss\vruler{12}}\vss}%
+ \kern-1pt\vrule width4pt height 0.1pt}%
+
\def\doitem#1{
- #1 %
- %\twvrul%doesn't work
- \hbox to 50pt{\qquad\twhrul\mb{#1}\hss}\setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
+ #1%
+ \vbox to12pt{\vfill\hbox to0pt{\qquad\kern-1pt\twvrul\hss}}%
+ \hbox to50pt{\qquad\twhrul\mb{#1}\hss}%
+ \setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
\newcount\n
\def\charn{\n=-1
\def\ldoubledot{\kern-\notewidth\doubledot}
\def\ltripledot{\kern-\notewidth\tripledot}
+\mdef\turn{67}
\maccentdef\sforzato{30}{-3/2}
\maccentdef\marcato{20}{-1/1}
\maccentdef\imarcato{21}{1/1}
\mdef\ispicato{29}
\mdef\upbow{23}
\mdef\downbow{22}
+
+\def\tr{{\it tr}}