TOPLEVEL_MAJOR_VERSION = 0
TOPLEVEL_MINOR_VERSION = 0
-TOPLEVEL_PATCH_LEVEL = 55
+TOPLEVEL_PATCH_LEVEL = 56
# use to send patches, always empty for released version:
# include separator: ".postfix", "-pl" makes rpm barf
-TOPLEVEL_MY_PATCH_LEVEL =
+TOPLEVEL_MY_PATCH_LEVEL =
changes, cadenza-mode, key changes, repeat bars
-[Kudos to FSF, all linux hackers, and --of course-- especially
+[Kudos to the FSF, all linux hackers, and --of course-- especially
GrandMaster Linus T, for the OS and The Announce :-]
Han-Wen Nienhuys <hanwen@stack.nl>
-19/Apr/97 LilyPond 0.0.53 1
+19/Apr/97 LilyPond 0.0.55 1
'(lambda() (c-set-style "Stroustrup")
)
)
+If you like using font-lock, you can also add this to your F<.emacs>:
+ (setq font-lock-maximum-decoration t)
+ (setq c++-font-lock-keywords-3
+ (cons
+ '("\\b\\([a-zA-Z_]+_\\)\\b" 1 font-lock-variable-name-face)
+ c++-font-lock-keywords-3))
=head2 CLASSES and TYPES:
=over 4
=item *
+
builtin bool
=item *
+
64 bit integral type long long
=item *
+
typeof
=item *
+
operator <?, operator >?
=item *
+
the new for-scope
=item *
-class Rational (libg++)
-=item *
-named return values
+class Rational (libg++)
=back
plet === midi-note: c4*2/3; c4*385/384,
-=back
-
=item *
drop \music,
-22/Apr/97 LilyPond 0.0.54 1
+22/Apr/97 LilyPond 0.0.56 1
-22/Apr/97 LilyPond 0.0.54 2
+22/Apr/97 LilyPond 0.0.56 2
-22/Apr/97 LilyPond 0.0.54 3
+22/Apr/97 LilyPond 0.0.56 3
-22/Apr/97 LilyPond 0.0.54 4
+22/Apr/97 LilyPond 0.0.56 4
+pl 56
+ - Massive Rest/Stem/Collision/Note_column rewrite: resolve
+notehead/rest ambiguities and bugs. eg, [c8 r8 c8]
+
+pl 54.jnc1
+ - standchen.ly: repeats; lyricii to end
+ - convert-mudela: help + usage
+ - fixed midi key/meter-change (triggered by martien.ly) bug
+
+******
+April 23
pl 55
- staff-side robustification
- script-on-rest bug
Have fun!
-======================
-
IMPORTANT
- * resolve notehead/rest ambiguities and bugs. [HWN]
- eg, [c8 r8 c8]
-
-
* mi2mu man page
- * use Real for y positions.
-
* update 20 pt table
* rename mf fonts to avoid conflicts with musixtex
* abbreviations c4=16
+ * doublebar "||", finishbar "|||" (or "||." ?)
+
INPUTLANGUAGE
* relative mode for pitch entering
SMALLISH PROJECTS
- * use rest size in Collision
+ * write Rest_collision
+
+ * use Real for y positions.
* bugreport to doc++ devel: struct not in class hier; public
virtual baseclasses
* caching breakpoints / saving them.
+ * hack ElectricFence to use with LD_PRELOAD
+
* use dstream feature in mi2mu
* qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc.
* breath marks
* used fixedpoint arithmetic for min. energy.
+
+ * default convert mudela-file.ly -> mudela-file.tex
+ - move test.tex: '\include lilyponddefs' ->
+ mudela-file.ly: '\texinclude "lilyponddefs";'
+ (junking test.tex and latex.test)
+ - rename {standchen,scsii-menuetto,...}.tex
+
#!/usr/bin/perl -w
+#
+# version of "supporting" engine, not mudela conversions.
+#
+
+$convert_mudela_version = "0.1";
use Getopt::Long;
-sub
- version_string_conv
+sub version_string_conv
{
my ($from_version, $to_version) = @_;
s/\version \"0.0.$from_version\"/\version \"0.0.$to_version\"/g;
################################################################
-sub
- conv_pl0_0_50_pl0_0_52
+sub no_conv
{
-
}
-
-sub conv_pl52_pl53
+
+sub convert_0_0_52_to_0_0_53
{
s/include \"/$1\\include \"/g;
}
-sub conv_pl53_pl54
+
+sub convert_0_0_53_to_0_0_54
{
print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ;
}
###############################################################
-
-
-
-
-sub usage
+sub last_conversion
{
- print STDERR "Usage: convert-mudela\n";
- print STDERR "other options: --edit --output=FILE --show-rules\n";
- exit 2;
+ my @v = &versions;
+ return pop @v;
}
+sub identify
+{
+ print STDERR "This is convert-mudela " . $convert_mudela_version .
+ " (up to mudela version 0.0.", 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=PATCHLEVEL convert to version 0.0.PATCHLEVEL\n"
+ }
+
+# beware of the year 2000
my %minor_conversions = (50 => \&no_conv,
- 52 => \&conv_pl0_0_50_pl0_0_52,
- 53 => \&conv_pl52_pl53,
- 54 => \&conv_pl53_pl54
- );
+ 52 => \&convert_0_0_50_to_0_0_52,
+ 53 => \&convert_0_0_52_to_0_0_53,
+ 54 => \&convert_0_0_53_to_0_0_54
+ );
+
+
sub versions
{
return (sort keys %minor_conversions);
$outfile = "$infile.NEW";
$infile = "$infile";
}
- print STDERR "Input $infile.. ";
+ print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. ";
}
($from_version = get_auto_from $infile) unless defined($opt_from);
return if (!defined($from_version));
- my @v = versions;
- ($to_version = pop @v) unless (defined($opt_to));
+ ($to_version = last_conversion) unless (defined($opt_to));
die "can't open \`$infile\'" unless open INLY,$infile ;
}
}
-GetOptions ("output=s", "from=i", "to=i", "minor=i", "edit", "show-rules");
+## "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 ;
make dist;
setversion
LILYVER=$NEWVER
-mv lilypond-$LILYVER.tar.gz ../releases
+
+tarball=lilypond-$LILYVER.tar.gz
+patch=patch-$LILYVER.gz
+
+mv $tarball ../releases
cd ../test
$heredir/bin/make_patch $LASTVER $NEWVER lilypond
gzip -f9 patch-$NEWVER
-mv patch-$NEWVER.gz ../patches/
+mv $patch ../patches/
RPMS=`find ~/rpms/ -name lilypond-$NEWVER'*'rpm`
rm *.rpm {lilypond,patch}-*.gz
if [ ! -z $RPMS ]; then
ln $RPMS .
fi
-ln ../releases/lilypond-$NEWVER.tar.gz .
-ln ../patches/patch-$NEWVER.gz .
+
+ln ../releases/$tarball .
+ln ../patches/$patch .
+
-RPMS=`echo *.rpm`
-tar cf updeet {lily,patch-}*.gz $RPMS
+if [ ! -z $RPMS ]; then
+ RPMS=lilypond-$LILYVER-1.i386.rpm lilypond-$LILYVER-1.src.rpm
+fi
+tar cf updeet $tarball $patch $RPMS
tar tfv updeet
-%% BUG in MIDI!
%
% Viola Quartet
% Martien Lohman (194x-????)
% \barnumbering5
% \barnumberstyle\boxed
-globalmusic= \melodic{
- \meter 2/4;
-% \key fis
- \skip 2*56;
-% \key bes es as
- \skip 2*8;
- \meter 6/8;
- \skip 8*48;
- \meter 2/4;
- \skip 2*16;
-% \key fis
+commands = \melodic{
+ \meter 2/4;
+% \key fis
+ \skip 2*56;
+% \key bes es as
+ \skip 2*8;
+ \meter 6/8;
+ \skip 8*48;
+ \meter 2/4;
+ \skip 2*16;
+% \key fis
}
\include "mlalt.ly"
\include "mlcello.ly"
\score{
- \staff{ melodicregs globalmusic alto }
- \staff{melodicregs globalmusic violinI }
- \staff{ melodicregs globalmusic violinII }
- \staff{ melodicregs globalmusic cello }
+ \staff{ melodicregs commands alto }
+ \staff{ melodicregs commands violinI }
+ \staff{ melodicregs commands violinII }
+ \staff{ melodicregs commands cello }
\paper{
\unitspace 24\mm
\width 195\mm
%86
ges |
%87
-% = g |
+ g! |
%88
\textstyle "italic";
fis_"dacapo" \key fis;|
%%20
< { [ c'( bes a )bes g( )bes ] } { [ d ] } { [ g ] } > |
%%21
- < \multivoice {\stem 1; d'4(\stem 1; ) cis'4 d'4 } { \stem -1; g2 f4 } > |
+ < \multivoice
+ {\stem 1; d'4(\stem 1; ) cis'4 d'4 }
+ { \stem -1; g2 f4 }
+ > |
%%22
< { [ g( )f g e ] } { [ cis ] } > < f4 d4 > |
%%23
%
\version "0.0.54";
-melodie = \melodic{
- \meter 3/4 ;
+commands = \melodic{
+ \skip 2.*4;
+ \bar ":|";
+ \skip 2.*24;
+% volta1
+ \skip 2.*8;
+% volta2
+ \bar ":|";
+ \skip 2.*22;
+ \bar "||";
+ }
+
+melodie = \melodic{
+ \meter 3/4;
\clef\violin;
- \key bes ;
- \octave c' ;
- \duration 8 ;
+ \key bes;
+ \octave c';
+ \duration 8;
r \pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > |
%%2
r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > |
%%3
\textstyle "italic";
r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] >|
- \textstyle "roman" ;
+ \textstyle "roman";
%%4
r < [ 'a cis > e < 'a cis > e < 'a cis ] > |
%%5
- [ a()bes a ]2/3 d'4. a |
+ [ a()bes a ]2/3 d'4. a |
%%6
- [ g()a g ]2/3 d'4 g r |
+ [ g()a g ]2/3 d'4 g r |
%%7
- a4.^> g [ g()f e ]2/3 |
+ a4.^> g [ g()f e ]2/3 |
%%8
f2 r4 |
%%9
- < { a'4.( )g' [ g'( f' )e' ]2/3 }
- { cis'4. e'_"dolce" \plet 2/3 ; e' \plet 1/1 ; } > |
+ < { a'4.( )g' [ g'( f' )e' ]2/3 }
+ { cis'4. e'_"dolce" \plet 2/3; e' \plet 1/1; } > |
%%10
< f'2. d'2. > |
%%11
- [ a (\pp )bes a ]2/3 f'4. a |
+ [ a (\pp )bes a ]2/3 f'4. a |
%%12
- [ g( ) a g ]2/3 e'4. d' |
+ [ g( ) a g ]2/3 e'4. d' |
%%13
- c'4. bes [ bes( ) a g ]2/3 |
+ c'4. bes [ bes( ) a g ]2/3 |
%%14
a2 r
- < { d'( | )c'4. g [ bes a g ]2/3 }
- { f \p ( | )e4._"dolce" bes
- \plet 2/3 ; g
- \plet 1/1 ;
+ < { d'( | )c'4. g [ bes a g ]2/3 }
+ { f \p ( | )e4._"dolce" bes
+ \plet 2/3; g
+ \plet 1/1;
} > |
%%16
< a2. f2. > |
%%17
\textstyle "italic";
[ a8._"cresc." cis'16 ] f'4. e'
- \textstyle "roman" ;|
+ \textstyle "roman";|
%%18
[ d'8. a16 ] f4. d |
%%19
%#% c'\grace\stemup
- [ bes (\pp ) a bes ]2/3 d'4. bes |
+ [ bes (\pp ) a bes ]2/3 d'4. bes |
%%20
a2. |
%%21
%#% a\grace
- [ g( )fis g ]2/3 bes4.^> g |
+ [ g( )fis g ]2/3 bes4.^> g |
%%22
f!2. |
%%23
< d'2. fis2. > |
%#%\volta1
%%29
- < { bes2( [ d'8.( ))g16 ] }
+ < { bes2( [ d'8.( ))g16 ] }
{ g2 \mf [ bes8. bes16 ] } > |
%%30
< { a4. [ a-. a-. a-. ] }
{ fis4. [ fis-.( fis-. )fis-. ] } > |
-%%31
+%%31
< { a4. [ a-. a-. a-. ] }
{ g4. [ cis-.( e-. )g-. ] } > |
%%32
%%40
cis'2 r4 |
%%41
- < fis'4. \> cis'4. \f > e' [ e'( )d' \! cis' ]2/3 |
+ < fis'4. \> cis'4. \f > e' [ e'( )d' \! cis' ]2/3 |
%%42
[ b8. cis'16 ] d'4^> b r |
%%43
%%44
[ b8. \> cis'16 ] d'4^> b \! r |
%%45
- [ b \p ( )ais b ]2/3 d'4. b |
+ [ b \p ( )ais b ]2/3 d'4. b |
%%46
<a!2. fis2. > |
%%47
- [ e' \f( )dis' e' ]2/3 g'4.^> cis' |
+ [ e' \f( )dis' e' ]2/3 g'4.^> cis' |
%%48
\textstyle "italic";
<
{ fis2.( \group "+1"; \stem -1; )f2. }
- { d'2. ( \stem 1 ; )d'4 r4_"decresc." d'4 }
+ { d'2. ( \stem 1; )d'4 r4_"decresc." d'4 }
>
\textstyle "roman"; |
%%50
\meter 3/4;
\clef\bass;
\key bes;
- \octave c' ;
+ \octave c';
\duration 2;
'd r4 |
%%2
%%4
''a r4 |
%%5
-\duration 8 ;
- < \multivoice { \stem 1 ;
+\duration 8;
+ < \multivoice { \stem 1;
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'cis 'e 'g 'e 'g e ]
[ 'd 'a d 'a d 'a ] |
%%11
< \multivoice
- { \stem 1 ;
+ { \stem 1;
[ 'f 'a d 'a d 'a ]
[ 'd 'e 'g 'e 'g 'e ]
[ 'e 'g 'bes 'g 'bes 'g ]
< \multivoice
{ \stem 1;
[ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ]
- [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
+ [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] }
{ \stem -1;
''a2 r4
'd2 r4
%%37
[ ''a 'e 'g 'e ''bes^> 'e ] |
%%38
- [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
+ [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
%%39
[ ''a 'e 'g 'e ''bes^> 'e ] |
%%40
- [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
+ [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > |
%%41
[ ''ais 'e 'fis 'e 'fis 'e ] |
%%42
tekstI = \lyric{
- \meter 3/4 ;
+ \meter 3/4;
\duration 4;
_ _ _
_ _ _
[ Lei- se8 ]2/3 fleh-4. en8
[ mei- ne8 ]2/3 Lie- der8 _8
Durch4. die8 [ Nacht zu8 ]2/3
- dir;2 _
+ dir;2 _
_ _ _
_ _ _
% 11
% 37
La\ss8. auch16 dir8. die16 Brust8. be-16
we- gen, _
- Lieb-4. chen,8 h\"o-8. re16
+ Lieb-4. chen,8 h\"o-8. re16
mich!2 _
Be-8. bend16 harr' ich8 _8
dir8. ent-16 ge- gen!8 _8
}
tekstII = \lyric{
- \meter 3/4;
+ \meter 3/4;
\duration 4;
_ _ _
_ _ _
Herz.2.
_ _ _
_ _ _
-
% volta 1
% 29
_ _ _ _ _ _
% volta 2
% 37
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
% 47
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
-% _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
% 57
-% _ _ _ _ _ _
+ _ _ _ _ _ _
}
\staff{ lyricregs tekstI }
\staff{ lyricregs tekstII }
- \staff{ melodicregs melodie }
- \staff{ melodicregs begeleiding }
+ \staff{ melodicregs melodie commands}
+ \staff{ melodicregs begeleiding commands }
\paper{
\width 195\mm
melody = \melodic{
\clef\violin;
+ \octave c';
c4 c | g g | a a | g g |
f f | e e | d d8.( e16 | )c2 | % :|
Stem_info::Stem_info(Stem const *s)
{
- x = s->hindex();
+ x = s->hpos_f();
int dir = s->dir_i_;
- idealy = max(dir*s->top, dir*s->bot);
- miny = max(dir*s->minnote, dir*s-> maxnote);
+ idealy = dir * s->stem_end_f();
+ miny = dir * s->stem_start_f();
assert(miny <= idealy);
-
}
/* *************** */
{
stems.bottom().add(s);
s->add_dependency(this);
- s->print_flag = false;
+ s->print_flag_b_ = false;
}
void
Array<Stem_info> sinfo;
for (iter_top(stems,i); i.ok(); i++) {
i->set_default_extents();
+ if (i->invisible_b())
+ continue;
+
Stem_info info(i);
sinfo.push(info);
}
Beam::set_stemlens()
{
iter_top(stems,s);
- Real x0 = s->hindex();
+ Real x0 = s->hpos_f();
for (; s.ok() ; s++) {
- Real x = s->hindex()-x0;
+ Real x = s->hpos_f()-x0;
s->set_stemend(left_pos + slope * x);
}
}
iter_top(stems,s);
Array<int> flags;
for (; s.ok(); s++) {
- int f = intlog2(abs(s->flag))-2;
+ int f = intlog2(abs(s->flag_i_))-2;
assert(f>0);
flags.push(f);
}
iter_top(stems,s);
for (int i=0; i < b.size() && s.ok(); i+=2, s++) {
- s->beams_left = b[i];
- s->beams_right = b[i+1];
+ s->beams_left_i_ = b[i];
+ s->beams_right_i_ = b[i+1];
}
}
Beam::do_width() const
{
Beam * me = (Beam*) this; // ugh
- return Interval( (*me->stems.top()) ->hindex(),
- (*me->stems.bottom()) ->hindex() );
+ return Interval( (*me->stems.top()) ->hpos_f(),
+ (*me->stems.bottom()) ->hpos_f() );
}
/*
Molecule
Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const
{
- assert( !next || next->hindex() > here->hindex() );
- assert( !prev || prev->hindex() < here->hindex() );
+ assert( !next || next->hpos_f() > here->hpos_f() );
+ assert( !prev || prev->hpos_f() < here->hpos_f() );
Real dy=paper()->internote()*2;
Real stemdx = paper()->rule_thickness();
Real sl = slope*paper()->internote();
/* half beams extending to the left. */
if (prev) {
- int lhalfs= lhalfs = here->beams_left - prev->beams_right ;
- int lwholebeams= here->beams_left <? prev->beams_right ;
- Real w = (here->hindex() - prev->hindex())/4;
+ int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ;
+ int lwholebeams= here->beams_left_i_ <? prev->beams_right_i_ ;
+ Real w = (here->hpos_f() - prev->hpos_f())/4;
Symbol dummy;
Atom a(dummy);
if (lhalfs) // generates warnings if not
}
if (next){
- int rhalfs = here->beams_right - next->beams_left;
- int rwholebeams = here->beams_right <? next->beams_left;
+ int rhalfs = here->beams_right_i_ - next->beams_left_i_;
+ int rwholebeams = here->beams_right_i_ <? next->beams_left_i_;
- Real w = next->hindex() - here->hindex();
+ Real w = next->hpos_f() - here->hpos_f();
Atom a = paper()->lookup_l()->beam(sl, w + stemdx);
int j = 0;
Molecule*
-Beam::brew_molecule_p() const return out;
+Beam::brew_molecule_p() const
{
+ Molecule *out=0;
Real inter=paper()->internote();
out = new Molecule;
- Real x0 = stems.top()->hindex();
+ Real x0 = stems.top()->hpos_f();
for (iter_top(stems,i); i.ok(); i++) {
PCursor<Stem*> p(i-1);
Stem * next = n.ok() ? n.ptr() : 0;
Molecule sb = stem_beams(i, next, prev);
- Real x = i->hindex()-x0;
+ Real x = i->hpos_f()-x0;
sb.translate(Offset(x, (x * slope + left_pos)* inter));
out->add(sb);
}
out->translate(Offset(x0 - left_col_l_->hpos,0));
+ return out;
}
IMPLEMENT_STATIC_NAME(Beam);
Note_column * col_l_a[4];
Real x_off [4];
int y_off[4];
- bool rest_b_a[4];
for (int j =0 ; j < 4; j++) {
if (clash_group_arr_a[j].size())
y_extent[j] = col_l_a[j]->head_positions_interval();
}
- rest_b_a[j] = (col_l_a[j]) ? col_l_a[j]->rest_b_ : false;
+
x_off [j] = 0.0;
y_off[j] = 0;
}
x_off[idx(d, true)] = d*0.5;
} while ((d *= -1) != 1);
- do {
- int i1 = idx(d, false);
- int i2 = idx(d,true);
- if (!intersection(y_extent[i1] ,
- y_extent[i2]).empty_b()) {
- if (rest_b_a[i1]) {
- y_off[i1] = -y_extent[i1][-d] + y_extent[1][d] + d*4; // ugh
- y_extent[i1] += y_off[i1];
- }
- }
- } while ((d *= -1) != 1);
+
- do {
- int i1 = idx(d, false);
- int i2 = idx(-d,false);
-
- if (d*(y_extent[i1][-d] - y_extent[i2][d] )< 0&& rest_b_a[i1]) {
- y_off[i1] = -y_extent[i1][-d] + y_extent[i2][d] +d* 4; // ugh
- y_extent[i1] += y_off[i1];
- }
- } while ((d *= -1) != 1);
-
Interval_t<int> middle( y_extent[0].min(), y_extent[3].max());
Interval_t<int> open_middle( y_extent[3].max()+1, y_extent[0].min()-1);
do{
} while ((d *= -1) != 1);
if (!middle.empty_b() &&
- middle.length() <= 1 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]
- && !rest_b_a[idx(1,0)] && !rest_b_a[idx(-1,0)]) {
-
+ middle.length() <= 1 && col_l_a[idx(1,0)] && col_l_a[idx(-1,0)]) {
Notehead * nu_l= col_l_a[idx(1,0)]->head_l_arr_[idx(1,0)];
Notehead * nd_l = col_l_a[idx(-1,0)]->head_l_arr_[idx(1,0)];
- if (! (nu_l->balltype == nd_l->balltype && nu_l->dots == nd_l->dots)) {
+ if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_)) {
x_off[idx(1,0)] -= 0.5;
x_off[1] -= 0.5;
x_off[2] += 0.5;
n_p->set_rhythmic(note_req_l_->rhythmic());
if (note_req_l_->note()) {
- n_p->position = note_req_l_->note()->height() +
+ n_p->position_i_ = note_req_l_->note()->height() +
*get_staff_info().c0_position_i_l_;
} else if (note_req_l_->rest()) {
n_p->rest_b_ = true;
#include "item.hh"
class Collision : public Item {
- Array<Note_column*> clash_l_arr_;
protected:
virtual void do_pre_processing();
public:
+ Array<Note_column*> clash_l_arr_;
NAME_MEMBERS(Collision);
void add (Note_column*ncol_l);
Collision();
struct Note_column;
struct Staff_side;
struct Staff_symbol;
-
+struct Script_column;
+struct Rest_column;
+struct Rest_collision_register;
+struct Rest_collision;
#endif // LILY_PROTO_HH
#include "register.hh"
class Note_column_register :public Request_register {
+ Rest_column * rest_col_l();
+ Note_column * note_col_l();
+
+ Array< Script * > script_l_arr_;
+ Stem * stem_l_;
Note_column *ncol_p_;
+ Rest_column *restcol_p_;
bool h_shift_b_;
int dir_i_;
+
/* *************** */
bool acceptable_elem_b(Staff_elem const*)const;
protected:
virtual void set_feature(Feature);
virtual void acknowledge_element(Staff_elem_info);
virtual void pre_move_processing();
-
+ virtual void post_move_processing();
public:
Note_column_register();
NAME_MEMBERS(Note_column_register);
#ifndef NOTE_COLUMN_HH
#define NOTE_COLUMN_HH
#include "item.hh"
-#include "interval.hh"
+#include "script-column.hh"
/** a struct for treating a group of noteheads (noteheads, stem
(chord) and scripts ) as a single entity. */
-class Note_column : public Item {
- virtual Interval do_height()const;
- virtual void do_print() const ;
- virtual void do_pre_processing();
- virtual Interval do_width()const;
+class Note_column : public Script_column {
public:
bool h_shift_b_;
- Stem * stem_l_;
- Array<Script *> script_l_arr_;
- bool rest_b_;
- Array<Notehead*> head_l_arr_;
+ Array<Notehead*> head_l_arr_;
+ Interval_t<int> head_positions_interval()const;
+
/** The relative position of the "voice" containing this
chord. Normally this would be the same as the stem direction,
but rests do not have stems. */
int dir_i_;
- Interval_t<int> head_positions_interval()const;
-
+
NAME_MEMBERS(Note_column);
Note_column();
void add(Notehead *);
void add(Stem *);
- virtual void translate(Offset);
void sort();
- void add(Script *);
+ void add(Script* s) { Script_column::add(s);}
};
+
#endif // NOTE_COLUMN_HH
NAME_MEMBERS(Notehead);
bool rest_b_;
- int position;
+ int position_i_;
+
/// -1 = lowest, 0 = inside, 1 = top
- int extremal;
+ int extremal_i_;
/// needed for the help-lines
- int staff_size;
- int dots;
- int balltype;
- int x_dir;
+ int staff_size_i_;
+ int dots_i_;
+ int balltype_i_;
+ int x_dir_i_;
/* *************** */
--- /dev/null
+/*
+ rest-collision-reg.hh -- declare Rest_collision_register
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLLISION_REG_HH
+#define REST_COLLISION_REG_HH
+
+#include "varray.hh"
+#include "register.hh"
+
+class Rest_collision_register : public Request_register {
+ Rest_collision* rest_collision_p_;
+ Array< Collision *> collision_l_arr_;
+protected:
+ virtual void acknowledge_element(Staff_elem_info);
+ virtual void pre_move_processing();
+public:
+ Rest_collision_register();
+ NAME_MEMBERS(Rest_collision_register);
+};
+#endif // REST_COLLISION_REG_HH
--- /dev/null
+/*
+ rest-collision.hh -- declare Rest_collision
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLLISION_HH
+#define REST_COLLISION_HH
+
+#include "lily-proto.hh"
+#include "item.hh"
+
+class Rest_collision : public Item {
+ Array<Rest_column *> rest_l_arr_;
+ Array<Note_column *> ncol_l_arr_;
+public:
+ void add(Rest_column*);
+ void add(Collision*);
+ NAME_MEMBERS(Rest_collision);
+protected:
+ virtual void do_post_processing();
+};
+#endif // REST_COLLISION_HH
--- /dev/null
+/*
+ rest-column.hh -- declare Rest_column
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef REST_COLUMN_HH
+#define REST_COLUMN_HH
+
+#include "script-column.hh"
+
+/**
+ struct to treat a set of rests as union (one voicegroup should
+ only produce one rest.
+ */
+class Rest_column : public Script_column {
+ Array<Notehead*> head_l_arr_;
+public:
+ int dir_i_;
+ void add(Notehead *);
+ NAME_MEMBERS(Rest_column);
+ void translate_y(Real dy);
+};
+
+#endif // REST_COLUMN_HH
--- /dev/null
+/*
+ script-column.hh -- declare Script_column
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef SCRIPT_COLUMN_HH
+#define SCRIPT_COLUMN_HH
+
+#include "item.hh"
+
+/** a struct for treating a group of noteheads (noteheads, stem
+ (chord) and scripts ) as a single entity. */
+class Script_column : public Item {
+protected:
+ virtual Interval do_height()const;
+ virtual Interval do_width()const;
+ virtual void do_print() const ;
+ virtual void do_pre_processing();
+public:
+ Array<Script *> script_l_arr_;
+ Array<Item *> support_l_arr_;
+
+ NAME_MEMBERS(Script_column);
+ virtual void translate(Offset);
+ void add(Script *);
+ void add_support(Item*);
+};
+
+#endif // SCRIPT_COLUMN_HH
POSTCALCING, // busy calculating. This is used to trap cyclic deps.
POSTCALCED, // after spacing calcs done
OUTPUT, // molecule has been output
+ DELETED, // to catch malloc mistakes.
} status;
/// the pstaff it is in
\item the flag
\item up/down position.
\end{itemize}
- */
-
-struct Stem : Item {
- /// heads that the stem encompasses (positions)
- int minnote, maxnote;
- /// false if in beam
- bool print_flag;
+ should move beam_{left, right} into Beam
+ */
+class Stem : public Item {
+
+ Real stem_bottom_f_, stem_top_f_;
- int beams_left;
- int beams_right;
/// needed for determining direction/length
- int staff_center;
-
+ int staff_size_i_;
/**extent of the stem (positions).
fractional, since Beam has to adapt them.
*/
- Real bot, top;
- Real stemlen;
-
- /// flagtype? 4 none, 8 8th flag, 0 = beam.
- int flag;
-
/**
geen gedonder, jij gaat onder.
- -1 stem points down, +1: stem points up
- */
+ -1 stem points down, +1: stem points up
+ */
+ Real stem_xoffset_f_;
+ /**
+ store the wholes (for vapourware tremolo)
+ */
+ Array<Notehead*> whole_l_arr_;
+ Array<Notehead*> head_l_arr_;
+ Array<Notehead*> rest_l_arr_;
+
+public:
+ /// flagtype? 4 none, 8 8th flag, 0 = beam.
+ int flag_i_;
- int dir_i_;
- Real stem_xoffset;
+ int beams_left_i_;
+ int beams_right_i_;
+
+ /// false if in beam
+ bool print_flag_b_;
- Array<Notehead*> heads;
+ int dir_i_;
+
/* *************** */
- Stem(int center); //, Moment duration);
+ Stem(int staff_size_i);
/// ensure that this Stem also encompasses the Notehead #n#
void add(Notehead*n);
NAME_MEMBERS(Stem);
- Real hindex()const;
+ Real hpos_f()const;
+
void do_print() const;
void set_stemend(Real);
int get_default_dir();
void set_default_stemlen();
void set_default_extents();
void set_noteheads();
- void do_pre_processing();
- virtual Interval do_width() const;
+ Real stem_length_f()const;
+ Real stem_end_f()const;
+ Real stem_start_f() const;
+ bool invisible_b()const;
+
+ /// heads that the stem encompasses (positions)
+ int max_head_i() const;
+ int min_head_i() const;
+protected:
+ void do_pre_processing();
+ virtual Interval do_width() const;
Molecule* brew_molecule_p() const;
};
#endif
Moment duration_;
Voice const *voice_C_;
IPointerList<Request*> req_p_list_;
+ Request * principal_req_l_;
/* *************** */
void transpose(Melodic_req const &)const;
return 0;
}
Array<Request_register*>
-Input_register::get_nongroup_p_arr() const return a;
+Input_register::get_nongroup_p_arr() const
{
+ Array <Request_register*>a;
Array<String> sa(get_nongroups_str_arr());
for (int i=0; i < sa.size(); i++)
a.push(get_nongroup_register_p(sa[i]));
+ return a;
}
void
void
Midi_track::add( int delta_time_i, String event_str )
{
+ if ( delta_time_i < 0 ) {
+ cout << String_convert::bin2hex_str( i2varint_str( delta_time_i ) ) << endl;
+ cout << String_convert::bin2hex_str( event_str ) << endl;
+ }
assert(delta_time_i >= 0);
Midi_chunk::add( i2varint_str( delta_time_i ) + event_str );
}
Command_req *c_l = ptr()->commandreq_l_arr_[i]->command();
Meter_change_req* meter_l = c_l->meterchange();
if ( meter_l )
- output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), 0 );
+ output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), ptr()->when() );
Key_change_req* key_l = c_l->keychange();
if ( key_l ) {
int sharps_i = key_l->sharps_i();
int flats_i = key_l->flats_i();
// midi cannot handle non-conventional keys
if ( !( flats_i && sharps_i ) )
- output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), 0 );
+ output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), ptr()->when() );
}
}
rest_req_p->set_spot( here_input());
velt_p->add(rest_req_p);
+
+ Stem_req * stem_p = new Stem_req;
+ stem_p->duration_ = *duration_p;
+ stem_p->set_spot ( here_input ());
+ velt_p->add(stem_p);
delete duration_p;
return velt_p;
}
{
Voice_element*v = new Voice_element;
v->set_spot( here_input());
+
+ v->add(rq);
if (duration_p->type_i_ >= 2) {
Stem_req * stem_req_p = new Stem_req();
rq->set_duration(*duration_p);
rq->set_spot( here_input());
-
-
- v->add(rq);
delete duration_p ;
return v;
}
#include "stem.hh"
#include "note-column.hh"
#include "script.hh"
+#include "rest-column.hh"
bool
Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const
return (nC == Script::static_name() || nC == Notehead::static_name()
|| nC == Stem::static_name());
}
+Note_column*
+Note_column_register::note_col_l()
+{
+ if (!ncol_p_){
+ ncol_p_ = new Note_column;
+ announce_element(Staff_elem_info(ncol_p_, 0));
+ }
+ return ncol_p_;
+}
+
+Rest_column *
+Note_column_register::rest_col_l()
+{
+ if (!restcol_p_) {
+ restcol_p_ = new Rest_column;
+ announce_element(Staff_elem_info(restcol_p_,0));
+ }
+ return restcol_p_;
+}
void
Note_column_register::acknowledge_element(Staff_elem_info i)
if (!acceptable_elem_b(i.elem_l_))
return;
- if (!ncol_p_){
- ncol_p_ = new Note_column;
- announce_element(Staff_elem_info(ncol_p_, 0));
- }
+
char const*nC = i.elem_l_->name();
- if (nC == Script::static_name())
- ncol_p_->add((Script*)i.elem_l_);
- else if (nC == Notehead::static_name())
- ncol_p_->add((Notehead*)i.elem_l_);
- else if (nC == Stem::static_name())
- ncol_p_->add((Stem*)i.elem_l_);
+ if (nC == Script::static_name()) {
+ script_l_arr_.push((Script*)i.elem_l_);
+ } else if (nC == Notehead::static_name()) {
+ Notehead * h_l = (Notehead*)i.elem_l_;
+ if (h_l->rest_b_)
+ rest_col_l()->add(h_l);
+ else
+ note_col_l()->add(h_l);
+ }
+ else if (nC == Stem::static_name()){
+ stem_l_ = (Stem*)i.elem_l_;
+ }
}
void
Note_column_register::pre_move_processing()
{
+ Script_column *col_l = ( ncol_p_ ) ? ncol_p_ : restcol_p_;
+ if (!col_l)
+ return;
+
+ for (int i=0; i < script_l_arr_.size(); i++)
+ col_l->add(script_l_arr_[i]);
+
+ if (ncol_p_&&stem_l_)
+ ncol_p_->add(stem_l_);
+ if (restcol_p_) {
+ if (! restcol_p_ -> dir_i_)
+ restcol_p_->dir_i_ = dir_i_;
+ typeset_element(restcol_p_);
+ restcol_p_ =0;
+ }
if (ncol_p_) {
if (! ncol_p_->dir_i_ )
ncol_p_->dir_i_ = dir_i_;
}
}
+void
+Note_column_register::post_move_processing()
+{
+ script_l_arr_.set_size(0);
+ stem_l_ =0;
+}
+
void
Note_column_register::set_feature(Feature i)
{
{
dir_i_ =0;
h_shift_b_ = false;
+
ncol_p_=0;
+ restcol_p_ =0;
+ post_move_processing();
}
IMPLEMENT_STATIC_NAME(Note_column_register);
ADD_THIS_REGISTER(Note_column_register);
void
Note_column::add(Stem*stem_l)
{
- assert(!stem_l_);
- stem_l_ = stem_l;
- add_dependency(stem_l);
+ add_support(stem_l);
}
void
Note_column::add(Notehead* n_l)
{
- if (head_l_arr_.size()){
- if (n_l->rest_b_ != rest_b_) return; // ugly fix. Should think about integrating rests into colunms.
- } else
- rest_b_ = n_l->rest_b_;
-
+ assert(!n_l->rest_b_);
head_l_arr_.push(n_l);
- add_dependency(n_l);
-}
-
-void
-Note_column::add(Script*s_l)
-{
- script_l_arr_.push(s_l);
- add_dependency(s_l);
-}
-
-void
-Note_column::translate(Offset o)
-{
- for (int i=0; i < head_l_arr_.size(); i++)
- head_l_arr_[i]->translate(o);
- for (int i=0; i < script_l_arr_.size(); i++)
- script_l_arr_[i]->translate(o);
- if (stem_l_)
- stem_l_->translate(o);
-}
-
-
-void
-Note_column::do_print()const
-{
- mtor << "heads: " << head_l_arr_.size() << '\n';
- mtor << "scripts: " << script_l_arr_.size() << '\n';
-}
-
-Interval
-Note_column::do_height()const return r
-{
- if (stem_l_)
- r.unite(stem_l_->height());
- for (int i=0; i < head_l_arr_.size(); i++)
- r.unite(head_l_arr_[i]->height());
- for (int i=0; i < script_l_arr_.size(); i++)
- r.unite(script_l_arr_[i]->height());
-}
-
-Interval
-Note_column::do_width()const return r;
-{
- if (stem_l_)
- r.unite(stem_l_->width());
- for (int i=0; i < head_l_arr_.size(); i++)
- r.unite(head_l_arr_[i]->width());
- for (int i=0; i < script_l_arr_.size(); i++)
- r.unite(script_l_arr_[i]->width());
-}
-
-void
-Note_column::do_pre_processing()
-{
- if (stem_l_ && !dir_i_)
- dir_i_ = stem_l_->dir_i_;
-
- if (!script_l_arr_.size())
- return;
-
- Array<Script*> placed_l_arr_a[4];
- for (int i=0; i < script_l_arr_.size(); i++) {
- Script*s_l = script_l_arr_[i];
- int j = (s_l->dir_i_ >0) ? 0 : 2;
- if (!s_l->inside_staff_b_)
- j ++;
-
- placed_l_arr_a[j].push(s_l);
- }
- for (int j =0; j <4; j++) {
- placed_l_arr_a[j].sort( Script::compare);
- }
-
- Notehead *top_head_l=0;
- Notehead *bot_head_l=0;
- for (int i=0; i< head_l_arr_.size(); i++) {
- if (head_l_arr_[i]->extremal == -1)
- bot_head_l = head_l_arr_[i];
- else if (head_l_arr_[i]->extremal == 1)
- top_head_l = head_l_arr_[i];
- }
- /* argh. This sux. */
- if (!top_head_l)
- top_head_l = bot_head_l;
- if (!bot_head_l)
- bot_head_l = top_head_l;
- //assert(bot_head_l && top_head_l);
- Item *support_l=top_head_l;
- int j;
- for (j = 0; j < 2; j++ ) {
- for (int i=0; i < placed_l_arr_a[j].size(); i++) {
- if (support_l)
- placed_l_arr_a[j][i]->add_support(support_l);
- support_l = placed_l_arr_a[j][i];
- }
- }
-
- support_l=bot_head_l;
- for (; j < 4; j++ ) {
- for (int i=0; i < placed_l_arr_a[j].size(); i++) {
- if (support_l)
- placed_l_arr_a[j][i]->add_support(support_l);
- support_l = placed_l_arr_a[j][i];
- }
- }
+ add_support(n_l);
}
Note_column::Note_column()
{
h_shift_b_ =false;
- stem_l_ =0;
- rest_b_ = false;
dir_i_ =0;
}
+
void
Note_column::sort()
{
Note_column::head_positions_interval()const
{
( (Note_column*)this)->sort();
- return Interval_t<int> ( head_l_arr_[0]->position,
- head_l_arr_.top()->position);
+ return Interval_t<int> ( head_l_arr_[0]->position_i_,
+ head_l_arr_.top()->position_i_);
}
Notehead::Notehead(int ss)
{
- x_dir = 0;
- staff_size=ss;
- position = 0;
- balltype = 0;
- dots = 0;
- extremal = 0;
+ x_dir_i_ = 0;
+ staff_size_i_=ss;
+ position_i_ = 0;
+ balltype_i_ = 0;
+ dots_i_ = 0;
+ extremal_i_ = 0;
rest_b_ = false;
}
void
Notehead::set_rhythmic(Rhythmic_req*r_req_l)
{
- balltype = r_req_l->duration_.type_i_;
- dots = r_req_l->duration_.dots_i_;
+ balltype_i_ = r_req_l->duration_.type_i_;
+ dots_i_ = r_req_l->duration_.dots_i_;
}
IMPLEMENT_STATIC_NAME(Notehead);
#ifndef NPRINT
if (rest_b_)
mtor << "REST! ";
- mtor << "balltype "<< balltype << ", position = "<< position
- << "dots " << dots;
+ mtor << "balltype_i_ "<< balltype_i_ << ", position_i_ = "<< position_i_
+ << "dots_i_ " << dots_i_;
#endif
}
int
Notehead::compare(Notehead *const &a, Notehead * const &b)
{
- return a->position - b->position;
+ return a->position_i_ - b->position_i_;
}
Molecule*
-Notehead::brew_molecule_p() const return out;
+Notehead::brew_molecule_p() const
{
+ Molecule*out = 0;
Paper_def *p = paper();
Real dy = p->internote();
Symbol s;
if (!rest_b_)
- s = p->lookup_l()->ball(balltype);
+ s = p->lookup_l()->ball(balltype_i_);
else
- s = p->lookup_l()->rest(balltype);
+ s = p->lookup_l()->rest(balltype_i_);
out = new Molecule(Atom(s));
- if (dots) {
- Symbol d = p->lookup_l()->dots(dots);
+ if (dots_i_) {
+ Symbol d = p->lookup_l()->dots(dots_i_);
Molecule dm;
dm.add(Atom(d));
- if (!(position %2))
+ if (!(position_i_ %2))
dm.translate(Offset(0,dy));
out->add_right(dm);
}
- out->translate(Offset(x_dir * p->note_width(),0));
- bool streepjes = (position<-1)||(position > staff_size+1);
+ out->translate(Offset(x_dir_i_ * p->note_width(),0));
+ bool streepjes = (position_i_<-1)||(position_i_ > staff_size_i_+1);
- if (rest_b_ && balltype > 2)
+ if (rest_b_ && balltype_i_ > 2)
streepjes = false;
if (streepjes) {
- int dir = sign(position);
- int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
+ int dir = sign(position_i_);
+ int s =(position_i_<-1) ? -((-position_i_)/2): (position_i_-staff_size_i_)/2;
Symbol str = p->lookup_l()->streepjes(s);
Molecule sm;
sm.add(Atom(str));
- if (position % 2)
+ if (position_i_ % 2)
sm.translate(Offset(0,-dy* dir));
out->add(sm);
}
- out->translate(Offset(0,dy*position));
+ out->translate(Offset(0,dy*position_i_));
+ return out;
}
steno_note_req notemode_duration {
if (!THIS->lexer_p_->note_state_b())
THIS->parser_error("have to be in Note mode for notes");
+ $1->set_duration (*$2);
$$ = THIS->get_note_element($1, $2);
}
| RESTNAME notemode_duration {
}
Array<Request*>
-Pulk_voice::get_req_l_arr() return req_l_arr;
+Pulk_voice::get_req_l_arr()
{
+ Array<Request*> req_l_arr;
Moment w = when();
do {
Moment sub = subtle_moment_priorities_[subtle_idx_];
}
next();
} while ( ok() && when () == w);
+ return req_l_arr;
}
void
}
Staff_info
-Request_register::get_staff_info() return inf;
+Request_register::get_staff_info()
{
- inf = daddy_reg_l_->get_staff_info();
+ return daddy_reg_l_->get_staff_info();
}
void
--- /dev/null
+/*
+ rest-collision-reg.cc -- implement Rest_collision_register
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-collision.hh"
+#include "rest-collision-reg.hh"
+#include "collision.hh"
+#include "rest-column.hh"
+#include "note-column.hh"
+
+void
+Rest_collision_register::acknowledge_element(Staff_elem_info i)
+{
+ char const * nC = i.elem_l_->name();
+ if (nC == Collision::static_name()) {
+ collision_l_arr_.push((Collision*)i.elem_l_);
+ }
+ else if (nC == Rest_column ::static_name()) {
+ if (!rest_collision_p_)
+ rest_collision_p_ = new Rest_collision;
+ rest_collision_p_->add((Rest_column*)i.elem_l_);
+ }
+}
+
+void
+Rest_collision_register::pre_move_processing()
+{
+ if (rest_collision_p_) {
+ typeset_element(rest_collision_p_);
+ rest_collision_p_ = 0;
+ }
+}
+
+Rest_collision_register::Rest_collision_register()
+{
+ rest_collision_p_ =0;
+}
+
+IMPLEMENT_STATIC_NAME(Rest_collision_register);
+ADD_THIS_REGISTER(Rest_collision_register);
--- /dev/null
+/*
+ rest-collision.cc -- implement Rest_collision
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-collision.hh"
+#include "rest-column.hh"
+#include "collision.hh"
+
+void
+Rest_collision::add(Rest_column *rc_l)
+{
+ rest_l_arr_.push(rc_l);
+ add_dependency(rc_l);
+}
+void
+Rest_collision::add(Collision * c_l)
+{
+ add_dependency(c_l);
+ for (int i=0; i < c_l->clash_l_arr_.size(); i ++)
+ ncol_l_arr_.push(c_l->clash_l_arr_[i]);
+}
+
+
+void
+Rest_collision::do_post_processing()
+{
+ #if 0
+ bool rest_b_a[4];
+ rest_b_a[j] = (col_l_a[j]) ? col_l_a[j]->rest_b_ : false;
+ do {
+ int i1 = idx(d, false);
+ int i2 = idx(d,true);
+ if (!intersection(y_extent[i1] ,
+ y_extent[i2]).empty_b()) {
+ if (rest_b_a[i1]) {
+ y_off[i1] = -y_extent[i1][-d] + y_extent[1][d] + d*4; // ugh
+ y_extent[i1] += y_off[i1];
+ }
+ }
+ } while ((d *= -1) != 1);
+
+ do {
+ int i1 = idx(d, false);
+ int i2 = idx(-d,false);
+
+ if (d*(y_extent[i1][-d] - y_extent[i2][d] )< 0&& rest_b_a[i1]) {
+ y_off[i1] = -y_extent[i1][-d] + y_extent[i2][d] +d* 4; // ugh
+ y_extent[i1] += y_off[i1];
+ }
+ } while ((d *= -1) != 1);
+
+#endif
+}
+IMPLEMENT_STATIC_NAME(Rest_collision);
--- /dev/null
+/*
+ rest-column.cc -- implement Rest_column
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "rest-column.hh"
+#include "notehead.hh"
+#include "rest-column.hh"
+
+void
+Rest_column::add(Notehead *n_l)
+{
+ add_support(n_l);
+ head_l_arr_.push(n_l);
+}
+
+void
+Rest_column::translate_y(Real dy_f)
+{
+ for (int i=0; i < head_l_arr_.size(); i++)
+ head_l_arr_[i]->translate(Offset(0,dy_f));
+}
+
+IMPLEMENT_STATIC_NAME(Rest_column);
--- /dev/null
+/*
+ script-column.cc -- implement Script_column
+
+ source file of the LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "script-column.hh"
+#include "debug.hh"
+#include "script.hh"
+#include "notehead.hh"
+#include "stem.hh"
+
+IMPLEMENT_STATIC_NAME(Script_column);
+
+
+void
+Script_column::add(Script*s_l)
+{
+ script_l_arr_.push(s_l);
+ add_dependency(s_l);
+}
+
+void
+Script_column::translate(Offset o)
+{
+ for (int i=0; i < script_l_arr_.size(); i++)
+ script_l_arr_[i]->translate(o);
+}
+
+
+void
+Script_column::do_print()const
+{
+ mtor << "scripts: " << script_l_arr_.size() << '\n';
+}
+
+Interval
+Script_column::do_height()const return r
+{
+ for (int i=0; i < script_l_arr_.size(); i++)
+ r.unite(script_l_arr_[i]->height());
+}
+
+Interval
+Script_column::do_width()const
+{
+ Interval r;
+ for (int i=0; i < script_l_arr_.size(); i++)
+ r.unite(script_l_arr_[i]->width());
+ return r;
+}
+
+void
+Script_column::do_pre_processing()
+{
+ if (!script_l_arr_.size())
+ return;
+ /* up+outside, up+inside, down+outside, down+inside */
+ Array<Script*> placed_l_arr_a[4];
+ for (int i=0; i < script_l_arr_.size(); i++) {
+ Script*s_l = script_l_arr_[i];
+ int j = (s_l->dir_i_ >0) ? 0 : 2;
+ if (!s_l->inside_staff_b_)
+ j ++;
+
+ placed_l_arr_a[j].push(s_l);
+ }
+
+ for (int j =0; j <4; j++) {
+ placed_l_arr_a[j].sort( Script::compare);
+ }
+
+
+ for (int j =0; j < 4; j++) {
+ if (placed_l_arr_a[j].size())
+ for (int i=0; i < support_l_arr_.size(); i++)
+ placed_l_arr_a[j][0]->add_support( support_l_arr_[i]);
+ }
+ Item * support_l=0;
+ int j = 0;
+ for (; j < 2; j++ ) {
+ for (int i=1; i < placed_l_arr_a[j].size(); i++) {
+ if (support_l)
+ placed_l_arr_a[j][i]->add_support(support_l);
+ support_l = placed_l_arr_a[j][i];
+ }
+ }
+ support_l = 0;
+ for (; j < 4; j++ ) {
+ for (int i=1; i < placed_l_arr_a[j].size(); i++) {
+ if (support_l)
+ placed_l_arr_a[j][i]->add_support(support_l);
+ support_l = placed_l_arr_a[j][i];
+ }
+ }
+}
+
+
+void
+Script_column::add_support(Item*i_l)
+{
+ support_l_arr_.push(i_l);
+ add_dependency(i_l);
+}
}
script_p_arr_.set_size(0);
}
+
void
Script_register::post_move_processing()
{
Offset
Slur::center() const
{
- int pos1 = encompass.top()->position;
- int pos2 = encompass[0]->position;
+ int pos1 = encompass.top()->position_i_;
+ int pos2 = encompass[0]->position_i_;
int dy = pos1-pos2;
{
int sumpos=0;
for (int i=0; i < encompass.size(); i ++) {
- sumpos += encompass[i]->position;
+ sumpos += encompass[i]->position_i_;
}
/* should consult stems */
int minp=1000, maxp=-1000; // todo
for (int i=0; i<encompass.size(); i++) {
- minp = encompass[i]->position <? minp;
- maxp = encompass[i]->position >? maxp;
+ minp = encompass[i]->position_i_ <? minp;
+ maxp = encompass[i]->position_i_ >? maxp;
}
assert(encompass.size()>0); // todo
Notehead *lnote_p =encompass[0];
Notehead *rnote_p =encompass.top();
- int lpos_i = lnote_p->position;
- int rpos_i = rnote_p->position;
- Offset left_off(lnote_p->x_dir, lpos_i + 2*dir_i_);
- Offset right_off(lnote_p->x_dir, rpos_i + 2*dir_i_);
- if (!lnote_p->extremal)
+ int lpos_i = lnote_p->position_i_;
+ int rpos_i = rnote_p->position_i_;
+ Offset left_off(lnote_p->x_dir_i_, lpos_i + 2*dir_i_);
+ Offset right_off(lnote_p->x_dir_i_, rpos_i + 2*dir_i_);
+ if (!lnote_p->extremal_i_)
left_off += Offset(0.5, -dir_i_);
- if (!rnote_p->extremal)
+ if (!rnote_p->extremal_i_)
right_off+= Offset(-0.5, -dir_i_);
int dy = int(right_off.y - left_off.y);
*/
Staff_elem::~Staff_elem()
{
- delete output;
+ assert(status < DELETED);
+ delete output;
+ status = DELETED;
+ output = 0;
}
void
}
Interval
-Staff_elem::do_width() const return r;
+Staff_elem::do_width() const
{
+ Interval r;
if (!output){
Molecule*m = brew_molecule_p();
delete m;
} else
r = output->extent().x;
+ return r;
}
+
Interval
Staff_elem::width() const
{
return r;
}
Interval
-Staff_elem::do_height() const return r
+Staff_elem::do_height() const
{
+ Interval r;
if (!output){
Molecule*m = brew_molecule_p();
r = m->extent().y;
delete m;
} else
r = output->extent().y;
+ return r;
}
Interval
#include "input-register.hh"
Staff_info
-Staff_registers::get_staff_info() return inf;
+Staff_registers::get_staff_info()
{
+ Staff_info inf;
inf = Request_register::get_staff_info();
inf.staff_sym_l_=staff_sym_l_;
inf.c0_position_i_l_ = &c0_position_i_;
+ return inf;
}
Staff_registers::Staff_registers(Input_register const*ireg_C)
Interval
-Staff_side::support_height() const return r;
+Staff_side::support_height() const
{
+ Interval r;
for (int i=0; i < support_l_arr_.size(); i++)
r.unite(support_l_arr_[i]->height());
if (r.empty_b()) {
r = Interval(0,0);
}
+ return r;
}
void
get_staff_info().time_C_->whole_in_measure_,
stem_req_l_->duration());
- stem_p_->flag = stem_req_l_->duration_.type_i_;
+ stem_p_->flag_i_ = stem_req_l_->duration_.type_i_;
if (beam_p_) {
if (stem_req_l_->duration_.type_i_<= 4)
-
- stem_req_l_->warning( "stem doesn't fit in Beam");
+ stem_req_l_->warning( "stem doesn't fit in Beam");
else
beam_p_->add(stem_p_);
- stem_p_->print_flag = false;
+ stem_p_->print_flag_b_ = false;
} else {
- stem_p_->print_flag = true;
+ stem_p_->print_flag_b_ = true;
}
announce_element(Staff_elem_info(stem_p_, stem_req_l_));
if (info.elem_l_->name() == Notehead::static_name() &&
stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){
Notehead * n_l= (Notehead*)info.elem_l_;
- if (!n_l->rest_b_)
- stem_p_->add((Notehead*)info.elem_l_);
+ stem_p_->add(n_l);
}
}
void
const int STEMLEN=7;
+int
+Stem::min_head_i()const
+{
+ int m = 1000;
+ for (int i =0; i < head_l_arr_.size(); i++)
+ m = m <? head_l_arr_[i]->position_i_;
+ return m;
+}
-Stem::Stem(int c) //, Moment len)
+int
+Stem::max_head_i() const
{
- beams_left = 0;
- beams_right = 0;
- minnote = 1000; // invalid values
- maxnote = -1000;
- bot = top = 0;
- flag = 4;
+ int m = -1000;
+ for (int i =0; i < head_l_arr_.size(); i++)
+ m = m >? head_l_arr_[i]->position_i_;
+ return m;
+
+}
+
+Stem::Stem(int c)
+{
+ beams_left_i_ = 0;
+ beams_right_i_ = 0;
+
+ stem_bottom_f_ = stem_top_f_ = 0;
+ flag_i_ = 4;
dir_i_ =0;
- staff_center=c;
- stemlen=0;
- print_flag=true;
- stem_xoffset=0;
+ staff_size_i_ = c;
+
+ print_flag_b_=true;
+ stem_xoffset_f_ =0;
+
}
IMPLEMENT_STATIC_NAME(Stem);
Stem::do_print() const
{
#ifndef NPRINT
- mtor << "flag "<< flag << " print_flag " << print_flag
- << "min,max [" << minnote << ", " << maxnote << "]";
+ mtor << "flag "<< flag_i_ << " print_flag_b_ " << print_flag_b_;
+
#endif
}
+
+Real
+Stem::stem_length_f()const
+{
+ return stem_top_f_-stem_bottom_f_ ;
+}
+
+Real
+Stem::stem_start_f()const
+{
+ return (dir_i_ < 0)? stem_top_f_ : stem_bottom_f_;
+}
+
+Real
+Stem::stem_end_f() const
+{
+ return (dir_i_ < 0)? stem_bottom_f_ : stem_top_f_;
+}
+
void
Stem::set_stemend(Real se)
{
-
// todo: margins
- if (! ((dir_i_ > 0 && se >= maxnote) || (se <= minnote && dir_i_ <0)) )
+ if (! ((dir_i_ > 0 && se >= max_head_i()) ||
+ (se <= min_head_i() && dir_i_ <0)) )
warning("Weird stem size; check for narrow beams");
-
- top = (dir_i_ < 0) ? maxnote : se;
- bot = (dir_i_ < 0) ? se : minnote;
- flag = dir_i_*abs(flag);
+
+ stem_top_f_ = (dir_i_ < 0) ? max_head_i() : se;
+ stem_bottom_f_ = (dir_i_ < 0) ? se : min_head_i();
}
void
Stem::add(Notehead *n)
{
- assert(status < PRECALCED);
-
- if (n->balltype == 1)
- return;
- int p = n->position;
- if (p < minnote)
- minnote = p;
- if (p > maxnote)
- maxnote = p;
- heads.push(n);
n->add_dependency(this);
+ if (n->rest_b_) {
+ rest_l_arr_.push(n);
+ } else if (n->balltype_i_ == 1) {
+ whole_l_arr_.push(n);
+ return;
+ } else{
+ head_l_arr_.push(n);
+ }
}
+bool
+Stem::invisible_b()const
+{
+ return !head_l_arr_.size();
+}
int
Stem::get_default_dir()
{
+ int staff_center = staff_size_i_ /2;
if (dir_i_)
return dir_i_;
- Real mean = (minnote+maxnote)/2;
+ Real mean = (min_head_i() + max_head_i())/2;
return (mean > staff_center) ? -1: 1;
}
if (!dir_i_)
set_default_dir();
- int stafftop = 2*staff_center;
- stemlen = STEMLEN + (maxnote - minnote);
// uhh... how about non 5-line staffs?
- if (maxnote < -2 && dir_i_ == 1){
- int t = staff_center - staff_center/2;
- stemlen = t - minnote +2;
- } else if (minnote > stafftop + 2 && dir_i_ == -1) {
- int t = staff_center + staff_center/2;
- stemlen = maxnote -t +2;
- }
+ if ((max_head_i() < -2 && dir_i_ == 1 )
+ ||(min_head_i() > staff_size_i_ + 2 && dir_i_ == -1) ){
+ set_stemend( staff_size_i_ /2 );
+ } else {
+ set_stemend( (dir_i_ > 0) ? max_head_i() + STEMLEN :
+ min_head_i() - STEMLEN);
- assert(stemlen);
+ }
}
void
Stem::set_default_extents()
{
- if (minnote > maxnote) {
- warning("Empty stem. Ugh!");
- minnote = -10;
- maxnote = 20;
- }
-
- if (!stemlen)
+ if (!stem_length_f())
set_default_stemlen();
- set_stemend((dir_i_< 0) ? maxnote-stemlen: minnote +stemlen);
+ set_stemend((dir_i_< 0) ?
+ max_head_i()-stem_length_f(): min_head_i() +stem_length_f());
if (dir_i_ > 0){
- stem_xoffset = paper()->note_width()-paper()->rule_thickness();
+ stem_xoffset_f_ = paper()->note_width()-paper()->rule_thickness();
} else
- stem_xoffset = 0;
+ stem_xoffset_f_ = 0;
}
void
Stem::set_noteheads()
{
- if(!heads.size())
+ if(!head_l_arr_.size())
return;
- heads.sort(Notehead::compare);
- heads[0]->extremal = -1;
- heads.top()->extremal = 1;
+ head_l_arr_.sort(Notehead::compare);
+ head_l_arr_[0]->extremal_i_ = -1;
+ head_l_arr_.top()->extremal_i_ = 1;
int parity=1;
- int lastpos = heads[0]->position;
- for (int i=1; i < heads.size(); i ++) {
- int dy =abs(lastpos- heads[i]->position);
+ int lastpos = head_l_arr_[0]->position_i_;
+ for (int i=1; i < head_l_arr_.size(); i ++) {
+ int dy =abs(lastpos- head_l_arr_[i]->position_i_);
if (dy <= 1) {
if (parity)
- heads[i]->x_dir = (stem_xoffset>0) ? 1:-1;
+ head_l_arr_[i]->x_dir_i_ = (stem_xoffset_f_>0) ? 1:-1;
parity = !parity;
} else
parity = 0;
- lastpos = heads[i]->position;
+ lastpos = head_l_arr_[i]->position_i_;
}
}
void
Stem::do_pre_processing()
{
- if (bot == top)
+ if (stem_bottom_f_== stem_top_f_)
set_default_extents();
set_noteheads();
+ flag_i_ = dir_i_*abs(flag_i_);
}
Interval
Stem::do_width()const
{
- if (!print_flag || abs(flag) <= 4)
+ if (!print_flag_b_ || abs(flag_i_) <= 4)
return Interval(0,0); // TODO!
Paper_def*p= paper();
- Interval r(p->lookup_l()->flag(flag).dim.x);
- r+= stem_xoffset;
+ Interval r(p->lookup_l()->flag(flag_i_).dim.x);
+ r+= stem_xoffset_f_;
return r;
}
Molecule*
-Stem::brew_molecule_p()const return out;
+Stem::brew_molecule_p()const
{
+ Molecule *out =0;
+ if ( invisible_b() )
+ return Staff_elem::brew_molecule_p();
+
+ Real bot = stem_bottom_f_;
+ Real top = stem_top_f_;
+ if (min_head_i() > max_head_i()) {
+ warning("Empty stem. Ugh!");
+ bot = -10;
+ top = 20;
+ }
+
assert(bot!=top);
-
Paper_def *p =paper();
Real dy = p->internote();
out = new Molecule(Atom(ss));
- if (print_flag&&abs(flag) > 4){
- Symbol fl = p->lookup_l()->flag(flag);
+ if (print_flag_b_&&abs(flag_i_) > 4){
+ Symbol fl = p->lookup_l()->flag(flag_i_);
Molecule m(fl);
- if (flag < -4){
+ if (flag_i_ < -4){
out->add_bottom(m);
- } else if (flag > 4) {
+ } else if (flag_i_ > 4) {
out->add_top(m);
} else
assert(false);
}
- out->translate(Offset(stem_xoffset,0));
+ out->translate(Offset(stem_xoffset_f_,0));
+ return out;
}
Real
-Stem::hindex()const
+Stem::hpos_f()const
{
- return hpos_f() + stem_xoffset;
+ return Item::hpos_f() + stem_xoffset_f_;
}
String
-Symbol::str()const return s;
+Symbol::str()const
{
- s = "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
+ return "symbol(\'"+tex+"\', (" + dim.x.str() + ", " + dim.y.str() + "))";
}
{
#ifndef NPRINT
mtor << "voice_element { dur :"<< duration_ <<"\n";
+ mtor << "principal: " << principal_req_l_->name() << "\n";
for (iter_top(req_p_list_,rc); rc.ok(); rc++) {
rc->print();
}
+
mtor << "}\n";
#endif
}
void
Voice_element::add(Request*r)
{
+ if (! principal_req_l_ )
+ principal_req_l_ = r;
+
if (r->duration()) {
assert (!duration_ || duration_ == r->duration());
duration_ = r->duration();
Voice_element::Voice_element()
{
+ principal_req_l_ = 0;
voice_C_ = 0;
duration_ = 0;
}
Voice_element::Voice_element(Voice_element const&src)
: Input(src)
{
-
voice_C_=0;
for (iter_top(src.req_p_list_, i); i.ok(); i++)
add(i->clone());
Staff_info
-Walker_registers::get_staff_info() return inf;
+Walker_registers::get_staff_info()
{
+ Staff_info inf;
if (walk_l_->score_walk_l_) // we get called ctors
inf.break_allowed_b_ = walk_l_->score_walk_l_->break_allowed_b();
inf.walk_l_ = walk_l_;
inf.time_C_ = &walk_l_->time_;
inf.rhythmic_C_ = walk_l_->default_grouping;
+ return inf;
}
Paper_def*
echo 0 > $@
-%.text: check-doc-deps
+$(depth)/%.text: check-doc-deps
rm -f $@
ln `find ${depth}/Documentation -name $@|head -1` .
#
lib: $(LIBRARY)
#
-
+TOCLEAN= $(allobs) $(alldeps)
clean: localclean
- rm -f $(allobs) $(alldeps)
+ifdef allobs
+ rm -f $(allobs)
+endif
+ifdef alldeps
+ rm -f $(alldeps)
+endif
ifdef SUBDIRS
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
endif
Begin3
Title: LilyPond
-Version: 0.0.55
+Version: 0.0.56
Entered-date: 04/23/97
Description: LilyPond is a program which converts a music-script (mudela) into
TeX output, or MIDI to produce multi-staff scores. Features include multiple
jan@digicash.com (Jan Nieuwenhuizen)
Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
Primary-site: pcnov095.win.tue.nl /pub/lilypond/
- 300k lilypond-0.0.55.tar.gz
+ 300k lilypond-0.0.56.tar.gz
Alternate-site:
Original-site:
Platform: unix/win32, GNU C++
Name: lilypond
-Version: 0.0.55
+Version: 0.0.56
Release: 1
Copyright: GPL
Group: Applications/Publishing
-Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.55.tar.gz
+Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.56.tar.gz
Summary: A preprocessor to make TeX typeset music.
URL: http://www.stack.nl/~hanwen/lilypond
Packager: Han-Wen Nienhuys <hanwen@stack.nl>