+++ /dev/null
-TOPLEVEL_MAJOR_VERSION = 0
-TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 77
-# use to send patches, always empty for released version:
-# include separator: ".postfix", "-pl" makes rpm barf
-
-TOPLEVEL_MY_PATCH_LEVEL = .jcn1
- We are proud to announce the birth of "GNU LilyPond 0.1", a.k.a.
+Subject: LilyPond 0.1 released - GNU Project music typesetter
- Lily 0.1
- born August 1, 1997
+ 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 335 kilobytes
+Lily is a healthy, bouncing baby weighing 340 kilobytes
Visiting hours: 24hrs a day at
-
ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe)
ftp://alpha.gnu.ai.mit.edu/pub/lilypond/lilypond-0.1.0.tar.gz (US)
-you can see some babyfood, diapers and pictures at
+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)
-
[ And now the serious part ]
Announcing
+\bo Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc
bugfixes, some Beam and Stem code.
+ +\bo Alexandre Oliva <oliva@dcc.unicamp.br>
+
Your name could be here! If you want to help, then take a
look at the SMALLISH PROJECTS section of in the file _\bT_\bO_\bD_\bO.
Some do not involve coding C++
-
-
-26/Jul/97 LilyPond 0.0.77 1
+30/Jul/97 LilyPond 0.0.77 1
[document reintroduced deficiencies.]
-midi instrument?
+wrong instrument:
+
+cad = \melodic { \id "Staff" "fr horn"; c4 }
+
+\score {
+ \melodic {\cad}
+}
+
*******************
'.' -> lilypond: lexer.l:258: int My_lily_lexer::yylex(): Assertion `cnv == 1' failed.
Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>, misc bugfixes, some
Beam and Stem code.
+=item *
+
+Alexandre Oliva <oliva@dcc.unicamp.br>
+
=back
Your name could be here! If you want to help, then take a look at the
the C<type> is a Hungarian notation postfix for C<Type>. See below
+=head2 MACROS
+
+
=head2 BROKEN CODE
# list of distribution files:
#
EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES)
+
default: do-doc
# don't do DVI files. They can only be made if lily is installed
html: $(HTMLFILES)
htmldist: html
- ./$(lily_bindir)/make_website
+ $(lily_bindir)/make_website
+dvi: $(DVIFILES)
# generic targets and rules:
#
-include ./$(depth)/make/Targets.make
-include ./$(depth)/make/Rules.make
+include $(depth)/make/Targets.make
+include $(depth)/make/Rules.make
#
localclean:
MAN1FILES = lilypond convert-mudela mi2mu mudela-book
MAN1GROFF = $(addprefix $(outdir)/, $(addsuffix .1,$(MAN1FILES)))
-localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5
- $(INSTALL) -d $(mandir)/man5
+localinstall: $(outdir)/lilypond.1
$(INSTALL) -d $(mandir)/man1
- $(INSTALL) -m 755 $(MAN1GROFF) $(mandir)/man1
+ $(INSTALL) -m 644 $(MAN1GROFF) $(mandir)/man1
localuninstall:
mv $(notdir $@) $(outdir)
$(outdir)/%.mudtex: %.doc
- $(depth)/bin/mudela-book --outdir=$(outdir)/ --outname=$(notdir $@) $<
-
+ $(binout)/mudela-book --outdir=$(outdir)/ --outname=$(notdir $@) $<
$(outdir)/%.text: $(outdir)/%.1
groff -man -Tascii $< > $@
=head1 NAME
-GNU LilyPond -- the Webpage
-
-Excuse me for this poor page. I don't really have time for doing this..
+The Homepage of LilyPond -- the GNU Project music typesetter
=head1 DESCRIPTION
-
-
GNU LilyPond is a program which converts music definition files into
visual or auditive output: it can typeset formatted sheet music to a
TeX file and and (mechanical) performances to MIDI files.
=back
-
=head2 The program
-
=over 5
-
-
-
=item *
<a href=TODO.txt
>
</a
>
-=item *
-Get LilyPond at ftp://pcnov095.win.tue.nl/pub/lilypond !
-
-
=item *
<a href=links.html
>
-B<download LilyPond> and other interesting links
+B<download> LilyPond and other interesting links
</a
>
[This is as close to the ``standard'' reference work for music
notation issues as one is likely to get. MB]
+K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle
+Verlag, Vienna 1948
+
MPA. Standard music notation specifications for computer programming.
December 1996
LilyPond is part of the GNU Project started by the Free Software
Foundation to create a system of free software for the world-community
-=item http://www.ssc.com/linux/
-
-The Number One Free OS-Kernel: Linux
-
-=item http:// /linux_soundapps.html
-
-Dave Philips' Linux sound applications page
-
-
=back
=head2 Ftp
mail with subject "subscribe" to
gnu-music-discuss-request@vuse.vanderbilt.edu,
-
=back
Announces of new versions will be sent to info-gnu-music and
gnu-music-discuss.
+=head2 Backlinks
+
+=over 4
+
+=item http://www.ssc.com/linux/
+
+The Number One Free OS-Kernel: Linux
+
+=item http://www.bright.net/~dlphilp/linux_soundapps.html
+
+Dave Philips' Linux sound applications page
+
+=item http://www.medieval.org/emfaq/scores/software.html
+
+More software for (early) music.
+
+=item http://www.emry.net/
+
+Linux webwatcher.
+
+=back
% -*-LaTeX-*-
+% this document should be run through the mudela-book script after lilypond
+% has been installed.
+
+
\documentclass{article}
\usepackage{a4wide}
\title{Mudela and LilyPond crash course}
\begin[verbatim]{mudela}
\score {
- \melodic { % { means voice
- c'4 g'4 % 4 means quaver, 1 beat in 4/4 meter
+ \melodic { % {...} is a voice
+ c'4 g'4 % c and g are pitches, 4 is the duration (quaver)
c''4 ''c4 % c' is 1 octave up, 'c 1 down.
- <c'4 g'4> % <> means a chord
+ <c'4 g'4> % <...> is a chord
}
}
\end{mudela}
% -*-latex-*-
+
+% this document should be run through the mudela-book script after lilypond
+% has been installed.
+
\documentclass{article}
\usepackage{a4wide}
\title{GNU LilyPond input format 0.1}
duration is one and a half quaver (\verb+4.+) times 2/3.
Notenames are just a special kind of identifiers, and can be declared
-for any language appropriate (see \file{dutch.ini}). The default language
+for any language appropriate (see \file{init/dutch.ly}). The default language
for notenames is defined to be dutch. In dutch, the notenames are
a,b,c,d,e,f and g. Sharps are formed by adding the extension "is",
flats by adding ``es''
Ties connect the noteheads of adjacent notes. They are entered as follows:
-\begin[fragment]{mudela}
-a4 ~ a4
+\begin[verbatim,fragment]{mudela}
+a'4 ~ a''4
\end{mudela}
Slurs connect whole chords, and try to avoid crossing stems. They are
entered as follows:
-\begin{verbatim}
-\begin[fragment]{mudela}
-a4( )a4
+\begin[verbatim,fragment]{mudela}
+a'4( )a''4
\end{mudela}
\subsection{Scripts}
Symbols which can be put at either side (above or below) of a staff
are entered as follows:
-\begin[fragment]{mudela}
+\begin[verbatim,fragment]{mudela}
a-^ % marcato, direction: default
a^- % portato, direction: above note
a_. % staccato, direction: below note
c-"marcato"
\end{mudela}
-If you want to define your own scripts refer to \file{script.ini} for
+If you want to define your own scripts refer to \file{init/script.ly} for
details.
- beams and stems
- scripts
-For the actual list, see the init file \file{register.ini}
+For the actual list, see the init file \file{init/register.ly}
Putting different musical lines in to the same voicegroup effectively
makes LilyPond try to form chords of all those lines. Putting
-pl 77.jcn1
- - init/*.ly in dist
- - bf: string-convert.cc: return local buf
- - bf: debug.cc: <new.h>
- - bf: template4.cc: #includes
+pl 78
+ - bf: Midi_instrument
+ - added enable/disable defaults to help.
+ - incredibly ugly NAME_MEMBERS(); bug. Immediately changed to
+DECLARE_MY_RUNTIME_TYPEINFO;
+ - \stem -1 -> \stem \down in input
+ - bf: slurchar index
+ - configure warnings
+ - preliminary stuff for multiarch building
+ - #!/usr/bin/perl fixes (AO)
+ - some Makefile cleanups: now faster.
+
+pl 77.jcn2
+ - Midi_instrument
+
+******
+july 29
pl 77
- some fixes for internal compiler errors
derive from Pointer_list with default dtor gives error with -O2
* dots into separate item.
+ * use String iso Text_def for lyrics.
+
+ * use position 0 for center of staff iso bottom.
+
* return status
* lyrics in chords still fuck up.
* Raw request syntax
- * subtime with Subtle_reqs
-
PROJECTS
* Do RTTI i.s.o. static_name(), name() and request-junk.
- Translators
- Complex mudela?
- * y -dims in internote?
+ * y -dims in internote? Staff-space? X-dimensions?
* merge Atom and Symbol?
--- /dev/null
+TOPLEVEL_MAJOR_VERSION = 0
+TOPLEVEL_MINOR_VERSION = 0
+TOPLEVEL_PATCH_LEVEL = 78
+# use to send patches, always empty for released version:
+# include separator: ".postfix", "-pl" makes rpm barf
+
+TOPLEVEL_MY_PATCH_LEVEL =
# bin/Makefile
-# subdir level:
-#
depth = ..
include $(depth)/make/Include.make
-# list of distribution files:
-SCRIPTS = clearlily cpgento genheader make_patch \
- lily.efence\
- make-version make-website release convert-mudela show-latest \
- mudela-book conflily
-EXTRA_DISTFILES = $(SCRIPTS)
+# list of distribution files:
+SCRIPTS = clearlily cpgento make_patch lily.efence \
+ make-version release conflily
+PERL_SCRIPTS_IN = $(wildcard *.in)
+PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.in=))
+EXTRA_DISTFILES = $(SCRIPTS) $(PERL_SCRIPTS_IN)
#
+all: $(PERL_SCRIPTS)
+
+$(outdir)/%: %.in
+# cd .. && CONFIG_FILES=bin/$(notdir $@) CONFIG_HEADERS= ./config.status
+# mv $(< :.in=) $@
+# this nukes make/out/Configure_variables.make.
+ sed 's!@PERL@!$(PERL)!' < $< > $@
+ chmod 755 $@
+
EXECUTABLES=convert-mudela mudela-book
localinstall: all
$(INSTALL) -d $(bindir)
- $(INSTALL) -m 755 convert-mudela $(bindir)
- $(INSTALL) -m 755 mudela-book $(bindir)
+ $(INSTALL) -m 755 $(outdir)/convert-mudela $(bindir)
+ $(INSTALL) -m 755 $(outdir)/mudela-book $(bindir)
localuninstall:
rm -f $(bindir)/convert-mudela $(bindir)/mudela-book
-#!/bin/bash
+#!/bin/sh
# conflily
# ugh: must be executed from lilypond-x.x.x (bin/conflily)
ln -s $lelie $HOME/lelie
fi
-rm $lelie/current >& /dev/null
+rm $lelie/current 2>&1 > /dev/null
current=`basename \`pwd\``
echo ln -s $lelie/$current $lelie/current
ln -s $lelie/$current $lelie/current
-ln -sf $lelie/current/lily/out/lilypond bin/lilypond
-ln -sf $lelie/current/mi2mu/out/mi2mu bin/mi2mu
+ln -sf $lelie/current/lily/out/lilypond bin/out/lilypond
+ln -sf $lelie/current/mi2mu/out/mi2mu bin/out/mi2mu
if [ "x$LILYINCLUDE" = "x" ]; then
- export LILYINCLUDE=$lelie/current/init
+ echo you should make add the following to your login script
+ echo "export LILYINCLUDE=$lelie/current/init"
+ echo "export PATH=$PATH:$lelie/current/bin/out/"
fi
configure --prefix=$root --enable-debugging --enable-printing --enable-checking
+++ /dev/null
-#!/usr/bin/perl -w
-
-=head1 TODO
-
- detect \lyrics and \melodic, and do substitution accordingly.
- count <> and {} ?
-
-Ugh . Perl sux. Anybody for Python?
-
-=cut
-
-
-
-#
-# version of "supporting" engine, not mudela conversions.
-#
-
-
-
-
-$convert_mudela_version = "0.1.1";
-
-use Getopt::Long;
-
-
-sub version_compare
-{
- local ($a,$b)=@_;
- return &cmpver;
-}
-
-
-sub cmpver
-{
- my(@a)= split /\./,$a;
- my(@b)= split /\./,$b;
-
- for $i (0,1,2) {
- return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
- }
- return $a cmp $b;
-}
-
-sub version_string_conv
-{
- my ($from_version, $to_version) = @_;
- s/\version \"$from_version\"/\version \"$to_version\"/g;
-}
-
-################################################################
-
-sub no_conv
-{
-}
-
-sub convert_0_0_52_to_0_0_53
-{
-
- s/include \"/$1\\include \"/g;
-}
-
-
-sub convert_0_0_54_to_0_0_55
-{
- s/%{/% {/g;
-}
-
-
-sub convert_0_0_53_to_0_0_54
-{
- print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ;
-}
-
-# we-re not at 58 yet, but this is at least one of the rules
-sub convert_0_0_55_to_0_0_56
-{
- s/\"\|\|\"/\"|.\"/g;
-}
-
-sub convert_0_0_56_to_0_0_57
-{
- s/\(([ \]\[|\t-\.>]|\\[<!>a-z]+)*\)/\~ $1/g;
-}
-
-sub convert_0_0_57_to_0_0_58
-{
- s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g;
-}
-
-sub convert_0_0_58_to_0_0_59
-{
- die "Not smart enough to convert 0.0.58 to 0.0.59\n";
-}
-
-sub convert_0_0_59_to_0_0_60
-{
- s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g;
- s/(\\output \"[^\"]+\")/$1;/;
- s/(\\tempo [0-9: ]+)/$1;/;
-}
-
-sub convert_0_0_60_to_0_0_61
-{
- s/(\\unitspace|\\geometric|\\width)/$1=/g;
-
-}
-
-###############################################################
-
-sub last_conversion
-{
- my @v = &versions;
- return pop @v;
-}
-sub identify
-{
-
- print STDERR "This is convert-mudela " . $convert_mudela_version .
- " (up to mudela version ", last_conversion, ")\n";
-}
-
-
- sub usage
- {
- print STDERR "Usage: convert-mudela [options] [mudela-file]...\n"
- . "Convert old mudela source from mudela-file or stdin\n\n"
- . "Options:\n"
- . " -e, --edit perform in-place conversion\n"
- . " -f, --from=PATHLEVEL use source version 0.0.PATCHLEVEL\n"
- . " -h, --help print this help\n"
- . " -o, --output=FILE name output file\n"
- . " -s, --show-rules print all known conversion rules\n"
- . " -t, --to=VERSION convert to version VERSION\n"
- }
-
-
-my %minor_conversions = ("0.0.50" => \&no_conv,
- "0.0.52" => \&convert_0_0_50_to_0_0_52,
- "0.0.53" => \&convert_0_0_52_to_0_0_53,
- "0.0.54" => \&convert_0_0_53_to_0_0_54,
- "0.0.55" => \&convert_0_0_54_to_0_0_55,
- "0.0.56" => \&convert_0_0_55_to_0_0_56,
- "0.0.57" => \&convert_0_0_56_to_0_0_57,
- "0.0.58" => \&convert_0_0_57_to_0_0_58,
- "0.0.59" => \&convert_0_0_58_to_0_0_59,
- "0.0.60" => \&convert_0_0_59_to_0_0_60,
- "0.0.61" => \&convert_0_0_60_to_0_0_61
- );
-
-
-sub versions
-{
- return (sort keys %minor_conversions);
-}
-
-
-sub show_rules
-{
- print "Rules: ", join(", ", sort keys %minor_conversions), "\n";
-
-}
-
-sub do_conversion
-{
- my ($from,$to) = @_;
-
- my @applicable_conversion;
- my @mudela_levels;
-
-# die "This is too old to convert " if $from < 50;
- my @v = versions;
- foreach $ver (@v) {
- if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){
- push @applicable_conversion, $minor_conversions{$ver};
- push @mudela_levels, $ver;
- }
- }
-
- print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n";
-
- while (<INLY>) {
- foreach $subroutine (@applicable_conversion) {
-
- &$subroutine;
-
- }
- version_string_conv $from, $to;
- print OUTLY;
- }
-}
-
-sub get_auto_from
-{
- my ($fn)=@_;
- my ($ver);
- open INLY, $fn || die "Can't open";
-
- while (<INLY>) {
- s/^.*\\version \"([^\"]*)\".*$//;
- if (defined ($1)) {
- print STDERR "Guessing version: ", $1, ".. ";
- $ver = $1;
- last;
- }
- }
- if (!defined($ver)){
- print STDERR "can't determine mudela version in $fn.\n";
- my $u;
- return $u;
- }
- close INLY;
- return $ver;
-}
-
-sub set_files
-{
- $infile = "-";
- $outfile = "-";
- $outfile = $opt_output if (defined($opt_output));
-
- if ($ARGV [0]) {
- $infile = $ARGV[0];
- }
- if (( ! -f $infile) && (! $infile =~ /\\.ly$/s ) ){
- $infile .= ".ly";
-
-
- }
- if ($opt_edit && $infile ne "-") {
- $opt_edit = 1;
- $outfile = "$infile.NEW";
- $infile = "$infile";
- }
- print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. ";
-
-}
-
-sub do_one_arg
-{
- set_files;
-
- local ($from_version, $to_version);
- $from_version = $opt_from;
- $to_version = $opt_to;
-
- ($from_version = get_auto_from $infile) unless defined($opt_from);
- return if (!defined($from_version));
-
- ($to_version = last_conversion) unless (defined($opt_to));
-
- die "can't open \`$infile\'" unless open INLY,$infile ;
- die "can't open \`$outfile\'" unless open OUTLY, ">$outfile";
-
- do_conversion $from_version, $to_version;
- close INLY;
- close OUTLY;
-
- if ($opt_edit) {
- rename $infile, "$infile~";
- rename $outfile, "$infile";
- }
-}
-
-## "main"
-
-identify;
-
-
-GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
-
-if ($opt_help) {
- usage();
- $opt_help = 0; # to extinguish typo check.
- exit 0;
-}
-
-if ($opt_show_rules) {
- show_rules ;
- $opt_show_rules = 0; # to extinguish typo check.
- exit 0;
-}
-
-local ( $infile,$outfile);
-my $processed_one=0;
-
-while (defined($ARGV[0])) {
- do_one_arg;
- shift @ARGV;
- $processed_one = 1;
-}
-do_one_arg unless ($processed_one);
-
-
--- /dev/null
+#!@PERL@ -w
+
+=head1 TODO
+
+ detect \lyrics and \melodic, and do substitution accordingly.
+ count <> and {} ?
+
+Ugh . Perl sux. Anybody for Python?
+
+=cut
+
+
+
+#
+# version of "supporting" engine, not mudela conversions.
+#
+
+
+
+
+$convert_mudela_version = "0.1.1";
+
+use Getopt::Long;
+
+
+sub version_compare
+{
+ local ($a,$b)=@_;
+ return &cmpver;
+}
+
+
+sub cmpver
+{
+ my(@a)= split /\./,$a;
+ my(@b)= split /\./,$b;
+
+ for $i (0,1,2) {
+ return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
+ }
+ return $a cmp $b;
+}
+
+sub version_string_conv
+{
+ my ($from_version, $to_version) = @_;
+ s/\version \"$from_version\"/\version \"$to_version\"/g;
+}
+
+################################################################
+
+sub no_conv
+{
+}
+
+sub convert_0_0_52_to_0_0_53
+{
+
+ s/include \"/$1\\include \"/g;
+}
+
+
+sub convert_0_0_54_to_0_0_55
+{
+ s/%{/% {/g;
+}
+
+
+sub convert_0_0_53_to_0_0_54
+{
+ print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ;
+}
+
+# we-re not at 58 yet, but this is at least one of the rules
+sub convert_0_0_55_to_0_0_56
+{
+ s/\"\|\|\"/\"|.\"/g;
+}
+
+sub convert_0_0_56_to_0_0_57
+{
+ s/\(([ \]\[|\t-\.>]|\\[<!>a-z]+)*\)/\~ $1/g;
+}
+
+sub convert_0_0_57_to_0_0_58
+{
+ s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g;
+}
+
+sub convert_0_0_58_to_0_0_59
+{
+ die "Not smart enough to convert 0.0.58 to 0.0.59\n";
+}
+
+sub convert_0_0_59_to_0_0_60
+{
+ s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g;
+ s/(\\output \"[^\"]+\")/$1;/;
+ s/(\\tempo [0-9: ]+)/$1;/;
+}
+
+sub convert_0_0_60_to_0_0_61
+{
+ s/(\\unitspace|\\geometric|\\width)/$1=/g;
+
+}
+
+###############################################################
+
+sub last_conversion
+{
+ my @v = &versions;
+ return pop @v;
+}
+sub identify
+{
+
+ print STDERR "This is convert-mudela " . $convert_mudela_version .
+ " (up to mudela version ", last_conversion, ")\n";
+}
+
+
+ sub usage
+ {
+ print STDERR "Usage: convert-mudela [options] [mudela-file]...\n"
+ . "Convert old mudela source from mudela-file or stdin\n\n"
+ . "Options:\n"
+ . " -e, --edit perform in-place conversion\n"
+ . " -f, --from=PATHLEVEL use source version 0.0.PATCHLEVEL\n"
+ . " -h, --help print this help\n"
+ . " -o, --output=FILE name output file\n"
+ . " -s, --show-rules print all known conversion rules\n"
+ . " -t, --to=VERSION convert to version VERSION\n"
+ }
+
+
+my %minor_conversions = ("0.0.50" => \&no_conv,
+ "0.0.52" => \&convert_0_0_50_to_0_0_52,
+ "0.0.53" => \&convert_0_0_52_to_0_0_53,
+ "0.0.54" => \&convert_0_0_53_to_0_0_54,
+ "0.0.55" => \&convert_0_0_54_to_0_0_55,
+ "0.0.56" => \&convert_0_0_55_to_0_0_56,
+ "0.0.57" => \&convert_0_0_56_to_0_0_57,
+ "0.0.58" => \&convert_0_0_57_to_0_0_58,
+ "0.0.59" => \&convert_0_0_58_to_0_0_59,
+ "0.0.60" => \&convert_0_0_59_to_0_0_60,
+ "0.0.61" => \&convert_0_0_60_to_0_0_61
+ );
+
+
+sub versions
+{
+ return (sort keys %minor_conversions);
+}
+
+
+sub show_rules
+{
+ print "Rules: ", join(", ", sort keys %minor_conversions), "\n";
+
+}
+
+sub do_conversion
+{
+ my ($from,$to) = @_;
+
+ my @applicable_conversion;
+ my @mudela_levels;
+
+# die "This is too old to convert " if $from < 50;
+ my @v = versions;
+ foreach $ver (@v) {
+ if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){
+ push @applicable_conversion, $minor_conversions{$ver};
+ push @mudela_levels, $ver;
+ }
+ }
+
+ print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n";
+
+ while (<INLY>) {
+ foreach $subroutine (@applicable_conversion) {
+
+ &$subroutine;
+
+ }
+ version_string_conv $from, $to;
+ print OUTLY;
+ }
+}
+
+sub get_auto_from
+{
+ my ($fn)=@_;
+ my ($ver);
+ open INLY, $fn || die "Can't open";
+
+ while (<INLY>) {
+ s/^.*\\version \"([^\"]*)\".*$//;
+ if (defined ($1)) {
+ print STDERR "Guessing version: ", $1, ".. ";
+ $ver = $1;
+ last;
+ }
+ }
+ if (!defined($ver)){
+ print STDERR "can't determine mudela version in $fn.\n";
+ my $u;
+ return $u;
+ }
+ close INLY;
+ return $ver;
+}
+
+sub set_files
+{
+ $infile = "-";
+ $outfile = "-";
+ $outfile = $opt_output if (defined($opt_output));
+
+ if ($ARGV [0]) {
+ $infile = $ARGV[0];
+ }
+ if (( ! -f $infile) && (! $infile =~ /\\.ly$/s ) ){
+ $infile .= ".ly";
+
+
+ }
+ if ($opt_edit && $infile ne "-") {
+ $opt_edit = 1;
+ $outfile = "$infile.NEW";
+ $infile = "$infile";
+ }
+ print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. ";
+
+}
+
+sub do_one_arg
+{
+ set_files;
+
+ local ($from_version, $to_version);
+ $from_version = $opt_from;
+ $to_version = $opt_to;
+
+ ($from_version = get_auto_from $infile) unless defined($opt_from);
+ return if (!defined($from_version));
+
+ ($to_version = last_conversion) unless (defined($opt_to));
+
+ die "can't open \`$infile\'" unless open INLY,$infile ;
+ die "can't open \`$outfile\'" unless open OUTLY, ">$outfile";
+
+ do_conversion $from_version, $to_version;
+ close INLY;
+ close OUTLY;
+
+ if ($opt_edit) {
+ rename $infile, "$infile~";
+ rename $outfile, "$infile";
+ }
+}
+
+## "main"
+
+identify;
+
+
+GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
+
+if ($opt_help) {
+ usage();
+ $opt_help = 0; # to extinguish typo check.
+ exit 0;
+}
+
+if ($opt_show_rules) {
+ show_rules ;
+ $opt_show_rules = 0; # to extinguish typo check.
+ exit 0;
+}
+
+local ( $infile,$outfile);
+my $processed_one=0;
+
+while (defined($ARGV[0])) {
+ do_one_arg;
+ shift @ARGV;
+ $processed_one = 1;
+}
+do_one_arg unless ($processed_one);
+
+
+++ /dev/null
-#!/usr/bin/perl -w
-
-# generate the standard header of a LilyPond source file.
-my $fn;
-
-sub
- do_init
-{
- $MAILADRESS=$ENV{MAILADRESS};
- @pw=(getpwuid($<));
- $username=$pw[6];
-
- die "arg needed\n" if (!($#ARGV+1));
- $fn = $ARGV[0];
-
- $hh_b = ($fn =~ /hh$/ );
- $inc_b= ($hh_b || $fn =~ /[ti]cc$/);
-}
-
-sub
- do_head
-{
-
- my $what="implement ";
- $what = "declare " if ($hh_b);
- my ($PROJECT, $cwd);
- $PROJECT = "the GNU LilyPond music typesetter";
- chop($cwd = `pwd`);
-
- $PROJECT= "the Flower Library" if ($cwd =~ /flower/);
-
- my $headstr ="/*
- $fn -- $what
-
- source file of $PROJECT
-
- (c) 1997 $username <$MAILADRESS>
-*/\n";
- print $headstr;
-}
-sub do_inc
-{
- my $headstr="";
- my $startdef= $fn;
- $startdef =~ s/[\.-]/_/g;
- $startdef =~ tr/a-z/A-Z/;
- my $terminatestr="\n";
-
- if ($inc_b) {
- $headstr = "\n\n#ifndef $startdef\n#define $startdef\n";
- $terminatestr .= "#endif // $startdef\n"
- }
-
- print $headstr, $terminatestr;
-}
-do_init;
-do_head;
-do_inc;
-
-
--- /dev/null
+#!@PERL@ -w
+
+# generate the standard header of a LilyPond source file.
+my $fn;
+
+sub
+ do_init
+{
+ $MAILADRESS=$ENV{MAILADRESS};
+ @pw=(getpwuid($<));
+ $username=$pw[6];
+
+ die "arg needed\n" if (!($#ARGV+1));
+ $fn = $ARGV[0];
+
+ $hh_b = ($fn =~ /hh$/ );
+ $inc_b= ($hh_b || $fn =~ /[ti]cc$/);
+}
+
+sub
+ do_head
+{
+
+ my $what="implement ";
+ $what = "declare " if ($hh_b);
+ my ($PROJECT, $cwd);
+ $PROJECT = "the GNU LilyPond music typesetter";
+ chop($cwd = `pwd`);
+
+ $PROJECT= "the Flower Library" if ($cwd =~ /flower/);
+
+ my $headstr ="/*
+ $fn -- $what
+
+ source file of $PROJECT
+
+ (c) 1997 $username <$MAILADRESS>
+*/\n";
+ print $headstr;
+}
+sub do_inc
+{
+ my $headstr="";
+ my $startdef= $fn;
+ $startdef =~ s/[\.-]/_/g;
+ $startdef =~ tr/a-z/A-Z/;
+ my $terminatestr="\n";
+
+ if ($inc_b) {
+ $headstr = "\n\n#ifndef $startdef\n#define $startdef\n";
+ $terminatestr .= "#endif // $startdef\n"
+ }
+
+ print $headstr, $terminatestr;
+}
+do_init;
+do_head;
+do_inc;
+
+
#shift;
if test "x$1" = x;
then
- versionfile=".version"
+ versionfile="VERSION"
else
versionfile=$1;
fi
+++ /dev/null
-#!/usr/bin/perl -w
-# stupid script to generate WWW site.
-
-use FileHandle;
-use Getopt::Long;
-my $lily_version;
-my $footstr;
-my $mw_id = "<!make_website!>";
-my $id_str = "make-website 0.3";
-
-my $TAR="tar";
-my $MAKE="make";
-
-sub get_version
-{
- my ($vstr)=("");
- open V, "$depth/.version";
- while (<V>) {
- s/#.*$//g;
- next if (/^ *$/);
- s/^/\$/;
- s/= *(.*)$/=\"$1\";/;
- $vstr .= $_;
- }
- eval ($vstr);
-
- $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
-
- # stupid checks.
- $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
-
-
- close V;
-}
-
-sub set_html_footer
-{
- my $MAILADRESS=$ENV{MAILADRESS};
- my @pw=(getpwuid($<));
- my $username=$pw[6];
-
- $footstr =
- "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
-<font size=-1>
-This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
-<p>
-<address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
-<p>" . `date` . "
-<p></font>";
-}
-
-
-# do something, check return status
-sub my_system
-{
- my (@cmds) = @_;
- foreach $cmd (@cmds) {
- my ($ignoreret)=0;
- if ( $cmd =~ /^-/ ) {
- $ignoreret = 1;
- $cmd = substr ($cmd, 1);
- }
-
- my $ret = ( system ($cmd));
- if ($ret) {
- if ($ignoreret) {
- print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
- }else {
- print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
- exit 2;
- }
- }
- }
-}
-
-
-local $base="lilypond/";
-local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
- "scsii-menuetto", "collisions", "cadenza", "scales");
-
-# rhythm, scales,
-
-
-sub gen_html
-{
- print "generating HTML\n";
- my_system "$MAKE -kC .. html";
-}
-
-sub gen_examples
-{
- print "generating examples: \n";
- my @todo=();
- foreach $a (@examples) {
- push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
- }
-
- my_system ("$MAKE -C .. " . join(' ', @todo));
-}
-
-my @texstuff = ("mudela-man", "mudela-course");
-
-sub gen_manuals
-{
- print "generating TeX doco list\n";
- open HTMLLIST, ">tex_manuals.html";
- print HTMLLIST "<html><body><title>LilyPond manuals in TeX</title>\n" .
- "<ul>\n";
- my @todo=();
- foreach $a (@texstuff) {
- push @todo , "out/$a.ps.gz";
- print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
- }
- print HTMLLIST "</ul>";
- close HTMLLIST;
-
- my_system( "$MAKE -C .. " . join(' ', @todo));
-}
-
-sub gen_list
-{
- print "generating HTML list\n";
- open HTMLLIST, ">example_output.html";
- print HTMLLIST "<html><body><title>LilyPond examples</title>\n
-These example files are taken from the LilyPond distribution.\n
-LilyPond currently only outputs TeX and MIDI. The pictures and\n
- PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
-The GIF files have been scaled to eliminate aliasing.";
- foreach $a (@examples) {
- $name=$a;
- print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
-
- open IF, "$depth/input/$a.ly";
- input_record_separator IF "%}";
-
- $desc = <IF>;
- close IF;
-
- print HTMLLIST "$desc\n</XMP>";
-
- $inputf="$a.ly.txt";
- $giff="$a.gif";
- $jpegf="$a.jpeg";
- $pngf = "$a.png";
- $psf="$a.ps.gz";
- $midif="$a.midi";
-
- print HTMLLIST "<ul>";
-
- print HTMLLIST "<li><a href=$inputf> The input file</a>"
- if ( -f $inputf );
-
- print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
- if ( -f $giff );
-
- print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
- if ( -f $psf );
-
- print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
- if ( -f $midif );
- print HTMLLIST "</ul>";
- }
- print HTMLLIST "</BODY></HTML>";
- close HTMLLIST;
-}
-
-sub edit_html
-{
- print STDERR "adding footer\n";
-
- OUTER:
- foreach $a (<*.html>) {
- open H, "$a";
- my $sep="</BODY>";
- input_record_separator H $sep;
- my $file="";
-
- while (<H>) {
- if (/$mw_id/) {
- close H;
- next OUTER;
- }
- $file .= $_;
-
- }
- close H;
-
- my $subst = $footstr;
- $subst .= $back if (! $a =~ /index.html/ );
- $file =~ s/$sep/$subst$sep/g ;
- $file =~ s/\.gif/\.$image/g;
- open H, ">$a";
- print H $mw_id;
- print H $file;
- close H;
- }
-}
-
-sub copy_txt_file
-{
- my ($f) = @_;
- my $d = $f;
- $d =~ s!^.*\/!!;
- if (! $f =~ /.txt$/) {
- $d = "$f.txt";
- }
- print $f, $d;
-}
-
-sub copy_files
-{
- print "copying files\n";
- print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
- my_system "cp $depth/TODO ./TODO.txt",
- "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
- "cp $depth/NEWS ./NEWS.txt",
- "cp $depth/DEDICATION ./DEDICATION.txt",
- "cp ../lelie*gif .";
-}
-
-sub set_images
-{
- for $a (<*.gif>) {
- if ($opt_png) {
- my_system "gif2png -d $a";
- }
- if ($opt_jpeg) {
- my $b=$a;
- $b =~ s/.gif/.jpeg/;
- my_system "cjpeg -o $b $a";
- }
- }
-}
-
-sub docxx_update
-{
- my_system "$MAKE -C $depth doc++";
-}
-
-sub do_tar
-{
- print "tarring.\n";
- $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
- my_system
- "-$TAR zvhcf website.tar.gz $files;",
-# "gzip -f9 website.tar;";
-}
-
-sub identify
-{
- print STDERR "This is " . $id_str . "\n";
-
-}
-sub main
-{
- identify;
- GetOptions("jpeg", "gif", "png", "noexamples");
-
- local $image="gif" ;
- $image = "png" if ($opt_png);
- $image = "jpeg" if ($opt_jpeg);
-
- $depth = "../";
- my $cwd;
- chomp($cwd = `pwd`);
- die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
- get_version;
- set_html_footer;
-
-
- $depth = "../../";
-
- chdir ("out");
- $ENV{"TEXINPUTS"} .= ":$depth/input/:";
- $ENV{"LILYINCLUDE"} = "$depth/input/";
-
-
- gen_html;
- copy_files;
- if (! $opt_noexamples) {
- gen_examples;
- gen_list;
- }
- gen_manuals;
- set_images;
-
- edit_html;
- docxx_update;
- do_tar;
-}
-
-main;
--- /dev/null
+#!@PERL@ -w
+# stupid script to generate WWW site.
+
+use FileHandle;
+use Getopt::Long;
+my $lily_version;
+my $footstr;
+my $mw_id = "<!make_website!>";
+my $id_str = "make-website 0.3";
+
+my $TAR="tar";
+my $MAKE="make";
+
+sub get_version
+{
+ my ($vstr)=("");
+ open V, "$depth/VERSION";
+ while (<V>) {
+ s/#.*$//g;
+ next if (/^ *$/);
+ s/^/\$/;
+ s/= *(.*)$/=\"$1\";/;
+ $vstr .= $_;
+ }
+ eval ($vstr);
+
+ $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
+
+ # stupid checks.
+ $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL";
+
+
+ close V;
+}
+
+sub set_html_footer
+{
+ my $MAILADRESS=$ENV{MAILADRESS};
+ my @pw=(getpwuid($<));
+ my $username=$pw[6];
+
+ $footstr =
+ "\n<hr>Please take me <a href=index.html>back to the index</a>\n<hr>
+<font size=-1>
+This page was generated by <code>" . $id_str . "</code> from lilypond-$lily_version by
+<p>
+<address><br>$username <a href=mailto:$MAILADRESS><<!bla>$MAILADRESS</a>></address>
+<p>" . `date` . "
+<p></font>";
+}
+
+
+# do something, check return status
+sub my_system
+{
+ my (@cmds) = @_;
+ foreach $cmd (@cmds) {
+ my ($ignoreret)=0;
+ if ( $cmd =~ /^-/ ) {
+ $ignoreret = 1;
+ $cmd = substr ($cmd, 1);
+ }
+
+ my $ret = ( system ($cmd));
+ if ($ret) {
+ if ($ignoreret) {
+ print STDERR "ignoring failed command \`$cmd\' (status $ret)\n";
+ }else {
+ print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n";
+ exit 2;
+ }
+ }
+ }
+}
+
+
+local $base="lilypond/";
+local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E",
+ "scsii-menuetto", "collisions", "cadenza", "scales");
+
+# rhythm, scales,
+
+
+sub gen_html
+{
+ print "generating HTML\n";
+ my_system "$MAKE -kC .. html";
+}
+
+sub gen_examples
+{
+ print "generating examples: \n";
+ my @todo=();
+ foreach $a (@examples) {
+ push @todo, "out/$a.ps.gz", "out/$a.gif", "out/$a.ly.txt";
+ }
+
+ my_system ("$MAKE -C .. " . join(' ', @todo));
+}
+
+my @texstuff = ("mudela-man", "mudela-course");
+
+sub gen_manuals
+{
+ print "generating TeX doco list\n";
+ open HTMLLIST, ">tex_manuals.html";
+ print HTMLLIST "<html><body><title>LilyPond manuals in TeX</title>\n" .
+ "<ul>\n";
+ my @todo=();
+ foreach $a (@texstuff) {
+ push @todo , "out/$a.ps.gz";
+ print HTMLLIST "<li><a href=$a.ps.gz>$a.ps.gz</a>";
+ }
+ print HTMLLIST "</ul>";
+ close HTMLLIST;
+
+ my_system( "$MAKE -C .. " . join(' ', @todo));
+}
+
+sub gen_list
+{
+ print "generating HTML list\n";
+ open HTMLLIST, ">example_output.html";
+ print HTMLLIST "<html><body><title>LilyPond examples</title>\n
+These example files are taken from the LilyPond distribution.\n
+LilyPond currently only outputs TeX and MIDI. The pictures and\n
+ PostScript files were generated using TeX, Ghostscript and some graphics tools. \n
+The GIF files have been scaled to eliminate aliasing.";
+ foreach $a (@examples) {
+ $name=$a;
+ print HTMLLIST "<h1>example file: $name</h1>\n<XMP>\n";
+
+ open IF, "$depth/input/$a.ly";
+ input_record_separator IF "%}";
+
+ $desc = <IF>;
+ close IF;
+
+ print HTMLLIST "$desc\n</XMP>";
+
+ $inputf="$a.ly.txt";
+ $giff="$a.gif";
+ $jpegf="$a.jpeg";
+ $pngf = "$a.png";
+ $psf="$a.ps.gz";
+ $midif="$a.midi";
+
+ print HTMLLIST "<ul>";
+
+ print HTMLLIST "<li><a href=$inputf> The input file</a>"
+ if ( -f $inputf );
+
+ print HTMLLIST "<li><a href=$giff>The output (picture)</a>"
+ if ( -f $giff );
+
+ print HTMLLIST "<li><a href=$psf>The output (PS)</a>\n"
+ if ( -f $psf );
+
+ print HTMLLIST "<li><a href=$midif>The output (MIDI)</a>\n"
+ if ( -f $midif );
+ print HTMLLIST "</ul>";
+ }
+ print HTMLLIST "</BODY></HTML>";
+ close HTMLLIST;
+}
+
+sub edit_html
+{
+ print STDERR "adding footer\n";
+
+ OUTER:
+ foreach $a (<*.html>) {
+ open H, "$a";
+ my $sep="</BODY>";
+ input_record_separator H $sep;
+ my $file="";
+
+ while (<H>) {
+ if (/$mw_id/) {
+ close H;
+ next OUTER;
+ }
+ $file .= $_;
+
+ }
+ close H;
+
+ my $subst = $footstr;
+ $subst .= $back if (! $a =~ /index.html/ );
+ $file =~ s/$sep/$subst$sep/g ;
+ $file =~ s/\.gif/\.$image/g;
+ open H, ">$a";
+ print H $mw_id;
+ print H $file;
+ close H;
+ }
+}
+
+sub copy_txt_file
+{
+ my ($f) = @_;
+ my $d = $f;
+ $d =~ s!^.*\/!!;
+ if (! $f =~ /.txt$/) {
+ $d = "$f.txt";
+ }
+ print $f, $d;
+}
+
+sub copy_files
+{
+ print "copying files\n";
+ print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ;
+ my_system "cp $depth/TODO ./TODO.txt",
+ "cp $depth/ANNOUNCE ./ANNOUNCE.txt",
+ "cp $depth/NEWS ./NEWS.txt",
+ "cp $depth/DEDICATION ./DEDICATION.txt",
+ "cp ../lelie*gif .";
+}
+
+sub set_images
+{
+ for $a (<*.gif>) {
+ if ($opt_png) {
+ my_system "gif2png -d $a";
+ }
+ if ($opt_jpeg) {
+ my $b=$a;
+ $b =~ s/.gif/.jpeg/;
+ my_system "cjpeg -o $b $a";
+ }
+ }
+}
+
+sub docxx_update
+{
+ my_system "$MAKE -C $depth doc++";
+}
+
+sub do_tar
+{
+ print "tarring.\n";
+ $files = join (' ', < *.html *.$image *.ps.gz *.txt *.midi docxx/*>);
+ my_system
+ "-$TAR zvhcf website.tar.gz $files;",
+# "gzip -f9 website.tar;";
+}
+
+sub identify
+{
+ print STDERR "This is " . $id_str . "\n";
+
+}
+sub main
+{
+ identify;
+ GetOptions("jpeg", "gif", "png", "noexamples");
+
+ local $image="gif" ;
+ $image = "png" if ($opt_png);
+ $image = "jpeg" if ($opt_jpeg);
+
+ $depth = "../";
+ my $cwd;
+ chomp($cwd = `pwd`);
+ die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/));
+ get_version;
+ set_html_footer;
+
+
+ $depth = "../../";
+
+ chdir ("out");
+ $ENV{"TEXINPUTS"} .= ":$depth/input/:";
+ $ENV{"LILYINCLUDE"} = "$depth/input/";
+
+
+ gen_html;
+ copy_files;
+ if (! $opt_noexamples) {
+ gen_examples;
+ gen_list;
+ }
+ gen_manuals;
+ set_images;
+
+ edit_html;
+ docxx_update;
+ do_tar;
+}
+
+main;
+++ /dev/null
-#!/usr/bin/perl -w
-my $mudcount = 0;
-my $mudela_b = 0;
-my $outdir = "";
-my $outname = "";
-use Getopt::Long;
-
-sub gen_mufile
-{
- return "$outdir/$outname$mudcount.ly";
-}
-
-sub gen_texfile
-{
- return "$outdir/$outname$mudcount.tex";
-}
-
-sub close_mudela
-{
- $mudela_b = 0;
- if ($fragment_b) {
- print MUDELA "}\n \\paper { linewidth = -1.0\\cm; } }\n";
- $fragment_b =0;
- }
- if ( $verbatim_b) {
- print BOOK "\\end{verbatim}\n\\interexample";
- $verbatim_b =0;
- }
- close MUDELA;
- my $status =0;
- if ( -f gen_mufile ) {
- $status = system "diff -q $outdir/book-mudela.ly " . gen_mufile;
- } else {
- $status = 1;
- }
- if ( $status ) {
- rename "$outdir/book-mudela.ly", gen_mufile;
- unlink gen_texfile;
- }
-
- if ( ! -f gen_texfile) {
- system "lilypond ". gen_mufile;
- rename "lelie.tex", gen_texfile;
- }
- print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n";
-
-}
-
-sub open_mudela
-{
- $mudcount++;
- $mudela_b = 1 ;
- open MUDELA, ">$outdir/book-mudela.ly";
- if ($verbatim_b) {
- print BOOK "\\begin{verbatim}\n";
- }
- if ($fragment_b) {
- print MUDELA "\\score { \\melodic {";
- }
-
-}
-
-sub begin_b
-{
- my ($s) = @_;
- return (/^\\begin{$s}/) ;
-}
-
-sub end_b
-{
- my ($s) = @_;
- return (/^\\end{$s}/) ;
-}
-sub parse_mudela_opts
-{
- my ($s) = @_;
- $s =~ s/[\[\]]//g;
-
- $verbatim_b =1 if ($s =~ /verbatim/ );
- $fragment_b = 1 if ($s =~ /fragment/ );
-}
-
-sub main
-{
- GetOptions( 'outdir=s', 'outname=s');
- $outdir = $opt_outdir;
- $outname = $opt_outname if (defined ($opt_outname) && $opt_outname);
- open INFILE, $ARGV[0];
-
- open BOOK, ">$outdir/$outname";
- while (<INFILE>) {
- if ($mudela_b) {
- if (end_b "mudela") {
- close_mudela;
- next;
- }
- print MUDELA;
- if ( $verbatim_b ) {
- my $s = $_;
- $s =~ s/\t/ /g; #shit
- print BOOK $s;
- }
-
- } else {
- if (/^\\begin(\[.*\])?{mudela}/ ) {
- my $opts ="";
- $opts = $1 if ( defined ($1));
-
- parse_mudela_opts($opts);
- open_mudela;
- next;
- }
- print BOOK;
- }
- }
- close INFILE;
- close BOOK;
-}
-
-main;
--- /dev/null
+#!@PERL@ -w
+my $mudcount = 0;
+my $mudela_b = 0;
+my $outdir = "";
+my $outname = "";
+use Getopt::Long;
+
+sub gen_mufile
+{
+ return "$outdir/$outname$mudcount.ly";
+}
+
+sub gen_texfile
+{
+ return "$outdir/$outname$mudcount.tex";
+}
+
+sub close_mudela
+{
+ $mudela_b = 0;
+ if ($fragment_b) {
+ print MUDELA "}\n \\paper { linewidth = -1.0\\cm; } }\n";
+ $fragment_b =0;
+ }
+ if ( $verbatim_b) {
+ print BOOK "\\end{verbatim}\n\\interexample";
+ $verbatim_b =0;
+ }
+ close MUDELA;
+ my $status =0;
+ if ( -f gen_mufile ) {
+ $status = system "diff -q $outdir/book-mudela.ly " . gen_mufile;
+ } else {
+ $status = 1;
+ }
+ if ( $status ) {
+ rename "$outdir/book-mudela.ly", gen_mufile;
+ unlink gen_texfile;
+ }
+
+ if ( ! -f gen_texfile) {
+ system "lilypond ". gen_mufile;
+ rename "lelie.tex", gen_texfile;
+ }
+ print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n";
+
+}
+
+sub open_mudela
+{
+ $mudcount++;
+ $mudela_b = 1 ;
+ open MUDELA, ">$outdir/book-mudela.ly";
+ if ($verbatim_b) {
+ print BOOK "\\begin{verbatim}\n";
+ }
+ if ($fragment_b) {
+ print MUDELA "\\score { \\melodic {";
+ }
+
+}
+
+sub begin_b
+{
+ my ($s) = @_;
+ return (/^\\begin{$s}/) ;
+}
+
+sub end_b
+{
+ my ($s) = @_;
+ return (/^\\end{$s}/) ;
+}
+sub parse_mudela_opts
+{
+ my ($s) = @_;
+ $s =~ s/[\[\]]//g;
+
+ $verbatim_b =1 if ($s =~ /verbatim/ );
+ $fragment_b = 1 if ($s =~ /fragment/ );
+}
+
+sub main
+{
+ GetOptions( 'outdir=s', 'outname=s');
+ $outdir = $opt_outdir;
+ $outname = $opt_outname if (defined ($opt_outname) && $opt_outname);
+ open INFILE, $ARGV[0];
+
+ open BOOK, ">$outdir/$outname";
+ while (<INFILE>) {
+ if ($mudela_b) {
+ if (end_b "mudela") {
+ close_mudela;
+ next;
+ }
+ print MUDELA;
+ if ( $verbatim_b ) {
+ my $s = $_;
+ $s =~ s/\t/ /g; #shit
+ print BOOK $s;
+ }
+
+ } else {
+ if (/^\\begin(\[.*\])?{mudela}/ ) {
+ my $opts ="";
+ $opts = $1 if ( defined ($1));
+
+ parse_mudela_opts($opts);
+ open_mudela;
+ next;
+ }
+ print BOOK;
+ }
+ }
+ close INFILE;
+ close BOOK;
+}
+
+main;
# script to automate releases
-grep -q '^TOP' .version
+grep -q '^TOP' VERSION
res=$?
-if test ! -f .version || test $res != 0; then
+if test ! -f VERSION || test $res != 0; then
echo not in topleveldir
exit 1
fi
function setversion() {
-eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' .version`
+eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' VERSION`
MJ=$TOPLEVEL_MAJOR_VERSION
MI=$TOPLEVEL_MINOR_VERSION
+++ /dev/null
-#!/usr/bin/perl
-
-
-$reldir="~/musix/releases";
-
-use FileHandle;
-
-sub cmpver
-{
-
- my(@a)= split /\./,$a;
- my(@b)= split /\./,$b;
-
- for $i (0,1,2) {
- return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
- }
- return $a cmp $b;
-}
-
-my @versions;
-open LS, "ls -1 $reldir|";
-
-
-while (<LS>) {
-
- $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/;
- push @versions, $1;
-}
-
-
-@versions = sort cmpver @versions;
-my $last= (pop @versions);
-
-
-system "rm $reldir/zZ*";
-system "> $reldir/zZ_LATEST_IS_$last";
-
-open NEWS, "tar --to-stdout -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |";
-input_record_separator NEWS "****";
-$desc = <NEWS>;
-chop ($desc);
-close NEWS;
- print $desc;
--- /dev/null
+#!@PERL@
+
+
+$reldir="~/musix/releases";
+
+use FileHandle;
+
+sub cmpver
+{
+
+ my(@a)= split /\./,$a;
+ my(@b)= split /\./,$b;
+
+ for $i (0,1,2) {
+ return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]);
+ }
+ return $a cmp $b;
+}
+
+my @versions;
+open LS, "ls -1 $reldir|";
+
+
+while (<LS>) {
+
+ $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/;
+ push @versions, $1;
+}
+
+
+@versions = sort cmpver @versions;
+my $last= (pop @versions);
+
+
+system "rm $reldir/zZ*";
+system "> $reldir/zZ_LATEST_IS_$last";
+
+open NEWS, "tar --to-stdout -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |";
+input_record_separator NEWS "****";
+$desc = <NEWS>;
+chop ($desc);
+close NEWS;
+ print $desc;
ac_help="$ac_help
enable-printing turn on debug printing"
ac_help="$ac_help
- disable-checking set runtime checks (assert calls)"
+ enable-checking set runtime checks (assert calls). Default: on"
ac_help="$ac_help
- disable-debugging set debug info "
+ enable-debugging set debug info. Default: on"
ac_help="$ac_help
- enable-optimise use maximal speed optimisations"
+ enable-optimise use maximal speed optimisations. Default: off"
ac_help="$ac_help
- enable-profiling compile with gprof support"
+ enable-profiling compile with gprof support. Default: off"
ac_help="$ac_help
mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)"
ac_help="$ac_help
tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)"
ac_help="$ac_help
- tex-dir=DIR set the directory to put LilyPond TeX files in. "
+ tex-dir=DIR set the directory to put LilyPond TeX files in. "
ac_help="$ac_help
mf-dir=DIR set the directory to put LilyPond MetaFont files in."
# if given here, these vars are initted at the checking point.
+if test x$host = xNONE; then
+ buildprefix=.
+else
+ buildprefix="$host-build-dir"
+ mkdir $buildprefix;
+ for a in `find -type d -and -not -name '*-build-dir'`; do
+ mkdir $buildprefix/$a;
+ done
+fi
printing_b=no
checking_b=yes
debug_b=yes
optimise_b=no
profile_b=no
-
+warn_b=no
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:664: checking for $ac_word" >&5
+echo "configure:673: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:695: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:704: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 705 "configure"
+#line 714 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:729: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:738: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:734: checking whether we are using GNU C++" >&5
+echo "configure:743: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:758: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:767: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:788: checking for $ac_word" >&5
+echo "configure:797: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:844: checking for a BSD compatible install" >&5
+echo "configure:853: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:898: checking for $ac_word" >&5
+echo "configure:907: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:932: checking for $ac_word" >&5
+echo "configure:941: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test FIND = error; then
- echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2
+
+ echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2
+ warn_b=yes
+
fi
+
for ac_prog in bison
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:986: checking for $ac_word" >&5
+echo "configure:999: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1020: checking for $ac_word" >&5
+echo "configure:1033: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1054: checking for $ac_word" >&5
+echo "configure:1067: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
done
test -n "$MAKE" || MAKE="error"
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1099: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$PERL" in
+ /*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_PERL="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="error"
+ ;;
+esac
+fi
+PERL="$ac_cv_path_PERL"
+if test -n "$PERL"; then
+ echo "$ac_t""$PERL" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
for ac_prog in pod2man
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1088: checking for $ac_word" >&5
+echo "configure:1133: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
test -n "$PODMAN" || PODMAN="error"
-
+
if test "x$TEXPREFIX" = xauto ; then
echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6
-echo "configure:1124: checking TeX/MF root dir directory" >&5
+echo "configure:1169: checking TeX/MF root dir directory" >&5
find_root_prefix="$prefix"
if test "x$find_texpostfix" = x; then
find_texpostfix='/lib/texmf/tex'
- echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2
+
+ echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2
+ warn_b=yes
+
fi
find_texprefix="$find_root_prefix/$find_texpostfix"
echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1162: checking TeX input directory" >&5
+echo "configure:1210: checking TeX input directory" >&5
find_dirdir=`(cd $find_texprefix;
$FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
if test "x$find_dirdir" = x; then
find_dirdir="/tex";
- echo "configure: warning: Cannot determine TeX input subdirectory. Please set from command-line" 1>&2
+
+ echo "configure: warning: Cannot determine TeX input subdirectory. Please set from command-line" 1>&2
+ warn_b=yes
+
true
fi
TEXDIR=$find_dirdir
fi
-if test "x$MFDIR" = xauto; then
-
-
-
- echo $ac_n "checking MF input directory""... $ac_c" 1>&6
-echo "configure:1184: checking MF input directory" >&5
- find_dirdir=`(cd $find_texprefix;
- $FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')`
-
-
- if test "x$find_dirdir" = x; then
- find_dirdir="/source";
- echo "configure: warning: Cannot determine MF input subdirectory. Please set from command-line" 1>&2
- true
- fi
- MFDIR=$find_dirdir
- echo "$ac_t""$find_texprefix/$find_dirdir" 1>&6
-
- MFDIR="$TEXPREFIX/$MFDIR"
-
-fi
if test $MAKE = "error"
then
$MAKE -v| grep GNU > /dev/null
if test "$?" = 1
then
- echo "configure: warning: Please install *GNU* make" 1>&2
+
+ echo "configure: warning: Please install *GNU* make" 1>&2
+ warn_b=yes
+
fi
fi
if test $BISON = "error"
then
- echo "configure: warning: can't find bison. Please install Bison (1.25 or better)" 1>&2
+
+ echo "configure: warning: can't find bison. Please install Bison (1.25 or better)" 1>&2
+ warn_b=yes
+
else
bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
if test $bison_version -lt 25; then
- echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2
+
+ echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2
+ warn_b=yes
+
fi
fi
+if test $PERL = "error"
+then
+
+ echo "configure: warning: can't find perl. You should install Perl (version 5 or better)" 1>&2
+ warn_b=yes
+
+ PERL=/usr/bin/perl
+fi
+
if test $PODMAN = "error"
then
- echo "configure: warning: can't find pod. You should install Perl (version 5 or better)" 1>&2
+
+ echo "configure: warning: can't find pod. You should install Perl (version 5 or better)" 1>&2
+ warn_b=yes
+
fi
if test $FLEX = "error"
then
- echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2
+
+ echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2
+ warn_b=yes
+
fi
if $CXX --version | grep '2\.7' > /dev/null
then
true
else
- echo "configure: warning: can't find g++ 2.7" 1>&2
+
+ echo "configure: warning: can't find g++ 2.7" 1>&2
+ warn_b=yes
+
fi
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1240: checking how to run the C++ preprocessor" >&5
+echo "configure:1297: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1310 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1278: checking for FlexLexer.h" >&5
+echo "configure:1335: checking for FlexLexer.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1283 "configure"
+#line 1340 "configure"
#include "confdefs.h"
#include <FlexLexer.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
true
else
echo "$ac_t""no" 1>&6
-echo "configure: warning: can't find flex header. Please install Flex headers correctly" 1>&2
+
+ echo "configure: warning: can't find flex header. Please install Flex headers correctly" 1>&2
+ warn_b=yes
+
fi
+
subdirs="flower"
trap '' 1 2 15
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
s%@AUTOHEADER@%$AUTOHEADER%g
s%@BISON@%$BISON%g
s%@FLEX@%$FLEX%g
+s%@PERL@%$PERL%g
s%@TEXPREFIX@%$TEXPREFIX%g
s%@TEXDIR@%$TEXDIR%g
s%@MFDIR@%$MFDIR%g
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"make/out/Configure_variables.make:make/Configure_variables.make.in"}
+CONFIG_FILES=\${CONFIG_FILES-"$buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
eval "DIR_DATADIR=$datadir"
DIR_DATADIR="$DIR_DATADIR/lilypond"
echo $ac_n "checking ""... $ac_c" 1>&6
-echo "configure:1691: checking " >&5
+echo "configure:1753: checking " >&5
-cat << EOF > lib/out/config.hh
+cat << EOF > $buildprefix/lib/out/config.hh
/* automatically generated by configure */
/* include this file only once! */
EOF
-CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh
+CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh
-touch make/out/Site.make
+touch $buildprefix/make/out/Site.make
# ugr
-(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
+(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh
+
)
-# rgu
-sed 's/TOPLEVEL_//g' < .version > lily/.version
-(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
+(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh
)
-echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile
+echo '# WARNING : Automatically generated from make/Toplevel.make.in' \
+ | cat - make/Toplevel.make.in > Makefile
+
cat << END
For making everything, do:
make # GNU make
+or if you used --host=SunUltraWitteReus
+
+ make buildprefix=SunUltraWitteReus-build-dir
+
If you want to make site-wide extensions to the makefiles, please use
make/out/Site.make
END
+if test $warn_b = "yes" ; then
+cat <<EOF
+
+ *******************************
+ Warning: configure found errors.
+ Please resolve these and rerun configure
+ before sending any bugreports.
+ *******************************
+
+EOF
+fi
+
dnl should cache result.
dnl should look in $prefix first.
+AC_DEFUN(AC_LILY_WARN, [
+ AC_MSG_WARN($1)
+ warn_b=yes
+])
AC_DEFUN(AC_TEX_PREFIX, [
if test "x$find_texpostfix" = x; then
find_texpostfix='/lib/texmf/tex'
- AC_MSG_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
+ AC_LILY_WARN(Cannot determine the TeX-directory. Please use --enable-tex-prefix)
fi
find_texprefix="$find_root_prefix/$find_texpostfix"
if test "x$find_dirdir" = x; then
find_dirdir="/$3";
- AC_MSG_WARN(Cannot determine $4 subdirectory. Please set from command-line)
+ AC_LILY_WARN(Cannot determine $4 subdirectory. Please set from command-line)
true
fi
$2=$find_dirdir
# if given here, these vars are initted at the checking point.
+if test x$host = xNONE; then
+ buildprefix=.
+else
+ buildprefix="$host-build-dir"
+ mkdir $buildprefix;
+ for a in `find -type d -and -not -name '*-build-dir'`; do
+ mkdir $buildprefix/$a;
+ done
+fi
printing_b=no
checking_b=yes
debug_b=yes
optimise_b=no
profile_b=no
-
+warn_b=no
AC_LANG_CPLUSPLUS
AC_ARG_ENABLE(printing,
AC_ARG_ENABLE(checking,
- [ disable-checking set runtime checks (assert calls)],
+ [ enable-checking set runtime checks (assert calls). Default: on],
[checking_b=$enableval] )
AC_ARG_ENABLE(debugging,
- [ disable-debugging set debug info ],
+ [ enable-debugging set debug info. Default: on],
[debug_b=$enableval])
AC_ARG_ENABLE(optimise,
- [ enable-optimise use maximal speed optimisations],
+ [ enable-optimise use maximal speed optimisations. Default: off],
[optimise_b=$enableval])
AC_ARG_ENABLE(profiling,
- [ enable-profiling compile with gprof support],
+ [ enable-profiling compile with gprof support. Default: off],
[profile_b=$enableval])
AC_ARG_ENABLE(mingw-prefix,
[TEXPREFIX=auto] )
AC_ARG_ENABLE(tex-dir,
- [ tex-dir=DIR set the directory to put LilyPond TeX files in. ],
+ [ tex-dir=DIR set the directory to put LilyPond TeX files in. ],
[TEXDIR=$enableval],
[TEXDIR=auto] )
dnl should check out -print
if test FIND = error; then
- AC_MSG_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
+ AC_LILY_WARN(Couldn't find \`find'. Please use --enable-tex-dir)
fi
AC_SUBST(CXXFLAGS)
AC_SUBST(AUTOHEADER)
AC_SUBST(BISON)
AC_SUBST(FLEX)
+AC_SUBST(PERL)
AC_SUBST(TEXPREFIX)
AC_SUBST(TEXDIR)
AC_SUBST(MFDIR)
AC_CHECK_PROGS(BISON, bison, error)
AC_CHECK_PROGS(FLEX, flex, error)
AC_CHECK_PROGS(MAKE, make, error)
+AC_PATH_PROG(PERL, perl, error)
AC_CHECK_PROGS(PODMAN, pod2man, error)
-
+
if test "x$TEXPREFIX" = xauto ; then
AC_TEX_PREFIX(TEXPREFIX)
else
AC_TEX_SUBDIR(TEXDIR)
fi
-if test "x$MFDIR" = xauto; then
- AC_MF_SUBDIR(MFDIR)
-fi
+dnl if test "x$MFDIR" = xauto; then
+dnl AC_MF_SUBDIR(MFDIR)
+dnl fi
if test $MAKE = "error"
then
$MAKE -v| grep GNU > /dev/null
if test "$?" = 1
then
- AC_MSG_WARN(Please install *GNU* make)
+ AC_LILY_WARN(Please install *GNU* make)
fi
fi
if test $BISON = "error"
then
- AC_MSG_WARN(can't find bison. Please install Bison (1.25 or better))
+ AC_LILY_WARN(can't find bison. Please install Bison (1.25 or better))
else
bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
if test $bison_version -lt 25; then
- AC_MSG_WARN(Your bison is too old (1.$bison_version). Please install 1.25)
+ AC_LILY_WARN(Your bison is too old (1.$bison_version). Please install 1.25)
fi
fi
+if test $PERL = "error"
+then
+ AC_LILY_WARN(can't find perl. You should install Perl (version 5 or better))
+ PERL=/usr/bin/perl
+fi
+
if test $PODMAN = "error"
then
- AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better))
+ AC_LILY_WARN(can't find pod. You should install Perl (version 5 or better))
fi
if test $FLEX = "error"
then
- AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better))
+ AC_LILY_WARN(can't find flex. Please install Flex (2.5 or better))
fi
if $CXX --version | grep '2\.7' > /dev/null
then
true
else
- AC_MSG_WARN(can't find g++ 2.7)
+ AC_LILY_WARN(can't find g++ 2.7)
fi
AC_CHECK_HEADER(FlexLexer.h, true,
- AC_MSG_WARN(can't find flex header. Please install Flex headers correctly))
+ AC_LILY_WARN(can't find flex header. Please install Flex headers correctly))
+
AC_CONFIG_SUBDIRS(flower)
-AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in)
+AC_OUTPUT($buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in)
DIR_DATADIR="$DIR_DATADIR/lilypond"
AC_MSG_CHECKING
-cat << EOF > lib/out/config.hh
+cat << EOF > $buildprefix/lib/out/config.hh
/* automatically generated by configure */
/* include this file only once! */
EOF
-CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh
+CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh
-touch make/out/Site.make
+touch $buildprefix/make/out/Site.make
# ugr
-(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
-dnl echo 0 > out/.build
+(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh
+
)
-# rgu
-sed 's/TOPLEVEL_//g' < .version > lily/.version
-(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
+(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh
)
-echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile
+echo '# WARNING : Automatically generated from make/Toplevel.make.in' \
+ | cat - make/Toplevel.make.in > Makefile
+
cat << END
For making everything, do:
make # GNU make
+or if you used --host=SunUltraWitteReus
+
+ make buildprefix=SunUltraWitteReus-build-dir
+
If you want to make site-wide extensions to the makefiles, please use
make/out/Site.make
END
+if test $warn_b = "yes" ; then
+cat <<EOF
+
+ *******************************
+ Warning: configure found errors.
+ Please resolve these and rerun configure
+ before sending any bugreports.
+ *******************************
+
+EOF
+fi
+
+++ /dev/null
-MAJOR_VERSION = 1
-MINOR_VERSION = 1
-PATCH_LEVEL = 23
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL = # include separator: "-1" or ".a"
-#
#
NAME = flower
MODULE_NAME = flower
-include out/Flower-flags.make
#
-# edit .version only
-include ./$(depth)/.version
-include ./$(depth)/flower/.version
+# edit VERSION only
+include ./$(depth)/VERSION
+include ./$(depth)/flower/VERSION
# generic variables:
#
include ./$(depth)/make/Variables.make
include ./$(depth)/make/Files.make
+include $(flowerout)/Flower-flags.make
+
#
# descent order into subdirectories:
#
SCRIPTS =
README_FILES = NEWS README TODO
-EXTRA_DISTFILES= configure config.hh.in configure.in .version $(README_FILES) $(SCRIPTS) Flower-flags.make.in
+EXTRA_DISTFILES= configure config.hh.in configure.in VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in
#
version 1.1:
+pl 24
+ - Diagonal_storage for band matrices.
+ - matrix hackings: support for other Matrix_storage
+ - NAME_MEMBERS(); -> DECLARE_MY_RUNTIME_TYPEINFO;
+ - Matrix::band_i()
+
pl 23:
- virtual-methods : static_is_type_b
- - Choleski checks no if PARANOID
+ - Choleski checks off if not PARANOID
pl 22:
- ACursor and PACursor to give array a List like interface.
--- /dev/null
+MAJOR_VERSION = 1
+MINOR_VERSION = 1
+PATCH_LEVEL = 24
+# use to send patches, always empty for released version:
+MY_PATCH_LEVEL = # include separator: "-1" or ".a"
+#
#include "choleski.hh"
const Real EPS = 1e-7; // so sue me. Hard coded
+// for testing new Matrix_storage.
+//#define PARANOID
+
Vector
Choleski_decomposition::solve(Vector rhs)const
{
return x;
}
-/*
- Standard matrix algorithm.
- Should add support for banded matrices
- */
-
-Choleski_decomposition::Choleski_decomposition(Matrix P)
- : L(P.dim()), D(P.dim())
+void
+Choleski_decomposition::full_matrix_decompose(Matrix const & P)
{
- int n = P.dim();
-
-#ifdef PARANOID
- assert((P-P.transposed()).norm()/P.norm() < EPS);
-#endif
-
+
+ int n = P.dim();
L.unit();
for (int k= 0; k < n; k++) {
for (int j = 0; j < k; j++){
D(k) = d;
}
+}
+
+void
+Choleski_decomposition::band_matrix_decompose(Matrix const &P)
+{
+ int n = P.dim();
+ int b = P.band_i();
+ L.unit();
+
+ for (int i= 0; i < n; i++) {
+ for (int j = 0 >? i - b; j < i; j++){
+ Real sum(0.0);
+ for (int l=0 >? i - b; l < j; l++)
+ sum += L(i,l)*L(j,l)*D(l);
+ L(i,j) = (P(i,j) - sum)/D(j);
+ }
+ Real sum=0.0;
+
+ for (int l=0 >? i - b; l < i; l++)
+ sum += sqr(L(i,l))*D(l);
+ Real d = P(i,i) - sum;
+ D(i) = d;
+ }
+ L.try_set_band();
+ assert ( L.band_i() == P.band_i());
+}
+
+
+
+
+/*
+ Standard matrix algorithm.
+ */
+
+Choleski_decomposition::Choleski_decomposition(Matrix const & P)
+ : L(P.dim()), D(P.dim())
+{
+#ifdef PARANOID
+ assert((P-P.transposed()).norm()/P.norm() < EPS);
+#endif
+ if (P.band_b())
+ band_matrix_decompose(P);
+ else
+ full_matrix_decompose(P);
+
+
#ifdef PARANOID
assert((original()-P).norm() / P.norm() < EPS);
#endif
shared_b=no
LIB_SUFFIX=.a
+# if given here, these vars are initted at the checking point.
+if test x$host = xNONE; then
+ flowerbuildprefix=.
+else
+ flowerbuildprefix="../$host-build-dir/Flower"
+ mkdir $flowerbuildprefix;
+ for a in `find -type d -and -not -name '*-build-dir'`; do
+ mkdir $flowerbuildprefix/$a;
+ done
+fi
+
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:571: checking for $ac_word" >&5
+echo "configure:582: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:602: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:613: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 612 "configure"
+#line 623 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:636: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:647: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:641: checking whether we are using GNU C++" >&5
+echo "configure:652: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:665: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:676: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:693: checking for 8-bit clean memcmp" >&5
+echo "configure:704: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 701 "configure"
+#line 712 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
}
EOF
-if { (eval echo configure:714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:732: checking for vprintf" >&5
+echo "configure:743: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 737 "configure"
+#line 748 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
; return 0; }
EOF
-if { (eval echo configure:763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:787: checking for _doprnt" >&5
+echo "configure:798: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 792 "configure"
+#line 803 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
; return 0; }
EOF
-if { (eval echo configure:818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
for ac_func in memmem snprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:845: checking for $ac_func" >&5
+echo "configure:856: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 850 "configure"
+#line 861 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
-CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
+CXX="$ac_cv_prog_CXX" ../bin/make-version > $flowerbuildprefix/out/version.hh
trap '' 1 2 15
cat > confcache <<\EOF
ac_given_srcdir=$srcdir
-trap 'rm -fr `echo "out/Flower-flags.make:Flower-flags.make.in out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in $flowerbuildprefix/out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"out/Flower-flags.make:Flower-flags.make.in"}
+CONFIG_FILES=\${CONFIG_FILES-"$flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="out/config.hh:config.hh.in"
+ CONFIG_HEADERS="$flowerbuildprefix/out/config.hh:config.hh.in"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
shared_b=no
LIB_SUFFIX=.a
+# if given here, these vars are initted at the checking point.
+if test x$host = xNONE; then
+ flowerbuildprefix=.
+else
+ flowerbuildprefix="../$host-build-dir/Flower"
+ mkdir $flowerbuildprefix;
+ for a in `find -type d -and -not -name '*-build-dir'`; do
+ mkdir $flowerbuildprefix/$a;
+ done
+fi
+
AC_ARG_ENABLE(shared,
[ enable-shared shared flower library],
[shared_b=$enableval])
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(memmem snprintf )
-AC_CONFIG_HEADER(out/config.hh:config.hh.in)
+AC_CONFIG_HEADER($flowerbuildprefix/out/config.hh:config.hh.in)
-CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh
+CXX="$ac_cv_prog_CXX" ../bin/make-version > $flowerbuildprefix/out/version.hh
-AC_OUTPUT(out/Flower-flags.make:Flower-flags.make.in)
+AC_OUTPUT($flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in)
--- /dev/null
+/*
+ diagonal-storage.cc -- implement Diagonal_storage
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#include "diagonal-storage.hh"
+
+int
+Diagonal_storage::dim()const
+{
+ return band_.rows();
+}
+
+Diagonal_storage::Diagonal_storage()
+{
+}
+
+int
+Diagonal_storage::rows() const
+{
+ return band_.rows();
+}
+
+int
+Diagonal_storage::cols() const
+{
+ return band_.rows();
+}
+
+int
+Diagonal_storage::band_size_i()const
+{
+ return (band_.cols()-1)/2;
+}
+
+void
+Diagonal_storage::set_band_size(int s)
+{
+ Full_storage f(dim(), 2*s+1);
+ for (int i=0; i < dim(); i++) {
+ int k=-s;
+ for ( ; k < -band_size_i(); k++)
+ f.elem(i,k + s) = 0.0;
+ for ( ; k <= band_size_i()&& k<=s ; k++)
+ f.elem(i, k + s) = band_.elem(i,k+ band_size_i());
+ for( ; k <= s; k++)
+ f.elem(i, k + s) =0.0;
+ }
+
+ band_ = f;
+}
+
+
+
+/*
+ any takers?
+ */
+void
+Diagonal_storage::insert_row(int )
+{
+ assert(false);
+}
+
+void
+Diagonal_storage::delete_row(int )
+{
+ assert(false);
+}
+
+void
+Diagonal_storage::resize(int,int)
+{
+}
+
+void
+Diagonal_storage::resize(int)
+{
+}
+
+void
+Diagonal_storage::delete_column(int )
+{
+ assert(false);
+}
+
+Diagonal_storage::~Diagonal_storage()
+{
+}
+
+
+bool
+Diagonal_storage::band_elt_b(int i,int j)const
+{
+ return abs(i-j) <= band_size_i();
+}
+
+void
+Diagonal_storage::assert_valid(int i,int j )const
+{
+ assert( band_elt_b(i,j) );
+ assert( i >=0 && j >=0 && i < dim() && j < dim());
+}
+
+
+void
+Diagonal_storage::resize_dim(int d)
+{
+ Full_storage f(d, 2*band_size_i()+1);
+ for (int i=0; i < d&& i < dim(); i++) {
+ for ( int k=0; k < 2*band_size_i(); k++)
+ f.elem(i,k) = elem(i,k);
+ }
+
+ band_ = f;
+}
+
+
+
+bool
+Diagonal_storage::mult_ok(int i,int )const
+{
+ return i < dim();
+}
+
+void
+Diagonal_storage::mult_next(int &i, int &j)const
+{
+ j++;
+ if ( j < i - band_size_i() )
+ j = i- band_size_i();
+ if ( j > i + band_size_i() || j >= dim() ) {
+ i++;
+ j = i - band_size_i();
+ if (j < 0)
+ j=0;
+ }
+}
+
+bool
+Diagonal_storage::trans_ok(int ,int j)const
+{
+ return j < dim();
+}
+
+void
+Diagonal_storage::trans_next(int &i, int& j)const
+{
+ i++;
+ if ( i < j - band_size_i())
+ i = j-band_size_i();
+
+ if ( i >= dim() || i > j + band_size_i() ) {
+ j++;
+ i = j - band_size_i();
+ if (i < 0)
+ i=0;
+ }
+}
+
+static Real nul_entry=0.0;
+
+Real
+Diagonal_storage::elem(int i, int j)const
+{
+ if (abs ( i-j ) > band_size_i())
+ return 0;
+ else
+ return band_.elem(i, j - i +band_size_i());
+}
+
+Real &
+Diagonal_storage::elem(int i, int j)
+{
+ /*
+ if this fails, the previous call fucked up
+ */
+ assert(nul_entry);
+ if (abs ( i-j ) > band_size_i())
+ return nul_entry;
+ else
+ return band_.elem(i, j - i + band_size_i());
+}
+
+/*
+ Hairy routine to try to save some fp-ops
+ */
+
+bool
+Diagonal_storage::try_right_multiply(Matrix_storage*dest,
+ const Matrix_storage*right)const
+{
+ if ( right->name() != Diagonal_storage::static_name() )
+ return false;
+
+ const Diagonal_storage* diag = (Diagonal_storage const*)right;
+ int band2 = diag->band_size_i();
+ int n = dim();
+ /*
+ should check if dest is a Diagonal_storage of sufficient size too.
+ */
+ for (int i=0; i < n; i++) {
+ for (int j = 0; j < n; j++) {
+ int startk = i - band_size_i() >? 0 >? j - band2;
+ int stopk = i + band_size_i() <? n-1 <? j + band2;
+ int relk = startk + band_size_i() -i;
+ Real sum =0.0;
+ for ( int k = startk; k <= stopk; k++)
+ sum += band_.elem(i, relk) * diag->elem(relk, j);
+ dest->elem(i, j) = sum;
+
+ }
+ }
+ return true;
+}
+
+IMPLEMENT_IS_TYPE_B1(Diagonal_storage, Matrix_storage);
+
+
+Diagonal_storage::Diagonal_storage(Matrix_storage*stor_l, int band_i)
+{
+ set_band_size(band_i);
+ resize_dim(stor_l->dim());
+
+ for ( int i=0,j=0; mult_ok(i,j); mult_next(i,j))
+ band_.elem(i, j + band_i -i ) = stor_l->elem(i,j);
+}
+
+void
+Diagonal_storage::OK() const
+{
+ band_.OK();
+}
source file of the Flower Library
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "full-storage.hh"
Full_storage::OK() const
{
#ifndef NDEBUG
- // static Real dummy;
+
assert(max_height_i_ >= height_i_ && max_width_i_ >= width_i_);
assert(height_i_ >= 0 && width_i_ >= 0);
assert(els_p_p_||!max_height_i_);
#endif
}
+
void
Full_storage::resize_cols(int newh)
{
height_i_ = max_height_i_ = newh;
}
+
+Full_storage::Full_storage(Matrix_storage*m)
+{
+ set_size(m->rows(), m->cols());
+ if ( !m->is_type_b ( Full_storage::static_name()))
+ for (int i=0; i<height_i_; i++)
+ for (int j=0; j<width_i_; j++)
+ els_p_p_[i][j]=0.0;
+ for (int i,j=0; m->mult_ok(i,j); m->mult_next(i,j))
+ els_p_p_[i][j] = m->elem(i,j);
+}
+
void
Full_storage::resize_rows(int neww)
{
OK();
resize_cols(rows);
resize_rows(cols);
-
}
bool
-Full_storage::mult_ok(int i, int j) const
+Full_storage::mult_ok(int i, int ) const
{
- return valid(i,j);
+ return i < height_i_;
}
bool
-Full_storage::trans_ok(int i, int j) const
+Full_storage::trans_ok(int , int j) const
{
- return valid(i,j);
+ return j < width_i_;
}
}
-
-Array<Real>
-Full_storage::row(int n) const
+int
+Full_storage::dim()const
{
- Array<Real> r;
- for (int j = 0; j < width_i_; j++)
- r.push(els_p_p_[n][j]);
- return r;
+ assert (rows()==cols());
+ return rows();
}
-Array<Real>
-Full_storage::column(int n) const
-{
-
- Array<Real> r;
- for (int i = 0; i<height_i_; i++)
- r.push(els_p_p_[i][n]);
- return r;
-}
-
-
-Full_storage::Full_storage(Full_storage&s)
+Full_storage::Full_storage(Full_storage const&s)
{
init();
(*this) = s;
}
-Matrix_storage*
-Full_storage::clone()
-{
- return new Full_storage(*this);
-}
-
-
-Matrix_storage *
-Matrix_storage::get_full(int n, int m)
-{
- return new Full_storage(n,m);
-}
bool
-Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * right)
+Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * right)const
{
if (dest->name() != Full_storage::static_name() ||
right->name() != Full_storage::static_name())
}
-IMPLEMENT_IS_TYPE_B(Matrix_storage);
IMPLEMENT_IS_TYPE_B1(Full_storage,Matrix_storage);
# generic stuff/Makefile
#
include ./$(depth)/make/Include.make
-include ./$(depth)/flower/.version
+include ./$(depth)/flower/VERSION
# identify module:
#
P needs to be symmetric positive definite
*/
- Choleski_decomposition(Matrix P);
+ Choleski_decomposition(Matrix const &P);
/**
solve Px = rhs
return P, calc'ed from L and D
*/
Matrix original() const;
-
+private:
+ void full_matrix_decompose(Matrix const & P);
+ void band_matrix_decompose(Matrix const &P);
};
#endif
--- /dev/null
+/*
+ diagonal-storage.hh -- declare Diagonal_storage
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DIAGONAL_STORAGE_HH
+#define DIAGONAL_STORAGE_HH
+#include "full-storage.hh"
+
+/**
+ Store a single-band matrix;
+
+ INVARIANT
+
+ Diagonal_storage(i,j) == band_(i, j-i + band_size_i())
+
+ band_.cols() == 2 * band_size_i() + 1
+
+ */
+class Diagonal_storage : public Matrix_storage {
+ Full_storage band_;
+
+public:
+ void set_band_size(int b);
+ int band_size_i()const;
+
+ void assert_valid(int i, int j) const;
+ bool band_elt_b(int,int )const;
+ void resize_dim(int);
+
+ virtual void resize_rows(int d) { resize_dim (d); }
+ virtual void resize_cols(int d) { resize_dim(d); }
+ virtual int dim() const;
+
+ virtual int rows() const ;
+ virtual int cols() const ;
+
+
+ virtual void resize(int i, int j);
+ virtual void resize(int i);
+
+ virtual Real& elem(int i,int j);
+ virtual Real elem(int i, int j) const;
+ Diagonal_storage(Matrix_storage* , int band_i);
+ Diagonal_storage();
+ void OK() const;
+
+ virtual void insert_row(int k);
+ virtual void delete_row(int k);
+ virtual void delete_column(int k);
+
+ ~Diagonal_storage();
+ virtual bool mult_ok(int i, int j)const;
+ virtual void mult_next(int &i, int &j) const ;
+ virtual bool trans_ok(int i, int j) const;
+ virtual void trans_next(int &i, int &j) const;
+ VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const *)const;
+};
+#endif // DIAGONAL_STORAGE_HH
/*
- flower-debug.hh -- declare
+ flower-debug.hh -- declare global constants relating to debug dumps
source file of the Flower Library
#include "varray.hh"
#include "matrix-storage.hh"
#include "real.hh"
+
/// simplest matrix storage. refer to its baseclass for the doco.
class Full_storage : public Matrix_storage
{
}
- virtual void set_size(int i, int j)
- {
- resize(i,j); //this could be more efficient.
- }
-
- virtual void set_size(int i) {
- set_size(i,i);
- }
virtual void resize(int i, int j);
virtual void resize(int i) {
resize(i,i);
assert(valid(i,j));
return els_p_p_[i][j];
}
- virtual Real const & elem(int i, int j) const {
+ virtual Real elem(int i, int j) const {
assert(valid(i,j));
return els_p_p_[i][j];
}
- virtual Array<Real> row(int i) const;
- virtual Array<Real> column(int j) const;
-
+ int dim()const;
+ Full_storage(Matrix_storage*);
Full_storage() {
init();
}
init();
set_size(i,j);
}
- Full_storage(Full_storage&);
+ Full_storage(Full_storage const&);
Full_storage(int i) {
init();
set_size(i);
virtual void insert_row(int k);
virtual void delete_row(int k);
virtual void delete_column(int k);
-
~Full_storage();
virtual bool mult_ok(int i, int j)const;
virtual void mult_next(int &i, int &j) const ;
virtual bool trans_ok(int i, int j) const;
virtual void trans_next(int &i, int &j) const;
- virtual Matrix_storage * clone();
- NAME_MEMBERS();
- virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const * );
+ VIRTUAL_COPY_CONS(Full_storage,Matrix_storage);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const * )const;
};
#endif // FULL_STORAGE_HH
/// width of matrix
virtual int cols() const = 0;
-
+
+ /// size if square
+ virtual int dim() const =0;
/** set the size. contents lost.
PRE
i >=0, j>=0
*/
- virtual void set_size(int rows, int cols) = 0;
+ virtual void set_size(int rows, int cols) ;
+
/**set the size to square dimen. contents lost
PRE
i>=0
*/
- virtual void set_size(int i) = 0;
+ virtual void set_size(int i) ;
/**set the size to i.
keep contents. If enlarged contents unspecified
virtual void resize(int i) = 0;
- /**
+ /**
access an element.
Generate an errormessage, if this happens
virtual Real& elem(int i,int j) = 0;
/// access a element, no modify
- virtual Real const & elem(int i, int j) const = 0;
+ virtual Real elem(int i, int j) const = 0;
- virtual Array<Real> row(int i) const = 0;
- virtual Array<Real> column(int j) const = 0;
+ virtual Array<Real> row(int i) const ;
+ virtual Array<Real> column(int j) const;
/**
virtual void delete_row(int k)=0;
virtual void delete_column(int k)=0;
virtual ~Matrix_storage() { }
- virtual Matrix_storage *clone()=0;
+ virtual Matrix_storage *clone()const=0;
*/
virtual void mult_next(int &i, int &j) const = 0;
-/**
+ /**
valid matrix entry. return false if at end of row
*/
virtual bool trans_ok(int i, int j) const=0;
*/
virtual void trans_next(int &i, int &j) const = 0;
+
/// generate a "Full_storage" matrix
static Matrix_storage *get_full(int n, int m);
-
-
+ static void set_band(Matrix_storage*&, int band);
+ static void set_full(Matrix_storage*&);
virtual bool try_right_multiply(Matrix_storage *dest,
- const Matrix_storage *fact) ;
+ const Matrix_storage *fact)const ;
/**
RTTI.
*/
- NAME_MEMBERS();
-};
-
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ static Matrix_storage* get_product_result(Matrix_storage *left,
+ Matrix_storage *right);
+
+
+ static void set_addition_result(
+ Matrix_storage *&dat, Matrix_storage *right);
+ static void set_product_result(
+ Matrix_storage*&dest, Matrix_storage*left, Matrix_storage*right);
+};
-inline bool
-Matrix_storage::try_right_multiply(Matrix_storage *,
- const Matrix_storage *)
-{
- return false;
-}
#endif // MATRIX_STORAGE_HH
class Matrix {
+ friend Matrix operator *(Matrix const &m1, Matrix const &m2);
+
+protected:
Matrix_storage *dat;
-
+ void set(Matrix_storage*);
+ Matrix(Matrix_storage*);
public:
void OK() const { dat->OK(); }
int cols() const { return dat->cols(); }
*/
int dim() const;
- // Matrix() { dat = 0; }
+ /**
+ the band size of the matrix.
+ @ret
+
+ 0 <= band_i() <= dim
+ */
+ int band_i() const;
+ bool band_b()const;
+ void set_full()const;
+ void try_set_band()const;
~Matrix() { delete dat; }
/// set entries to r
square n matrix, initialised to null
*/
Matrix(int n);
-
+
/**
n x m matrix, init to 0
*/
m1 -= m2;
return m1;
}
+inline Matrix operator +(Matrix m1,const Matrix m2)
+{
+ m1 += m2;
+ return m1;
+}
#endif
The static_name() can *not* be inlined (this might have the effect that
s->name() != S::static_name(). Overlapping strings need not be merged in C++
*/
-#define NAME_MEMBERS() \
+#define DECLARE_MY_RUNTIME_TYPEINFO \
static char const *static_name();\
static bool static_is_type_b(const char*s);\
virtual bool is_type_b(const char *s)const { return static_is_type_b(s); } \
+/*
+ matrix-debug.cc -- implement Matrix print routines
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
#include "flower-debug.hh"
#include "matrix.hh"
+#include "matrix-storage.hh"
Matrix::operator String() const
{
String s;
#ifndef NPRINT
- s="matrix {\n";
+ Matrix_storage const * stor_c_l = dat;
+ s=String("matrix { (") + dat->name() + ")\n";
for (int i=0; i< rows(); i++){
for (int j = 0; j < cols(); j++) {
- s+= String(dat->elem(i,j), "%6f ");
+ s+= String(stor_c_l->elem(i,j), "%6f ");
}
s+="\n";
}
--- /dev/null
+/*
+ matrix-storage.cc -- implement Matrix_storage
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "full-storage.hh"
+#include "diagonal-storage.hh"
+
+void
+Matrix_storage::set_addition_result(Matrix_storage *&dat, Matrix_storage *right)
+{
+ if (dat && dat->name() == Diagonal_storage::static_name()
+ && right->name() == Diagonal_storage::static_name()) {
+ Diagonal_storage *L = (Diagonal_storage*)dat;
+ Diagonal_storage* R = (Diagonal_storage*) right;
+
+ if ( R->band_size_i() > L->band_size_i()) {
+ L->set_band_size(R->band_size_i());
+ return ;
+ }
+ }
+ if (!dat || !dat->is_type_b(Full_storage::static_name() )) {
+
+ Matrix_storage *new_stor = (dat)? new Full_storage(dat) :
+ new Full_storage( right->rows(), right->cols());
+ delete dat;
+ dat = new_stor;
+ }
+}
+
+Matrix_storage*
+Matrix_storage::get_product_result(Matrix_storage*left, Matrix_storage*right)
+{
+ Matrix_storage* dest =0;
+ set_product_result(dest, left,right);
+ return dest;
+}
+
+
+/*
+ hairy
+ */
+void
+Matrix_storage::set_product_result(Matrix_storage*&dest,
+ Matrix_storage*left, Matrix_storage*right)
+{
+ if ( left->name() == Diagonal_storage::static_name()
+ && right->name() == Diagonal_storage::static_name()) {
+ Diagonal_storage *L = (Diagonal_storage*)left;
+ Diagonal_storage* R = (Diagonal_storage*) right;
+
+ if (L->band_size_i() + R->band_size_i() < L->dim()/2 ) {
+ if (dest ->name() != Diagonal_storage::static_name()){
+ delete dest;
+ dest = new Diagonal_storage;
+ }
+
+ dest->set_size(L->dim());
+ return;
+ }
+ }
+
+ if ( dest && dest->name() == Full_storage::static_name()) {
+ dest->set_size(left->rows(), right->cols());
+ } else {
+ delete dest;
+ dest = new Full_storage( left->rows(), right->cols());
+ }
+}
+
+IMPLEMENT_IS_TYPE_B(Matrix_storage);
+
+Matrix_storage *
+Matrix_storage::get_full(int n, int m)
+{
+ return new Full_storage(n,m);
+}
+
+
+
+ bool
+Matrix_storage::try_right_multiply(Matrix_storage *,
+ const Matrix_storage *)const
+{
+ return false;
+}
+
+Array<Real>
+Matrix_storage::row(int n) const
+{
+ Array<Real> r;
+ for (int j = 0; j < cols(); j++)
+ r.push(elem(n,j));
+ return r;
+}
+
+Array<Real>
+Matrix_storage::column(int n) const
+{
+ Array<Real> r;
+ for (int i = 0; i < rows(); i++)
+ r.push(elem(i,n));
+ return r;
+}
+
+void
+Matrix_storage::set_size(int rows, int cols)
+{
+
+ resize(rows,cols);
+}
+
+void
+Matrix_storage::set_size(int rows)
+{
+
+ resize(rows);
+}
+
+
+void
+Matrix_storage::set_band(Matrix_storage *&mat, int b)
+{
+ Matrix_storage* ns = new Diagonal_storage(mat, b);
+ delete mat;
+ mat=ns;
+}
+
+
+void
+Matrix_storage::set_full(Matrix_storage *&mat)
+{
+ Matrix_storage* ns = new Full_storage(mat);
+ delete mat;
+ mat=ns;
+}
+/*
+ matrix.cc -- implement Matrix
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "matrix.hh"
+#include "full-storage.hh"
+#include "diagonal-storage.hh"
+
+bool
+Matrix::band_b()const
+{
+ return dat->is_type_b( Diagonal_storage::static_name());
+}
+
+void
+Matrix::set_full() const
+{
+ if ( dat->name() != Full_storage::static_name()) {
+ Matrix_storage::set_full( ((Matrix*)this)->dat );
+ }
+}
+
+void
+Matrix::try_set_band()const
+{
+ if (band_b())
+ return;
+
+ int b = band_i();
+ if ( b > dim()/2)
+ return;
+ // it only looks constant
+ Matrix*self = (Matrix*)this;
+ Matrix_storage::set_band(self->dat,b);
+}
Real
Matrix::norm() const
void
Matrix::operator+=(Matrix const &m)
{
+ Matrix_storage::set_addition_result(dat, m.dat);
assert(m.cols() == cols());
assert(m.rows() == rows());
for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
void
Matrix::operator-=(Matrix const &m)
{
+ Matrix_storage::set_addition_result(dat, m.dat);
assert(m.cols() == cols());
assert(m.rows() == rows());
for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j))
delete dat;
dat = m.dat->clone();
}
+
+int
+Matrix::band_i()const
+{
+ int starty = dim();
+ while (starty >= 0 ) {
+ for ( int i = starty, j = 0; i < dim(); i++, j++ )
+ if (dat->elem( i,j ))
+ goto gotcha;
+ for ( int i=0, j = starty; j < dim(); i++,j++)
+ if (dat->elem(i,j))
+ goto gotcha;
+ starty --;
+ }
+gotcha:
+ return starty;
+}
Matrix::Matrix(Matrix const &m)
{
fill(0);
}
+Matrix::Matrix(Matrix_storage*stor_p)
+{
+ dat = stor_p;
+}
+
Matrix::Matrix(int n)
{
dat = Matrix_storage::get_full(n,n);
return m;
}
-
-/* should do something smarter: bandmatrix * bandmatrix is also banded matrix. */
Matrix
operator *(Matrix const &m1, Matrix const &m2)
{
- Matrix result(m1.rows(), m2.cols());
+ Matrix result(Matrix_storage::get_product_result(m1.dat, m2.dat));
+
result.set_product(m1,m2);
return result;
}
{
assert(m1.cols()==m2.rows());
assert(cols()==m2.cols() && rows()==m1.rows());
-
+
if (m1.dat->try_right_multiply(dat, m2.dat))
return;
for (int i=0, j=0; dat->mult_ok(i,j);
return rows();
}
+
+
String
String_convert::double_str(double f, char const* fmt)
{
- static char buf[STRING_BUFFER_LEN];
+ char buf[STRING_BUFFER_LEN];
snprintf(buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f);
- return buf;
+ return String(buf);
}
/**
# identify module:
#
NAME =flower-test
-# include ./$(depth)/$(NAME)/.version
+# include ./$(depth)/$(NAME)/VERSION
MODULE_NAME = flower
-include ./$(depth)/flower/.version
+include ./$(depth)/flower/VERSION
#
# don't do the exec, as this might fail if flowerlib isn't installed yet.
default: $(BUILDSTRINGTEST)
-
-do-stringtest:
+test: $(EXECUTABLE)
$(EXECSTRINGTEST) > $(outdir)/result
cmp $(outdir)/result result
--- /dev/null
+/*
+ mat-test.cc -- test Matrix
+
+ source file of the Flower Library
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include <iostream.h>
+#include "matrix.hh"
+#include "string.hh"
+#include "flower-test.hh"
+#include "choleski.hh"
+
+void
+matrix()
+{
+ int N=10;
+ Matrix m(N,N), q(N,N);
+ Vector v(N);
+
+ for (int i=0; i < N; i++) {
+ v(i) =i;
+ for (int j=0; j < N; j++) {
+ m(i,j) = i+j;
+ q(i,j) = (abs(i-j) > 3) ?0 :i-j;
+ }
+ }
+
+ cout << "v: " << String(v);
+ cout << "m: " << String(m );
+ cout << "q: " << String(q);
+ cout << "m*q; " << String(m*q);
+ cout << "m*m: " << String(m*m);
+ m.OK();
+ cout << "m: " << String(m);
+ cout << "q.band " << q.band_i() << endl;
+ q.try_set_band();
+ cout << "q(B): " << q;
+ q.OK();
+ Matrix sum(q+q);
+ cout << "q + q " << sum;
+ q.OK();
+ cout << "q*q: " << q*q;
+ q.OK();
+
+ Matrix hilbert(N,N), h2(hilbert);
+ for (int i=0; i < N; i++) {
+ for (int j=0; j < N; j++) {
+ hilbert(i,j) = 1/(i+j+1);
+ h2 (i,j) = (abs(i-j) > 3) ?0 : hilbert(i,j);
+ }
+ }
+ h2.try_set_band();
+ Choleski_decomposition ch(h2);
+ cout << "red Hilbert " << h2;
+ cout << "choleski " << ch.L;
+}
+
+ADD_TEST(matrix);
# generic stuff/Makefile
#
include ./$(depth)/make/Include.make
-#
# list of distribution files:
#
-INITFILES = $(wildcard *.ly)
-DISTFILES = Makefile $(INITFILES)
-#
+INIFILES = $(wildcard *.ly)
+DISTFILES = Makefile $(INIFILES)
+
localinstall:
$(INSTALL) -d $(datadir)/lilypond/init
- $(INSTALL) -m 644 $(INITFILES) $(datadir)/lilypond/init
+ $(INSTALL) -m 644 $(INIFILES) $(datadir)/lilypond/init
localuninstall:
for i in $(INIFILES) ; do rm -f $(datadir)/lilypond/init/$$i; done
+++ /dev/null
-
-% enough for the parsing step
-
-include "init/dutch.ly"
-include "init/table_sixteen.ly"
\consists "Swallow_engraver";
}
\consists "Vertical_align_engraver";
+ \consists "Line_group_engraver";
}
orchestral_score_translator = \requesttranslator {
+\include "performer.ly"
default_midi = \midi {
\tempo 4:60;
- \include "performer.ly"
+ \requesttranslator{ \default_midi_perf }
}
interline = 4.\pt;
notewidth = 5.0\pt;
wholewidth = 4.8\pt;
- unitspace = 30.\pt;
- basicspace = 5.0\pt;
+ unitspace = 22.\pt;
+ basicspace = 4.\pt;
%
interbeam = 2.667\pt;
%
% setup for Request->Element conversion. Guru-only
%
+staff_perf = \requesttranslator {
+ Performer "Staff_performer"
+ \alias "Staff";
-\requesttranslator {
+ \contains\requesttranslator{
+ Performer "Performer_group_performer"
+ \alias "Voice_group";
+ \contains\requesttranslator{
+ Performer "Performer_group_performer"
+ \consists "Note_performer";
+ }
+ }
+ \consists "Key_performer";
+ \consists "Meter_performer";
+ }
+
+default_midi_perf = \requesttranslator {
Performer "Score_performer"
\alias "Score";
-% \consists "Clef_performer";
-% \consists "Key_performer";
-% \consists "Meter_performer";
+
% \consists "Tempo_performer";
- \contains\requesttranslator {
+ \contains \requesttranslator{ \staff_perf }
+ \contains\requesttranslator{
+ Performer "Performer_group_performer"
+ \alias "Piano";
+ \contains\requesttranslator{\staff_perf}
+ }
+ \contains\requesttranslator{
Performer "Staff_performer"
- \alias "Midi";
- \contains\requesttranslator{
- Performer "Voice_group_performer"
- \alias "Voice_group";
+ \alias "Lyric";
+ \contains\requesttranslator {
+ Performer "Performer_group_performer"
\contains\requesttranslator{
Performer "Performer_group_performer"
\consists "Lyric_performer";
- \consists "Note_performer";
-
}
}
- \consists "Key_performer";
\consists "Meter_performer";
- \consists "Swallow_performer";
}
+ \consists "Swallow_performer";
}
+
"|" "\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 16.0\pt
"||" "\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt
"|." "\finishbar{%}" -4.0\pt 0.0\pt 0.0\pt 16.0\pt
+ ".|" "\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt
":|" "\repeatbar" -8.0\pt 0.0\pt 0.0\pt 16.0\pt
"|:" "\startrepeat" 0.0\pt 8.0\pt 0.0\pt 16.0\pt
":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 16.0\pt
%}
\score{
- \staff{ \inputregister{melodicregs}
- \melodic{ \octave c';
+ \melodic <\multi 3;
+ { \octave c';
\meter 8/4;
\duration8;
- \stem 1; [c c'' a' f']
+ \stem \up; [c c'' a' f']
\duration16;
- \stem 1; [c c'' a' f']
+ \stem \up; [c c'' a' f']
\duration32;
- \stem 1; [c c'' a' f']
+ \stem \up; [c c'' a' f']
\duration64;
- \stem 1; [c c'' a' f']
+ \stem \up; [c c'' a' f']
\duration128;
- \stem 1; [c c'' a' f']
+ \stem \up; [c c'' a' f']
\duration 8;
- \stem 1; ['g 'g 'g 'g]
+ \stem \up; ['g 'g 'g 'g]
\duration 16;
- \stem 1; ['g 'g 'g 'g]
+ \stem \up; ['g 'g 'g 'g]
\duration 32;
- \stem 1; ['g 'g 'g 'g]
+ \stem \up; ['g 'g 'g 'g]
\duration 64;
- \stem 1; ['g 'g 'g 'g]
+ \stem \up; ['g 'g 'g 'g]
\duration 128;
- \stem 1; ['g 'g 'g 'g]
+ \stem \up; ['g 'g 'g 'g]
}
- }
- \staff{ \inputregister{melodicregs}
- \melodic{ \octave c';
+
+ { \octave c';
\meter 8/4;
\duration8;
- \stem -1; [a' 'a c e]
+ \stem \down; [a' 'a c e]
\duration16;
- \stem -1; [a' 'a c e]
+ \stem \down; [a' 'a c e]
\duration32;
- \stem -1; [a' 'a c e]
+ \stem \down; [a' 'a c e]
\duration64;
- \stem -1; [a' 'a c e]
+ \stem \down; [a' 'a c e]
\duration128;
- \stem -1; [a' 'a c e]
+ \stem \down; [a' 'a c e]
\octave c;
\duration 8;
- \stem -1; [d'' d'' d'' d'']
+ \stem \down; [d'' d'' d'' d'']
\duration 16;
- \stem -1; [d'' d'' d'' d'']
+ \stem \down; [d'' d'' d'' d'']
\duration 32;
- \stem -1; [d'' d'' d'' d'']
+ \stem \down; [d'' d'' d'' d'']
\duration 64;
- \stem -1; [d'' d'' d'' d'']
+ \stem \down; [d'' d'' d'' d'']
\duration 128;
- \stem -1; [d'' d'' d'' d'']
+ \stem \down; [d'' d'' d'' d'']
}
- }
- \paper{}
-}
+ >}
+
+
\version "0.1.0";
-cad = \melodic {
+\score {
+ \melodic {\id "Staff" "french horn";
\cadenza 1;
\grouping 1*4;\duration 8;\octave c';
c4
}
-\score {
- \melodic{ \cad }
\paper {
unitspace= 14.0\mm;
geometric= 1.4;
}
-% \midi { \tempo 4:90 }
+ \midi { \tempo 4:90; }
}
two_voice = \melodic
< \multi 2;
- { \octave c'; \stem -1;
+ { \octave c'; \stem \down;
c4 d e f g2~ g4 a [c8 d e f] c2| }
- { \stem 1;
+ { \stem \up;
g4 f e g ~ g2 g2 c4 g4 g2 }
>
two_voice_steminvert = \melodic
< \multi 2;
- { \octave c'; \stem 1;
+ { \octave c'; \stem \up;
% the f and g on 4th beat are exceptionally ugh.
c4 d e f g2 g4 a | }
- { \stem -1;
+ { \stem \down;
g4 f e g g2 g2 }
>
three_voice = \melodic
< \multi 2;
- { \stem 1;
+ { \stem \up;
g4 f e f g a g2 }
- { \hshift 1; \stem 1;
+ { \hshift 1; \stem \up;
e2 e2 e2 e2 }
- { \stem -1;
+ { \stem \down;
c4 d e d c d es }
>
rests = \melodic
< \multi 2;
- { \stem 1;
+ { \stem \up;
| r8 r r r r r r r
[c' b a g] [f e d c]
}
- { \stem -1;
+ { \stem \down;
[c8 d e f] [g a b c']
r r r r r r r r
}
restsII = \melodic {
\octave c';
< \multi2;
- { \stem 1; g' f' e' d' c' b a g f e d c }
- { \stem -1; r r r r r r r r r r r r }
+ { \stem \up; g' f' e' d' c' b a g f e d c }
+ { \stem \down; r r r r r r r r r r r r }
>
< \multi2;
- { \stem 1; r r r r r r r r r r r r }
- { \stem -1; c d e f g a b c' d' e' f' g' }
+ { \stem \up; r r r r r r r r r r r r }
+ { \stem \down; c d e f g a b c' d' e' f' g' }
>
r8 r4
< \multi2; r8 r8 >
< \multi2; r8 r8 r8 r8 >
< \multi2; r r >
< \multi2; r r r >
- \stem 1;
+ \stem \up;
[c''8 r8 c''8 c''8]
[c8 r8 c8 c8]
- \stem -1;
+ \stem \down;
[c8 r8 c8 c8]
[c''8 r8 c''8 c''8]
}
+% remark: still temporarily broken.
%{MudelaHeader
filename: coriolan-alto.ly
+++ /dev/null
-\version "0.0.58";
-
-\include "this-is-hopefully-a-nonexisting-file"
-
-
-
-mwa = \melodic{
- \meter 3/4;
- [ a8 a8 a8 a8 a8 ] %
- [ a8 ] %
-% segfault
- < { [ bes^"1"~ a bes-. g-. ] a4-.^"4" } { [ e ] } { [ c ] } > |
- a ) b ] c % warning
- & % ok; error
- a b ) ] % ok; error
-% a......... % fatal error -- assert
- a b c
- |.| %
- abc % ok; print error, no \output
- \bla % STRING, reduced to lyric_elt.
- a [ b % warning, still \output
- < a( b > % warning, still \output
- a b ,c
- a b c-*
- a b c&
- < a-. b-. >
-
-}
-
-bla = \lyric{
- These Gates will open just like windows. % ok; warning
-}
-
-
-\include "this-is-hopefully-a-nonexisting-file"
-\score{
- \staff{ bla }
- \staff{ mwa }
-}
\melodic
{ \octave c'; c4 c4
< \multi 1; { c2 c2 } { c'2 c'2 } >
- < \multi 2; { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } >
+ < \multi 2; { \stem \down; c2 c2 } { \stem \up; c'2 c'2 } >
< \multi 3; { \clef "bass"; c2 c2 } { \meter 2/4;\bar "||"; \key fis cis gis; c'2 c'2 } >
c2 c1
c1 c1
< [ e'8 g > d' cis'_"2" e' a~ g ] |
%%11
< \multi 2;
- {\stem 1; a4~ d'4 cis'4-. }
- { \stem -1; f2 e4 } > |
+ {\stem \up; a4~ d'4 cis'4-. }
+ { \stem \down; f2 e4 } > |
%%12
< [ g'8^"4" d > f' e' f' d'^"3"~ c' ] |
%%13
\clef "alto";
< \multi 2;
- { \stem 1; bes2 c'4 }
- { \stem -1; g4~ f4 e4 }% ugh
+ { \stem \up; bes2 c'4 }
+ { \stem \down; g4~ f4 e4 }% ugh
> |
%%14
< [ a8 f > g a f ] < d'4-\upbow e4 'bes4 > |
< { [ c'8 ( bes a )bes g~ bes ] } { [ d ] } { [ g ] } > |
%%21
< \multi 2;
- {\stem 1; d'4 (\stem 1; ) cis'4 d'4 }
- { \stem -1; g2 f4 }
+ {\stem \up; d'4 (\stem \up; ) cis'4 d'4 }
+ { \stem \down; g2 f4 }
> |
%%22
< { [ g8 ~ f g e ] } { [ cis ] } > < f4 d4 > |
{ e ~ f }
>
< \multi 2;
- { \stem 1; c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c }
- { \stem -1; c (e g )c'~( [b a g )d] r2 }
+ { \stem \up; c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c }
+ { \stem \down; c (e g )c'~( [b a g )d] r2 }
>
}
%%48
\textstyle "italic";
<
- { fis2.~ \group "+1"; \stem -1; f2. }
- { d'2. ~ \stem 1; d'4 r4_"decresc." d'4 }
+ { fis2.~ \group "+1"; \stem \down; f2. }
+ { d'2. ~ \stem \up; d'4 r4_"decresc." d'4 }
>
\textstyle "roman"; |
%%50
''a r4 |
%%5
\duration 8;
- < \multi 2; { \stem 1;
+ < \multi 2; { \stem \up;
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'cis 'e 'g 'e 'g e ]
[ 'd 'a d 'a d 'a ]
}
- { \stem -1;
+ { \stem \down;
'd2 r4
''bes2 r4
''a2 r4
[ 'd 'a d 'a d 'a ] |
%%11
< \multi 2;
- { \stem 1;
+ { \stem \up;
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'e 'g 'bes 'g 'bes 'g ]
[ 'a c f c f c ]
- } { \stem -1;
+ } { \stem \down;
'd2 r4
''bes2 r4
'c2 r4
%%16
[ ''f 'c 'f 'c 'f 'c ] |
< \multi 2;
- { \stem 1;
+ { \stem \up;
[ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
[ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
- { \stem -1;
+ { \stem \down;
''a2 r4
'd2 r4
''bes2 r4
%%22
[ 'f 'a c 'a 'f 'c ] |
< \multi 2; {
- \stem 1;
+ \stem \up;
[ ''a 'e 'g 'e 'g 'e ]
[ 'd 'fis 'a 'fis 'a 'fis ]
[ ''g 'd 'b 'd 'b 'd ]
[ 'd 'a d 'a d 'a ]
}
- {\stem -1;
+ {\stem \down;
''a2 r4
'd2 r4
''g2 r4
%%44
< [ 'd ''b > 'fis 'b 'fis 'b 'fis ] |
%%45
- < \multi 2; { \stem 1;
+ < \multi 2; { \stem \up;
[ ''g 'd 'b 'd 'b 'd ]
[ 'd 'a d 'a d 'a ]
} {
- \stem -1;
+ \stem \down;
''g2 r4
'd2 r4
} >
% 13 -- how to type -- where to split -- this more neatly ?
\octave c';
<\multi 2;
- { \stem 1; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 }
- { \stem 1; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
- { \stem -1; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
+ { \stem \up; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 }
+ { \stem \up; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 }
+ { \stem \down; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 }
> |
% 16
}
\clef bass;
% 13
<\multi 2;
- { \stem 1; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
- { \stem 1; \hshift 1; r4 gis4. gis8~ gis4 | \stem -1; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 }
- { \stem -1; r4 < dis4 fis4 > < cis4 e4 > }
+ { \stem \up; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 }
+ { \stem \up; \hshift 1; r4 gis4. gis8~ gis4 | \stem \down; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 }
+ { \stem \down; r4 < dis4 fis4 > < cis4 e4 > }
> |
% 16
}
% 15
\octave c';
<\multi 2;
- { \stem 1; [b8 fis8] b4 }
- { \stem -1; fis2 }
+ { \stem \up; [b8 fis8] b4 }
+ { \stem \down; fis2 }
>
%{ this chord is usually set like this:
|
|
%}
< \multi 2;
- { \stem 1; \hshift 0; e'4 }
- { \stem 1; \hshift 1; cis'4 }
- { \stem 1; \hshift 2; ais4 }
- { \stem -1; fis4 }
+ { \stem \up; \hshift 0; e'4 }
+ { \stem \up; \hshift 1; cis'4 }
+ { \stem \up; \hshift 2; ais4 }
+ { \stem \down; fis4 }
> |
% 16
<\multi 2;
- { \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] }
- { \stem 1; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 }
- { \stem -1; fis2.~ fis2.~ fis4 e2 }
+ { \stem \up; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] }
+ { \stem \up; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 }
+ { \stem \down; fis2.~ fis2.~ fis4 e2 }
> |
% 19
}
% 15
b2
<\multi 2;
- { \stem 1; ais4 | bes2. }
- { \stem -1; e4 | fis2 fis4 }
+ { \stem \up; ais4 | bes2. }
+ { \stem \down; e4 | fis2 fis4 }
>
% 17
cis'2 e'4 |
\clef "violin";
\octave c';
- \stem -1;
+ \stem \down;
r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] |
[g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] |
[es c' b a] [g f! es d] [c8 es' d' c'] |
comes =
\melodic {
\octave c'';
- \stem 1;
+ \stem \up;
r1 |
r1 |
r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] |
[d c g G]
%% 30
< \multi 2;
- { \stem 1; c2~ | c1~ | c1 }
- { \stem -1; C2~ | C1~ | C1 }
+ { \stem \up; c2~ | c1~ | c1 }
+ { \stem \down; C2~ | C1~ | C1 }
>
}
+++ /dev/null
-MAJOR_VERSION = 0
-MINOR_VERSION = 0
-PATCH_LEVEL = 77
-# use to send patches, always empty for released version:
-# include separator: ".postfix", "-pl" makes rpm barf
-
-MY_PATCH_LEVEL =
#
include Stable.make
include ./$(depth)/make/Variables.make
-include .version
+include VERSION
#
# identify module:
# list of distribution files:
#
-EXTRA_DISTFILES = .version
+EXTRA_DISTFILES = VERSION
#
# list of custom libraries:
--- /dev/null
+MAJOR_VERSION = 0
+MINOR_VERSION = 0
+PATCH_LEVEL = 78
+# use to send patches, always empty for released version:
+# include separator: ".postfix", "-pl" makes rpm barf
+
+MY_PATCH_LEVEL =
warning("Crescendo too small");
w_dim = 0;
}
-// Real lookup_wid = w_dim * 0.9; // make it slightly smaller.
return Symbol( paper()->lookup_l()->hairpin( w_dim, grow_dir_i_ < 0) );
}
#include <fstream.h>
#include <signal.h>
-#include <new.h>
+#include <std/new.h>
#include <stdlib.h>
#include "debug.hh"
#include "dstream.hh"
#include "p-score.hh"
#include "score-elem.hh"
#include "input-translator.hh"
+
Engraver* get_engraver_p(String);
Engraver_group_engraver::~Engraver_group_engraver()
else
i++;
}
-
}
bool
Engraver_group_engraver::Engraver_group_engraver()
{
- itrans_l_ =0;
+ itrans_l_ = 0;
}
void
Bar * bar_p_;
public:
Bar_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
String type_str_;
int spanned_i_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Bar);
Bar();
private:
/* *************** */
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Beam();
void add(Stem*);
Molecule*brew_molecule_p()const;
public:
Bow();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Offset center() const;
};
#endif // BOW_HH
protected:
virtual void do_pre_processing();
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Break_align_item);
};
/* ************** */
Clef_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // CLEF_HH
bool default_b_;
/* *************** */
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Clef_item);
Clef_item();
void read(Clef_engraver const&);
virtual void do_pre_move_processing();
public:
Collision_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // COLLISION_GRAV_HH
virtual void do_pre_processing();
public:
Link_array<Note_column> clash_l_arr_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void add (Note_column*ncol_l);
Collision();
#include <math.h>
#include "real.hh"
-const Real EPS=1e-7; // qlpsolve.hh
-const int MAXITER=100; // qlpsolve.hh
const Real INFTY=HUGE_VAL;
#endif
SCORE_ELEM_CLONE(Crescendo);
virtual Molecule*brew_molecule_p()const;
virtual Interval symbol_height()const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
private:
Symbol get_symbol()const;
public:
Dynamic_engraver();
~Dynamic_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void acknowledge_element(Score_elem_info);
virtual bool do_try_request(Request *req_l);
class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
protected:
virtual void do_print() const;
};
class Horizontal_group_item : public Item, public Horizontal_group {
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_group_item);
protected:
virtual void do_print() const { Elbement_group::do_print(); }
Elbement_group();
bool contains_b(Score_elem const *)const;
void add_element(Score_elem*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
class Horizontal_group : public Elbement_group {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Horizontal_group(Horizontal_group const&);
Horizontal_group(){}
void add_element(Score_elem*);
public:
Vertical_group(Vertical_group const &);
Vertical_group(){}
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
/** A class to treat a group of elements as a single entity. The
public:
Horizontal_vertical_group();
bool contains_b(Score_elem const *)const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_print() const;
void add_element(Score_elem*);
*/
virtual void terminate_engraver(Engraver * grav_l);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
/**
Remove #grav_l# from the list, and return it.
Engraver();
virtual ~Engraver(){}
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void print() const;
};
class General_script_def : public Input {
public:
VIRTUAL_COPY_CONS(General_script_def,General_script_def);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual int staff_dir_i()const;
void print() const;
virtual int rel_stem_dir_i()const;
virtual void finish() {}
virtual void start() {}
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual Global_translator *global_l() { return this; }
void add(Script*s) { Script_column::add(s) ; }
virtual void set(Stem*);
Head_column();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void do_process_requests();
virtual void do_pre_move_processing();
virtual void do_post_move_processing();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
*/
int align_i_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_align_item);
void add(Item*, int p);
Horizontal_align_item();
virtual ~Identifier() ;
void print()const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void error(String);
IDACCESSOR(Input_translator, input_translator)
IDACCESSOR(Music, music)
#define declare_id_class(Idclass, Class, accessor) \
struct Idclass : Identifier {\
- NAME_MEMBERS(); \
+ DECLARE_MY_RUNTIME_TYPEINFO; \
Idclass(String s, Class*st, int code);\
virtual Class* accessor(bool copy);\
~Idclass();\
--- /dev/null
+/*
+ ineq-constrained-qp.hh -- declare Ineq_constrained_qp
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef INEQ_CONSTRAINED_QP_HH
+#define INEQ_CONSTRAINED_QP_HH
+
+
+
+#include "matrix.hh"
+
+/// inequality constrained quadratic program
+class Ineq_constrained_qp {
+ friend class Active_constraints;
+
+ Array<Vector> cons;
+ Array<Real> consrhs;
+public:
+ Matrix quad;
+ Vector lin;
+ Real const_term;
+
+
+ /**
+ use a KKT method to assert optimality of sol
+ */
+ void assert_solution(Vector sol) const;
+ /// solve the problem using a projected gradient method
+ Vector solve(Vector start) const;
+
+ /**
+ @return the number of variables in the problem
+ */
+ int dim() const{
+ return lin.dim();
+ }
+
+ /**
+ add a constraint
+
+
+ c*vars >= r
+
+ PRE
+ c.dim() == dim();
+
+ */
+ void add_inequality_cons(Vector c, double r);
+
+ /** set up matrices to go with the problem. */
+ Ineq_constrained_qp(int novars);
+
+ /**
+ evaluate the quadratic function for input #v#
+ */
+ Real eval(Vector v);
+
+ void eliminate_var(int idx, Real value);
+ void OK()const;
+ void print() const;
+
+};
+
+// ugh
+const Real EPS=1e-7;
+
+#endif // INEQ_CONSTRAINED_QP_HH
virtual Item *item() { return this; }
Item();
Real hpos_f() const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual Line_of_score * line_l() const;
protected:
virtual void do_breakable_col_processing();
virtual void do_post_move_processing();
virtual void acknowledge_element(Score_elem_info);
Key_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
private:
void create_key();
/* *************** */
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Key_item);
Key_item(int cposition);
class Key_performer : public Performer {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Key_performer();
~Key_performer();
/*
- line-group-grav.hh -- declare
+ line-group-grav.hh -- declare Line_group_engraver
source file of the GNU LilyPond music typesetter
virtual void acknowledge_element(Score_elem_info);
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Line_group_engraver();
};
virtual void acknowledge_element(Score_elem_info);
virtual void do_pre_move_processing();
Local_key_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // LOCALKEYGRAV_HH
update item if Items are removed
*/
struct Local_key_item : Item {
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Array<Local_acc> accs;
Link_array<Item> support_items_;
int c0_position;
virtual void do_process_requests();
virtual void do_post_move_processing();
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Lyric_engraver();
};
#endif // LYRIC_ENGRAVER_HH
class Lyric_performer : public Performer {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Lyric_performer();
~Lyric_performer();
virtual void do_creation_processing();
virtual void do_post_move_processing();
Meter_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // METERGRAV_HH
class Meter_performer : public Performer {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Meter_performer();
~Meter_performer();
Molecule*brew_molecule_p() const;
public:
Meter(Array<Scalar> args) ;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Meter);
};
#endif // METER_HH
#ifndef MIDI_ITEM_HH
#define MIDI_ITEM_HH
+
#include "string.hh"
#include "lily-proto.hh"
+#include "virtual-methods.hh"
+
+/**
+ Any piece of midi information.
+ Maybe use base classes for RIFF files?
+ */
struct Midi_item {
+ Midi_item() { }
+ DECLARE_MY_RUNTIME_TYPEINFO;
static String i2varint_str( int i );
virtual void output_midi( Midi_stream& midi_stream_r ) const;
virtual String str() const = 0;
- NAME_MEMBERS();
+private:
+ Midi_item(Midi_item const&){}
+ void operator=(Midi_item const&){}
};
struct Midi_key : public Midi_item {
Midi_key( int accidentals_i, int minor_i );
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual String str() const;
- NAME_MEMBERS();
/* *************** */
int accidentals_i_;
int minor_i_;
};
+/**
+ Change instrument event
+ */
+struct Midi_instrument : public Midi_item {
+ Midi_instrument( int channel_i, String instrument_str );
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+ virtual String str() const;
+
+ int channel_i_;
+ Byte program_byte_;
+};
+
struct Midi_note : public Midi_item {
/**
- Generate a note-event on a channel pitch.
+ Generate a note-event on a channel.
@param #melreq_l# is the pitch.
*/
Midi_note( Melodic_req* melreq_l, int channel_i, bool on_b );
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
virtual String str() const;
/* *************** */
struct Midi_duration : public Midi_item {
Midi_duration( Real seconds_f );
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual String str() const;
- NAME_MEMBERS();
/* *************** */
Real seconds_f_;
};
struct Midi_chunk : Midi_item {
Midi_chunk();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void add( String str );
void set( String header_str, String data_str, String footer_str );
virtual String str() const;
- NAME_MEMBERS();
private:
String data_str_;
String footer_str_;
struct Midi_header : Midi_chunk {
/* *************** */
Midi_header( int format_i, int tracks_i, int clocks_per_4_i );
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
struct Midi_text : Midi_item {
MARKER, CUE_POINT
};
Midi_text( Midi_text::Type type, String text_str );
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
virtual String str() const;
/* *************** */
Type type_;
struct Midi_tempo : Midi_item {
Midi_tempo( int per_minute_4_i );
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual String str() const;
/* *************** */
struct Midi_time : Midi_item {
Midi_time( int num_i, int den_i, int clocks_per_1_i );
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual String str() const;
struct Midi_track : Midi_chunk {
int number_i_;
/* *************** */
- Midi_track( );
- NAME_MEMBERS();
+ Midi_track();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void add( int delta_time_i, String event );
-// void add( Moment delta_time_moment, Midi_item& mitem_r );
void add( Moment delta_time_moment, Midi_item* mitem_l );
};
public:
Music_iterator *daddy_iter_l_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Array<Translator *>report_to_l_arr_;
Translator *report_to_l()const;
class Change_iterator : public Music_iterator {
Change_reg * change_l_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual void process_and_next(Moment);
Change_iterator(Change_reg*);
};
public:
~Chord_iterator();
Chord_iterator(Chord const*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void do_print()const;
virtual void construct_children();
bool last_b_;
public:
Request_chord_iterator(Request_chord*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void process_and_next(Moment);
void next_element();
public:
Voice_iterator(Voice const*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void do_print()const;
virtual void construct_children();
String id_str_;
Music_list(Music_list const&);
Music_list();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Music_list,Music);
virtual void add(Music*);
virtual void transpose(Melodic_req const *);
class Chord : public Music_list {
public:
Chord();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Chord,Music);
virtual void translate(Moment dt);
virtual MInterval time_int()const;
class Request_chord : public Chord {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Request_chord();
VIRTUAL_COPY_CONS(Request_chord,Music);
};
Moment offset_mom_;
Voice();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Voice, Music);
virtual void translate(Moment dt);
virtual MInterval time_int()const;
/// what name (or look for this name)
String id_str_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Change_reg, Music);
};
#endif // MUSIC_LIST_HH
virtual void transpose(Melodic_req const *);
virtual void translate(Moment dt);
VIRTUAL_COPY_CONS(Music,Music);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Music();
protected:
virtual void do_print() const;
virtual void do_post_move_processing();
public:
Note_column_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // NOTE_COLUMN_GRAV_HH
Interval_t<int> head_positions_interval()const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Note_column();
virtual void set(Stem *);
void sort();
class Note_head : public Item {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
bool rest_b_;
int position_i_;
class Note_performer : public Performer {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Note_performer();
~Note_performer();
class Performer_group_performer : public Performer, public virtual Translator {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Input_translator* itrans_l_;
Performer_group_performer();
class Performer {
bool init_b_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Performer_group_performer* daddy_perf_l_;
Performer();
#ifndef QLP_HH
#define QLP_HH
-#include "matrix.hh"
-
-/// inequality constrained quadratic program
-class Ineq_constrained_qp {
- friend class Active_constraints;
-
- Array<Vector> cons;
- Array<Real> consrhs;
-public:
- Matrix quad;
- Vector lin;
- Real const_term;
-
-
- /**
- use a KKT method to assert optimality of sol
- */
- void assert_solution(Vector sol) const;
- /// solve the problem using a projected gradient method
- Vector solve(Vector start) const;
-
- /**
- @return the number of variables in the problem
- */
- int dim() const{
- return lin.dim();
- }
-
- /**
- add a constraint
-
-
- c*vars >= r
-
- PRE
- c.dim() == dim();
-
- */
- void add_inequality_cons(Vector c, double r);
-
- /** set up matrices to go with the problem. */
- Ineq_constrained_qp(int novars);
-
- /**
- evaluate the quadratic function for input #v#
- */
- Real eval(Vector v);
-
- void eliminate_var(int idx, Real value);
- void OK()const;
- void print() const;
-
-};
-
+#include "ineq-constrained-qp.hh"
/**
Quadratic programming with mixed linear constraints.
#ifndef QLPSOLVE_HH
#define QLPSOLVE_HH
-#include "qlp.hh"
+
#include "matrix.hh"
virtual ~Request(){}
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Request,Music);
virtual MInterval time_int() const;
#define REQUESTMETHODS(T,accessor) \
virtual T * accessor() { return this;}\
-NAME_MEMBERS();\
+DECLARE_MY_RUNTIME_TYPEINFO;\
VIRTUAL_COPY_CONS(T, Request);\
virtual void do_print() const
virtual void do_pre_move_processing();
public:
Rest_collision_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // REST_COLLISION_GRAV_HH
void add(Note_column*);
void add(Rest_column*);
void add(Collision*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Rest_collision();
protected:
virtual void do_post_processing();
*/
class Rest_column : public Head_column {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void translate_heads(int dy);
};
const char* type_ch_C_;
int priority_i_;
Score_align_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void acknowledge_element(Score_elem_info);
virtual void do_pre_move_processing();
virtual ~Score_elem();
Score_elem();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Interval width() const;
Interval height() const;
void typeset_all();
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Score_engraver();
class Score_horizontal_align_engraver : public Engraver {
Break_align_item * halign_p_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Score_horizontal_align_engraver();
protected:
virtual void acknowledge_element(Score_elem_info);
public Performer_group_performer, public Global_translator
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Score_performer();
~Score_performer();
virtual String TeX_string() const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Line_of_score();
void add(Score_elem *);
public:
Link_array<Script> script_l_arr_;
Link_array<Item> support_l_arr_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void add(Script *);
void add_support(Item*);
virtual int priority_i()const;
virtual bool inside_b()const;
virtual Atom get_atom(Paper_def* p, int dir_i_)const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual bool do_equal_b(General_script_def const &)const;
virtual void do_print() const;
/* *************** */
bool acceptable_elem_b(Score_elem*);
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Script_engraver();
protected:
virtual bool do_try_request(Request*);
static int compare(Script *const&, Script *const&) ;
Script();
void set_stem(Stem*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
virtual void do_post_move_processing();
public:
Slur_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SLURGRAV_HH
virtual void do_substitute_dependency(Score_elem*, Score_elem*);
virtual void do_pre_processing();
SCORE_ELEM_CLONE(Slur);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SLUR_HH
Array<Bar*> bar_l_arr_;
Vertical_align_element * valign_l_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Span_bar_engraver();
protected:
Link_array<Bar> spanning_l_arr_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Span_bar);
void add(Bar* );
void set( Vertical_align_element *);
class Span_score_bar_engraver : public Span_bar_engraver
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual Span_bar* get_span_bar_p()const;
};
class Piano_bar_engraver : public Span_score_bar_engraver
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual Span_bar * get_span_bar_p() const;
};
class Span_score_bar : public Span_bar
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Span_score_bar);
Span_score_bar();
protected:
class Piano_brace : public Span_score_bar
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Piano_brace);
protected:
virtual Interval do_width()const;
virtual void do_print() const;
SCORE_ELEM_CLONE(Spanner_elem_group);
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SPANNER_ELEM_GROUP_HH
PCol *left_col_l_, *right_col_l_;
/* *************** */
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
virtual Spanner* spanner() { return this; }
Spanner();
bool broken_b() const;
class Staff_performer : public Performer_group_performer
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Staff_performer();
~Staff_performer();
Staff_side();
void add_support(Score_elem*);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual Interval symbol_height() const;
Staff_symbol *span_p_;
public:
Staff_sym_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual ~Staff_sym_engraver();
virtual void do_process_requests();
void set_extent(PCol* p1, PCol* p2);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Staff_symbol(int lines);
Real inter_note_f()const;
int steps_i()const;
SCORE_ELEM_CLONE(Line_of_staff);
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
/* *************** */
/**
int default_dir_i_;
public:
/* *************** */
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Stem_beam_engraver();
protected:
/// ensure that this Stem also encompasses the Notehead #n#
void add(Note_head*n);
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Real hpos_f()const;
virtual void handle_broken_dependencies();
virtual void do_add_processing();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SUPER_ELEM_HH
bool acceptable_request_b(Request*) const;
bool do_try_request(Request*) ;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // SWALLOW_GRAV_HH
class Swallow_performer : public Performer {
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual bool do_try_request (Request* ) { return true; }
};
class Text_def : public General_script_def {
protected:
virtual Atom get_atom(Paper_def* p, int dir_i_)const;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
VIRTUAL_COPY_CONS(Text_def,General_script_def);
public:
/**
virtual void acknowledge_element(Score_elem_info);
public:
Text_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // TEXTGRAV_HH
Text_item(General_script_def*,int dir=0);
virtual ~Text_item();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
General_script_def * tdef_p_;
Directional_spanner * support_span_l_;
General_script_def * spec_p_;
Offset text_off_;
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
void set_support(Directional_spanner*);
Text_spanner();
virtual void set_feature(Feature);
public:
Tie_engraver();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
};
#endif // TIE_GRAV_HH
void set_head(int, Note_head*head_l);
Tie();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Tie);
};
#endif // TIE_HH
virtual Translator *find_get_translator_l(String name, String id)=0;
virtual Translator *ancestor_l(int l=1)=0;
virtual ~Translator(){}
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Translator();
virtual Translator *get_default_interpreter()=0;
};
void add(Score_elem*);
bool contains_b(Score_elem const*)const;
Vertical_align_element();
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
protected:
virtual void do_substitute_dependency(Score_elem*,Score_elem*);
virtual void do_post_processing() ;
Vertical_align_spanner * valign_p_;
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
Vertical_align_engraver();
protected:
virtual void acknowledge_element(Score_elem_info);
class Vertical_align_spanner : public Vertical_align_element, public Spanner
{
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Vertical_align_spanner);
virtual void do_print() const { Vertical_align_element::do_print() ; }
public:
- NAME_MEMBERS();
+ DECLARE_MY_RUNTIME_TYPEINFO;
static bool static_acceptable_request_b(Request*);
Voice_group_engravers();
};
+++ /dev/null
-/*
- voice-group-performer.hh -- declare Voice_group_performer
-
- (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
- Jan Nieuwenhuizen <jan@digicash.com>
- */
-
-#ifndef VOICE_GROUP_PERFORMER_HH
-#define VOICE_GROUP_PERFORMER_HH
-
-#include "performer-group-performer.hh"
-
-#if 0
-class Voice_performer_group_performer : public Performer_group_performer {
-public:
- Voice_performer_
-
-};
-
-#endif
-
-class Voice_group_performer : public Performer_group_performer {
-public:
- NAME_MEMBERS();
-
- Voice_group_performer();
- ~Voice_group_performer();
-
-private:
-};
-
-
-#if 0
-class Voice_performer :
- public Performer_group_performer, public Interpreter
-{
-
-};
-#endif
-
-#endif // VOICE_GROUP_PERFORMER_HH
--- /dev/null
+/*
+ ineq-constrained-qp.cc -- implement Ineq_constrained_qp
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+#include "ineq-constrained-qp.hh"
+#include "qlpsolve.hh"
+#include "const.hh"
+#include "debug.hh"
+/*
+ MAy be this also should go into a library
+ */
+
+const int MAXITER=100; // qlpsolve.hh
+
+/*
+ assume x(idx) == value, and adjust constraints, lin and quad accordingly
+
+ TODO: add const_term
+ */
+void
+Ineq_constrained_qp::eliminate_var(int idx, Real value)
+{
+ Vector row(quad.row(idx));
+ row*= value;
+
+ quad.delete_row(idx);
+
+ quad.delete_column(idx);
+
+ lin.del(idx);
+ row.del(idx);
+ lin +=row ;
+
+ for (int i=0; i < cons.size(); i++) {
+ consrhs[i] -= cons[i](idx) *value;
+ cons[i].del(idx);
+ }
+}
+
+void
+Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
+{
+ cons.push(c);
+ consrhs.push(r);
+}
+
+Ineq_constrained_qp::Ineq_constrained_qp(int novars):
+ quad(novars),
+ lin(novars),
+ const_term (0.0)
+{
+}
+
+void
+Ineq_constrained_qp::OK() const
+{
+#if !defined(NDEBUG) && defined(PARANOID)
+ assert(cons.size() == consrhs.size());
+ Matrix Qdif= quad - quad.transposed();
+ assert(Qdif.norm()/quad.norm() < EPS);
+#endif
+}
+
+
+Real
+Ineq_constrained_qp::eval (Vector v)
+{
+ return v * quad * v + lin * v + const_term;
+}
+
+
+int
+min_elt_index(Vector v)
+{
+ Real m=INFTY; int idx=-1;
+ for (int i = 0; i < v.dim(); i++){
+ if (v(i) < m) {
+ idx = i;
+ m = v(i);
+ }
+ assert(v(i) <= INFTY);
+ }
+ return idx;
+}
+
+
+/**the numerical solving. Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
+ Prentice Hall.
+
+ Section 13.3
+
+ This is a "projected gradient" algorithm. Starting from a point x
+ the next point is found in a direction determined by projecting
+ the gradient onto the active constraints. (well, not really the
+ gradient. The optimal solution obeying the active constraints is
+ tried. This is why H = Q^-1 in initialisation) )
+
+
+ */
+Vector
+Ineq_constrained_qp::solve(Vector start) const
+{
+ if (!dim())
+ return Vector(0);
+ // experimental
+// quad.try_set_band();
+
+ Active_constraints act(this);
+
+
+ act.OK();
+
+
+ Vector x(start);
+ Vector gradient=quad*x+lin;
+// Real fvalue = x*quad*x/2 + lin*x + const_term;
+// it's no use.
+
+ Vector last_gradient(gradient);
+ int iterations=0;
+
+ while (iterations++ < MAXITER) {
+ Vector direction= - act.find_active_optimum(gradient);
+
+ mtor << "gradient "<< gradient<< "\ndirection " << direction<<"\n";
+
+ if (direction.norm() > EPS) {
+ mtor << act.status() << '\n';
+
+ Real minalf = INFTY;
+
+ Inactive_iter minidx(act);
+
+
+ /*
+ we know the optimum on this "hyperplane". Check if we
+ bump into the edges of the simplex
+ */
+
+ for (Inactive_iter ia(act); ia.ok(); ia++) {
+
+ if (ia.vec() * direction >= 0)
+ continue;
+ Real alfa= - (ia.vec()*x - ia.rhs())/
+ (ia.vec()*direction);
+
+ if (minalf > alfa) {
+ minidx = ia;
+ minalf = alfa;
+ }
+ }
+ Real unbounded_alfa = 1.0;
+ Real optimal_step = min(minalf, unbounded_alfa);
+
+ Vector deltax=direction * optimal_step;
+ x += deltax;
+ gradient += optimal_step * (quad * deltax);
+
+ mtor << "step = " << optimal_step<< " (|dx| = " <<
+ deltax.norm() << ")\n";
+
+ if (minalf < unbounded_alfa) {
+ /* bumped into an edge. try again, in smaller space. */
+ act.add(minidx.idx());
+ mtor << "adding cons "<< minidx.idx()<<'\n';
+ continue;
+ }
+ /*ASSERT: we are at optimal solution for this "plane"*/
+
+
+ }
+
+ Vector lagrange_mult=act.get_lagrange(gradient);
+ int m= min_elt_index(lagrange_mult);
+
+ if (m>=0 && lagrange_mult(m) > 0) {
+ break; // optimal sol.
+ } else if (m<0) {
+ assert(gradient.norm() < EPS) ;
+
+ break;
+ }
+
+ mtor << "dropping cons " << m<<'\n';
+ act.drop(m);
+ }
+ if (iterations >= MAXITER)
+ WARN<<"didn't converge!\n";
+
+ mtor << ": found " << x<<" in " << iterations <<" iterations\n";
+ assert_solution(x);
+ return x;
+}
+
+
Item::find_prebroken_piece(Line_of_score*l) const
{
if (line_l() == l)
- return this;
+ return (Item*)this;
else if (broken_to_a_[0] && broken_to_a_[0]->line_l() == l)
return broken_to_a_[0];
else if (broken_to_a_[1] && broken_to_a_[1]->line_l() == l)
#include "text-item.hh"
#include "paper-def.hh"
#include "lookup.hh"
+#include "paper-def.hh"
Lyric_engraver::Lyric_engraver()
{
{
if ( lreq_l_ ) {
lyric_item_p_ = new Text_item(lreq_l_->tdef_p_ );
+
+ lyric_item_p_->translate_x( paper()->note_width()/2 );
lyric_item_p_->dir_i_ = -1;
lyric_item_p_->fat_b_ = true;
announce_element( Score_elem_info( lyric_item_p_, lreq_l_));
#include "command-request.hh"
#include "midi-item.hh"
-
-
IMPLEMENT_IS_TYPE_B1(Meter_performer,Performer);
ADD_THIS_PERFORMER(Meter_performer);
IMPLEMENT_IS_TYPE_B1(Midi_duration, Midi_item);
IMPLEMENT_IS_TYPE_B1(Midi_chunk, Midi_item);
IMPLEMENT_IS_TYPE_B1(Midi_header, Midi_chunk);
-IMPLEMENT_IS_TYPE_B1(Midi_text, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_instrument, Midi_item);
IMPLEMENT_IS_TYPE_B1(Midi_tempo, Midi_item);
+IMPLEMENT_IS_TYPE_B1(Midi_text, Midi_item);
IMPLEMENT_IS_TYPE_B1(Midi_time, Midi_item);
IMPLEMENT_IS_TYPE_B1(Midi_track, Midi_chunk);
set( "MThd", str, "" );
}
+char const* const instrument_name_sz_a_[ ] = {
+
+ /* default is usually piano */
+ /* 0 */ "piano",
+
+ /* (1-8 piano) */
+ /* 1 */ "acoustic grand",
+ /* 2 */ "bright acoustic",
+ /* 3 */ "electric grand",
+ /* 4 */ "honky-tonk",
+ /* 5 */ "electric piano 1",
+ /* 6 */ "electric piano 2",
+ /* 7 */ "harpsichord",
+ /* 8 */ "clav",
+
+ /* (9-16 chrom percussion) */
+ /* 9 */ "celesta",
+ /* 10 */ "glockenspiel",
+ /* 11 */ "music box",
+ /* 12 */ "vibraphone",
+ /* 13 */ "marimba",
+ /* 14 */ "xylophone",
+ /* 15 */ "tubular bells",
+ /* 16 */ "dulcimer",
+
+ /* (17-24 organ) */
+ /* 17 */ "drawbar organ",
+ /* 18 */ "percussive organ",
+ /* 19 */ "rock organ",
+ /* 20 */ "church organ",
+ /* 21 */ "reed organ",
+ /* 22 */ "accoridan",
+ /* 23 */ "harmonica",
+ /* 24 */ "tango accordian",
+
+ /* (25-32 guitar) */
+ /* 25 */ "acoustic guitar(nylon)",
+ /* 26 */ "acoustic guitar(steel)",
+ /* 27 */ "electric guitar(jazz)",
+ /* 28 */ "electric guitar(clean)",
+ /* 29 */ "electric guitar(muted)",
+ /* 30 */ "overdriven guitar",
+ /* 31 */ "distortion guitar",
+ /* 32 */ "guitar harmonics",
+
+ /* (33-40 bass) */
+ /* 33 */ "acoustic bass",
+ /* 34 */ "electric bass(finger)",
+ /* 35 */ "electric bass(pick)",
+ /* 36 */ "fretless bass",
+ /* 37 */ "slap bass 1",
+ /* 38 */ "slap bass 2",
+ /* 39 */ "synth bass 1",
+ /* 40 */ "synth bass 2",
+
+ /* (41-48 strings) */
+ /* 41 */ "violin",
+ /* 42 */ "viola",
+ /* 43 */ "cello",
+ /* 44 */ "contrabass",
+ /* 45 */ "tremolo strings",
+ /* 46 */ "pizzicato strings",
+ /* 47 */ "orchestral strings",
+ /* 48 */ "timpani",
+
+ /* (49-56 ensemble) */
+ /* 49 */ "string ensemble 1",
+ /* 50 */ "string ensemble 2",
+ /* 51 */ "synthstrings 1",
+ /* 52 */ "synthstrings 2",
+ /* 53 */ "choir aahs",
+ /* 54 */ "voice oohs",
+ /* 55 */ "synth voice",
+ /* 56 */ "orchestra hit",
+
+ /* (57-64 brass) */
+ /* 57 */ "trumpet",
+ /* 58 */ "trombone",
+ /* 59 */ "tuba",
+ /* 60 */ "muted trumpet",
+ /* 61 */ "french horn",
+ /* 62 */ "brass section",
+ /* 63 */ "synthbrass 1",
+ /* 64 */ "synthbrass 2",
+
+ /* (65-72 reed) */
+ /* 65 */ "soprano sax",
+ /* 66 */ "alto sax",
+ /* 67 */ "tenor sax",
+ /* 68 */ "baritone sax",
+ /* 69 */ "oboe",
+ /* 70 */ "english horn",
+ /* 71 */ "bassoon",
+ /* 72 */ "clarinet",
+
+ /* (73-80 pipe) */
+ /* 73 */ "piccolo",
+ /* 74 */ "flute",
+ /* 75 */ "recorder",
+ /* 76 */ "pan flute",
+ /* 77 */ "blown bottle",
+ /* 78 */ "skakuhachi",
+ /* 79 */ "whistle",
+ /* 80 */ "ocarina",
+
+ /* (81-88 synth lead) */
+ /* 81 */ "lead 1 (square)",
+ /* 82 */ "lead 2 (sawtooth)",
+ /* 83 */ "lead 3 (calliope)",
+ /* 84 */ "lead 4 (chiff)",
+ /* 85 */ "lead 5 (charang)",
+ /* 86 */ "lead 6 (voice)",
+ /* 87 */ "lead 7 (fifths)",
+ /* 88 */ "lead 8 (bass+lead)",
+
+ /* (89-96 synth pad) */
+ /* 89 */ "pad 1 (new age)",
+ /* 90 */ "pad 2 (warm)",
+ /* 91 */ "pad 3 (polysynth)",
+ /* 92 */ "pad 4 (choir)",
+ /* 93 */ "pad 5 (bowed)",
+ /* 94 */ "pad 6 (metallic)",
+ /* 95 */ "pad 7 (halo)",
+ /* 96 */ "pad 8 (sweep)",
+
+ /* (97-104 synth effects) */
+ /* 97 */ "fx 1 (rain)",
+ /* 98 */ "fx 2 (soundtrack)",
+ /* 99 */ "fx 3 (crystal)",
+ /* 100 */ "fx 4 (atmosphere)",
+ /* 101 */ "fx 5 (brightness)",
+ /* 102 */ "fx 6 (goblins)",
+ /* 103 */ "fx 7 (echoes)",
+ /* 104 */ "fx 8 (sci-fi)",
+
+ /* (105-112 ethnic) */
+ /* 105 */ "sitar",
+ /* 106 */ "banjo",
+ /* 107 */ "shamisen",
+ /* 108 */ "koto",
+ /* 109 */ "kalimba",
+ /* 110 */ "bagpipe",
+ /* 111 */ "fiddle",
+ /* 112 */ "shanai",
+
+ /* (113-120 percussive) */
+ /* 113 */ "tinkle bell",
+ /* 114 */ "agogo",
+ /* 115 */ "steel drums",
+ /* 116 */ "woodblock",
+ /* 117 */ "taiko drum",
+ /* 118 */ "melodic tom",
+ /* 119 */ "synth drum",
+ /* 120 */ "reverse cymbal",
+
+ /* (121-128 sound effects) */
+ /* 121 */ "guitar fret noise",
+ /* 122 */ "breath noise",
+ /* 123 */ "seashore",
+ /* 124 */ "bird tweet",
+ /* 125 */ "telephone ring",
+ /* 126 */ "helicopter",
+ /* 127 */ "applause",
+ /* 128 */ "gunshot",
+ 0
+};
+
+Midi_instrument::Midi_instrument( int channel_i, String instrument_str )
+{
+ channel_i_ = channel_i;
+ instrument_str.to_lower();
+ for ( int i = 0; instrument_name_sz_a_[i]; i++ )
+ if ( instrument_str == String(instrument_name_sz_a_[ i ] )) {
+ program_byte_ = (Byte)i;
+ break;
+ }
+}
+
+String
+Midi_instrument::str() const
+{
+ if ( program_byte_ ) {
+ String str = String( (char)( 0xc0 + channel_i_ ) );
+ str += String( (char)program_byte_ );
+ return str;
+ }
+ return String( "" );
+}
+
String
Midi_item::i2varint_str( int i )
{
// use convention of 384 clocks per 4
// use Duration_convert
int delta_time_i = delta_time_moment * Moment( 384 ) / Moment( 1, 4 );
+ // ? int ( delta_time_moment * 4 * 384)
add( delta_time_i, mitem_l->str() );
}
Midi_stream&
Midi_stream::operator <<( String str )
{
- // still debugging...
if ( check_debug )
str = String_convert::bin2hex_str( str );
- // string now 1.0.26-2 handles binary streaming
+
*os_p_ << str;
return *this;
}
void
Midi_stream::header()
{
-// *os_p_ << "% Creator: " << get_version();
-// *os_p_ << "% Automatically generated, at ";
-// time_t t(time(0));
-// *os_p_ << ctime(&t);
-
-// 4D 54 68 64 MThd
-// String str = "MThd";
-// 00 00 00 06 chunk length
-// 00 01 format 1
-// 00 01 one track
-// 00 60 96 per quarter-note
-
-// char const ch_C = "0000" "0006" "0001" "0001" "0060";
-// str += String_convert::hex2bin_str( ch_C );
-// *os_p_ << str;
-
-// *this << Midi_header( 1, 1, tempo_i_ );
+/*
+ 4D 54 68 64 MThd
+ String str = "MThd";
+ 00 00 00 06 chunk length
+ 00 01 format 1
+ 00 01 one track
+ 00 60 96 per quarter-note
+*/
*this << Midi_header( 1, tracks_i_, clocks_per_4_i_ );
}
IMPLEMENT_IS_TYPE_B(Music_iterator);
-Chord_iterator::~Chord_iterator(){}
+Chord_iterator::~Chord_iterator()
+{
+}
+
void
Music_iterator::do_print()const
{
{
#ifndef NPRINT
mtor << name() << "{";
- mtor << "report to " << report_to_l() << " (" << report_to_l()->name() << ")\n";
+ mtor << "report to " <<
+ report_to_l() << " (" << report_to_l()->name() << ")\n";
mtor << "next at " << next_moment() << " ";
do_print();
mtor << "}\n";
#endif
}
-Translator*
+Translator *
Music_iterator::get_req_translator_l()
{
assert(report_to_l());
check_version:
VERSION STRING ';' {
- if (*$2 != MUDELA_VERSION) {
+ if ( String( *$2 ) != MUDELA_VERSION) {
if (THIS->ignore_version_b_) {
THIS->here_input().error("Incorrect mudela version");
} else {
lyrics_elt:
text_def notemode_duration {
+ /* this sux! text-def should be feature of lyric-engraver. */
if (!THIS->lexer_p_->lyric_state_b())
THIS->parser_error("Have to be in Lyric mode for lyrics");
$$ = THIS->get_word_element($1, $2);
+/*
+ qlp.cc -- implement Mixed_qp
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include "debug.hh"
#include "const.hh"
#include "qlp.hh"
#include "choleski.hh"
+
void
Mixed_qp::add_equality_cons(Vector , double )
{
eq_consrhs.push(r);
}
-void
-Ineq_constrained_qp::add_inequality_cons(Vector c, double r)
-{
- cons.push(c);
- consrhs.push(r);
-}
-
-Ineq_constrained_qp::Ineq_constrained_qp(int novars):
- quad(novars),
- lin(novars),
- const_term (0.0)
-{
-}
-
-void
-Ineq_constrained_qp::OK() const
-{
-#ifndef NDEBUG
- assert(cons.size() == consrhs.size());
- Matrix Qdif= quad - quad.transposed();
- assert(Qdif.norm()/quad.norm() < EPS);
-#endif
-}
-
-
-Real
-Ineq_constrained_qp::eval (Vector v)
-{
- return v * quad * v + lin * v + const_term;
-}
/**
eliminate appropriate variables, until we have a Ineq_constrained_qp
return sol;
}
-/*
- assume x(idx) == value, and adjust constraints, lin and quad accordingly
-
- TODO: add const_term
- */
-void
-Ineq_constrained_qp::eliminate_var(int idx, Real value)
-{
- Vector row(quad.row(idx));
- row*= value;
-
- quad.delete_row(idx);
-
- quad.delete_column(idx);
-
- lin.del(idx);
- row.del(idx);
- lin +=row ;
-
- for (int i=0; i < cons.size(); i++) {
- consrhs[i] -= cons[i](idx) *value;
- cons[i].del(idx);
- }
-}
-
-
void
Ineq_constrained_qp::assert_solution(Vector sol) const
#endif
}
-/* *************** */
-
Mixed_qp::Mixed_qp(int n)
: Ineq_constrained_qp(n)
{
try fixed point arithmetic, to speed up lily.
*/
+#include "ineq-constrained-qp.hh"
#include "qlpsolve.hh"
#include "const.hh"
#include "debug.hh"
inactive.push(i);
Choleski_decomposition chol(op->quad);
H=chol.inverse();
+ OK();
}
/** Find the optimum which is in the planes generated by the active
return H*g;
}
-/* *************************************************************** */
-
-int
-min_elt_index(Vector v)
-{
- Real m=INFTY; int idx=-1;
- for (int i = 0; i < v.dim(); i++){
- if (v(i) < m) {
- idx = i;
- m = v(i);
- }
- assert(v(i) <= INFTY);
- }
- return idx;
-}
-
-
-/**the numerical solving. Mordecai Avriel, Nonlinear Programming: analysis and methods (1976)
- Prentice Hall.
-
- Section 13.3
-
- This is a "projected gradient" algorithm. Starting from a point x
- the next point is found in a direction determined by projecting
- the gradient onto the active constraints. (well, not really the
- gradient. The optimal solution obeying the active constraints is
- tried. This is why H = Q^-1 in initialisation) )
-
-
- */
-Vector
-Ineq_constrained_qp::solve(Vector start) const
-{
- if (!dim())
- return Vector(0);
-
- Active_constraints act(this);
-
-
- act.OK();
-
-
- Vector x(start);
- Vector gradient=quad*x+lin;
-// Real fvalue = x*quad*x/2 + lin*x + const_term;
-// it's no use.
-
- Vector last_gradient(gradient);
- int iterations=0;
-
- while (iterations++ < MAXITER) {
- Vector direction= - act.find_active_optimum(gradient);
-
- mtor << "gradient "<< gradient<< "\ndirection " << direction<<"\n";
-
- if (direction.norm() > EPS) {
- mtor << act.status() << '\n';
-
- Real minalf = INFTY;
-
- Inactive_iter minidx(act);
-
-
- /*
- we know the optimum on this "hyperplane". Check if we
- bump into the edges of the simplex
- */
-
- for (Inactive_iter ia(act); ia.ok(); ia++) {
-
- if (ia.vec() * direction >= 0)
- continue;
- Real alfa= - (ia.vec()*x - ia.rhs())/
- (ia.vec()*direction);
-
- if (minalf > alfa) {
- minidx = ia;
- minalf = alfa;
- }
- }
- Real unbounded_alfa = 1.0;
- Real optimal_step = min(minalf, unbounded_alfa);
-
- Vector deltax=direction * optimal_step;
- x += deltax;
- gradient += optimal_step * (quad * deltax);
-
- mtor << "step = " << optimal_step<< " (|dx| = " <<
- deltax.norm() << ")\n";
-
- if (minalf < unbounded_alfa) {
- /* bumped into an edge. try again, in smaller space. */
- act.add(minidx.idx());
- mtor << "adding cons "<< minidx.idx()<<'\n';
- continue;
- }
- /*ASSERT: we are at optimal solution for this "plane"*/
-
-
- }
-
- Vector lagrange_mult=act.get_lagrange(gradient);
- int m= min_elt_index(lagrange_mult);
-
- if (m>=0 && lagrange_mult(m) > 0) {
- break; // optimal sol.
- } else if (m<0) {
- assert(gradient.norm() < EPS) ;
-
- break;
- }
-
- mtor << "dropping cons " << m<<'\n';
- act.drop(m);
- }
- if (iterations >= MAXITER)
- WARN<<"didn't converge!\n";
-
- mtor << ": found " << x<<" in " << iterations <<" iterations\n";
- assert_solution(x);
- return x;
-}
-
-
class C ## _align_engraver : public Score_align_engraver \
{ \
public: \
- NAME_MEMBERS(); \
+ DECLARE_MY_RUNTIME_TYPEINFO; \
C ## _align_engraver() : Score_align_engraver() \
{ type_ch_C_ = T::static_name();\
priority_i_ = p;} \
Midi_stream output_stream( midi_l_->outfile_str_, midi_item_p_arr_.size() + 1, 384 );
*mlog << "MIDI output to " << midi_l_->outfile_str_ << " ..." << endl;
- header( output_stream);
+ header( output_stream);
int track_i = 1;
for (int i=0; i< midi_item_p_arr_.size(); i++) {
Midi_item * it_p = midi_item_p_arr_[i];
((Midi_track*)it_p )->number_i_ = track_i ++;
output_stream<< *it_p;
}
+ *output_stream.os_p_ << flush;
*mlog << endl;
}
Midi_text track_name( Midi_text::TRACK_NAME, instrument_str());
midi_track_p_->add( Moment( 0 ), &track_name );
- // set instrument :-)
+ // set instrument description
Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, instrument_str() );
midi_track_p_->add( Moment( 0 ), &instrument_name );
-
+ // set instrument :-)
+ // lieve wendy, nu heb je mijn track_i_ / get_staff_i weggehaald...
+ // zie ook note-performer: ugh
+ // ugh, need to know channel (===track===staff) too
+ int channel_i = 0;
+ Midi_instrument instrument( channel_i, instrument_str() );
+ midi_track_p_->add( Moment( 0 ), &instrument );
+
Midi_tempo midi_tempo( get_tempo_i( ) );
midi_track_p_->add( Moment( 0 ), &midi_tempo );
}
*/
#include "proto.hh"
-#include "plist.hh"
#include "list.tcc"
#include "cursor.tcc"
+/*
+ template5.cc -- instantiate Intervals
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include <limits.h>
#include "proto.hh"
#include "string.hh"
Rational
Interval_t<Rational>::infinity()
{
- return INFTY;
+/*
+ windhoze-suck-suck-suck-suck-suck-thank-you-cygnus
+
+ I get tired of all these incompatibilities. We'll just assume:
+
+ that 2^31 is *Big*
+
+ */
+
+ return Rational(INT_MAX);
}
int
if (dir < 0)
idx += 128;
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
hidx = -hidx;
hidx --;
int idx =-1;
-
idx = widx * 16 + hidx;
if (xpart < 0)
idx += 128;
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
assert(dx >=0 && abs(dir) <= 1);
int y_sign = sign(dy);
- bool large = dy > 16;
+ bool large = abs(dy) > 8;
if (y_sign) {
large |= dx>= 4*16 PT;
if (hidx <0)
hidx = -hidx;
hidx --;
- if (hidx > 16) {
+ if (hidx > 8) {
WARN<<"slur to steep: " << dy << " shrinking (ugh)\n";
}
idx += 54;
}
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
+++ /dev/null
-/*
- voice-group-performer.cc -- implement Voice_group_performer
-
- (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
- Jan Nieuwenhuizen <jan@digicash.com>
- */
-
-
-#include "voice-group-performer.hh"
-#include "translator.hh"
-#include "input-translator.hh"
-#include "debug.hh"
-
-//IMPLEMENT_IS_TYPE_B2(Voice_group_performer,Performer, Translator);
-IMPLEMENT_IS_TYPE_B1(Voice_group_performer,Performer_group_performer);
-
-ADD_THIS_PERFORMER(Voice_group_performer);
-
-Voice_group_performer::Voice_group_performer()
-{
-}
-
-Voice_group_performer::~Voice_group_performer()
-{
-}
-
COMPILEINFO = @COMPILEINFO@
BISON = @BISON@
FLEX = @FLEX@
+PERL =@PERL@
+
+
rpmdocs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/$(outdir)/*.text)))\
BUGS TODO NEWS DEDICATION ANNOUNCE README
-rpmmudocs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/*.doc)))
+rpmmudocs=$(addprefix Documentation/, $(notdir $(shell ls $(depth)/Documentation/*.doc)))
rpmdvis=$(rpmmudocs:.doc=.dvi)
rpmexamples= $(addprefix input/, $(notdir $(shell ls $(depth)/input/*.{ly,tex})))
sed-version= sed 's!@TOPLEVEL_VERSION@!${TOPLEVEL_VERSION}!g'
sed-date=sed 's!@DATE@!${date}!g'
-sed-examples = sed 's!@EXAMPLE_LYS@!${rpmexamples} ${rpmdvis}!g'
+sed-examples = sed 's!@EXAMPLE_LYS@!${rpmexamples} ${rpmmudocs}!g'
sed-docs=sed 's!@TEXT_DOCS@!${rpmdocs}!g'
-$(outdir)/lilypond.spec: lilypond.spec.in $(depth)/.version
+$(outdir)/lilypond.spec: lilypond.spec.in $(depth)/VERSION
cat $< | $(sed-version) | $(sed-docs) | $(sed-examples) > $@
-$(outdir)/lilypond.lsm: lilypond.lsm.in $(depth)/.version
+$(outdir)/lilypond.lsm: lilypond.lsm.in $(depth)/VERSION
cat $< | $(sed-version) | $(sed-date) > $@
$(LD_COMMAND) $(OFILES) $(LOADLIBES)
exe: $(EXECUTABLE)
-#
-$(build): $(depth)/.version
+$(build): $(depth)/VERSION
echo 0 > $@
# dependency list of library:
#
lib: $(LIBRARY)
#
-TOCLEAN= $(allobs) $(alldeps)
# be careful about deletion.
clean: localclean
ifdef EXECUTABLE
rm -f $(EXECUTABLE)
endif
-ifdef allobs
- rm -f $(allobs)
+ifdef OFILES
+ rm -f $(OFILES)
endif
-ifdef alldeps
- rm -f $(alldeps)
+ifdef DEPFILES
+ rm -f $(DEPFILES)
endif
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
endif
-distclean: localdistclean
-ifdef SUBDIRS
- set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i localdistclean; done
-endif
-
-localdistclean:
-
-
# configure:
#
config:
doc++: $(progdocs)
doc++ -k -p -d $(DOCDIR) $^
+# ugh. should generate in out/
dist:
-mkdir $(distdir)
$(MAKE) localdist
# version stuff:
#
-$(outdir)/version.hh: .version
+$(outdir)/version.hh: VERSION
./$(lily_bindir)/make-version > $@
$(LIBLILY): dummy
$(MAKE) ./$(outdir)/$(@F) -C $(depth)/lib
-#
+
# RedHat rpm package:
#
-cp $< $(rpm-sources)
$(MAKE) -C $(make-dir) spec
rpm -ba $(makeout)/lilypond.spec
-#
+
check-rpm-doc-deps:
$(MAKE) -C $(depth)/Documentation/ xpms
#
NAME = ...
MODULE_NAME =
-include ./$(depth)/$(NAME)/.version
+include ./$(depth)/$(NAME)/VERSION
build = $(outdir)/.build #????!
#
# identify module:
#
NAME = lilypond
-include .version
+include VERSION
include ./$(depth)/make/Version.make
# generic variables:
#
SCRIPTS = configure configure.in install-sh
README_FILES = BUGS DEDICATION ANNOUNCE COPYING NEWS README TODO INSTALL.text AUTHORS.text
-EXTRA_DISTFILES= .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS)
+EXTRA_DISTFILES= .dstreamrc VERSION $(README_FILES) $(SCRIPTS) $(SYMLINKS)
# do not dist ./Makefile (is copied from make/Toplevel.make)
DISTFILES:=$(EXTRA_DISTFILES)# Makefile $(ALL_SOURCES)
rm -f INSTALL.text
ln `$(FIND) ./ -name INSTALL.text|head -1` .
-localdistclean:
- rm -rf Makefile $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen) config.cache config.status
+# all machine generated junk resides in out/
+distclean:
+ set -e; for i in `find -type d -name 'out'`; do \
+ rm -f $$i/*; done
+ rm -rf *-build-dir
+ rm -f Makefile config.cache config.status config.log
# toplevel version info, might be handy?
#
-include ./$(depth)/.version
+include $(depth)/VERSION
#
-include ./$(depth)/make/out/Configure_variables.make
-
ifeq (0,${MAKELEVEL})
MAKE:=$(MAKE) --no-builtin-rules
endif
# directory names:
-#
-outdir = out
-lily_bindir = ./$(depth)/bin
-distdir = ./$(depth)/$(DIST_NAME)
-module-distdir = ./$(depth)/$(MODULE_DIST_NAME)
+
+
+ifdef buildprefix
+top-directory := $(shell cd $(depth); pwd)
+abs-sub-directory := $(shell pwd)
+relative-sub-directory := $(subst $(top-directory),,$(abs-sub-directory))
+outdir=$(buildprefix)/$(relative-sub-directory)/out/
+else
+buildprefix=$(depth)
+outdir=out
+endif
+
+# derived names
+lily_bindir = $(depth)/bin
+distdir = $(depth)/$(DIST_NAME)
+module-distdir = $(depth)/$(MODULE_DIST_NAME)
depdir = $(outdir)
-flowerout = ./$(depth)/flower/$(outdir)
-libout = ./$(depth)/lib/$(outdir)
-lilyout = ./$(depth)/lily/$(outdir)
-mi2muout = ./$(depth)/mi2mu/$(outdir)
-makeout = ./$(depth)/make/$(outdir)
-doc-dir = ./$(depth)/Documentation
-flower-dir = ./$(depth)/flower
-lib-dir = ./$(depth)/lib
-lily-dir = ./$(depth)/lily
-mi2mu-dir = ./$(depth)/mi2mu
-make-dir = ./$(depth)/make
-include-lib = ./$(depth)/lib/include
-include-flower = ./$(depth)/flower/include
-#
+
+flowerout = $(buildprefix)/flower/out
+libout = $(buildprefix)/lib/out
+lilyout = $(buildprefix)/lily/out
+mi2muout = $(buildprefix)/mi2mu/out
+makeout = $(buildprefix)/make/out
+docout = $(buildprefix)/Documentation/out
+binout = $(buildprefix)/bin/out
+
+doc-dir = $(depth)/Documentation
+flower-dir = $(depth)/flower
+lib-dir = $(depth)/lib
+lily-dir = $(depth)/lily
+mi2mu-dir = $(depth)/mi2mu
+make-dir = $(depth)/make
+include-lib = $(depth)/lib/include
+include-flower = $(depth)/flower/include
+
+
rpm-sources = ${HOME}/rpms/SOURCES
#
+include $(makeout)/Configure_variables.make
+
# user settings:
#
-include ./$(depth)/make/User.make
+include $(depth)/make/User.make
#
#
# need to be defined in local Makefiles:
ERROR_LOG = 2> /dev/null
SILENT_LOG = 2>&1 > /dev/null
date = $(shell date +%x)
-allhh := $(shell $(FIND) ./ -name "*.hh" $(ERROR_LOG))
-allcc := $(shell $(FIND) ./ -name "*.cc" $(ERROR_LOG))
-allobs := $(shell $(FIND) ./ $(outdir) -name "*.o" $(ERROR_LOG))
-
-alldeps := $(shell $(FIND) ./ $(outdir) -name "*.dep" $(ERROR_LOG))
# version stuff:
#
# dependencies:
#
-depfile = ./$(depdir)/$(subst .o,.dep,$(notdir $@))
+depfile = $(depdir)/$(subst .o,.dep,$(notdir $@))
DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)"
#
DOCDIR=$(depth)/$(outdir)
# .hh should be first. Don't know why
-# take some trouble to vauto ignore sources and obsolete stuff.
-progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v 'obsolete/|out/') $(shell $(FIND) ./ -name '*.cc'|egrep -v 'out/|obsolete/')
+# take some trouble to auto ignore sources and obsolete stuff.
+progdocs=$(shell $(FIND) ./ -name '*.hh' |egrep -v 'out/') $(shell $(FIND) ./ -name '*.cc'|egrep -v 'out/')
pod2html=pod2html
STABLEOBS=$(addprefix $(outdir)/,$(stablecc:.cc=.o))
endif
-# substitute $(STRIP) if you want stripping
+# substitute $(STRIP) in Site.make if you want stripping
DO_STRIP=true
Begin3
Title: LilyPond
-Version: 0.0.77.jcn1
-Entered-date: 07/29/97
+Version: 0.0.78
+Entered-date: 07/30/97
Description:
-GNU LilyPond which converts music definition files into visual or
-audio output: it can typeset formatted sheet music to a TeX file and
-and (mechanical) performances to MIDI files. Features include multiple
-staffs, meters, clefs, keys, lyrics, versatile input-language, cadenzas
-beams, slurs, triplets.
+GNU LilyPond is a program which converts music definition files into
+visual or auditive output: it can typeset formatted sheet music to a
+TeX file and and (mechanical) performances to MIDI files. Features
+include multiple staffs, meters, clefs, keys, lyrics, versatile
+input-language, cadenzas beams, slurs, triplets.
Keywords: music typesetting midi notation
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
- 340k lilypond-0.0.77.jcn1.tar.gz
+ 340k lilypond-0.0.78.tar.gz
Original-site: pcnov095.win.tue.nl /pub/lilypond/
- 340k lilypond-0.0.77.jcn1.tar.gz
+ 340k lilypond-0.0.78.tar.gz
Platform: Unix/win32, GNU C++
Copying-policy: GPL
End
Version: @TOPLEVEL_VERSION@
Entered-date: @DATE@
Description:
-GNU LilyPond which converts music definition files into visual or
-audio output: it can typeset formatted sheet music to a TeX file and
-and (mechanical) performances to MIDI files. Features include multiple
-staffs, meters, clefs, keys, lyrics, versatile input-language, cadenzas
-beams, slurs, triplets.
+GNU LilyPond is a program which converts music definition files into
+visual or auditive output: it can typeset formatted sheet music to a
+TeX file and and (mechanical) performances to MIDI files. Features
+include multiple staffs, meters, clefs, keys, lyrics, versatile
+input-language, cadenzas beams, slurs, triplets.
Keywords: music typesetting midi notation
Author: hanwen@stack.nl (Han-Wen Nienhuys)
Name: lilypond
-Version: 0.0.77.jcn1
+Version: 0.0.78
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.77.jcn1.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.78.tar.gz
Summary: A preprocessor to make TeX typeset music.
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>
Icon: lelie_icon.gif
-Buildroot: /tmp/lilypond_build
+Buildroot: /tmp/lilypond-install
%description
GNU LilyPond which converts music definition files into visual or
strip lily/out/lilypond mi2mu/out/mi2mu
make prefix="$RPM_BUILD_ROOT/usr" install
%files
-%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/out/mudela-course.dvi Documentation/out/mudela-man.dvi Documentation/lelie_logo.gif
+%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README
+%doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/mudela-course.doc Documentation/mudela-man.doc
+%doc Documentation/lelie_logo.gif
/usr/bin/convert-mudela
/usr/bin/mudela-book
/usr/bin/lilypond
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>
Icon: lelie_icon.gif
-Buildroot: /tmp/lilypond_build
+Buildroot: /tmp/lilypond-install
%description
GNU LilyPond which converts music definition files into visual or
strip lily/out/lilypond mi2mu/out/mi2mu
make prefix="$RPM_BUILD_ROOT/usr" install
%files
-%doc @TEXT_DOCS@ @EXAMPLE_LYS@ Documentation/lelie_logo.gif
+%doc @TEXT_DOCS@
+%doc @EXAMPLE_LYS@
+%doc Documentation/lelie_logo.gif
/usr/bin/convert-mudela
/usr/bin/mudela-book
/usr/bin/lilypond
+++ /dev/null
-MAJOR_VERSION = 0
-MINOR_VERSION = 0
-PATCH_LEVEL = 18
-# use to send patches, always empty for released version:
-MY_PATCH_LEVEL =
-#
#
NAME = mi2mu
MODULE_NAME = mi2mu
-include $(mi2mu-dir)/.version
+include $(mi2mu-dir)/VERSION
build = $(mi2mu-dir)/$(outdir)/.build
#
# list of distribution files:
#
-EXTRA_DISTFILES = .version TODO
+EXTRA_DISTFILES = VERSION TODO
#
# list of custom libraries:
--- /dev/null
+MAJOR_VERSION = 0
+MINOR_VERSION = 0
+PATCH_LEVEL = 18
+# use to send patches, always empty for released version:
+MY_PATCH_LEVEL =
+#
str += String( (char)( ( key_i_ + 2 ) % 7 + 'A' ) );
else // heu, -2: should be - 1 1/2: A -> fis
str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a' ) );
- str = String( "% " ) + '"' + str + '"' + "; % not supported yet\n";
+ str = String( "% \"" ) + str
+ + String('"') + "; % not supported yet\n";
return str;
}
My_midi_lexer::My_midi_lexer( String &filename_str, Sources * sources )
{
source_file_l_ =sources->get_file_l(filename_str);
- switch_streams( source_file_l_->istream_l() );
+ switch_streams( source_file_l_->istream_l() ,0 );
errorlevel_i_ = 0;
char_count_ = 0;
running_status_i_ = 0;
%
\font\musicfont=musixsps
-\font\slurfont=xslu16
+\font\slurfont=xhslu16
\font\specfont=musixspx
% \def\thefont{\musicfont}
-\def\thefont{\specfont}
+%\def\thefont{\specfont}
+\def\thefont{\slurfont}
\def\mb#1{{\thefont\char#1}}