Lexer 1
+walking 1
+
# flower lib
File_path 1
Matrix 1
-Keywords: midi notation music typesetting gnu
-Subject: LilyPond 0.1 released - The GNU Project music typesetter
-
- BORN
-
- August 1, 1997
-
- Lily
-
- (GNU LilyPond 0.1)
-
- daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
-
-Lily is a healthy, bouncing baby weighing 345 kilobytes
-
-Visiting hours: 24 hours a day at
-
- ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe)
- ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz (US)
-
-You can see some babyfood, diapers and pictures at
-
- http://www.stack.nl/~hanwen/lilypond/index.html
-
-You can send your congratulations to Janneke (jan@digicash.com) and
-Wendy (hanwen@stack.nl)
-
+Keywords: midi notation music typesetting gnu font
+Subject: LilyPond 0.2 released - The GNU Project music typesetter
GNU LilyPond - The GNU Project Music Typesetter
-
``WHAT IS GNU LilyPond?''
-Well Mike, 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 (mechanical) performances to MIDI files.
-
-
-We have been working very hard on this system for the past year, and
-we finally think that it is ready to be used and hacked at by a larger
-public than us.
+GNU LilyPond is the GNU Project Music typesetter: it reads a music
+definition file and outputs formatted sheet music to a TeX file or
+(mechanical) performances to MIDI files.
WHY ?
of public domain music.
-BUT ..
-
-We haven't yet reached that goal:
-
-* The quality of the output isn't good enough yet due to some
-unsophisticated algorithms
-
-* Some features haven't been implemented, due to lack of time; most of
-them can be done quite simply
+WHAT'S NEW
-This is why we don't consider this software stable yet. It generally
-does what it is supposed to, but we reserve the right to make
-(incompatible) changes to the input format. We consider it
-of BETA quality.
+* LilyPond now includes a completely rewritten font: the Feta font.
+We did our best to copy the best symbol designs available and We're
+proud of the result. We hope you agree, so go check it out!
+* More elegant output due to
-WE WANT YOU!
+ * better spacing
+ * better breaking
+ * better font design
+ * PostScript output for variable symbols.
-You can become a user, but we'd really appreciate it if you would start
-hacking at Lily, and help us advance our project more quickly.
+* Lots of bugfixes
+* More robust, flexible, tweakable design
-``YES, IT IS FANTASTIC! WHAT DO I NEED?''
+* Better MIDI importing
-For compilation you need
+* Easier to use due to better scripts and input format enhancements.
- Unix. (windows32 is known to work, too)
- GNU C++ v2.7 or better, with libg++ installed.
- GNU make.
- Flex (2.5.1 or better).
- Bison. (1.25 or better)
+* MusixTeX not needed anymore
-For running you need
- TeX
- MusiXTeX fonts
-
-The MusiXTeX fonts are part of the MusiXTeX package version T.73,
-available at any CTAN mirror, or http://www.gmd.de/Misc/Music/
-
-
-``WHAT CAN LILYPOND DO?''
+WHAT CAN LILYPOND DO?
ASCII script input (mudela), with identifiers (for music reuse),
customizable notenames.
Integration with LaTeX through Perl scripts.
-``WHERE CAN I FIND MORE INFO?''
+MORE INFO
Sources for this project are on
ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe)
- ftp://alpha.gnu.ai.mit.edu/gnu/ (US)
+ ftp://alpha.gnu.org/gnu/ (US)
More detailed info and examples can be found on the webpage at
http://www.stack.nl/~hanwen/lilypond/index.html
-
-THANK YOU,
-
-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.
-
-
- --- * ---
--- /dev/null
+Keywords: midi notation music typesetting gnu
+Subject: LilyPond 0.1 released - The GNU Project music typesetter
+
+ BORN
+
+ August 1, 1997
+
+ Lily
+
+ (GNU LilyPond 0.1)
+
+ daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys
+
+Lily is a healthy, bouncing baby weighing 345 kilobytes
+
+Visiting hours: 24 hours a day at
+
+ ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe)
+ ftp://alpha.gnu.ai.mit.edu/gnu/lilypond-0.1.0.tar.gz (US)
+
+You can see some babyfood, diapers and pictures at
+
+ http://www.stack.nl/~hanwen/lilypond/index.html
+
+You can send your congratulations to Janneke (jan@digicash.com) and
+Wendy (hanwen@stack.nl)
+
+
+GNU LilyPond - The GNU Project Music Typesetter
+
+
+
+``WHAT IS GNU LilyPond?''
+
+Well Mike, 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 (mechanical) performances to MIDI files.
+
+
+We have been working very hard on this system for the past year, and
+we finally think that it is ready to be used and hacked at by a larger
+public than us.
+
+
+WHY ?
+
+We want to create tools to produce production quality scores and parts
+of public domain music.
+
+
+BUT ..
+
+We haven't yet reached that goal:
+
+* The quality of the output isn't good enough yet due to some
+unsophisticated algorithms
+
+* Some features haven't been implemented, due to lack of time; most of
+them can be done quite simply
+
+This is why we don't consider this software stable yet. It generally
+does what it is supposed to, but we reserve the right to make
+(incompatible) changes to the input format. We consider it
+of BETA quality.
+
+
+WE WANT YOU!
+
+You can become a user, but we'd really appreciate it if you would start
+hacking at Lily, and help us advance our project more quickly.
+
+
+``YES, IT IS FANTASTIC! WHAT DO I NEED?''
+
+For compilation you need
+
+ Unix. (windows32 is known to work, too)
+ GNU C++ v2.7 or better, with libg++ installed.
+ GNU make.
+ Flex (2.5.1 or better).
+ Bison. (1.25 or better)
+
+For running you need
+
+ TeX
+ MusiXTeX fonts
+
+The MusiXTeX fonts are part of the MusiXTeX package version T.73,
+available at any CTAN mirror, or http://www.gmd.de/Misc/Music/
+
+
+``WHAT CAN LILYPOND DO?''
+
+ASCII script input (mudela), with identifiers (for music reuse),
+customizable notenames.
+
+MIDI output lets you check if you have entered the correct notes.
+MIDI to Mudela conversion through the mi2mu program.
+
+Multiple staffs in one score. Each staff can have a different meters.
+Multiple voices within one staff (up to four handled graciously);
+beams optionally shared between voices. Multiple scores within one
+input file. Each score is output to a different file.
+
+Beams, slurs, chords, super/subscripts (accents and text),
+general n-plet (triplet, quadruplets, etc.), lyrics, transposition,
+dynamics (both absolute and hairpin style), clef changes, meter
+changes, cadenza-mode, key changes, repeat bars.
+
+Integration with LaTeX through Perl scripts.
+
+
+``WHERE CAN I FIND MORE INFO?''
+
+Sources for this project are on
+
+ ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe)
+ ftp://alpha.gnu.ai.mit.edu/gnu/ (US)
+
+More detailed info and examples can be found on the webpage at
+
+ http://www.stack.nl/~hanwen/lilypond/index.html
+
+
+THANK YOU,
+
+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.
+
+
+ --- * ---
TeX titling and lytodvi.sh
+=item * Shay Rojanski
+
+Some mudela source.
+
=item * Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>,
-misc bugfixes, some
-Beam and Stem code.
+misc bugfixes, some Beam and Stem code.
=item * Donald Ervin Knuth, http://www.cs.stanford.edu/~?
mf/ital-*.mf (these were taken from the CM fonts)
-=item * Alexandre Oliva <oliva@dcc.unicamp.br>, http://?.unicamp.br/
+=item * Alexandre Oliva <oliva@dcc.unicamp.br>, http://sunsite.unicamp.br/?
testing
Documentation/Vocab*
+=item * David R. Linn <drl@vuse.vanderbilt.edu>,
+
+Mailing list maintenance.
+
=back
Your name could be here! If you want to help, then take a look at the
configure
make
make install
- tar -C /usr/lib/texmf/fonts/source/ -zxf musixtex-T73.tgz 'mf/*'
-
+
The detailed instructions follow here.
=head1 PREREQUISITES
=item *
-The MusixTeX fonts (I included those found in MusixTeX T.73). Beware,
-the clef symbol seems to have changed its position in some versions,
-(notably Egler's, a.k.a. OpusTeX). The MusixTeX fonts are included in
-MusixTeX (T73 or better), which can be had from any CTAN site, e.g. at
-
-=over 4
-
-=item ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin
-
-=item ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin
-
-=item ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin
+A PostScript printer and/or viewer (such as Ghostscript).
=back
-You only need the contents of the F<mf/> subdirectory of the
-package. The primary site of the Taupin version is
-ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip
-
-Andreas Egler's version of MusixTeX, now called OpusTeX, will also
-work. Andreas moved some characters around in the fonts, so you have
-to edit the definitions in tex/eglerdefs.tex (patch appreciated)
-
=head1 RECOMMENDED
=over 4
-=item --enable-shared
+=item B<--enable-shared>
Make a shared library (gnu/linux, solaris (?) only )
-=item --enable-printing
+=item B<--enable-printing>
Enable debugging print routines (lilypond B<-d> option)
-=item --enable-optimise
+=item B<--enable-optimise>
Set maximum optimisation: compile with B<-O2>
-=item --enable-profiling
+=item B<--enable-profiling>
Compile with support for profiling
-=item --enable-tex-prefix
+=item B<--enable-tex-prefix>
Set the directory where TeX and Metafont live
-=item --enable-tex-dir
+=item B<--enable-tex-dir>
Set then directory TeX input is in (detected as a subdir of tex-prefix)
-=item --enable-mf-dir
+=item B<--enable-mf-dir>
Set the directory mf input is in (idem)
-=item --enable-out-dir
+=item B<--enable-out-dir>
Set the directory for machine generated output.
should do the trick.
-Install the musixtex fonts in a directory which TeX and MF knows (if
-you are root, look for a directory which contains the directories with
-AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex
-and copy the fonts into that). Do not forget to rehash TeX (if
-applicable)
-
-Example: my fonts are in F</usr/local/lib/texfonts/musixtex/>, and I
-have a symlink pointing to that in
-F</usr/lib/texmf/texmf/fonts/source/public/>. After I copied the
-files, I ran "texhash"
-
=head1 CAVEATS
=over 5
The -O2 option to gcc triggers a gcc bug on DEC Alpha in dstream.cc. You
should turn off this flag for this file.
-=item *
+=item *
-Perl5.003 and Perl5.004 use different syntax for pod2html:
+Perl5.003 and Perl5.004 use different syntax for pod2html.
=back
This is what I type in my xterm:
lilypond someinput.ly
- tex lelie.tex
- xdvi test&
+ tex someinput.tex
+ xdvi someinput&
This is what the output looks like over here:
Preprocessing elements...
Calculating column positions ... [14][25]
Postprocessing elements...
- TeX output to lelie.tex ...
- Creating MIDI elements ...MIDI output to lelie.midi ...
+ TeX output to someinput.tex ...
+ Creating MIDI elements ...MIDI output to someinput.midi ...
- hw:~/musix/spacer$ xdvi lelie&
+ hw:~/musix/spacer$ xdvi someinput&
[1] 855
Check out the input files, some of them have comments
=head1 REDHAT LINUX
RedHat Linux users should be able to get a RPM. A spec file is in
-F<make/out/lilypond.spec>. You should be able to create an rpm as a normal
-user. Be sure you have a ~/.rpmrc, and edit the RPM-dir in
+F<make/out/lilypond.spec>. You should be able to create an rpm as a
+normal user. Be sure you have a F<~/.rpmrc>, and edit the RPM-dir in
F<Variables.make>. (If you create the RPM as a normal user the
permissions will not be set correctly, unfortunately)
=head1 DEBIAN GNU/LINUX
-A Debian package is in the works
+A Debian package is also available; contact Anthony Fok
+<foka@debian.org>. The build scripts are in the subdirectory debian/
=head1 WINDOWS NT/95
is unpacked correctly, in particular the empty out directories
(F<flower/out>, F<lib/out> et. al.)
+=head1 MUSIXTEX
+
+Previous versions (before 0.1.39) used fonts from the TeX macro
+package "MusixTeX". You can still use these, but they are not
+supported. Since LilyPond's Feta font is much prettier, you'd be
+stupid to use them, but anyway, here are the installation instructions
+for those deprecated fonts.
+
+
+[obsolete] I use the MusixTeX fonts those found in MusixTeX
+T.73. Beware, the clef symbol seems to have changed its position in
+some versions, (notably Egler's, a.k.a. OpusTeX). The MusixTeX fonts
+are included in MusixTeX (T73 or better), which can be had from any
+CTAN site, e.g. at
+
+=over 4
+
+=item ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin
+
+=item ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin
+
+=item ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin
+
+=back
+
+You only need the contents of the F<mf/> subdirectory of the
+package. The primary site of the Taupin version is
+ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip
+
+Install the musixtex fonts in a directory which TeX and MF knows (if
+you are root, look for a directory which contains the directories with
+AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex
+and copy the fonts into that). Do not forget to rehash TeX (if
+applicable)
+
+Example: my fonts are in F</usr/local/lib/texfonts/musixtex/>, and I
+have a symlink pointing to that in
+F</usr/lib/texmf/texmf/fonts/source/public/>. After I copied the
+files, I ran "texhash"
+
+Andreas Egler's version of MusixTeX, now called OpusTeX, will also
+work. Andreas moved some characters around in the fonts, so you have
+to edit the definitions in F<tex/eglerdefs.tex>.
+
+
+
=head1 AUTHORS
Han-Wen Nienhuys <hanwen@stack.nl>
=item *
-GNU LilyPond uses MusiXTeX fonts and TeX for its output. This is not a key
-issue: in a future version, GNU LilyPond might bypass TeX, but at the moment
-TeX is convenient for producing output.
+GNU LilyPond uses TeX for its output. This is not a key issue: in a
+future version, GNU LilyPond might bypass TeX, but at the moment TeX
+is convenient for producing output.
=item *
name-stem= $(notdir $(basename $<))
$(outdir)/%.dvi: $(depth)/input/%.ly $(depth)/VERSION
(cd $(outdir); \
- lilypond -I. -o $(name-stem) ../$< )
+ lilypond -I/ ../$< )
(cd $(outdir); \
if [ -f ../$(basename $< ).tex ]; \
then \
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 > $@
+ sh $(depth)/bin/ps-to-gifs.sh $<
+ mv $(name-stem)-page*.gif $(outdir)/
+ touch $@
$(outdir)/%.ly.txt: $(depth)/input/%.ly
ln -f $< $@
=over 4
=item *
-<a href=ANNOUNCE.txt
+<a href=ANNOUNCE-0.1.txt
>
The announce of 0.1
</a
implementation progresses. If you want to see our previous musings,
take out an old version of lilypond]
-here are some thoughts on the language. Most of the examples are in
-pseudo current mudela. Some stuff gratuitously taken from your mails.
-
-
-=head1 NOTE
-
-I dislike vapourware. That's why I oppose to concrete plans on how to
-do input for features we don't know how to produce on paper
-
=head1 REQUIREMENTS
=head1 CONCRETE PROPOSALS
=head1 Decisions (Sat 1997-3-15, dommelpijpje no21)
-=over 4
-
-=item *
-
-abbrev: [c2 c2]\noplet{1/2} (wat bout [c2 c2]1/2\noplet?),
-
-=item *
-
-abbrev: c4=16 (heu, =?),
-
-=item *
-
-plet === midi-note: c4*2/3; c4*385/384,
-
-=item *
-
-drop \music,
-
-=item *
-\meter compulsory in Simple mudela,
-=item *
-
-C<+> is merge
-
-
-=item *
\extract{ \from 2:3*4 \to 5 oboe }
-=back
-
-
=head1 THOUGHTS
-[LOOSE THOUGHT]
-
-We might drop this {} argument altogether, by merely enforcing
-that each "statement" (music,score,staff,chord) takes a LIST as
-argument, and use the {} to group lists. This is admittedly perl. This
-is very sketchy.
-
-
=head2 Requests
I want to give the user some access to the internals. Technically,
=head2 Command placement:
-Mats is an arduous fan of having the commands inside music. I am
-not. I see the Mudela music as something which can be plugged into
-different staffs, transposed, translated in time, copied, quoted,
-etc. Encouraging "inline" commands would be bad since they hinder this
-reuse of typed music.
-
-The way I figure it, the bad part is essentially counting
-bars/wholes. Maybe we can get rid of it, by reinstalling the "mark"
-commands.
-
-I definitely want to avoid complicated logic ("Hey there is another
-bar request, should we merge this bar with another staff's", this kind
-of "smartness" makes a lot M$ software inconsistent) inside LilyPond,
-by making the input unambiguous in this respect.
-
-There is another complication: some symbols (bars) sometimes are
-linked across staffs. I should first think of a way to do this in
-LilyPond, before even considering a syntax.
-
=head2 Volta
Just ideas:
|| && ! filter syntax
- + merging of voices
=head2 Quoting
Send a description of the bug itself.
=item *
-Send it to bug-gnu-music@vuse.vanderbilt.edu.
+Send it to bug-gnu-music@gnu.org.
=back
=over 4
-=item info-gnu-music@vuse.vanderbilt.edu
+=item info-gnu-music@gnu.org
For information on the GNU Music project, to subscribe: send mail with
-subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu
+subject "subscribe" to info-gnu-music-request@gnu.org
-=item help-gnu-music@vuse.vanderbilt.edu
+=item help-gnu-music@gnu.org
For help with programs from the GNU music project. To subscribe: send
mail with subject "subscribe" to
-help-gnu-music-request@vuse.vanderbilt.edu
+help-gnu-music-request@gnu.org
-=item bug-gnu-music@vuse.vanderbilt.edu
+=item bug-gnu-music@gnu.org
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
+bug-gnu-music-request@gnu.org
-=item gnu-music-discuss@vuse.vanderbilt.edu,
+=item gnu-music-discuss@gnu.org,
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@gnu.org,
=back
=over 4
-=item news:comp.music.research
+=item news://comp.music.research
-=item news:rec.music.compose
+=item news://rec.music.compose
-=item news:gnu.announce
+=item news://gnu.announce
-=item news:comp.os.linux.announce
+=item news://comp.os.linux.announce
=back
=over 4
-=item info-gnu-music@vuse.vanderbilt.edu
+=item info-gnu-music@gnu.org
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
+info-gnu-music-request@gnu.org
-=item help-gnu-music@vuse.vanderbilt.edu
+=item help-gnu-music@gnu.org
For help with programs from the GNU music project. To subscribe: send
mail with subject "subscribe" to
-help-gnu-music-request@vuse.vanderbilt.edu
+help-gnu-music-request@gnu.org
-=item bug-gnu-music@vuse.vanderbilt.edu
+=item bug-gnu-music@gnu.org
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
+bug-gnu-music-request@gnu.org
-=item gnu-music-discuss@vuse.vanderbilt.edu,
+=item gnu-music-discuss@gnu.org,
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@gnu.org
=back
J.S. Bach, Das Wohltemperierte Clavier I: C major Prelude & Fugue, C
minor fugue. Solo cello suites: suite II, menuetto (alto version).
-=item *
+=item *
F. Schubert, St\"andchen (Serenade) "Leise flehen meine Lieder"
-=item *
+=item *
Tarquinio Merula, La Gallina a 2 violini
+pl 39
+ - 0.2 ANNOUNCE sketch
+ - unix style paths for LILYINCLUDE env
+ - show all output pages on website
+ - ps-to-gifs.sh
+ - bf: wtk1-fugue2
+ - python make-website
+ - higher brace resolution
+ - phased out musixtex stuff
+ - bf: rhythm.ly
+ - PS slurs
+ - PS beams
+ - Bow units
+ - turn on PS by default
+ - turn off barnumbers by default.
+ - bf: halfbeam size.
+ - bf: -M bug
+ - stafflinethick in PS (crescendi)
+ - continued (de)crescendi (in PS)
+ - bf: spurious beam reqs
+ - handle unfeasible spacing cleanly.
+ - ML-address change
+ - output naming: default to basename[-serialnumber].{midi,tex}
+ - bf: clef width
+
+pl 39.jcn2
+ - make-examples.sh
+ - leftright repeat sign + repeatbar dims
+ - smaller minimum sized rod at end of bar
+ - bf: spacing.ly
+ - less space at begin of bar
+ - experimental whitespace fixes at begin and end of bar
+ - added to beams.ly
+ - open-up beam spacing for mult > 3
+ - fixed hang/sit to overlap iso aligne with staffline
+ - fixed inter beam spacing, paper*.ly
+ - scsii-menuetto.ly fixes
+ - init/property.ly
+ - property settings for beam quantiseing and damping
+ - provisionary multiple-beam fix
+
+******
pl 38
- bf: \> \! \ff (crescendo overlap)
- misc feta-fixes, flageolet sign.
grep for TODO and ugh/ugr
0.2:
- * -M bug
- * unended beam: [c4
+ * beam quanting
- * continued hairpins
+ * disable spaces in TeX stuff
* height of dyns.
- * output naming:
- - default to basename[-serialnumber].{midi,tex}
-
* handle ^C for tmp/file creation.
- * PS for beams.
+ * WWW mirror/archive for the mailing lists.
* dots & rest collisions.
* documentation
- * spurious "Junk beam" warnings
-
- * standchen: warning: Excentric column (Meter dims?)
-
* naming Mozarella, Madeira, Muella?
* versioning for Feta
* bf: abbrevs over whole note
- * bf: wtk1-fug2 ending
-
STUFF
* give Items/Spanners access to unbroken originals
- MIDI instrument
- staff title
- * optimal pagebreaking.
+ * page handling:
+ - papersizes
+ - PS output
+ - optimal pagebreaking.
* put errorlevel in Input class
3RD PARTY BUGS:
+ * xdvi: PS magnifying glass.
+
* Rational infty(HUGE_VAL) on glibc / w32
* Fix profiling. gprof bugreport?
* Spring_spacer:
- write a faster Spring_spacer (without matrices if possible)
- - use straight QP to find minimal "fitting force"
+ - use straight LP to find minimal "fitting force"
- relate energybound to linelen unitspace fontsize etc.
- used fixed point fp
* \header
- - write perl/python script for handling it into databases
- - write TeX macros to generate titles
- - adapt make-website to use \header info.
- output header info to MIDI too.
* adaptive accidental spacing.
- * unix style paths for LILYINCLUDE env
-
* handle EOF graciously in error messages.
* caching Item/spanner dimensions.
TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 1
-TOPLEVEL_PATCH_LEVEL = 38
+TOPLEVEL_PATCH_LEVEL = 39
TOPLEVEL_MY_PATCH_LEVEL =
# use the above to send patches, always empty for released version:
#!/bin/sh
# unclobber current dir.
-rm -vf *.aux *.log `grep -li "^% Creator: GNU LilyPond" *.out` *.orig *~
+rm -vf *.aux *.log *.orig *~
+rm -vf `grep -li "^% Creator: GNU LilyPond" *.out *.tex`
rm -vf `grep -li "Creator: mi2mu" *.midi.ly`
+rm -vf `grep -li "%Creator: dvipsk" *.ps`
rm -vf `grep -li "Creator: GNU LilyPond" *.midi`
rm -vf `grep -li "Creator: ly2dvi" *.tex`
rm -vf `find -name 'core'`
rm -vf `find -name *.orig`
rm -vf `find -name *.rej`
+
# docxx mess
rm -vf *dvi
rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \
return v
+
lilydirs = Lilydirs()
if __name__ == '__main__':
print version_tuple_to_str(pv), prev_version(pv), next_version(pv)
print version_tuple_to_str((0,1,1,''))
print mv, version_str_to_tuple(mv)
+
+
+
+def dump_file(f, s):
+ i = open(f, 'w')
+ i.write(s)
+ i.close ()
+
+def gulp_file(f):
+ i = open(f)
+ i.seek (0, 2)
+ len = i.tell ()
+ i.seek (0,0)
+ return i.read (len)
+
+
+header_regex = regex.compile('\\header[ \t\n]*{\([^}]*\)}')
+header_entry_regex = regex.compile('[\n\t ]*\([^\n\t ]+\)[\n\t ]*=[\n \t]*\([^;]+\)[\n \t]*;')
+
+#
+# FIXME breaks on multiple strings.
+#
+def read_mudela_header (fn):
+ s = gulp_file(fn)
+ s = regsub.gsub('%.*$', '', s)
+ s = regsub.gsub('\n', ' ', s)
+
+ dict = {}
+ if header_regex.search(s) <> -1:
+ h = header_regex.group(1)
+ else:
+ return dict
+
+ while regex.search('=', h) <> -1:
+
+ if header_entry_regex.search (h) == -1:
+
+ raise 'format error'
+
+ h = regsub.sub(header_entry_regex, '', h)
+ left = header_entry_regex.group(1)
+ right = header_entry_regex.group(2)
+
+ right = regsub.gsub('\([^\\]\)\"', '\\1', right)
+ right = regsub.gsub('^"', '', right)
+ left = regsub.gsub('\([^\\]\)\"', '', left)
+ left = regsub.gsub('^"', '', left)
+
+ dict[left] = right
+
+ return dict
+
+
--- /dev/null
+#!/bin/sh
+# make-examples
+
+examples="twinkle-pop wtk1-fugue2 standchen-16 standchen-20 wtk1-prelude1 toccata-fuga-E scsii-menuetto cadenza gallina twinkle collisions font font20 scales rhythm multi spacing beams stem"
+pss=$(echo $examples | sed "s/[^ ][^ ]*/out\\/&.ps/g")
+
+# cd ~/lelie/current/Documentation/out
+cd ~/lelie/current/input
+make -C ../Documentation $pss
--- /dev/null
+#!@PYTHON@
+#
+# make-website.py -- implement The lilypond WWW site
+#
+# source file of the GNU LilyPond music typesetter
+#
+# (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+#
+
+"""
+ stupid script to generate WWW site.
+
+ The WWW site is my test-suite for LilyPond, I usually don't
+ distribute versions that fail to complete this script """
+
+from lilypython import *
+import __main__
+import glob
+
+depth = ''
+makewebsite_id = "<!make_website!>";
+id_str = "make-website 0.6";
+tar = "tar";
+make = "make";
+mailaddress = "unknown"
+fullname = "unknown"
+footstr = ""
+lilyversion= ''
+
+def set_vars():
+ __main__.lilyversion = version_tuple_to_str(lilydirs.version_tuple())
+ os.environ["TEXINPUTS"] = os.environ["TEXINPUTS"] + ":%s/input/:" % depth;
+ os.environ["LILYINCLUDE"] = "%s/input/" % depth;
+ os.environ["LILYTOP"] = depth;
+ __main__.mailaddress= os.environ['MAILADDRESS']
+ pw = pwd.getpwuid (os.getuid());
+
+ __main__.fullname= pw[4];
+
+backstr = '\n<hr>Please take me <a href=%s>back to the index</a>\n\
+of LilyPond -- The GNU Project Music typesetter\n\
+<hr><font size=-1>\n\
+This page was built using <code>%s</code> from lilypond-%s by <p>\n\
+<address><br>%s <a href=mailto:%s&>><<!bla>%s</a>></address>\n\
+<p></font>'
+
+
+def footstr(index):
+ return backstr % (index, id_str, lilyversion, fullname, mailaddress, mailaddress)
+
+
+
+# do something, check return status
+def my_system(cmds):
+ for cmd in cmds:
+ ignoreret=0;
+ if cmd[0] == '-':
+ ignoreret = 1
+ cmd = cmd[1:]
+
+ ret = os.system (cmd)
+ if ret:
+ if ignoreret:
+ sys.stderr.write( "ignoring failed command \`%s\' (status %d)\n" % (cmd, ret))
+ else:
+ sys.stderr.write( 'make-website: failed on command %s (status %d)\n' % (cmd, ret))
+ sys.exit (2)
+
+base="lilypond/";
+
+examples=["twinkle-pop",
+ "wtk1-fugue2",
+ "standchen-16",
+ "standchen-20",
+ "wtk1-prelude1",
+ "toccata-fuga-E",
+ "scsii-menuetto",
+ "cadenza",
+ "gallina",
+ "twinkle",
+ "collisions",
+ "font",
+ "font20",
+ #"scales",
+ "rhythm",
+ "multi"]
+
+def gen_html():
+ print 'generating HTML'
+ my_system (["make -kC .. html"]);
+
+
+def gen_examples():
+ print 'generating examples:\n'
+ list = map(lambda x: 'out/%s.ps.gz out/%s.gif out/%s.ly.txt' % (x,x,x), examples)
+ my_system (['make -C .. ' + join(' ', list)])
+
+texstuff = ["mudela-man", "mudela-course"]
+
+def gen_manuals():
+ print 'generating TeX doco manuals'
+ list = open('tex_manuals.html', 'w')
+ list.write( "<HTML><TITLE>PostScript Manuals</TITLE>\n"
+ "<BODY><h1>LilyPond manuals (in PostScript)</h1>"
+ "<ul>\n")
+ todo=''
+ for stuff in texstuff:
+ todo = todo + ' out/' + stuff + '.ps.gz'
+ list.write("<li><a href=%s.ps.gz>%s.ps.gz</a>" % (stuff, stuff))
+ list.write('</ul></BODY></HTML>')
+ list.close ()
+
+ my_system (['make -C .. ' + todo])
+
+def file_exist_b(name):
+ try:
+ f = open(name)
+ except IOError:
+ return 0
+ f.close ()
+ return 1
+
+def gen_list():
+ print "generating HTML list\n";
+ list = open('example_output.html', 'w')
+ list.write ('<html><TITLE>Rendered Examples</TITLE>\n'
+ '<body>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\n'
+ 'graphics tools. The papersize used for these examples is A4. The GIF\n'
+ 'files have been scaled to eliminate aliasing.\n');
+
+ for ex in examples:
+ header = read_mudela_header(ex + '.ly.txt')
+ def read_dict(s, default, h =header):
+ try:
+ ret = h[s]
+ except KeyError:
+ ret = default
+ return ret
+ head = read_dict('title', ex)
+ composer = read_dict('composer', '')
+ desc = read_dict('description', '')
+ list.write('<hr>')
+ list.write('<h1>example file: %s</h1>' % head);
+ if composer <> '':
+ list.write('<h2>%s</h2>\n' % composer)
+ if desc <> '':
+ list.write('%s<p>' % desc)
+ list.write ('<ul>')
+ def list_item(filename, desc, l = list):
+ if file_exist_b(filename):
+ l.write ('<li><a href=%s>%s</a>\n' % (filename, desc))
+
+ list_item(ex + '.ly.txt', 'The input')
+ for pageno in range(1,10):
+ f = ex + '-page%d.gif' % pageno
+ if not file_exist_b (f):
+ break
+ list_item(f, 'The output (picture, page %d)' % pageno)
+ list_item(ex + '.ps.gz', 'The output (gzipped PostScript)')
+ list_item(ex + '.midi', 'The output (MIDI)')
+ list.write ("</ul>");
+
+ list.write( "</BODY></HTML>");
+ list.close()
+
+def copy_files():
+ print "copying files\n"
+
+# my_system ("ln -s depth/out ./docxx" )
+ my_system([ "cp %s/TODO ./TODO.txt" % depth,
+ "cp %s/ANNOUNCE-0.1 ./ANNOUNCE.txt" % depth,
+ "cp %s/NEWS ./NEWS.txt" % depth,
+ "cp %s/DEDICATION ./DEDICATION.txt" % depth]);
+ my_system([ "make -C .. gifs"]);
+
+def docxx_update():
+ print 'docxx.. \n'
+ banner= open('/tmp/lilybanner.html', 'w');
+ banner.write (footstr('../index.html'))
+ banner.close ()
+ my_system(['BANNEROPT=\"-B /tmp/lilybanner.html\" %s/bin/out/make-docxx' % depth]);
+# os.unlink( "/tmp/lilybanner.html");
+
+def get_glob(exts):
+ result = []
+ for a in exts:
+ result = result + glob.glob1('./', '*.' + a)
+
+ return result
+
+def join(inter, list):
+ return reduce (lambda x,y, i=inter: x + i + y, list)
+
+def do_tar():
+ print "tarring.\n";
+ list = get_glob( ['html', 'gif', 'ps.gz' , 'txt', 'midi'])
+ files = join (' ', list)
+ print files
+ my_system( ['-tar zvhcf website.tar.gz ' + files + ' docxx/*'])
+
+
+def identify():
+ print 'This is %s\n' % id_str
+
+def clean_tmp():
+ my_system(['rm -f /tmp/gs*'])
+
+def get_top_of_NEWS():
+ i = open('NEWS.txt')
+ lines = i.readlines()
+ i.close ()
+ s = ''
+ for l in lines:
+ if regex.search('^\*\*\*\*\*\*', l) <> -1:
+ return s;
+ s = s + l
+ return s
+
+def edit_index():
+ s = gulp_file('index.html')
+ s = regsub.sub ('top_of_NEWS', '<XMP>\n' + get_top_of_NEWS () + '\n</XMP>', s)
+ dump_file ('index.html', s)
+
+def edit_html():
+ files = get_glob(['html'])
+ for f in files:
+
+ s = gulp_file(f)
+ if regex.search(makewebsite_id, s) <> -1:
+ continue;
+
+ s = regsub.sub ('</BODY>', footstr('index.html') + makewebsite_id + '</BODY>', s)
+ s = regsub.sub('<TITLE>\(.*\)</TITLE>$',
+ '<TITLE>LilyPond WWW: \\1</TITLE>', s)
+ dump_file (f,s)
+
+def main():
+ identify();
+
+ os.chdir (lilydirs.topdir + 'Documentation/out')
+ __main__.depth = "../../";
+
+ set_vars();
+ gen_html();
+ copy_files();
+ gen_examples();
+ gen_list();
+ gen_manuals();
+ #set_images();
+ edit_html();
+ edit_index();
+ docxx_update()
+ do_tar()
+ clean_tmp();
+
+
+main()
+
+
return "$outdir/$outname$mudcount.ly";
}
+sub gen_texbase
+{
+ return "$outname$mudcount.tex";
+}
sub gen_texfile
{
- return "$outdir/$outname$mudcount.tex";
+ return "$outdir/" . gen_texbase;
}
sub close_mudela
if ( ! -f gen_texfile) {
my_system "lilypond ". gen_mufile;
- rename "lelie.tex", gen_texfile;
+ rename gen_texbase, gen_texfile;
}
print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n";
--- /dev/null
+#!/bin/bash
+
+usage()
+{
+ echo 'ps-to-gifs.sh FILE.ps'
+ exit 2;
+}
+
+case $# in
+1)
+ FILE=`basename $1 .ps`
+ ;;
+*)
+ usage
+ ;;
+esac
+
+# generate the pixmap at twice the size, then rescale (for antialiasing)
+cat $1 | gs -q -sDEVICE=ppmraw \
+ -sOutputFile="|pnmscale 0.5|ppmtogif > $FILE-page%d.gif" \
+ -r200 -dNOPAUSE - -c quit
+
+
+
[TEXDIR=auto] )
AC_ARG_ENABLE(mf-dir,
- [ mf-dir=DIR set the directory to put LilyPond MetaFont files in. (obsolete)],
+ [ mf-dir=DIR set the directory to put LilyPond MetaFont files in. ],
[MFDIR=$enableval],
[MFDIR=auto])
#
-EXTRA_DISTFILES = README.debian TODO changelog control copyright \
+EXTRA_DISTFILES = README.Debian TODO changelog control copyright \
info.ex menu.ex postinst postinst.old.sh postrm preinst rules watch
--- /dev/null
+lilypond for DEBIAN
+-------------------
+
+Starting with version 0.1.12, LilyPond comes with some new MF fonts.
+These fonts are not currently listed in /usr/lib/texmf/fontname/special.map
+(from the teTeX package), therefore the fonts will be created in a
+non-standard directory somewhere under /var/spool/texmf. The problem is
+usually only aesthetic. TeTeX can create and find the *.tfm and *.pk files
+without any problems.
+
+However, if you experience any font problems (such as the note heads
+not showing up, characters in the wrong places, error messages from
+TeX), especially after upgrading to a new version of LilyPond, you may
+need to delete the relevant *.tfm and *.pk files under the directory
+/var/spool/texmf. You may also file a bug report about this if you
+like.
+
+LilyPond is still in active development, and many things may still change.
+When it is stablized in the future, these new fonts will probably be
+added into the standard special.map file.
+
+Anthony Fok <foka@debian.org>, Thu, 23 Oct 1997 16:59:32 -0600
+pl 33
+ - String naming
+ - unix style paths
+
pl 32
- Assoc::clear
- bf: Assoc[PreviouslyUsedAndDeletedKey] = foo
MAJOR_VERSION = 1
MINOR_VERSION = 1
-PATCH_LEVEL = 32
+PATCH_LEVEL = 33
# use to send patches, always empty for released version:
MY_PATCH_LEVEL = # include separator: "-1" or ".a"
#
}
bool
-Dstream::silence (String s)
+Dstream::silent_b (String s) const
{
if (!silent_assoc_p_->elt_b (s))
return false;
Assoc<String, bool> *silent_assoc_p_;
public:
void clear_silence();
- bool silence (String);
+ bool silent_b (String) const;
/**
if rcfile == 0, then do not read any rc file.
class File_path : private Array<String>
{
public:
- /// locate a file in the search path
- String find (String nm) const;
+ /// locate a file in the search path
+ String find (String nm) const;
- /// add to end of path.
- Array<String>::push;
- void add (String str) { push (str); }
+ /// add to end of path.
+ Array<String>::push;
+ void add (String str) { push (str); }
+ void parse_path (String);
};
/** split a path into its components.
/// return a piece starting at index_i (first char = index_i 0), length n
- String mid_str (int index_i, int n) const;
+ String cut (int index_i, int n) const;
/// cut out a middle piece, return remainder
String nomid_str (int index_i, int n) const;
/// index of rightmost c
int index_last_i (char c) const;
- /// index of rightmost element of string
+ /// index of rightmost element of string (???)
int index_last_i (char const* string) const;
+ /// index of leftmost #c#
int index_i (char c) const;
+
+
+ /// index of leftmost occurance of STRING
int index_i (String) const;
int index_any_i (String) const;
#include "path.hh"
#include "flower-debug.hh"
+#ifndef DIRSEP
+#define DIRSEP '/'
+#endif
+
#ifndef PATHSEP
-#define PATHSEP '/'
+#define PATHSEP ':'
#endif
/**
*/
void
split_path (String path,
- String &drive, String &dirs, String &filebase, String &extension)
+ String &drive, String &dirs, String &filebase, String &extension)
{
// peel off components, one by one.
int di = path.index_i (':');
if (di >= 0)
- {
- drive = path.left_str (di + 1);
- path = path.right_str (path.len() - di -1);
- }
+ {
+ drive = path.left_str (di + 1);
+ path = path.right_str (path.len() - di -1);
+ }
else
- drive = "";
+ drive = "";
- di = path.index_last_i (PATHSEP);
+ di = path.index_last_i (DIRSEP);
if (di >=0)
- {
- dirs = path.left_str (di + 1);
- path = path.right_str (path.len()-di -1);
- }
+ {
+ dirs = path.left_str (di + 1);
+ path = path.right_str (path.len()-di -1);
+ }
else
- dirs = "";
+ dirs = "";
di = path.index_last_i ('.');
if (di >= 0)
- {
- filebase = path.left_str (di);
- extension =path.right_str (path.len()-di);
- }
+ {
+ filebase = path.left_str (di);
+ extension =path.right_str (path.len()-di);
+ }
else
- {
- extension = "";
- filebase = path;
- }
+ {
+ extension = "";
+ filebase = path;
+ }
}
+void
+File_path::parse_path (String p)
+{
+ int l;
+
+ while ( (l = p.length_i ()) )
+ {
+ int i = p.index_i(PATHSEP);
+ if (i <0)
+ i = l;
+ add (p.left_str(i));
+ p = p.right_str (l- i - 1);
+ }
+}
+
+
+
+
/** find a file.
It will search in the current dir, in the construction-arg, and
in any other added path, in this order.
{
fdebug << _("looking for ") << nm << ": ";
if (!nm.length_i() || (nm == "-") )
- return nm;
+ return nm;
for (int i=0; i < size(); i++)
{
+ String path = elem(i);
+ if (path.length_i() )
+ path += "/";
- String path = elem(i);
- if (path.length_i() )
- path += "/";
+ path += nm;
- path += nm;
-
- fdebug << path << "? ";
- FILE *f = fopen (path.ch_C(), "r"); // ugh!
- if (f)
- {
- fdebug << _("found\n");
- fclose (f);
- return path;
- }
- }
+ fdebug << path << "? ";
+ FILE *f = fopen (path.ch_C(), "r"); // ugh!
+ if (f)
+ {
+ fdebug << _("found\n");
+ fclose (f);
+ return path;
+ }
+ }
fdebug << "\n";
return "";
}
Byte const* byte_C = bin_str.byte_C();
for (int i = 0; i < bin_str.length_i(); i++)
{
- str += (char)nibble2hex_byte (*byte_C >> 4);
- str += (char)nibble2hex_byte (*byte_C++);
+ str += (char)nibble2hex_byte (*byte_C >> 4);
+ str += (char)nibble2hex_byte (*byte_C++);
}
return str;
}
unsigned result_u = 0;
for (int i = 0; i < bin_str.length_i(); i++)
{
- result_u <<= 8;
- result_u += (Byte)bin_str[ i ];
+ result_u <<= 8;
+ result_u += (Byte)bin_str[ i ];
}
return result_u;
}
String_convert::dec2_i (String dec_str)
{
if (!dec_str.length_i())
- return 0;
+ return 0;
long l = 0;
int conv = sscanf (dec_str.ch_C(), "%ld", &l);
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
- (fmt ? fmt : "%Ld"), i64); // assume radix 10
+ (fmt ? fmt : "%Ld"), i64); // assume radix 10
return String (buffer);
}
String_convert::dec2_f (String dec_str)
{
if (!dec_str.length_i())
- return 0;
+ return 0;
double d = 0;
int conv = sscanf (dec_str.ch_C(), "%lf", &d);
assert (conv);
String_convert::hex2bin_i (String hex_str, String& bin_str_r)
{
if (hex_str.length_i() % 2)
- hex_str = "0" + hex_str;
+ hex_str = "0" + hex_str;
bin_str_r = "";
Byte const* byte_C= hex_str.byte_C();
int high_i = hex2nibble_i (*byte_C++);
int low_i = hex2nibble_i (*byte_C++);
if (high_i < 0 || low_i < 0)
- return 1; // illegal char
+ return 1; // illegal char
bin_str_r += String ((char)(high_i << 4 | low_i), 1 );
i += 2;
}
String_convert::hex2bin_str (String hex_str)
{
String str;
-// silly, asserts should alway be "on"!
-// assert (!hex2bin_i (hex_str, str) );
+ // silly, asserts should alway be "on"!
+ // assert (!hex2bin_i (hex_str, str) );
int error_i = hex2bin_i (hex_str, str);
assert (!error_i);
return str;
String_convert::hex2nibble_i (Byte byte)
{
if (byte >= '0' && byte <= '9')
- return byte - '0';
+ return byte - '0';
if (byte >= 'A' && byte <= 'F')
- return byte - 'A' + 10;
+ return byte - 'A' + 10;
if (byte >= 'a' && byte <= 'f')
- return byte - 'a' + 10;
+ return byte - 'a' + 10;
return -1;
}
{
char fill_ch = ch;
if (fill_ch)
- fill_ch = '0';
+ fill_ch = '0';
// ugh
String dec_str (i);
{
String str;
if (!u)
- str = "0";
+ str = "0";
#if 1 // both go...
while (u)
{
- str = String ((char)((u % 16)["0123456789abcdef"] ) ) + str;
- u /= 16;
+ str = String ((char)((u % 16)["0123456789abcdef"] ) ) + str;
+ u /= 16;
}
#else
str += int_str (u, "%x"); // hmm. %lx vs. %x -> portability?
str = String (fill_ch, length_i - str.length_i()) + str;
while ((str.length_i() > length_i) && (str[ 0 ] == 'f' ) )
- str = str.mid_str (2, INT_MAX);
+ str = str.cut (2, INT_MAX);
return str;
}
String_convert::nibble2hex_byte (Byte byte)
{
if ((byte & 0x0f) <= 9 )
- return (byte & 0x0f) + '0';
+ return (byte & 0x0f) + '0';
else
- return (byte & 0x0f) - 10 + 'a';
+ return (byte & 0x0f) - 10 + 'a';
}
/**
Convert an integer to a string
{
char buffer[STRING_BUFFER_LEN];
snprintf (buffer, STRING_BUFFER_LEN,
- (fmt ? fmt : "%d"), i); // assume radix 10
+ (fmt ? fmt : "%d"), i); // assume radix 10
return String (buffer);
}
String s = n;
if (r.denominator() != 1)
{
- char * d = Itoa (r.denominator());
- s += String ('/') + String (d);
- //delete d;
+ char * d = Itoa (r.denominator());
+ s += String ('/') + String (d);
+ //delete d;
}
-/* delete n;
- */
+ /* delete n;
+ */
return s;
}
String::print_on (ostream& os) const
{
if (!strh_.is_binary_bo())
- os << ch_C();
+ os << ch_C();
else
- for (int i = 0; i < length_i(); i++)
- os << (Byte)(*this)[ i ];
+ for (int i = 0; i < length_i(); i++)
+ os << (Byte)(*this)[ i ];
}
\f
/*
Byte const* p1 = s1.byte_C();
Byte const* p2 = s2.byte_C();
if (p1 == p2)
- return 0;
+ return 0;
int i1 = s1.length_i();
int i2 = s2.length_i();
String::index_last_i (char const c) const
{
if (!length_i())
- return -1;
+ return -1;
char const* me = strh_.ch_C();
char const* p = memrchr (me, length_i(), c);
if (p)
- return p - me;
+ return p - me;
return -1;
}
assert (false); // broken
int length = strlen (string); // ugrh
if (!length_i() || !length)
- return -1;
+ return -1;
int next_i = index_i (string);
if (next_i == -1)
- return -1;
+ return -1;
int index_i = 0;
while (next_i >= 0)
{
- index_i += next_i;
- next_i = right_str (length_i() - index_i - length).index_i (string );
+ index_i += next_i;
+ next_i = right_str (length_i() - index_i - length).index_i (string );
}
return index_i;
}
char const* me = strh_.ch_C();
char const* p = (char const *) memchr (me,c, length_i());
if (p)
- return p - me;
+ return p - me;
return -1;
}
{
char const* me = strh_.ch_C();
char const* p = (char const *) memmem (
- me, length_i(), searchfor.ch_C(), searchfor.length_i ());
+ me, length_i(), searchfor.ch_C(), searchfor.length_i ());
if (p)
- return p - me;
+ return p - me;
else
- return -1;
+ return -1;
}
/** find chars of a set.
{
int n = length_i();
if (!n)
- return -1;
+ return -1;
void const * me_l = (void const *) strh_.ch_C();
for (int i=0; i < set.length_i(); i++)
{
- char * found=(char*) memchr (me_l, set[i], n );
- if (found)
- {
- return found - me_l;
- }
+ char * found=(char*) memchr (me_l, set[i], n );
+ if (found)
+ {
+ return found - me_l;
+ }
}
return -1;
}
String::left_str (int n) const
{
if (n >= length_i())
- return *this;
+ return *this;
String retval;
if (n < 1)
- return retval;
+ return retval;
retval = *this;
retval.strh_.trunc (n);
String::right_str (int n) const
{
if (n > length_i())
- return *this;
+ return *this;
if (n < 1)
- return "";
+ return "";
return String (strh_.byte_C() + length_i() - n, n);
}
{
if (index_i < 0)
{
- n += index_i;
- index_i = 0;
+ n += index_i;
+ index_i = 0;
}
if (n <= 0)
- return *this;
+ return *this;
return
- left_str (index_i) +
- right_str (length_i() - index_i - n) ;
+ left_str (index_i) +
+ right_str (length_i() - index_i - n) ;
}
-/*
- proposal: change to "cut()"
- */
String
-String::mid_str (int index_i, int n) const
+String::cut (int index_i, int n) const
{
if (index_i <0)
{
- n += index_i;
- index_i=0;
+ n += index_i;
+ index_i=0;
}
if (!length_i() || (index_i < 0) || (index_i >= length_i () ) || (n < 1 ) )
- return String();
+ return String();
if ((n > length_i()) || (index_i + n > length_i () ) )
- n = length_i() - index_i;
+ n = length_i() - index_i;
return String (byte_C() + index_i, n);
}
\type Score_engraver;
\consists "Timing_engraver";
- \consists "Bar_column_engraver";
- \consists "Bar_number_engraver";
+ %\consists "Bar_column_engraver";
+ %\consists "Bar_number_engraver";
\consists "Span_score_bar_engraver";
\consists "Score_priority_engraver";
\include "paper16.ly"
\include "paper20.ly"
-
default_paper = \paper{
\paper_sixteen
}
right = 1
up = 1
down = -1
+% zillie spellink?
center=0
-
-stemup = {
- \skip 1*0;
- % Stupid hack to make < { \stemup } > work
- \property Voice.ydirection = \up
- }
-stemboth= {
- \skip 1*0;
- \property Voice.ydirection = \center
-}
-stemdown = {
- \skip 1*0;
- \property Voice.ydirection = \down
-}
-
+\include "property.ly"
arithmetic_basicspace = 2.;
arithmetic_multiplier = 4.8\pt;
- %
- interbeam = 2.667\pt;
+ % three beams span two interlines, including stafflines:
+ % 2 interbeam + beam_thickness = 2 interline - staffline_thickness
+ % ( beam_thickness = 0.48 interline for now...)
+ % interbeam = interline - (beam_thickness + staffline_thickness) / 2
+ % interbeam = 2.84;
+ % ugh: interline *in fact* is rule_thickness + "interline"?
+ interbeam = 3.14;
gourlay_energybound = 100000.;
gourlay_maxmeasures = 14.;
arithmetic_multiplier = 6.\pt;
%
- interbeam = 3.333\pt;
+ % three beams span two interlines, including stafflines:
+ % 2 interbeam + beam_thickness = 2 interline - staffline_thickness
+ % ( beam_thickness = 0.48 interline for now...)
+ % interbeam = interline - (beam_thickness + staffline_thickness) / 2
+ % interbeam = 3.6;
+ % ugh: interline *in fact* is rule_thickness + "interline"?
+ interbeam = 3.9;
+
gourlay_energybound = 100000.;
gourlay_maxmeasures = 12.;
--- /dev/null
+% property.ly
+% list of properties that lily recognises
+% and some shorthands (ugh)
+
+%{
+
+PROPERTIES
+
+name value effect shorthand
+
+[Voice]
+ydirection -1 force stem down \stemdown
+ydirection 0 stem direction free \stemboth
+ydirection 1 force stem up \stemup
+
+[Score?]
+beamslopedamping 0 no damping \beamslopeproportional
+beamslopedamping 1 damping1) \beamslopedamped
+beamslopedamping 100000 zero slope \beamslopezero
+
+[Score?]
+beamquantisation 0 no quantisations \beamposfree
+beamquantisation 1 quantise pos and slope \beamposnormal
+beamquantisation 2 quantise avoide wedge2) \beampostraditional
+
+
+[Staff?]
+instrument ascii midi instrument table lookup
+
+
+1) after beam slope damping table suggested in [Wanske]
+2) [Wanske] as well as [Ross] suggests that beams sloped upward must not
+ start sitting on a staffline, and beams sloped downward must not hang
+ from a staffline (similar for beam-ends). This would create a wedge
+ that is traditionally being avoided because it could easily be filled-up
+ with ink.
+ However, avoiding these wedges restricts the freedom of beams quite a lot
+ while they don't seem to be a problem in modern printing.
+ In no piece of sheetmusic engraved after 1953 (Baerenreiter) i've seen
+ these wedges being avoided.
+
+%}
+
+%hmm, (these) abbrevs suck, imo
+% i guess they're meant as some form of doco
+% that's what i use them for...
+% should compile a list with recognised properties!
+stemup = {
+ \skip 1*0;
+ % Stupid hack to make < { \stemup } > work
+ \property Voice.ydirection = \up
+ }
+stemboth= {
+ \skip 1*0;
+ \property Voice.ydirection = \center
+}
+stemdown = {
+ \skip 1*0;
+ \property Voice.ydirection = \down
+}
+
+% ugh, cluttering global namespace...
+none=0
+free=0
+normal=1
+traditional=2
+infinity=10000
+
+beamslopeproportional = {
+ \property Score.beamslopedamping = \none
+}
+
+beamslopedamped = {
+ \property Score.beamslopedamping = \normal
+}
+
+beamslopezero = {
+ \property Score.beamslopedamping = \infinity
+}
+
+% this sucks, you'd want to pass an array, at least
+% (or embedded code: you still can't dictate the slope / stemlength)
+beamposfree = {
+ \property Score.beamquantisation = \none
+}
+
+beamposnormal = {
+ \property Score.beamquantisation = \normal
+}
+
+beampostraditional = {
+ \property Score.beamquantisation = \traditional
+}
+
back = \script { "back" 0 -1 -1 0 0 }
front = \script { "front" 0 -1 1 0 0 }
-trill =\script { "trill" 0 0 1 0 0 }
+trill =\script { "trill" 0 0 1 0
+ 2000 % be above text.
+}
"empty" "\emptybar"
"" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt
"|" "\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt
- "||" "\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt
- "|." "\finishbar{%}" 0.0\pt 2.0\pt 0.0\pt 20.0\pt
+ "||" "\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt
+ "|." "\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt
".|" "\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt
- ":|" "\repeatbar" -8.0\pt 0.0\pt 0.0\pt 20.0\pt
- "|:" "\startrepeat" 0.0\pt 8.0\pt 0.0\pt 20.0\pt
- ":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 20.0\pt
+ ":|" "\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt
+ "|:" "\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt
+ ":|:" "\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt
}
"meters" = \table {
\version "0.1.7";
\score{
- \melodic \multi 3 <
+ \melodic { \multi 3 <
{ \octave c';
\meter 8/4;
\duration8;
\stemup [c c'' a' f']
\duration128;
\stemup [c c'' a' f']
+ r32
\duration 8;
\stemup ['g 'g 'g 'g]
\stemup ['g 'g 'g 'g]
\duration 128;
\stemup ['g 'g 'g 'g]
+ r32
}
- { \octave c';
+ { \octave c';
\meter 8/4;
\duration8;
\stemdown [a' 'a c e]
\stemdown [a' 'a c e]
\duration128;
\stemdown [a' 'a c e]
+ r32
\octave c;
\duration 8;
\stemdown [d'' d'' d'' d'']
\duration 128;
\stemdown [d'' d'' d'' d'']
+ r32
+
+ } >
+
+ {\duration "last";
+ % ugh, "duration mode"
+
+ [g8 g] [a a] [b b] [c' c']
+
+ [g16 g ] [a a] [b b] [c' c']
+ [g32 g] [a a] [b b] [c' c']
+
+ [g64 g ] [c' c' ]
+ }
+ {
+ \transpose d {
+ \octave c''';
+ | [g8 g] [a a] [b b] [c' c']
+ [g16 g ] [a a] [b b] [c' c']
+ [g32 g] [a a] [b b] [c' c']
+ [g64 g]
+ [c' c']
+ }
}
- >}
+ }
+ \paper{
+ gourlay_maxmeasures = 1.;
+ }
+}
\two_voice_steminvert
\three_voice
\rests
+ % UGH ! bug!
%\restsII
}
\header{
-title= "The Feta font";
+title= "The Feta Font";
subtitle = "proofsheet";
-enteredby = "jcn";
+enteredby = "jcn & hwn";
copyright = "public domain";
-TestedFeatures = "This file tests the Feta music-font"
- "(Feta definitively is not an abbreviation of Font-En-TjA)";
+description = "This file tests the Feta music font";
+% "(Feta definitively is not an abbreviation of Font-En-TjA)";
}
\version "0.1.7";
+% "This file is a stub to fool make-website"
+
\header{
-TestedFeatures = "This file is a stub to fool make-website"
- "this will display the 20pt version of the proofsheet";
+title= "The Feta font";
+subtitle = "proofsheet";
+enteredby = "jcn";
+copyright = "public domain";
+description = "This file tests the Feta music-font";
+TestedFeatures =
+ "(Feta definitively is not an abbreviation of Font-En-TjA)";
}
+
+
Score = \translator {
\type Score_engraver;
- \consists "Bar_align_engraver";
- \consists "Clef_align_engraver";
- \consists "Key_align_engraver";
- \consists "Meter_align_engraver";
- \consists "Score_horizontal_align_engraver";
- \consists "Vertical_align_engraver";
+ %\consists "Timing_engraver";
+ %\consists "Bar_column_engraver";
+ %\consists "Bar_number_engraver";
+
\consists "Span_score_bar_engraver";
+ \consists "Score_priority_engraver";
+ \consists "Priority_horizontal_align_engraver";
+ \consists "Vertical_align_engraver";
\accepts "Staff_group";
\accepts "Staff";
\accepts "Lyrics";
\accepts "Grandstaff";
- }
+}
%% add Timing_engraver to the staff
Staff = \translator {
% % because piece is set very tightly
IImenuetto = \melodic{
+ \property Voice.beamslopedamping = \infinity
\clef"alto";
\property Staff.instrument = cello
\meter 3/4;
%%2
\textstyle "finger"; % ugh.
- < [ bes8^"1" e8 c8_"2"_"4" >
- a8 bes8-. g8-. ] a4-.^"4" |
+ < [ bes8^"1"( e8 c8_"2"_"4" >
+ )a8 bes8-. g8-. ] a4-.^"4" |
%%3
+ \property Voice.beamslopedamping = \normal
< d4 'bes4-. > g4-. [ f8-. e8-. ] |
+ \property Voice.beamslopedamping = \infinity
%%4
- < [ f8 'a > e8 d8 cis8-. 'b8-. 'a8-. ]
+ < [ f8( 'a > e8 )d8 cis8-. 'b8-. 'a8-. ]
%%5
< a2 f2 d2 > bes!4-. |
%%6
%%9
\clef "violin";
< e'2 a2 \f >
+ \property Voice.beamslopedamping = \normal
[ d'8( e'16 )f'16 ] |
+ \property Voice.beamslopedamping = \infinity
%%10
- < [ e'8 g8 > d' cis'_"2" e' a () g8 ] |
+ < [ e'8( g8 > d' cis'_"2" )e' a () g8 ] |
%%11
\multi 2 <
{\stemup a4() d'4 cis'4-. }
{ \stemdown f2 e4 } > |
\stemboth
%%12
- < [ g'8^"4" d8 > f' e' f' d'^"3"() c' ] |
+ % oeps: slur gets attached at d8 iso g'8!
+% < [ g'8^"4"( d8 > f' e' )f' d'^"3"() c' ] |
+ % wrong still...
+ < { [ g'8^"4"( f' e' )f' d'^"3"() c' ] } { [ d8 ] } > |
%%13
\clef "alto";
\multi 2 <
%%16
[ f( e8 )f a8-. g8-. bes8-. ] |
%%17
- < a2^"0" fis2_"3" > bes4 |
+ < a2^"0"^\trill fis2_"3" > bes4 |
%%18
- < { [ c'8 () bes8 c' a8 ] } es8 > fis4 |
+ < { [ c'8 () bes8 c' a8 ] } es8 > fis4^\trill |
%%19
< d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes8 d8 > a8 ] |
%%20
%%22
< { [ g8 () f8 g8 e8 ] } cis8 > < f4 d4 > |
%%23
- [ 'g8 g8 ] < e4. 'a4. > d8-\upbow |
+ \property Voice.beamslopedamping = \normal
+ [ 'g8 g8 ] < e4.^\trill 'a4. > d8-\upbow |
+ \property Voice.beamslopedamping = \infinity
%%24
\textstyle "roman"; % ugh
< d2.^"fine" 'a2. 'd2._"3 mins.">
--- /dev/null
+\header{
+title= "Spacing";
+subtitle = "proofsheet";
+enteredby = "jcn";
+copyright = "public domain";
+TestedFeatures = "This file tests various spacings";
+}
+
+\version "0.1.7";
+
+multipart = \melodic{
+ \multi 3 <
+ {
+ c4
+ c
+ c c
+ }
+ {
+ [c8 c]
+ [c c]
+ [c c] [c c]
+ }
+ {
+ [2/3 c8 c c]1/1
+ [2/3 c c c]1/1
+ [2/3c c c]1/1 [2/3c c c]1/1
+ }
+ {
+ [2/4 c8 c c c]1/1
+ [2/4 c c c c]1/1
+ [2/4c c c c]1/1 [2/4c c c c]1/1
+ }
+ {
+ [2/5 c8 c c c c]1/1
+ [2/5 c c c c c]1/1
+ [2/5c c c c c]1/1 [2/5c c c c c]1/1
+ }
+ {
+ [2/6c8 c c c c c]1/1
+ [2/6c c c c c c]1/1
+ [2/6c c c c c c]1/1 [2/6c c c c c c]1/1
+ }
+ {
+ [2/7c8 c c c c c c]1/1
+ [2/7c c c c c c c]1/1
+ [2/7c c c c c c c]1/1 [2/7c c c c c c c]1/1
+ }
+ >
+ }
+
+singlepart = \melodic{
+ c4 d e f
+ c4 d e [f8 f]
+ c4 d e f8 [f16 f]
+ c4 d e f8 f16 [f32 f]
+ c4 d e f8 f16 f32 [f64 f]
+ c4 c4 c4 c4
+
+ }
+
+ \score{
+ \melodic {
+ \singlepart
+ \multipart
+ }
+ \paper {
+% linewidth= 18.\cm;
+% gourlay_maxmeasures = 4.0
+ }
+}
composer = "Franz Schubert (1797-1828)"
"Text by Ludwig Rellstab (1799-1860)";
enteredby = "JCN";
+description = "A schubert song in 16 pt";
copyright = "public domain";
}
"Text by Ludwig Rellstab (1799-1860)";
enteredby = "JCN";
copyright = "public domain";
+description = "A schubert song in 20 pt";
}
\version "0.1.7";
%
% UGH UGH
-\advance\oddsidemargin-25mm
+\advance\oddsidemargin-30mm
\evensidemargin\oddsidemargin
\advance\textwidth30mm
\addtolength{\textheight}{20mm}
\paper{
\paper_twenty
% 20pt music uses whole pagewidth
- % ja Vette Pech. Koop maar aan A4 printer
- linewidth= 185.\mm;
+ % ja Vette Pech. Koop maar een A3 printer
+ % huh? [jcn]
+ linewidth= 195.\mm;
arithmetic_multiplier = 7.\pt;
gourlay_maxmeasures = 9.;
\header{
filename = "toccata-fuga-E.ly";
title = "toccata and fuga in E-major ";
-opus = "BWV 566"
- "toccata 3 bar excerpt"
+opus = "BWV 566";
+description = "toccata 3 bar excerpt, "
"2nd fuga transposed subject --- 4 bar excerpt";
composer = "Johann Sebastian Bach (1685-1750)";
\melodic {
\meter 4/4; % should be \meter C
\keyCminor
- \skip 1*32;
+ \skip 1*31;
\bar "|."; |
}
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);
for (int i = 2; i < pre_str.length_i(); i += 3)
- pre_str = pre_str.left_str(i) + " " + pre_str.mid_str(i, INT_MAX);
+ pre_str = pre_str.left_str(i) + " " + pre_str.cut(i, INT_MAX);
String post_str((Byte const*)pos_ch_c_l, end_ch_c_l - pos_ch_c_l);
post_str = String_convert::bin2hex_str(post_str);
for (int i = 2; i < post_str.length_i(); i += 3)
- post_str = post_str.left_str(i) + " " + post_str.mid_str(i, INT_MAX);
+ post_str = post_str.left_str(i) + " " + post_str.cut(i, INT_MAX);
String str = pre_str
+ String('\n')
String str = line_str.left_str(pos_ch_C - begin_ch_C)
+ String('\n')
+ String(' ', error_col_i)
- + line_str.mid_str(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg..
+ + line_str.cut(pos_ch_C - begin_ch_C, INT_MAX); // String::mid should take 0 arg..
return str;
}
MAJOR_VERSION = 0
MINOR_VERSION = 1
-PATCH_LEVEL = 38
+PATCH_LEVEL = 39
MY_PATCH_LEVEL =
+ dim_.y ().str () + "))";
}
-String
-Atom::TeX_string() const
-{
- String tex_str = tex_;
- Offset off = off_;
+bool
+Atom::check_infinity_b ()const
+{
+ bool ridiculous = false;
+#ifndef NDEBUG
+
/* infinity checks. */
for (int a = X_AXIS; a < NO_AXES; a++)
{
Axis ax = (Axis)a;
- if (abs (off[ax]) >= 100 CM)
+ if (abs (off_[ax]) >= 100 CM)
{
warning (_("ridiculous dimension ") + axis_name_str (ax) + ", "
- +print_dimen(off[ax]));
- off[ax] = 0.0;
- tex_str += "\errormark";
+ +print_dimen(off_[ax]));
+ ((Atom*)this)->off_[ax] = 0.0;
+ ridiculous = true;
}
}
- // whugh.. Hard coded...
+#endif
+ return ridiculous;
+}
+String
+Atom::TeX_string() const
+{
+ String tex_str = tex_;
+ if (check_infinity_b ())
+ tex_str += "\errormark";
+
+ // whugh.. Hard coded...
String s ("\\placebox{");
- s += print_dimen (off[Y_AXIS])+"}{";
- s += print_dimen (off[X_AXIS]) + "}{";
+ s += print_dimen (off_[Y_AXIS])+"}{";
+ s += print_dimen (off_[X_AXIS]) + "}{";
s += tex_str + "}";
return s;
}
Atom::translate_axis (Real r, Axis a)
{
off_[a] += r;
+ check_infinity_b ();
}
void
Atom::translate (Offset o)
{
off_ += o;
+ check_infinity_b ();
}
String
axis_name_str (Axis a)
{
- return String (a + 'x');
+ return String (char(a + 'x'));
}
/*
void
Beam_engraver::do_process_requests()
{
- if ( !beam_p_ && span_reqs_drul_[LEFT]) {
- current_grouping_p_ = new Rhythmic_grouping;
- beam_p_ = new Beam;
- if (span_reqs_drul_[LEFT]->nplet)
- {
- plet_spanner_p_ = new Text_spanner();
- Text_def *defp = new Text_def;
- plet_spanner_p_->set_support (beam_p_);
-
- // ugh
- plet_spanner_p_->set_bounds (LEFT, get_staff_info ().command_pcol_l ());
+ if ( !beam_p_ && span_reqs_drul_[LEFT])
+ {
+ current_grouping_p_ = new Rhythmic_grouping;
+ beam_p_ = new Beam;
+ if (span_reqs_drul_[LEFT]->nplet)
+ {
+ plet_spanner_p_ = new Text_spanner;
+ Text_def *defp = new Text_def;
+ plet_spanner_p_->set_support (beam_p_);
- defp->align_i_ = 0;
- defp->text_str_ = span_reqs_drul_[LEFT]->nplet;
- defp->style_str_="italic";
- plet_spanner_p_->spec_p_ = defp;
- announce_element (Score_elem_info(plet_spanner_p_,0));
- }
- announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT]));
- }
+ defp->align_i_ = 0;
+ defp->text_str_ = span_reqs_drul_[LEFT]->nplet;
+ defp->style_str_="italic";
+ plet_spanner_p_->spec_p_ = defp;
+ announce_element (Score_elem_info(plet_spanner_p_,0));
+ }
+
+ Scalar prop = get_property ("beamslopedamping");
+ if (prop.isnum_b ())
+ {
+ beam_p_->damping_i_ = prop;
+ }
+
+ prop = get_property ("beamquantisaton");
+ if (prop.isnum_b ())
+ {
+ beam_p_->quantisation_ = (Beam::Quantise)(int)prop;
+ }
+
+ announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT]));
+ }
}
void
IMPLEMENT_IS_TYPE_B1 (Beam, Spanner);
-const int MINIMUM_STEMLEN = 5;
+// ugh, hardcoded
+const int MINIMUM_STEMLEN[] = {
+ 0, // just in case
+ 5,
+ 4,
+ 3,
+ 2,
+ 2,
+};
Beam::Beam ()
{
- slope_f = 0;
- left_y = 0.0;
+ slope_f_ = 0;
+ left_y_ = 0.0;
+ damping_i_ = 1;
+ quantisation_ = NORMAL;
+ multiple_i_ = 0;
}
void
Beam::add (Stem*s)
{
- stems.push (s);
+ stems_.push (s);
s->add_dependency (this);
s->beam_l_ = this;
{
Molecule *mol_p = new Molecule;
Real inter_f = paper ()->internote_f ();
- Real x0 = stems[0]->hpos_f ();
- for (int j=0; j <stems.size (); j++)
+ Real x0 = stems_[0]->hpos_f ();
+ for (int j=0; j <stems_.size (); j++)
{
- Stem *i = stems[j];
- Stem * prev = (j > 0)? stems[j-1] : 0;
- Stem * next = (j < stems.size ()-1) ? stems[j+1] :0;
+ Stem *i = stems_[j];
+ Stem * prev = (j > 0)? stems_[j-1] : 0;
+ Stem * next = (j < stems_.size ()-1) ? stems_[j+1] :0;
Molecule sb = stem_beams (i, next, prev);
Real x = i->hpos_f ()-x0;
- sb.translate (Offset (x, (x * slope_f + left_y)* inter_f));
+ sb.translate (Offset (x, (x * slope_f_ + left_y_)* inter_f));
mol_p->add (sb);
}
mol_p->translate_axis (x0 - spanned_drul_[LEFT]->absolute_coordinate (X_AXIS), X_AXIS);
Beam::center () const
{
Real w= (paper ()->note_width () + width ().length ())/2.0;
- return Offset (w, (left_y + w* slope_f)*paper ()->internote_f ());
+ return Offset (w, (left_y_ + w* slope_f_)*paper ()->internote_f ());
}
void
Beam::do_print () const
{
#ifndef NPRINT
- DOUT << "slope_f " <<slope_f << "left ypos " << left_y;
+ DOUT << "slope_f_ " <<slope_f_ << "left ypos " << left_y_;
Spanner::do_print ();
#endif
}
void
Beam::do_post_processing ()
{
- if (stems.size () < 2)
+ if (stems_.size () < 2)
{
warning (_ ("Beam with less than 2 stems"));
transparent_b_ = true;
Beam::do_substitute_dependent (Score_elem*o,Score_elem*n)
{
if (o->is_type_b (Stem::static_name ()))
- stems.substitute ((Stem*)o->item (), n? (Stem*) n->item ():0);
+ stems_.substitute ((Stem*)o->item (), n? (Stem*) n->item ():0);
}
Interval
Beam::do_width () const
{
- return Interval (stems[0]->hpos_f (),
- stems.top ()->hpos_f ());
+ return Interval (stems_[0]->hpos_f (),
+ stems_.top ()->hpos_f ());
}
void
count[UP] = count[DOWN] = 0;
Direction d = DOWN;
- for (int i=0; i <stems.size (); i++)
+ for (int i=0; i <stems_.size (); i++)
do {
- Stem *s = stems[i];
+ Stem *s = stems_[i];
int current = s->dir_
? (1 + d * s->dir_)/2
: s->get_center_distance (Direction (-d));
count[d] = 1;
} while ((d *= -1) != DOWN);
- /* the following relation is equal to
- up / up_count > down / down_count
- */
- dir_ = (total[UP] * count[DOWN] > total[DOWN] * count[UP]) ? UP : DOWN;
+ /*
+
+ [Ross] states that the majority of the notes dictates the
+ direction (and not the mean of "center distance")
+ */
+ dir_ = (total[UP] > total[DOWN]) ? UP : DOWN;
- for (int i=0; i <stems.size (); i++)
+ for (int i=0; i <stems_.size (); i++)
{
- Stem *sl = stems[i];
+ Stem *sl = stems_[i];
sl->dir_ = dir_;
}
}
/*
should use minimum energy formulation (cf linespacing)
-
*/
void
Beam::solve_slope ()
{
Array<Stem_info> sinfo;
- for (int j=0; j <stems.size (); j++)
+ for (int j=0; j <stems_.size (); j++)
{
- Stem *i = stems[j];
+ Stem *i = stems_[j];
i->set_default_extents ();
if (i->invisible_b ())
sinfo.push (info);
}
if (! sinfo.size ())
- slope_f = left_y = 0;
+ slope_f_ = left_y_ = 0;
else if (sinfo.size () == 1)
{
- slope_f = 0;
- left_y = sinfo[0].idealy_f_;
+ slope_f_ = 0;
+ left_y_ = sinfo[0].idealy_f_;
}
else
{
l.input.push (Offset (sinfo[i].x, sinfo[i].idealy_f_));
}
- l.minimise (slope_f, left_y);
+ l.minimise (slope_f_, left_y_);
}
Real dy = 0.0;
for (int i=0; i < sinfo.size (); i++)
{
- Real y = sinfo[i].x * slope_f + left_y;
+ Real y = sinfo[i].x * slope_f_ + left_y_;
Real my = sinfo[i].miny_f_;
if (my - y > dy)
dy = my -y;
}
- left_y += dy;
- left_y *= dir_;
+ left_y_ += dy;
+ left_y_ *= dir_;
- slope_f *= dir_;
+ slope_f_ *= dir_;
/*
- This neat trick is by Werner Lemberg, damped = tanh (slope_f) corresponds
+ This neat trick is by Werner Lemberg, damped = tanh (slope_f_) corresponds
with some tables in [Wanske]
*/
- slope_f = 0.6 * tanh (slope_f);
+ if (damping_i_)
+ slope_f_ = 0.6 * tanh (slope_f_) / damping_i_;
quantise_yspan ();
// y-values traditionally use internote dimension: therefore slope = (y/in)/x
// but mf and beam-lookup use PT dimension for y (as used for x-values)
// ugh --- there goes our simplified but careful quantisation
- Real sl = slope_f * paper ()->internote_f ();
- paper ()->lookup_l ()->beam (sl, 20 PT);
- slope_f = sl / paper ()->internote_f ();
+ Real sl = slope_f_ * paper ()->internote_f ();
+ paper ()->lookup_l ()->beam (sl, 20 PT, 1 PT);
+ slope_f_ = sl / paper ()->internote_f ();
}
void
{
/*
[Ross] (simplification of)
- Try to set slope_f complying with y-span of:
+ Try to set slope_f_ complying with y-span of:
- zero
- beam_thickness / 2 + staffline_thickness / 2
- beam_thickness + staffline_thickness
+ n * interline
*/
+
+ if (!quantisation_)
+ return;
+
Real interline_f = paper ()->interline_f ();
Real internote_f = interline_f / 2;
Real staffline_thickness = paper ()->rule_thickness ();
beam_thickness + staffline_thickness
};
- Real xspan_f = stems.top ()->hpos_f () - stems[0]->hpos_f ();
+ Real xspan_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
// y-values traditionally use internote dimension: therefore slope = (y/in)/x
- Real yspan_f = xspan_f * abs (slope_f * internote_f);
+ Real yspan_f = xspan_f * abs (slope_f_ * internote_f);
int yspan_i = (int)(yspan_f / interline_f);
Real q = (yspan_f / interline_f - yspan_i) * interline_f;
int i = 0;
yspan_f = (Real)yspan_i * interline_f + q;
// y-values traditionally use internote dimension: therefore slope = (y/in)/x
- slope_f = yspan_f / xspan_f / internote_f * sign (slope_f);
+ slope_f_ = yspan_f / xspan_f / internote_f * sign (slope_f_);
}
void
if extend then stems must not get shorter
*/
+ if (!quantisation_)
+ return;
+
Real interline_f = paper ()->interline_f ();
Real internote_f = interline_f / 2;
Real staffline_thickness = paper ()->rule_thickness ();
const int QUANTS = 6;
Real qy[QUANTS] = {
- -staffline_thickness,
+ 0,
beam_thickness / 2,
- beam_thickness + staffline_thickness / 2,
+ beam_thickness,
interline_f / 2 + beam_thickness / 2 + staffline_thickness / 2,
- interline_f - staffline_thickness,
+ interline_f,
interline_f + beam_thickness / 2,
};
/*
};
// y-values traditionally use internote dimension
- Real y = left_y * internote_f;
+ Real y = left_y_ * internote_f;
int y_i = (int)floor(y / interline_f);
y = (y / interline_f - y_i) * interline_f;
Real lower_y = (qy[lower_i] + interline_f * y_i) / internote_f;
if (extend_b)
- left_y = (dir_ > 0 ? upper_y : lower_y);
+ left_y_ = (dir_ > 0 ? upper_y : lower_y);
else
- left_y = (upper_y - left_y < y - lower_y ? upper_y : lower_y);
+ left_y_ = (upper_y - left_y_ < y - lower_y ? upper_y : lower_y);
}
void
Beam::set_stemlens ()
{
- Real x0 = stems[0]->hpos_f ();
+ Real x0 = stems_[0]->hpos_f ();
Real dy = 0;
Real interline_f = paper ()->interline_f ();
Real internote_f = interline_f / 2;
Real staffline_thickness = paper ()->rule_thickness ();
Real beam_thickness = 0.48 * (interline_f - staffline_thickness);
- Real xspan_f = stems.top ()->hpos_f () - stems[0]->hpos_f ();
+ Real interbeam_f = paper ()->interbeam_f ();
+ if (multiple_i_ > 3)
+ interbeam_f += 2.0 * staffline_thickness / 4;
+ Real xspan_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
/*
ugh, y values are in "internote" dimension
*/
- Real yspan_f = xspan_f * abs (slope_f * internote_f);
+ Real yspan_f = xspan_f * abs (slope_f_ * internote_f);
int yspan_i = (int)(yspan_f / interline_f);
Pos left_pos = NONE;
- if (yspan_f < staffline_thickness / 2)
+ if ((yspan_f < staffline_thickness / 2) || (quantisation_ == NORMAL))
left_pos = (Pos)(STRADDLE | SIT | HANG);
else
- left_pos = (Pos) (sign (slope_f) > 0 ? STRADDLE | HANG
+ left_pos = (Pos) (sign (slope_f_) > 0 ? STRADDLE | HANG
: SIT | STRADDLE);
/*
if (q < interline_f / 3 - beam_thickness / 2)
left_pos = (Pos) (left_pos | INTER);
- if (stems[0]->beams_right_i_ > 1)
- left_pos = (Pos)(left_pos & (STRADDLE | INTER));
+ if (multiple_i_ > 1)
+ left_pos = (Pos) (dir_ > 0 ? HANG : SIT);
// ugh, rounding problems!
const Real EPSILON = interline_f / 10;
do
{
- left_y += dy * dir_;
+ left_y_ += dy * dir_;
quantise_left_y (left_pos, dy);
dy = 0;
- for (int j=0; j < stems.size (); j++)
+ for (int j=0; j < stems_.size (); j++)
{
- Stem *s = stems[j];
+ Stem *s = stems_[j];
Real x = s->hpos_f () - x0;
- s->set_stemend (left_y + slope_f * x);
+ s->set_stemend (left_y_ + slope_f_ * x);
Real y = s->stem_length_f ();
- if (y < MINIMUM_STEMLEN)
- dy = dy >? (MINIMUM_STEMLEN - y);
+ int mult = max (stems_[j]->beams_left_i_, stems_[j]->beams_right_i_);
+ if (mult > 1)
+ // dim(y) = internote
+ y -= (mult - 1) * interbeam_f / internote_f;
+ if (y < MINIMUM_STEMLEN[mult])
+ dy = dy >? (MINIMUM_STEMLEN[mult] - y);
}
} while (abs (dy) > EPSILON);
}
{
def.OK ();
cur.OK ();
- assert (cur.children.size () == stems.size ());
+ assert (cur.children.size () == stems_.size ());
cur.split (def);
Array<int> b;
{
Array<int> flags;
- for (int j=0; j <stems.size (); j++)
+ for (int j=0; j <stems_.size (); j++)
{
- Stem *s = stems[j];
+ Stem *s = stems_[j];
int f = s->flag_i_ - 2;
assert (f>0);
b= cur.generate_beams (flags, fi);
b.insert (0,0);
b.push (0);
- assert (stems.size () == b.size ()/2);
+ assert (stems_.size () == b.size ()/2);
}
- for (int j=0, i=0; i < b.size () && j <stems.size (); i+= 2, j++)
+ for (int j=0, i=0; i < b.size () && j <stems_.size (); i+= 2, j++)
{
- Stem *s = stems[j];
+ Stem *s = stems_[j];
s->beams_left_i_ = b[i];
s->beams_right_i_ = b[i+1];
+ multiple_i_ = multiple_i_ >? (b[i] >? b[i+1]);
}
}
{
assert (!next || next->hpos_f () > here->hpos_f ());
assert (!prev || prev->hpos_f () < here->hpos_f ());
- // Real dy=paper ()->internote_f ()*2;
- Real dy = paper ()->interbeam_f ();
- Real stemdx = paper ()->rule_thickness ();
- Real sl = slope_f*paper ()->internote_f ();
- paper ()->lookup_l ()->beam (sl, 20 PT);
+
+ Real staffline_thickness = paper ()->rule_thickness ();
+ Real interbeam_f = paper ()->interbeam_f ();
+ Real internote_f =paper ()->internote_f ();
+ Real interline_f = 2 * internote_f;
+ Real beamheight_f = 0.48 * (interline_f - staffline_thickness);
+ if (multiple_i_ > 3)
+ interbeam_f += 2.0 * staffline_thickness / 4;
+ Real dy = interbeam_f;
+ Real stemdx = staffline_thickness;
+ Real sl = slope_f_* internote_f;
+ paper ()->lookup_l ()->beam (sl, 20 PT, 1 PT);
Molecule leftbeams;
Molecule rightbeams;
{
int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
- Real w = (here->hpos_f () - prev->hpos_f ())/4;
+ Real w = (here->hpos_f () - prev->hpos_f ())/4 <? paper ()->note_width ();;
Atom a;
if (lhalfs) // generates warnings if not
- a = paper ()->lookup_l ()->beam (sl, w);
+ a = paper ()->lookup_l ()->beam (sl, w, beamheight_f);
a.translate (Offset (-w, -w * sl));
for (int j = 0; j < lhalfs; j++)
{
int rwholebeams = here->beams_right_i_ <? next->beams_left_i_;
Real w = next->hpos_f () - here->hpos_f ();
- Atom a = paper ()->lookup_l ()->beam (sl, w + stemdx);
-
+ Atom a = paper ()->lookup_l ()->beam (sl, w + stemdx, beamheight_f);
+ a.translate_axis( - stemdx/2, X_AXIS);
int j = 0;
Real gap_f = 0;
if (here->beam_gap_i_)
// TODO: notehead widths differ for different types
gap_f = paper ()->note_width () / 2;
w -= 2 * gap_f;
- a = paper ()->lookup_l ()->beam (sl, w + stemdx);
+ a = paper ()->lookup_l ()->beam (sl, w + stemdx, beamheight_f);
}
for (; j < rwholebeams; j++)
rightbeams.add (b);
}
- w /= 4;
+ w = w/4 <? paper ()->note_width ();
if (rhalfs)
- a = paper ()->lookup_l ()->beam (sl, w);
+ a = paper ()->lookup_l ()->beam (sl, w, beamheight_f);
for (; j < rwholebeams + rhalfs; j++)
{
}
leftbeams.add (rightbeams);
+
+ /*
+ Does beam quanting think of the asymetry of beams?
+ Refpoint is on bottom of symbol. (FIXTHAT) --hwn.
+ */
+ if (experimental_features_global_b && dir_ < 0)
+ leftbeams.translate_axis (-beamheight_f, Y_AXIS);
return leftbeams;
}
Bow::Bow()
{
- pos_i_drul_[LEFT] = pos_i_drul_[RIGHT] = 0;
+ dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0;
dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
}
Offset
Bow::center() const
{
- int dy = pos_i_drul_[RIGHT]-pos_i_drul_[LEFT];
+ Real dy = dy_f_drul_[RIGHT]-dy_f_drul_[LEFT];
Real w = width().length ();
- return Offset (w/2,dy * paper()->internote_f ());
+ return Offset (w/2,dy );
}
Molecule*output = new Molecule;
Real w = width().length ();
- int dy = pos_i_drul_[RIGHT] - pos_i_drul_[LEFT];
+ Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
Real nw_f = paper()->note_width ();
Real nh_f = paper()->internote_f ();
- w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ;
+ w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
Real round_w = w; // slur lookup rounds the slurwidth .
- Atom a = paper()->lookup_l ()->slur (dy , round_w, dir_);
+ Atom a = paper()->lookup_l ()->slur (dy_f, round_w, dir_);
Real error = w-round_w;
- a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2,
- pos_i_drul_[LEFT] * nh_f));
+ a.translate (Offset ((dx_f_drul_[LEFT] + 0.5*nw_f)
+ + error/2,
+ dy_f_drul_[LEFT]));
output->add (a);
return output;
}
}
void
-Col_hpositions::stupid_solution()
+Col_hpositions::set_stupid_solution(Vector v)
{
energy_f_ = infinity_f;
ugh_b_ = true;
- config = spacer_l_->default_solution();
+ config = v;
+}
+
+void
+Col_hpositions::stupid_solution()
+{
+ set_stupid_solution (spacer_l_->default_solution());
}
void
#include "lookup.hh"
#include "paper-def.hh"
#include "debug.hh"
+#include "score-column.hh"
Crescendo::Crescendo()
{
grow_dir_ =0;
- dir_ = DOWN ;
+ dir_ = DOWN;
dyn_b_drul_[LEFT] = dyn_b_drul_[RIGHT] =false;
}
w_dim = 0;
}
- return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0));
+ Drul_array<bool> broken;
+ Direction d = LEFT;
+ do {
+ Score_column* s = (Score_column* )spanned_drul_[d] ; // UGH
+ broken[d] = (!s->musical_b());
+ } while ((d *= -1) != LEFT);
+
+
+ bool continued = broken[(Direction)-grow_dir_];
+ return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0, continued));
}
Molecule*
/// a symbol which can be translated, and freely copied
-struct Atom {
+class Atom {
+ Offset off_;
+public:
String tex_;
Box dim_;
- Offset off_;
String str() const; // for printing.
Atom (String, Box);
Box extent() const;
void print() const;
String TeX_string() const;
+ bool check_infinity_b () const;
};
#endif
#include "directional-spanner.hh"
#include "plist.hh"
-/** a beam connects multiple stems Beam adjusts the stems its owns to
- make sure that they reach the beam and that point in the correct
- direction */
+/** a beam connects multiple stems.
+
+ Beam adjusts the stems its owns to make sure that they reach the
+ beam and that point in the correct direction */
class Beam: public Directional_spanner {
public:
enum Pos { NONE, SIT = 1, STRADDLE = 2, HANG = 4, INTER = 8 };
+ // ugh, silly C++
+ enum Quantise { NUN, NORMAL, TRADITIONAL };
- Link_array<Stem> stems;
+ Link_array<Stem> stems_;
/// the slope of the beam in posns / point (dimension)
- Real slope_f;
+ Real slope_f_;
/// position of leftmost end of beam
- Real left_y;
-
+ Real left_y_;
+ /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
+ int damping_i_;
+ /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
+ Quantise quantisation_;
+ /// maximum number of beams (for opening-up of beam-spacing)
+ int multiple_i_;
+
- /* *************** */
DECLARE_MY_RUNTIME_TYPEINFO;
Beam();
void add (Stem*);
*/
class Bow : public Directional_spanner {
protected:
- Drul_array<int> pos_i_drul_;
+ Drul_array<Real> dy_f_drul_;
Drul_array<Real> dx_f_drul_;
-
+
Molecule*brew_molecule_p() const;
public:
Bow();
typedef Array<Paper_column*> Line_of_cols;
struct Col_hpositions {
- Line_spacer * spacer_l_;
- bool ugh_b_;
- Line_of_cols error_col_l_arr_;
- Line_of_cols cols;
- Array<Real> config;
- Real energy_f_;
- bool satisfies_constraints_b_;
-
- /* ************** */
- void OK() const;
- ~Col_hpositions();
- void solve_line();
- void approximate_solve_line();
- /** generate a solution with no regard to idealspacings or
- constraints. should always work */
- void stupid_solution();
- Col_hpositions();
- void add (Paper_column*c);
- void print() const;
+ Line_spacer * spacer_l_;
+ bool ugh_b_;
+ Line_of_cols error_col_l_arr_;
+ Line_of_cols cols;
+ Array<Real> config;
+ Real energy_f_;
+ bool satisfies_constraints_b_;
+
+ /* ************** */
+ void OK() const;
+ ~Col_hpositions();
+ void solve_line();
+ void approximate_solve_line();
+ /** generate a solution with no regard to idealspacings or
+ constraints. should always work */
+ void stupid_solution();
+ void set_stupid_solution (Vector);
+ Col_hpositions();
+ void add (Paper_column*c);
+ void print() const;
};
Atom beam_element (int,int,Real=0) const;
/// round slope to closest TeXslope
- Atom beam (Real&,Real) const;
+ Atom beam (Real&,Real, Real) const;
+ Atom ps_beam (Real, Real, Real)const;
+ Atom tex_beam (Real&, Real) const;
Atom streepje (int type) const;
Atom bar (String, Real height) const;
Atom dots () const;
- Atom slur (int dy, Real &dx, Direction dir) const;
+ Atom slur (Real &dy, Real &dx, Direction dir) const;
+ Atom tex_slur (int dy, Real &dx, Direction dir) const;
+ Atom ps_slur (Real dy, Real dx, Real dir) const;
Atom half_slur (int dy, Real &dx, Direction dir, int xpart) const;
Atom half_slur_middlepart (Real &dx, Direction dir) const;
Atom big_slur (int dy, Real &dx, Direction dir) const;
Atom text (String style, String text, int align = 1) const;
Atom script (String idx) const;
- Atom hairpin (Real & width, bool decresc) const;
+ Atom hairpin (Real & width, bool decresc, bool continued) const;
Atom dynamic (String) const;
};
String find_file (String);
String get_version_str();
String get_version_number_str();
-extern Sources* source_l_g;
-extern bool only_midi;
+extern Sources* source_global_l;
+extern bool no_paper_global_b;
extern int exit_status_i_;
extern bool experimental_features_global_b;
extern bool postscript_global_b;
-extern String default_out_fn;
-
+extern String default_outname_base_global;
+extern String default_outname_suffix_global;
+extern int default_count_global;
#endif
definitions for midi output. Rather empty
*/
class Midi_def : public Music_output_def {
+ static int default_count_i_;
public:
VIRTUAL_COPY_CONS(Midi_def, Music_output_def);
DECLARE_MY_RUNTIME_TYPEINFO;
int get_tempo_i (Moment moment);
void print() const;
void set_tempo (Moment moment, int count_per_minute_i);
+ virtual int get_next_default_count () const;
};
#endif // MIDI_DEF_HH
void assign_translator (String, Translator*);
String outfile_str_;
Translator * find_translator_l (String) const;
+ virtual int get_next_default_count () const;
};
#endif // Music_output_DEF_HH
class Paper_def : public Music_output_def {
Lookup *lookup_p_;
Dictionary<Real> *real_vars_p_;
-
+ static int default_count_i_;
protected:
VIRTUAL_COPY_CONS(Paper_def,Music_output_def);
public:
Real geometric_spacing(Moment) const;
Real arithmetic_constant(Moment minimal_mom) const;
Real arithmetic_spacing( Moment mom,Real constant) const;
+ virtual int get_next_default_count () const;
String TeX_output_settings_str () const;
};
/// generate an (nonoptimal) solution
Vector find_initial_solution() const;
- /// check if problem is too tight
- bool check_feasible() const;
-
/// does #this# contain the column #w#?
bool contains (Paper_column const *w);
triplets, eentweetjes, ottava, etc. */
class Text_spanner : public Spanner {
public:
- Directional_spanner * support_span_l_;
- General_script_def * spec_p_;
- Offset text_off_;
- DECLARE_MY_RUNTIME_TYPEINFO;
+ Directional_spanner * support_span_l_;
+ General_script_def * spec_p_;
+ Offset text_off_;
+ DECLARE_MY_RUNTIME_TYPEINFO;
- void set_support (Directional_spanner*);
- Text_spanner();
- Text_spanner (Text_spanner const&);
+ void set_support (Directional_spanner*);
+ Text_spanner();
+ Text_spanner (Text_spanner const&);
protected:
- SCORE_ELEM_CLONE(Text_spanner);
- ~Text_spanner();
- virtual void do_substitute_dependency (Score_elem*,Score_elem*);
- virtual void do_pre_processing();
- virtual void do_post_processing();
- virtual Interval height() const ;
- virtual Molecule* brew_molecule_p() const;
- virtual void do_print() const;
+ SCORE_ELEM_CLONE(Text_spanner);
+ ~Text_spanner();
+ virtual void do_add_processing ();
+ virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+ virtual void do_pre_processing();
+ virtual void do_post_processing();
+ virtual Interval height() const ;
+ virtual Molecule* brew_molecule_p() const;
+ virtual void do_print() const;
};
#endif // TEXTSPANNER_HH
String s (YYText ()+1);
s = s.left_str (s.length_i ()-1);
DOUT << "#include `" << s << "\'\n";
- new_input (s,source_l_g);
+ new_input (s,source_global_l);
yy_pop_state ();
}
<incl>\"[^"]* { // backup rule
TODO
This doth suck. We should have PS output, and read spacing info from TFMs
- Glissando, bracket
+ Glissando,
*/
}
Atom
-Lookup::hairpin (Real &wid, bool decresc) const
+Lookup::hairpin (Real &wid, bool decresc, bool continued) const
{
bool embedded_b = postscript_global_b;
String embed;
Real height = 2 PT;
embed = "\\embeddedps{\n" ;
embed += String (wid) + " "
- + String (height)
+ + String (height) + " "
+ + String (continued ? height/2 : 0) +
+ " draw_" + String(decresc ? "de" : "") + "cresc}\n";
ret.tex_ = embed;
}
Interval ydims = brace.dim_[Y_AXIS];
Real min_y = ydims[LEFT];
Real max_y = ydims[RIGHT];
- Real step = 2.0 PT;
+ Real step = 1.0 PT;
if (y < min_y)
{
#include "my-lily-parser.hh"
static bool version_ignore_b = false;
-Sources* source_l_g = 0;
-bool only_midi = false;
+Sources* source_global_l = 0;
+bool no_paper_global_b = false;
+
bool experimental_features_global_b = false;
-bool postscript_global_b = false;
+bool postscript_global_b = true;
int exit_status_i_;
void destill_inname (String &name_str_r);
{0, "debug", 'd'},
{1, "init", 'i'},
{1, "include", 'I'},
- {0, "midi", 'M'},
- {0, "postscript", 'p'},
+ {0, "no-midi", 'M'},
+ {0, "no-postscript", 'P'},
{0, "ignore-version", 'V'},
{0,0,0}
};
usage()
{
cout <<
- _("Usage: lilypond [options] [mudela-file]\n"
+ _("Usage: lilypond [options] [mudela-files]\n"
"Typeset and or produce midi output from mudela-file or stdin\n"
"\n"
"Options:\n"
" -w, --warranty show warranty and copyright\n"
" -o, --output=FILE set FILE as default output\n"
" -t, --test switch on experimental features\n"
- " -M, --midi produce midi output only\n"
+ " -M, --no-paper produce midi output only\n"
" -V, --ignore-version ignore mudela version\n"
- " -p, --postscript try to use PostScript\n"
+ " -P, --no-postscript don't use PostScript\n"
"\n"
"GNU LilyPond was compiled with the following settings:\n")
#ifdef NDEBUG
cout <<
_("\n"
"GNU LilyPond -- The GNU Project music typesetter.\n"
- "Copyright 1996,97 by\n"
+ "Copyright 1996, 97, 98 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
" Jan Nieuwenhuizen <jan@digicash.com>\n"
"\n"
}
Sources sources;
- source_l_g = &sources;
- source_l_g->set_path (&path);
+ source_global_l = &sources;
+ source_global_l->set_path (&path);
{
- My_lily_parser parser (source_l_g);
+ My_lily_parser parser (source_global_l);
parser.set_version_check (version_ignore_b);
parser.parse_file (init_str, file_str);
-
+
+ if (file_str.length_i() && file_str[0] != '-')
+ {
+ String a,b,c,d;
+ split_path (file_str, a, b, c, d);
+ default_outname_base_global = c;
+ }
+ else
+ default_outname_base_global = "lelie";
+
if (parser.error_level_i_)
{
exit_status_i_ = 1;
do_scores();
clear_scores ();
}
- source_l_g = 0;
+ source_global_l = 0;
+}
+
+void
+identify ()
+{
+ cout << get_version_str() << endl;
}
int
main (int argc, char **argv)
{
+ identify ();
debug_init(); // should be first
// must override (come before) "/usr/local/share/lilypond"!
- char const * env_l=getenv ("LILYINCLUDE");
- if (env_l)
- {
- path.add (env_l);
- }
+ char const *env_sz = getenv ("LILYINCLUDE");
+ if (env_sz)
+ path.parse_path (env_sz);
+
path.add ("");
path.add (String (DIR_DATADIR) + "/init/");
path.push (DIR_DATADIR);
Getopt_long oparser (argc, argv,theopts);
- cout << get_version_str() << endl;
String init_str ("lily-init.ly");
while (Long_option_init const * opt = oparser())
experimental_features_global_b = true;
break;
case 'o':
- set_default_output (oparser.optional_argument_ch_C_);
+ default_outname_base_global = oparser.optional_argument_ch_C_;
break;
case 'w':
notice();
case 'V':
version_ignore_b = true;
break;
- case 'p':
- postscript_global_b = true;
+ case 'P':
+ postscript_global_b = false;
break;
case 'd':
set_debug (true);
break;
case 'M':
- only_midi = true;
+ no_paper_global_b = true;
break;
default:
assert (false);
Midi_def::Midi_def()
{
- outfile_str_ = "";
// ugh
set_tempo (Moment (1, 4), 60);
}
Midi_def::print() const
{
#ifndef NPRINT
+ Music_output_def::print ();
DOUT << "Midi {";
DOUT << "4/min: " << Real (60) / (whole_in_seconds_mom_ * 4);
- DOUT << "out: " << outfile_str_;
DOUT << "}\n";
#endif
}
IMPLEMENT_IS_TYPE_B1(Midi_def, Music_output_def);
+
+int Midi_def::default_count_i_=0;
+int
+Midi_def::get_next_default_count () const
+{
+ return default_count_i_++;
+}
Midi_stream&
Midi_stream::operator <<(String str)
{
- if (check_debug && !monitor->silence("Midistrings"))
+ if (check_debug && !monitor->silent_b("Midistrings"))
str = String_convert::bin2hex_str (str);
*os_p_ << str;
- if (check_debug && !monitor->silence("Midistrings"))
+ if (check_debug && !monitor->silent_b ("Midistrings"))
*os_p_ << "\n";
return *this;
{
// *this << mitem_c_r.str();
mitem_c_r.output (this);
- if (check_debug && !monitor->silence("Midistrings"))
+ if (check_debug && !monitor->silent_b("Midistrings"))
*os_p_ << "\n";
return *this;
}
#include "global-translator.hh"
#include "dictionary-iter.hh"
+int
+Music_output_def::get_next_default_count () const
+{
+ return 0;
+}
+
IMPLEMENT_IS_TYPE_B(Music_output_def);
Music_output_def::Music_output_def ()
Music_output_def::Music_output_def (Music_output_def const &s)
{
+ outfile_str_ = s.outfile_str_;
for (Dictionary_iter<Translator*> i (s.translator_p_dict_); i.ok (); i++)
assign_translator (i.key (), i.val ()->clone ());
}
{
t->type_str_ = s;
t->output_def_l_ = this;
+
if (translator_p_dict_.elt_b (s))
delete translator_p_dict_[s];
translator_p_dict_[s] = t;
DOUT << i.key () << " = ";
i.val ()->print ();
}
+ DOUT << "output: " << outfile_str_;
#endif
}
Span_req:: do_equal_b (Request*r) const
{
Span_req * s = r->span();
- return spantype - s->spantype;
+ return spantype == s->spantype;
}
Span_req::Span_req()
String s = "";
if (init_parse_b_)
s = "Init";
- set_yydebug (!monitor->silence (s+"Parser") && check_debug);
- lexer_p_->set_debug (!monitor->silence (s+"Lexer") && check_debug);
+ set_yydebug (!monitor->silent_b (s+"Parser") && check_debug);
+ lexer_p_->set_debug (!monitor->silent_b (s+"Lexer") && check_debug);
#endif
}
if (init_parse_b_)
s = "Init";
- if (!monitor->silence (s+"Declarations") && check_debug)
+ if (!monitor->silent_b (s+"Declarations") && check_debug)
{
lexer_p_->print_declarations (init_parse_b_);
}
// output
String outname = paper_l_->outfile_str_ ;
if (outname.empty_b ())
- outname = default_out_str_+ ".tex";
-
+ {
+ outname = default_outname_base_global;
+ int def = paper_l_->get_next_default_count ();
+ if (def)
+ {
+ outname += "-" + String(def);
+ }
+ outname += ".tex";
+ }
*mlog << _("TeX output to ") << outname << " ...\n";
Tex_stream tex_out (outname);
lookup_p_ = s.lookup_p_? new Lookup (*s.lookup_p_) : 0;
lookup_p_->paper_l_ = this;
real_vars_p_ = new Dictionary<Real> (*s.real_vars_p_);
- outfile_str_ = s.outfile_str_;
}
void
#ifndef NPRINT
Music_output_def::print ();
DOUT << "Paper {";
- DOUT << "out: " <<outfile_str_;
lookup_p_->print();
for (Assoc_iter<String,Real> i (*real_vars_p_); i.ok(); i++)
{
String
Paper_def::TeX_output_settings_str () const
{
-
String s("\n ");
s += lookup_p_->texsetting + "%(Tex id)\n";
for (Assoc_iter<String,Real> i (*real_vars_p_); i.ok(); i++)
s += String ("\\def\\mudelapaper") + i.key () + "{" + i.val () + "}\n";
return s;
}
+
+int Paper_def::default_count_i_ = 0;
+
+int
+Paper_def::get_next_default_count () const
+{
+ return default_count_i_ ++;
+}
String out=midi_l_->outfile_str_;
if (out.empty_b ())
- out = default_out_str_ + ".midi";
-
+ {
+
+ out = default_outname_base_global;
+ int def = midi_l_->get_next_default_count ();
+ if (def)
+ {
+ out += "-" + String(def);
+ }
+
+ out += ".midi";
+ }
+
Midi_stream midi_stream (out);
*mlog << _("MIDI output to ") << out<< " ..." << endl;
Spanner *s = elem_p->spanner ();
pscore_p_->typeset_unbroken_spanner (s);
- /*
+
+
+ /*
do something sensible if spanner not
spanned on 2 items.
*/
Direction d = LEFT;
do {
if (!s->spanned_drul_[d])
- s->set_bounds(d, command_column_l_);
+ {
+ s->set_bounds(d, command_column_l_);
+ warning ("Unbound spanner");
+ }
} while ((d *= -1) != LEFT);
-
}
else
{
#include "global-translator.hh"
#include "header.hh"
#include "cpu-timer.hh"
+#include "main.hh"
+#include "paper-def.hh"
-extern String default_out_fn;
Score::Score()
{
{
w = iter->next_moment();
DOUT << "proccing: " << w <<"\n";
- iter->print();
+ if (!monitor->silent_b ("walking"))
+ iter->print();
}
+
trans_p->modify_next (w);
trans_p->prepare (w);
- trans_p->print();
+ if (!monitor->silent_b ("walking"))
+ trans_p->print();
iter->process_and_next (w);
trans_p->process();
output->header_l_ = header_p_;
- output->default_out_str_ = default_out_fn;
output->origin_str_ = location_str();
*mlog << endl;
print();
for (int i=0; i < def_p_arr_.size (); i++)
- run_translator (def_p_arr_[i]);
+ {
+ if (no_paper_global_b
+ && def_p_arr_[i]->is_type_b (Paper_def::static_name ()))
+ continue;
+ run_translator (def_p_arr_[i]);
+ }
}
-
void
Score::print() const
{
#include "parray.hh"
static Link_array<Score> global_score_array;
-String default_out_fn = "lelie";
+String default_outname_suffix_global = "";
+String default_outname_base_global = "lelie";
+int default_count_global;
+
void
do_scores()
if (!is_p->header_p_)
is_p->header_p_ = new Header;
+
is_p->header_p_->lily_id_str_ = "Lily was here, " +
get_version_number_str();
if (is_p->errorlevel_i_)
global_score_array.push (s);
}
-void
-set_default_output (String s)
-{
- default_out_fn = s;
-}
if (extrema[d] != spanned_drul_[d])
{
dx_f_drul_[d] = -d
- *(spanned_drul_[d]->width ().length ()/nw_f -0.5);
+ *(spanned_drul_[d]->width ().length () -0.5*nw_f);
}
else if (extrema[d]->stem_l_ && !extrema[d]->stem_l_->transparent_b_)
- pos_i_drul_[d] = (int)rint (extrema[d]->stem_l_->height()[dir_]/inter_f);
+ dy_f_drul_[d] = (int)rint (extrema[d]->stem_l_->height()[dir_]);
else
- pos_i_drul_[d] = (int)rint (extrema[d]->head_positions_interval()[dir_]);
- pos_i_drul_[d] += dir_;
+ dy_f_drul_[d] = (int)rint (extrema[d]->head_positions_interval()[dir_])* inter_f;
+ dy_f_drul_[d] += dir_ * inter_f;
}
while ((d *= -1) != LEFT);
}
#include "paper-def.hh"
#include "dimen.hh"
#include "colhpos.hh"
-
+#include "main.hh" // experimental_fietsers
Vector
Spring_spacer::default_solution() const
return true;
}
-bool
-Spring_spacer::check_feasible() const
-{
- Vector sol (try_initial_solution());
- return check_constraints (sol);
-}
-
-/// generate a solution which obeys the min distances and fixed positions
+/// try to generate a solution which obeys the min distances and fixed
+/// positions
Vector
Spring_spacer::try_initial_solution() const
{
{
Real r =initsol (i-1) + cols[i-1].width_[RIGHT];
if (initsol (i) < r)
- {
- warning (_("overriding fixed position"));
initsol (i) =r;
- }
}
}
-Vector
-Spring_spacer::find_initial_solution() const
-{
- Vector v (try_initial_solution());
- assert (check_constraints (v));
- return v;
-}
-
// generate the matrices
void
Spring_spacer::make_matrices (Matrix &quad, Vector &lin, Real &c) const
for (int j=0; j < cols.size(); j++)
if (cols[j].fixed())
qp.add_fixed_var (j,cols[j].fixed_position());
-
-
}
// put the constraints into the LP problem
start.fill (0.0);
Vector solution_vec (lp.solve (start));
+ DOUT << "Lower bound sol: " << solution_vec;
positions->energy_f_ = calculate_energy_f (solution_vec);
positions->config = solution_vec;
positions->satisfies_constraints_b_ = check_constraints (solution_vec);
void
Spring_spacer::solve (Col_hpositions*positions) const
{
- assert (check_feasible());
+ Vector solution_try (try_initial_solution());
+
+ if (check_constraints (solution_try))
+ {
+ Mixed_qp lp (cols.size());
+ make_matrices (lp.quad,lp.lin, lp.const_term);
+ make_constraints (lp);
+ set_fixed_cols (lp);
- Mixed_qp lp (cols.size());
- make_matrices (lp.quad,lp.lin, lp.const_term);
- make_constraints (lp);
- set_fixed_cols (lp);
- Vector start=find_initial_solution();
- Vector solution_vec (lp.solve (start));
+ Vector solution_vec (lp.solve (solution_try));
- positions->satisfies_constraints_b_ = check_constraints (solution_vec);
- if (!positions->satisfies_constraints_b_)
+ positions->satisfies_constraints_b_ = check_constraints (solution_vec);
+ if (!positions->satisfies_constraints_b_)
+ {
+ WARN << _("solution doesn't satisfy constraints.\n") ;
+ }
+ position_loose_cols (solution_vec);
+ positions->energy_f_ = calculate_energy_f (solution_vec);
+ positions->config = solution_vec;
+ positions->error_col_l_arr_ = error_pcol_l_arr();
+ }
+ else
{
- WARN << _("solution doesn't satisfy constraints.\n") ;
+ positions->set_stupid_solution (solution_try);
}
- position_loose_cols (solution_vec);
- positions->energy_f_ = calculate_energy_f (solution_vec);
- positions->config = solution_vec;
- positions->error_col_l_arr_ = error_pcol_l_arr();
-
}
/**
Array<Moment> &context_shortest_arr)
{
for (int i=0; i < cols.size(); i++)
- scol_l (i)->preprocess();
-
+ {
+ scol_l (i)->preprocess();
+ scol_l (i)->print ();
+ }
int start_context_i=0;
Moment context_shortest = infinity_mom;
context_shortest_arr.set_size(cols.size());
{
context_shortest = context_shortest <? scol_l(i)->durations[0];
}
+
// ji was j, but triggered ICE
for (int ji=i+1; ji --;)
{
Array<Moment> context_shortest_arr;
get_ruling_durations(shortest_playing_arr, context_shortest_arr);
+ Real interline_f = paper_l ()->interline_f ();
Array<Real> ideal_arr_;
Array<Real> hooke_arr_;
- for (int i=0; i < cols.size(); i++){
+ for (int i=0; i < cols.size() - 1; i++){
ideal_arr_.push (-1.0);
hooke_arr_.push (1.0);
}
+ /*
+ First do all non-musical columns
+ */
for (int i=0; i < cols.size(); i++)
{
- if (!scol_l (i)->musical_b())
+ if (!scol_l (i)->musical_b() && i+1 < cols.size())
{
Real symbol_distance =cols[i].width_[RIGHT] + 2 PT;
Real durational_distance = 0;
- if (i+1 < cols.size())
- {
+
Moment delta_t = scol_l (i+1)->when() - scol_l (i)->when () ;
Real k= paper_l()->arithmetic_constant(context_shortest_arr[i]);
if (delta_t)
durational_distance = paper_l()->duration_to_dist (delta_t,k);
symbol_distance += -cols[i+1].width_[LEFT];
- }
+
ideal_arr_[i] = symbol_distance >? durational_distance;
- hooke_arr_[i] = 2.0;
+ hooke_arr_[i] = 1; //2.0;
}
}
+
+ /*
+ Then musicals
+ */
for (int i=0; i < cols.size(); i++)
{
if (scol_l (i)->musical_b())
Real dist = paper_l()->duration_to_dist (shortest_playing_len, k);
dist *= delta_t / shortest_playing_len;
- /* all sorts of ugliness to avoid running into bars/clefs, but not taking
- extra space if this is not needed */
- if (!scol_l (i+1)->musical_b())
+ /*
+ According to [Ross] and [Wanske], and from what i've seen:
+
+ * whitespace at the begin of the bar should be fixed at
+ (about) one interline.
+ [Ross]:
+ when spacing gets real tight, a smaller fixed value may be
+ used, so that there are two discrete amounts of whitespace
+ possible at the begin of a bar; but this is not implemented
+ right now.
+
+ * whitespace at the end of the bar is the normal amount of
+ "hinterfleish" that would have been used, had there been
+ yet another note in the bar.
+ [Ross]:
+ some editors argue that the bar line should not take any
+ space, not to hinder the flow of music spaced around a bar
+ line.
+ [Ross] and [Wanske] do not suggest this, however. Further,
+ it introduces some spacing problems and think that it is ugly
+ too.
+ [jcn]
+ */
+
+ /*
+ first musical column of bar
+ */
+ if (i && scol_l (i - 1)->breakable_b_)
{
- Real minimum_dist = - cols[i+1].width_[LEFT] + 2 PT + cols[i].width_[RIGHT];
- if (ideal_arr_[i+1] + minimum_dist < dist)
- {
- ideal_arr_[i] = dist - ideal_arr_[i+1];
- // hooke_arr_[i+1] =1.0;
- } else {
- ideal_arr_[i] = minimum_dist;
- }
-
- } else
- ideal_arr_[i] = dist;
+ // fixed: probably should set minimum (rod/spring)?
+ cols[i-1].width_[RIGHT] += interline_f;
+ // should adjust dist too?
+ ideal_arr_[i-1] = ideal_arr_[i-1] >? interline_f;
+ }
+
+ /*
+ last musical column of bar
+ */
+ if (i + 1 < cols.size () && scol_l(i+1)->breakable_b_)
+ {
+ // hmm, how bout?
+ dist = dist >? interline_f;
+
+ /*
+ uhuh, this code looks fine, already?
+ someone was junking this last "hinterfleisch" whitespace?!
+
+ but this seems to be fixed now :-)
+ */
+ // set minimum rod
+ cols[i].width_[RIGHT] += interline_f;
+ }
+
+ // ugh, do we need this?
+ if (i < cols.size () - 1 && !scol_l (i + 1)->musical_b ())
+ {
+ Real minimum = -cols[i + 1].width_[LEFT] + cols[i].width_[RIGHT]
+ + interline_f / 2;
+ dist = dist >? minimum;
+ }
+ ideal_arr_[i] = dist;
}
}
- for (int i=0; i < ideal_arr_.size()-1; i++)
+ for (int i=0; i < ideal_arr_.size(); i++)
{
assert (ideal_arr_[i] >=0 && hooke_arr_[i] >=0);
connect (i, i+1, ideal_arr_[i], hooke_arr_[i]);
{
Real dy = paper ()->interbeam_f ();
Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim_.x ().length ();
- Real beamdy = paper ()->interline_f () / 2;
+ Real interline_f = paper ()->interline_f ();
+ Real beamdy = interline_f/2;
int beams_i = 0;
Real slope_f = paper ()->internote_f () / 4;
if (beam_l_) {
// huh?
- slope_f = 2 * beam_l_->slope_f;
+ slope_f = 2 * beam_l_->slope_f_;
// ugh, rather calc from Abbreviation_req
beams_i = beams_right_i_ >? beams_left_i_;
}
- paper ()->lookup_l ()->beam (slope_f, 20 PT);
+ paper ()->lookup_l ()->beam (slope_f, 20 PT, 1 PT);
Molecule beams;
- Atom a (paper ()->lookup_l ()->beam (slope_f, w));
+ Atom a (paper ()->lookup_l ()->beam (slope_f, w, .48 * interline_f));
a.translate (Offset(- w / 2, stem_end_f () - (w / 2 * slope_f)));
// ugh
#include "debug.hh"
#include "lookup.hh"
#include "misc.hh"
+#include "main.hh"
Atom
Lookup::beam_element (int sidx, int widx, Real slope) const
return bs;
}
+Atom
+Lookup::beam(Real &slope, Real width, Real y_thick) const
+{
+ if (postscript_global_b)
+ {
+ return ps_beam (slope, width, y_thick);
+ }
+ else
+ return tex_beam(slope, width);
+}
+
+Atom
+Lookup::ps_beam (Real slope, Real width, Real y_thickness)const
+{
+ Atom ret;
+ String ps(String (width) + " "+ String(slope)
+ + " " + String(y_thickness) + " draw_beam");
+ ret.tex_ = String("\\embeddedps{" + ps + "}");
+ ret.dim_[X_AXIS] = Interval(0, width);
+ ret.dim_[Y_AXIS] = Interval(0, slope * width + y_thickness);
+ return ret;
+}
+
Atom
-Lookup::beam (Real &slope, Real width) const
+Lookup::tex_beam (Real &slope, Real width) const
{
const Real MAX_SLOPE = 0.6;
const Real SLOPES = 20.0;
}
Atom
-Lookup::slur (int dy , Real &dx, Direction dir) const
+Lookup::ps_slur (Real dy , Real dx, Real dir) const
{
- assert (abs (dir) <= 1);
- if (dx < 0)
- {
- warning (_("Negative slur/tie length: ") + print_dimen (dx));
- dx = 4.0 PT;
- }
+ String ps = "\\embeddedps{\n";
+
+ ps += String_convert::double_str (dx) + " "
+ + String_convert::double_str (dy) + " "
+ + String_convert::double_str (dir) +
+ " draw_slur}";
+
+ String mf = "\\embeddedmf{\n";
+ mf += "input feta-sleur;\n";
+ mf += "draw_slur((0,0),";
+ mf += "(" + String_convert::double_str (dx) + ","
+ + String_convert::double_str (dy) + "),";
+ mf += String_convert::double_str (dir) + ");\n";
+ mf += "end.\n";
+ mf += "}\n";
Atom s;
- s.dim_[X_AXIS] = Interval (0, dx);
- s.dim_[Y_AXIS] = Interval (min (0, dy), max (0, dy));
-
- // duh
- // let's try the embedded stuff
-
- /* bool embedded_b = experimental_features_global_b;
- // embedded stuff still sucks for slurs
- */
- bool embedded_b = false;
- String embed;
- if (embedded_b)
- {
- Real fdy = dy*paper_l_->internote_f ();
- Real fdx = dx;
- String ps = "\\embeddedps{\n";
- // ugh, how bout " /draw_slur { ... } def "
- ps += String_convert::double_str (fdx) + " "
- + String_convert::double_str (fdy) + " "
- + String_convert::double_str (dir) +
- " draw_slur}";
-
- String mf = "\\embeddedmf{\n";
- mf += "input feta-sleur;\n";
- mf += "draw_slur((0,0),";
- mf += "(" + String_convert::double_str (fdx) + ","
- + String_convert::double_str (fdy) + "),";
- mf += String_convert::double_str (dir) + ");\n";
- mf += "end.\n";
- mf += "}\n";
-
- embed = ps + mf;
- }
+ s.tex_ = ps + mf;
+ return s;
+}
+Atom
+Lookup::tex_slur (int dy , Real &dx, Direction dir) const
+{
+ assert (abs (dir) <= 1);
+ Atom s;
Direction y_sign = (Direction) sign (dy);
bool large = abs (dy) > 8;
if (large)
{
s = big_slur (dy, dx, dir);
- if (embedded_b)
- {
- s.tex_ = "\\embeddedtex{\n" + s.tex_ + "\n}\n";
- s.tex_ += embed;
- }
return s;
}
Real orig_dx = dx;
assert (idx < 256);
f+=String ("{") + String (idx) + "}";
s.tex_ = f;
- if (embedded_b)
- {
- s.tex_ = "\\embeddedtex{\n" + s.tex_ + "\n}\n";
- s.tex_ += embed;
- }
-
s.translate_axis (dx/2, X_AXIS);
return s;
}
s.dim_ = mol.extent();
return s;
}
+
+
+Atom
+Lookup::slur (Real &dy_f , Real &dx, Direction dir) const
+{
+ if (dx < 0)
+ {
+ warning (_("Negative slur/tie length: ") + print_dimen (dx));
+ dx = 4.0 PT;
+ }
+ Atom s;
+
+ if (postscript_global_b)
+ s = ps_slur (dy_f, dx, dir);
+ else
+ {
+ Real nh = paper_l_->internote_f ();
+ int dy_i = (int) rint(dy_f / nh);
+
+ s = tex_slur (dy_i, dx, dir);
+ dy_f = dy_i * nh;
+ }
+
+ s.dim_[X_AXIS] = Interval (0, dx);
+ s.dim_[Y_AXIS] = Interval (0 <? dy_f, 0 >? dy_f);
+ return s;
+}
Text_spanner::set_support (Directional_spanner*d)
{
if (support_span_l_)
- remove_dependency (support_span_l_);
+ remove_dependency (support_span_l_);
support_span_l_ =d;
add_dependency (d);
}
+void
+Text_spanner::do_add_processing ()
+{
+ set_bounds (LEFT, support_span_l_->spanned_drul_[LEFT]);
+ set_bounds (RIGHT, support_span_l_->spanned_drul_[RIGHT]);
+}
Text_spanner::Text_spanner()
{
Tie::do_post_processing()
{
Real nw_f = paper()->note_width ();
+ Real space_f = paper()->interline_f ();
assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
Direction d = LEFT;
do
{
- pos_i_drul_[d] = (head_l_drul_[d])?
- head_l_drul_[d]->position_i_ : head_l_drul_[(Direction)-d]->position_i_;
+ dy_f_drul_[d] =
+ .5 *space_f * (head_l_drul_[d]
+ ? head_l_drul_[d]->position_i_
+ : head_l_drul_[(Direction)-d]->position_i_);
}
while ((d *= -1) != LEFT);
{
if (head_l_drul_[d] && head_l_drul_[d]->extremal_i_)
{
- pos_i_drul_[d] += 2*dir_;
- dx_f_drul_[d] += d * 0.25;
+ dy_f_drul_[d] += dir_ * space_f;
+ dx_f_drul_[d] += d * 0.25 * nw_f;
}
else if (head_l_drul_[d])
- dx_f_drul_[d] += d*0.5;
+ dx_f_drul_[d] += d*0.5 * nw_f;
else
{
- pos_i_drul_[d] = pos_i_drul_[(Direction) -d];
- dx_f_drul_[d] = -d
- *(spanned_drul_[d]->width ().length ()/nw_f -0.5);
+ dy_f_drul_[d] = dy_f_drul_[(Direction) -d];
+ dx_f_drul_[d] = -d *(spanned_drul_[d]->width ().length ()
+ -0.5* nw_f);
}
}
while ((d *= -1) != LEFT);
# list of distribution files:
#
SCRIPTS = configure configure.in install-sh aclocal.m4
-README_FILES = BUGS DEDICATION ANNOUNCE COPYING ONEWS NEWS README TODO \
+README_FILES = BUGS DEDICATION ANNOUNCE-0.1 ANNOUNCE COPYING ONEWS NEWS README TODO \
INSTALL.text AUTHORS.text
EXTRA_DISTFILES = .dstreamrc mudela-mode.el VERSION $(README_FILES) $(SCRIPTS) $(SYMLINKS)
MIDI file. Features include multiple staffs, meters,
clefs, keys, lyrics, versatile input-language,
cadenzas, beams, slurs, triplets.
-Keywords: music notation typesetting midi
+ It includes a nice font of musical symbols.
+Keywords: music notation typesetting midi fonts
Author: hanwen@stack.nl (Han-Wen Nienhuys)
jan@digicash.com (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
- 460k lilypond-@TOPLEVEL_VERSION@.tar.gz
+ 470k lilypond-@TOPLEVEL_VERSION@.tar.gz
Original-site: pcnov095.win.tue.nl /pub/lilypond/development/
- 460k lilypond-@TOPLEVEL_VERSION@.tar.gz
+ 470k lilypond-@TOPLEVEL_VERSION@.tar.gz
Copying-policy: GPL
End
clefs, keys, lyrics, versatile input-language,
cadenzas, beams, slurs, triplets.
-[you need the musixtex fonts to use LilyPond]
-
%prep
%setup
%build
-
- design macro for penstroke with rounded endings
- design decent macro for bulbed endings
+ - printer dependencies.
- y-refpoint for rests should be the 4th staffline (gclef: b')
- versioning
- lo-res fixes.
--- /dev/null
+%
+% autometric.mf -- administrative MF routines
+%
+% source file of the Feta (Font-En-Tja) pretty-but-neat music font
+%
+% (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+% Jan Nieuwenhuizen <jan@digicash.com>
+%
+% these macros help create ascii logging output
+% to automate generation of lily tables and tex backend
+% The output should be parsed by the mf-to-table script
+
+% font or database?
+def fet_beginfont(expr name,size) =
+ font_identifier:=name&decimal size;
+ font_size size;
+ message "@{font@:"&name&"@:"&decimal size&"@}";
+ message "";
+ enddef;
+
+def fet_endfont(expr name) =
+ message "@{tnof@:"&name&"@}";
+ message "";
+ enddef;
+
+% group or table?
+def fet_begingroup(expr name) =
+ message "@{group@:"&name&"@}";
+ message "";
+ begingroup
+enddef;
+
+def fet_endgroup(expr name) =
+ endgroup;
+ message "@{puorg@:"&name&"@}";
+ message "";
+enddef;
+
+def autometric_output_char=
+ message "@{char@:"&charnamestr&"@:"&decimal charcode&"@:"&decimal charbp&"@:"&decimal charwd&"@:"&decimal chardp&"@:"&decimal charht&"@:"&idstr&"@:"&texstr&"@}";
+enddef;
+
+def hround_pixels(expr sharped) = hround(sharped * hppp) enddef;
+def vround_pixels(expr sharped) = vround(sharped * vppp) enddef;
+
+
+
+def tand(expr alpha) =
+ (sind alpha/cosd alpha)
+ enddef;
+
+%breapth, width, depth, height
+% breapth x-depth
+def set_char_box(expr b_sharp, w_sharp, d_sharp,h_sharp) =
+ save scharbp, scharht, scharwd, schardp;
+
+ % some paranoia if someone calls set_char_box(charwd, charbp, .. )
+ scharbp := b_sharp;
+ scharht := h_sharp;
+ schardp := d_sharp;
+ scharwd := w_sharp;
+
+ charbp := scharbp;
+ charht := scharht;
+ chardp := schardp;
+ charwd := scharwd;
+
+ w := hround(w_sharp *hppp);
+ b := hround(b_sharp *hppp);
+ h := hround(h_sharp *vppp);
+ d := hround(d_sharp *vppp);
+enddef;
+
+def no_dimen_beginchar(expr c) =
+ begingroup
+ charcode := if known c: byte c else: 0; fi;
+ charic := 0;
+ clearxy;
+ clearit;
+ clearpen;
+ scantokens extra_beginchar;
+enddef;
+
+code:=-1;
+
+% starts just as plain mf's beginchar:
+% charcode,
+% and then adds:
+% charname see below
+% id index in lily's table
+% texstr name of tex macro in lily's table and tex backend
+
+% the dims are uninitialised; you should use set_char_box manually.
+def fet_beginchar(expr name, id_lit, texstr_lit) =
+ save texstr, idstr, charnamestr;
+ save charbp;
+ save w,b,h,d;
+ string texstr, idstr, charnamestr;
+ texstr := texstr_lit;
+ charnamestr := name;
+ idstr := id_lit;
+
+ no_dimen_beginchar(incr code) name;
+ enddef;
+
+
+def makebox_with_breapth(text r) =
+ for y = -d, 0, h: r((-b, y),(w,y)); endfor
+ for x = -b, 0, w: r((x, -d),(x, h)); endfor
+enddef;
+
+%
+% override plain endchar. We want a different box.
+%
+def breapth_endchar =
+ scantokens extra_endchar;
+ if proofing > 0: makebox_with_breapth(proofrule); fi
+ chardx := 10*(w + b);
+ shipit;
+ endgroup
+enddef;
+
+def fet_endchar=
+ autometric_output_char;
+ breapth_endchar;
+ enddef;
enddef;
-for h := 2 staffsize# step 2 pt# until (6 * staffsize#):
+for h := 2 staffsize# step 1 pt# until (6 * staffsize#):
draw_brace(h, interline# );
endfor
mode_setup;
font_setup;
-input autometric;
+input feta-autometric;
fet_beginfont("feta-din", 10);
num=-1;
xbar:=u;
-input ital-f;
+input feta-ital-f;
bar#:=17/36pt#; % lowercase bar thickness
slant:=.38; % tilt ratio $(\Delta x/\Delta y)$
font_setup;
xbar:=.4u;
-input ital-f;
+input feta-ital-f;
stem#:=54/36pt#; % lowercase stem breadth
hair#:=12/36pt#; % lowercase hairline breadth
vair#:=7/36pt#; % vertical diameter of hairlines
font_setup;
-input ital-p;
+input feta-ital-p;
slant:=.28; % tilt ratio $(\Delta x/\Delta y)$
%stem#:=38/36pt#; % lowercase stem breadth
font_setup;
-input ital-m;
-input ital-r;
-input ital-s;
-input ital-z;
+input feta-ital-m;
+input feta-ital-r;
+input feta-ital-s;
+input feta-ital-z;
font_slant slant; font_x_height x_height#;
--- /dev/null
+% ital-f.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter f";
+% beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
+\"Dynamic letter f";
+beginchar(incr num,max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#);
+italcorr asc_height#*slant+.75u#;
+adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib;
+numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,-d); theta=angle(z88-z89);
+pos0(flare,0); pos1(hair,0); pos2(vair,90);
+pos3(.5[hair,stem],180); pos4(stem,theta+90);
+pos5(stem,theta-90); pos6(.5[hair,stem],0);
+pos7(vair,-90); pos8(hair,-180); pos9(flare,-180);
+rt x1r=hround(w+.25u); lft x8r=hround-.35u; x2=.6[x1,x4]; x7=.6[x8,x5];
+y9-.5flare=vround -.85d; y2-y0=y9-y7; top y2r=h+oo; bot y7r=-d-oo;
+% y4=.25[x_height,h]; y5=.5[-d,y4];
+y4=x_height-.5bar; y5=y4;
+z4=whatever[z88,z89]; z5=whatever[z88,z89];
+x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.8[y4,y2]; y6=.8[y5,y7];
+bulb(2,1,0); bulb(7,8,9); % bulbs
+filldraw stroke z2e{left}...z3e...{z89-z88}z4e; % upper arc
+filldraw z4r--z5l--z5r--z4l--cycle; % stem
+filldraw stroke z5e{z89-z88}...z6e...{left}z7e; % lower arc
+pickup crisp.nib; pos20(bar,90); pos21(bar,90);
+top y20r=top y21r=x_height;
+%lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u;
+lft x20=lft x4r-.5stem-xbar; rt x21=rt x4l+.5stem+1.5xbar;
+filldraw stroke z20e--z21e; % crossbar
+math_fit(desc_depth#*slant+u#,x_height#*slant);
+penlabels(0,1,2,3,4,5,6,7,8,9,20,21,88,89); endchar;
--- /dev/null
+% ital-m.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter m";
+% beginchar("m",15u#,x_height#,0);
+\"Dynamic letter m";
+% beginchar(incr num,15u#,x_height#,0);
+beginchar(incr num,12u#,x_height#,0);
+italcorr 1/3x_height#*slant+.5hair#+.5u#;
+adjust_fit(if monospace:-1.5u#,-2u# else: 0,0 fi); pickup fine.nib;
+numeric shaved_stem; shaved_stem=mfudged.stem;
+save stem; stem=shaved_stem;
+pos2(stem,0); x1=x2;
+if monospace: pos1(stem,0); lft x1l=hround(2.5u-.5stem); top y1=h;
+else: x0=0; lft x2l=hround(2.5u-.5stem);
+ hook_in(0,a,1); fi % opening hook
+y2-.5stem=-oo; filldraw circ_stroke z2e--z1e; % left stem
+x4+.5stem=hround(.5w+.5stem); ital_arch(2,3,4); % left arch
+pos5(stem,0); y5=y2; x5=x4;
+filldraw circ_stroke z5e--z4e; % middle stem
+x7+.5stem=hround(w-2.5u+.5stem);
+x8=x7-.25u; ital_arch(5,6,7); % right arch
+if monospace: pos9(vair,90); x9=good.x .5[x8,w]; bot y9l=0; y8=1/3h;
+ pos8(stem,0); filldraw stroke z8e{-u,-x_height}...{right}z9e; % terminal
+else: x9=w; hook_out(8,b,9)(skewed); fi % closing hook
+filldraw stroke z7e{down}..{-u,-x_height}z8e; % right stem
+math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#);
+penlabels(0,a,1,2,3,4,5,6,7,8,9); endchar;
--- /dev/null
+% ital-p.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter p";
+% beginchar("p",9u#,x_height#,desc_depth#);
+\"Dynamic letter p";
+beginchar(incr num,9u#,x_height#,desc_depth#);
+italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
+adjust_fit(0,0); pickup fine.nib;
+x0=0; x2-.5stem=hround(2.5u-.5stem); hook_in(0,1,2); % opening hook
+pos4(hair,-180); pos5(vair,-90); pos6(curve,0); pos7(vair,90);
+x4=x2; rt x6r=hround(w-1.5u+.5curve); x5=x7=.5[x4,x6];
+bot y5r=-oo; top y7r=h+oo; y4=y6=.5[y5,y7];
+filldraw stroke super_arc.e(4,5) & pulled_arc.e(5,6)
+ & pulled_arc.e(6,7) & super_arc.e(7,4); % bowl
+pickup tiny.nib; pos2'(stem,0); pos3(stem,0);
+z2=z2'; x3=x2; bot y3=-d; filldraw stroke z2'e--z3e; % stem
+dish_serif(3,2',a,1/3,.75jut,b,1/3,jut); % serif
+math_fit(-min(2/3x_height#*slant-.5hair#-.5u#,
+ 2u#-.5stem#-desc_depth#*slant),ic#);
+penlabels(0,1,2,3,4,5,6,7); endchar;
--- /dev/null
+% ital-r.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter r";
+% beginchar("r",5.5u#+max(1.75u#,flare#),x_height#,0);
+\"Dynamic letter r";
+beginchar(incr num,5.5u#+max(1.75u#,flare#),x_height#,0);
+italcorr x_height#*slant;
+adjust_fit(if monospace:.25u#,.5u# else: 0,0 fi); pickup fine.nib;
+x0=0; x2=x3; pos3(stem,0); lft x3l=hround(2.5u-.5stem); y3-.5stem=-oo;
+hook_in(0,1,2); % opening hook
+filldraw circ_stroke z3e--z2e; % left stem
+pos3'(hair,180); z3'=z3; pos4(vair,90); pos5(hair,0); pos6(flare,0);
+x4=w-.5u-max(1.75u,flare); rt x5r=hround(r-.5u); top y4r=h+oo;
+filldraw stroke z3'e{up}...z4e{right}; % link
+y6+.5flare=vround(bot y4l-.03x_height); bulb(4,5,6); % bulb
+math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#-.5u#);
+penlabels(0,1,2,3,4,5,6); endchar;
--- /dev/null
+% ital-s.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+% not
+
+% cmchar "Italic letter s";
+% beginchar("s",5.25u#+max(1.75u#,flare#),x_height#,0);
+\"Dynamic letter s";
+beginchar(incr num,5.25u#+max(1.75u#,flare#),x_height#,0);
+italcorr x_height#*slant-.5u#;
+adjust_fit(0,0); pickup fine.nib;
+numeric theta; theta=90-angle(40u,h); slope:=-h/40u; % angle at middle
+pos2(vair,-90); pos0(max(fine.breadth,ess),theta); pos7(vair,-90);
+x2l=x0=x7=.5w; top y2l=h+oo; bot y7r=-oo;
+y0-.5ess=y7l+.55(y2r-y7l-ess);
+lft x3l=hround u-eps; rt x6r=hround(w-.5u)+eps;
+x3r-x3l=x6r-x6l=hround .5[vair,ess]-fine;
+ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
+ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
+interim superness:=more_super;
+filldraw stroke super_arc.e(2,3) & z3e{down}
+ ..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke
+pos1(hair,0); pos10(hround .75[hair,flare],0);
+pos2'(vair,90); z2'=z2;
+pos8(hair,-180); pos9(flare,-180);
+rt x10r=hround(w-u)+2eps; lft x9r=hround .5u-2eps; y10=.78h; y9=.25h;
+bulb(2',1,10); bulb(7,8,9); % bulbs
+math_fit(0,ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
--- /dev/null
+% ital-z.mf
+% from itall.mf
+%
+% Computer Modern Italic lower case:
+% This lowercase italic alphabet was prepared by D. E. Knuth in December, 1979,
+% inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
+% The programs were revised for the new \MF\ conventions in 1985.
+
+% Character codes \0141 through \0172 are generated.
+%not
+
+% cmchar "Italic letter z";
+% beginchar("z",5.5u#+max(1.5u#,stem#),x_height#,0);
+\"Dynamic letter z";
+beginchar(incr num,5.5u#+max(1.5u#,stem#),x_height#,0);
+italcorr x_height#*slant+.5hair#;
+adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib;
+pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0);
+lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u);
+top y1=.78h; top y2l=top y4=h+oo; y3=.825h;
+pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0);
+x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps);
+bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h;
+pair p; p=(z4-z5) yscaled 2;
+filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e; % upper bar
+filldraw stroke z5e{p}...z6e{right}..{right}z7e...{up}z8e; % lower bar
+filldraw stroke z5e{p}..{p}z4e; % diagonal
+math_fit(0,1/3x_height#*slant+.5hair#+.5u#);
+penlabels(1,2,3,4,5,6,7,8); endchar;
set_char_box(
left_space# +
- -xpart exact_center + 1.1 * breapth_factor* reduced_il#,
+ -xpart exact_center + 1.0 * breapth_factor* reduced_il#,
right_space# +
xpart exact_center + .66 breapth_factor* reduced_il#,
-ypart exact_center + 3 * reduced_il#,
test:=0;
-input autometric;
+input feta-autometric;
fet_beginfont("feta-nummer", size);
mode_setup;
slant = .2;
local_copy(transform)(currenttransform);
- currenttransform := currenttransform slanted slant;
+ currenttransform := currenttransform slanted slant shifted (- interline, 0) ;
y1 = ascender;
x1l = 0;
--- z9r{up}
.. z8r{left} .. z7r{z5-z7} -- cycle;
fill r_p;
- set_char_box(0,2 interline#, 0,ascender#);
+ set_char_box(interline# , interline#, 0,ascender#);
penpos11(1/4 r_fatness, -20);
% font_identifier:="font-en-tja16";
% font_size 16pt#;
-input autometric;
+input feta-autometric;
fet_beginfont("feta-test", 16);
staffsize#:=16pt#;
test:=1;
% font_identifier:="font-en-tja20";
% font_size 20pt#;
-input autometric;
+input feta-autometric;
fet_beginfont("feta-test", 20);
staffsize#:=20pt#;
test:=1;
% font_identifier:="font-en-tja16";
% font_size 16pt#;
-input autometric;
+input feta-autometric;
fet_beginfont("feta", 16);
staffsize#:=16pt#;
test:=0;
staffsize#:=20pt#;
-input autometric;
+input feta-autometric;
fet_beginfont("feta", 20);
% AFBLIJVEN! Gebruik feta-test16/20, anders verneuk je de distributie.
IMPORTANT
+ * if multiple channels per track: output each to separate voice
+
* get rid of (last few?) midi-specifics in mudela-*
* find / remove trend (tempo) of mudela columns
int i = str.index_i (':');
i = (i >=0 ? i : str.length_i ());
key.accidentals_i_ = String_convert::dec2_i (str.left_str (i));
- key.minor_i_ = (int)(bool)String_convert::dec2_i (str.mid_str (i + 1,1));
+ key.minor_i_ = (int)(bool)String_convert::dec2_i (str.cut (i + 1,1));
break;
}
case 'n':
if (!i)
i = str.length_i();
String word = str.left_str (i);
- str = str.mid_str (i, str.length_i());
+ str = str.cut (i, str.length_i());
output_wrapped (word);
}
return *this;
\font\dynfont=feta-din10 scaled \magstep1
\font\bracefont=feta-braces16
\font\fingerfont=feta-nummer4
+ \interlinedist=4pt
}
\def\fettwentydefs{
+ \interlinedist=5pt
\font\fontentja=feta20
\font\vetfont=feta-beams20
\font\fetanummer=feta-nummer10
\font\fingerfont=feta-nummer5
}
+\def\sixteenfonts{\fetsixteendefs\cmrsixteen}
+\def\twentyfonts{\fettwentydefs\cmrtwenty}
+
\def\fetdef#1#2{\def#1{%
\hbox{\fetchar{#2}}}}
% oeps: \meter 12/8;
\def\generalmeter#1#2{%
\vbox to 0pt{\vss%
- \hbox to0.45\balkheight{\hss\fetanummer #1\hss}%
+ \hbox to0.45\staffheight{\hss\fetanummer #1\hss}%
\nointerlineskip%
- \hbox to0.45\balkheight{\hss\fetanummer #2\hss}%
+ \hbox to0.45\staffheight{\hss\fetanummer #2\hss}%
\vss}}
\def\pianobrace#1{{\bracefont\char #1}}
-%
-% WARNING: don't leave blank lines in the PS-code; they are
-% transformed into \par
-%
-
-
-\def\turnOnPostScript{
-\def\embeddedps##1{
- %
- % This sets CTM so that you get to the currentpoint
- % by executing a 0 0 moveto
- \special{ps: @beginspecial @setspecial ##1 @endspecial}
-}
-\special{ps:
-/draw_decresc
- {
- /ht exch def
- /wd exch def
-%
- 0 ht moveto
- wd ht neg rlineto
- wd neg ht neg rlineto
- stroke
- }
- def
- /draw_cresc
- {
- /ht exch def
- /wd exch def
-%
- 0 0 moveto
- wd ht rmoveto
- wd neg ht neg rlineto
- wd ht neg rlineto
- stroke
- }
- def
-}
-}
-
-\def\turnOnExperimentalFeatures{
-% draw a slur in embedded postscript
-\special{ps:
-/xbow 1 3 div def
-/ybow 1 4 div def
-/thin 0.2 def
-/thick thin 5 mul def
-/draw_slur {
- % up or down?
- /dir exch def
-%
-% for mo*tex shift
-% exch
-% 1 copy /dx exch def
-% exch
-%
- % calc angle alpha
- 2 copy exch atan /alpha exch def
- % calc len(gth)
- 2 exp exch 2 exp add sqrt /len exch def
-%
- % add and calc z2, z3
- len xbow mul
- len ybow mul dir mul
- 1 xbow sub len mul
- len ybow mul dir mul
-%
- % add z4, z1
- len 0
- 0 0
-%
- % add and calc z5..z8
- 8 copy
- thin dir mul sub
- 8 2 roll
- thin dir mul sub
- 8 2 roll
- thick dir mul sub
- 8 2 roll
- thick dir mul sub
-%
- % reverse order, must be cycle
- 8 6 roll
- 6 2 roll
- 4 2 roll
- 8 6 roll
-%
- % set z1..z4
- 16 8 roll
-%
- alpha rotate
-% silly mo*tex convention
-% dx 2 div -1 mul 0 translate
- % draw z1..z4
- moveto curveto
- % draw z5..z8
- lineto curveto
- % cycle
- 0 0 lineto
- fill
-} def }
-}
-
+\input lily-ps-defs
\def\embeddedtex#1{#1}
\def\embeddedmf#1{
% dat heb je handig gedaan, lieverd!
\nometafont
%\nopostscript
-%\notex
+\notex
\def\EndLilyPondOutput{
\storeembedcount
--- /dev/null
+%
+% WARNING: don't leave blank lines in the PS-code; they are
+% transformed into \par
+%
+
+%
+% Should put in a lily-ps.ps header?
+%
+%
+
+%
+% header info (macros/defs, etc) should go into a \special{! ... },
+% note the ! sign. See dvips.info for details.
+%
+
+% Use of
+% /foo { operatorname } bind def
+%
+% ``compiles'' operatorname binding in the body of foo, making
+% the code faster, and more reliable (less flexible)
+
+
+% transplant a TeX dimension into the PS output.
+\def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}}
+
+\def\turnOnPostScript{
+\def\embeddedps##1{%
+ % This sets CTM so that you get to the currentpoint
+ % by executing a 0 0 moveto
+ \special{ps: @beginspecial @setspecial ##1 @endspecial}
+}
+
+%
+% width, slope, height
+%
+\special{! % round cappings
+1 setlinecap
+/draw_beam
+{
+ /beam_thick exch def
+ /beam_slope exch def
+ /beam_wd exch def
+ beam_slope beam_wd mul /beam_ht exch def
+ 0 0 moveto
+ beam_wd beam_ht rlineto
+ 0 beam_thick rlineto
+ 0 beam_thick lineto
+ closepath fill
+} bind def
+% PS helper: convert (0.2pt) to the token 0.2
+/settexdimen { /thestring exch def
+ thestring 0 thestring length 2 sub
+ getinterval
+ token
+ pop exch pop }
+def
+%
+/deftexdimen {
+ settexdimen
+ def
+} def
+}
+
+
+\PSsetTeXdimen{staffrulethickness}
+\PSsetTeXdimen{staffheight}
+\special{! %
+/draw_decresc
+ {
+ staffrulethickness setlinewidth
+ /cresc_cont exch def
+ /cresc_ht exch def
+ /cresc_wd exch def
+%
+ cresc_wd cresc_cont moveto
+ 0 cresc_ht lineto
+ stroke
+ cresc_wd cresc_cont neg moveto
+ 0 cresc_ht neg lineto
+ stroke
+ }
+ bind def
+ /draw_cresc
+ {
+ /cresc_cont exch def
+ /cresc_ht exch def
+ /cresc_wd exch def
+%
+ 0 cresc_cont moveto
+ cresc_wd cresc_ht lineto
+ stroke
+ 0 cresc_cont neg moveto
+ cresc_wd cresc_ht neg lineto
+ stroke
+ }
+ bind def
+ /lily_distance {
+ 1 copy mul exch 1 copy mul add sqrt
+ } bind def
+ staffheight 2 div
+ /slurhtlimit exch def
+ /slurratio 0.3333 def
+ %
+ % (b*ratio)/(1 + b / htlimit)
+ /getslurcontrol
+ {
+ slurhtlimit 90 div /slur_alpha exch def
+ slurratio 60 div slur_alpha div /slur_beta exch def
+ slur_beta mul 1 atan slur_alpha mul
+ } bind def
+ staffrulethickness 1.5 mul /slur_thick exch def
+ /draw_slur
+ {
+ staffrulethickness setlinewidth
+ 0 0 moveto
+ /slur_dir exch def
+ /slur_dy exch def
+ /slur_dx exch def
+ slur_dy slur_dx lily_distance /slur_b exch def
+ slur_b getslurcontrol
+ slur_dir mul /slur_ht exch def
+ slur_b getslurcontrol /slur_indent exch def
+%
+ slur_dy slur_dx atan rotate
+ slur_indent slur_ht
+ slur_b slur_indent sub slur_ht
+ slur_b 0
+ % pstack
+ rcurveto
+ %
+ slur_indent neg slur_ht slur_dir slur_thick mul sub
+ slur_indent slur_b sub slur_ht slur_dir slur_thick mul sub
+ slur_b neg 0
+ rcurveto
+ %
+ gsave
+ fill
+ grestore
+ stroke
+ } bind def}}
+
+
+
+
+\def\turnOnExperimentalFeatures{
+% draw a slur in embedded postscript
+\special{ps:
+}}
\newdimen\interlinedist
\newdimen\stemthickness
\newcount\n
-\newdimen\balkheight
+\newdimen\staffheight
\newdimen\notewidth
\newdimen\noteheight
\newdimen\staffrulethickness
% set fonts and primary dimensions
% ugh
\def\musixtwentydefs{
- \balkheight=20pt
+ \staffheight=20pt
\notewidth=7.15pt
\noteheight=5pt
- \musixtwentyfonts
- \font\textmusic=cmmi12
+ \twentyfonts
\musixcalc
}
+\def\cmrtwenty{
+ \font\meterfont=cmbx15
+ \font\italicfont=cmti10
+ \font\musicmathfont=cmsy10
+ \font\normaltextfont=cmr10 %\textfont is a primitive
+ \font\smalltextfont=cmr8
+}
+\def\cmrsixteen{
+ \font\smalltextfont=cmr6
+ \font\normaltextfont=cmr8 %\textfont is a primitive
+ \font\meterfont=cmbx12
+ \font\italicfont=cmti8
+ \font\textmusic=cmmi10
+}
\def\musixsixteendefs{
- \balkheight=16pt
+ \staffheight=16pt
\notewidth=5.93pt
\noteheight=4pt
- \musixsixteenfonts
- \font\textmusic=cmmi10
+ \sixteenfonts
\musixcalc
}
% this has to be synced with the font definition
\def\musixcalc{
- \interlinedist=\fontdimen5\musicfnt
\smallspace=.3\interlinedist
- \interstaffrule=\balkheight
+ \interstaffrule=\staffheight
\divide\interstaffrule by 4
% [D.K.Roush & J.S.Gourlay] say this should be 0.072
% stacked horizontal lines
\input dyndefs
+\input fetdefs
-\input taupindefs
+%\input taupindefs
%\input eglerdefs
\def\emptybar{}
-\def\defaultthinbar{\thinbar{\balkheight}}
-\def\defaultthickbar{\thickbar{\balkheight}}
+\def\defaultthinbar{\thinbar{\staffheight}}
+\def\defaultthickbar{\thickbar{\staffheight}}
%? what-s wrong with rightalign?
\def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\defaultthinbar\hskip\smallspace\defaultthickbar}}
\def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
-\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
+\def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern2\smallspace\repeatcolon}}
%compatibility
\def\repeatbar{\repeatstopbar}
\def\musixtwentyfonts{
- \font\normaltextfont=cmr10 %\textfont is a primitive
- \font\smalltextfont=cmr8
- \font\meterfont=cmbx15
+ \font\dynfont=cmbxti10 scaled \magstep2
\font\slurufont=xslu20
\font\slurdfont=xsld20
\font\slurhfont=xslz20
\font\hslurhfont=xslhz20
\font\musicfnt=musix20
\font\musicdraw=musixsps
- \font\italicfont=cmti10
- \font\dynfont=cmbxti10 scaled \magstep2
- \font\musicmathfont=cmsy10
\fettwentydefs
}
\def\musixsixteenfonts{
\font\normaltextfont=cmr8 %\textfont is a primitive
\font\smalltextfont=cmr6
- \font\meterfont=cmbx12
- \font\italicfont=cmti8
\font\slurufont=xslu16
\font\slurdfont=xsld16
\font\slurhfont=xslz20 % sigh
% \musicfnt\char\count0}}
-\input fetdefs