Q: Why are [] around the notes, and () inbetween?
A: [] designate beams, a note can only be in one beam at the same
-time. () is a slur, which connects notes. You need to be able to specify
+time. () is a slur, which connects notes. You need to be able to
+specify
a()a()a
Q: I want a DOS/NT/W95 port.
-A: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm,
-please :). No, I'm not considering compilation in W95, but feel free to give it a try.
+A0: Reconsider. Try Linux. It-s fun!
+
+A1: Currently (patchlevel 27), LilyPond (and flowerLib) compiles, links
+and runs on windhoos-nt, using the cygnus gnu port (release b17.1).
+I (JCN) only had to make a minor workaround for missing library calls.
+Have a look at http://www.cygnus.com/gnu-win32. To make LilyPond type
+make $OS. (I am not promising to maintain this platform, it is just that
+when having to use doze, i-m sometimes too lazy to reboot.)
+
+A2: I haven't had time to find a GCC crosscompiler to DOS/win (in rpm,
+please :).
Q: Why GPL?
$(exe): $(obs)
- strip --strip-debug $(STABLEOBS)
+ $(STRIPDEBUG) $(STABLEOBS)
$(CXX) -o $@ $^ $(LOADLIBES)
all: kompijl doc
+win32: # value of $(OSTYPE) on windhoos; "make $OSTYPE" if u use bash :-)
+ $(MAKE) -C . CXX=g++
+
doc:
$(MAKE) -C Documentation doc
+pl 29
+ - multiplatform Makefile
+ - context errors: bugfixes
+
pl 28
Internal
SMALLISH PROJECTS
+ * stafftypes: voice names/ instrument names.
+
* make spanner for staffsym
* Lookup::tex_glissando, Lookup::tex_bracket,
+# version info
+MAJVER=0
+MINVER=0
+PATCHLEVEL=29
+include Site.make
####
#### USER CONFIGURABLE
####
-# version info
-MAJVER=0
-MINVER=0
-PATCHLEVEL=28
VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL)
CXXVER=`$(CXX) --version`
depfile=deps/$(subst .o,.dep,$(notdir $@))
DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(OBJECTDIR)/$(notdir $@)"
+STRIPDEBUG=strip --strip-debug
\ No newline at end of file
PREFIX=${PREFIX:-.}
echo using PREFIX=$PREFIX
-NEEDFLOWERVER=1.0.24
+NEEDFLOWERVER=1.0.25
flowertar=flower-$NEEDFLOWERVER
here=`pwd`
cd ..
cd $here
echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
-
+touch Site.make
make -f Initial.make
+
+pl 25
+ - merge sstack and Array
+pl 24
+ - small fix in vector print
pl 23
- win32 patches (JN)
-pl 22:
+pl 22
- Array::add -> Array::push
\ No newline at end of file
findcurs.hh unionfind.hh compare.hh handle.hh matrix.hh\
smat.hh vsmat.hh vector.hh real.hh choleski.hh\
tsmat.hh tvsmat.hh plist.hh associter.hh fproto.hh\
- interval.hh scalar.hh sstack.hh rational.hh iterate.hh\
+ interval.hh scalar.hh rational.hh iterate.hh\
path.hh
MAJVER=1
MINVER=0
-PATCHLEVEL=24
+PATCHLEVEL=25
PACKAGENAME=flower
#PROFILEFLAG=-pg
String s("vector [");
#ifndef NPRINT
for (int i=0; i < dim(); i++) {
- s += String(dat[i], "%6f") + ' ';
+ s += String(dat[i], "%6f") + String(' ');
}
#endif
s+="]";
+++ /dev/null
-/*
- sstack.hh -- part of Flower lib
-
- (c) 1996 Han-Wen Nienhuys
-*/
-
-#ifndef SSTACK_HH
-#define SSTACK_HH
-
-#include "varray.hh"
-
-/// A simple stack based on Array.
-template<class T>
-struct sstack : Array<T> {
- T top()const { return last(); }
- T pop() {
- assert(!empty());
- T l = last();
- Array<T>::pop();
- return l;
- }
-};
-/**
- Same as for #Array# goes here.
-*/
-
-
-#endif // SSTACK_HH
-
#include <stdio.h>
#include <ctype.h>
#include "string.hh"
-#include "sstack.hh"
+#include "varray.hh"
/// line counting input stream.
class Text_stream
// could just have used streams.
FILE *f;
- sstack<char> pushback;
+ Array<char> pushback;
String name;
public:
*dest++ = *src++;
}
-///scaleable array template, for T with def ctor.
+///scaleable array/stack template, for T with def ctor.
template<class T>
class Array {
protected:
// vars
thearray[size_++] = x;
}
-
- /// junk last entry.
- void pop() { size_ -- ; }
-
- /// return last entry
- T& last(int j=0) {
+ /// remove and return last entry
+ T pop() {
+ assert(!empty());
+ T l = top(0);
+ set_size(size()-1);
+ return l;
+ }
+ /// access last entry
+ T& top(int j=0) {
return (*this)[size_-j-1];
}
- T last(int j=0) const {
+ /// return last entry
+ T top (int j=0) const {
return (*this)[size_-j-1];
}
+
+
void swap (int i,int j) {
T t((*this)[i]);
(*this)[i]=(*this)[j];
destructors. The type T should have a default constructor. It is
best suited for simple types, such as int, double or String
+ It uses stack terminology, (push, pop, top), and can be used as a stack.
*/
#endif
#include <FlexLexer.h>
#include "proto.hh"
#include "fproto.hh"
-#include "sstack.hh"
+#include "varray.hh"
#include "string.hh"
int yylex();
struct Input_file {
istream* is;
+ char const* defined_ch_c_l_m;
Source_file* sourcefile_l_;
int line;
String name;
/// lexer with provisions for include files.
struct My_flex_lexer : yyFlexLexer {
- sstack<Input_file*> include_stack;
+ Array<Input_file*> include_stack;
Assoc<String, Identifier*> *the_id_tab;
Keyword_table * keytable;
Notename_tab * defaulttab;
#ifndef REGISTER_HH
#define REGISTER_HH
#include "proto.hh"
-#include "sstack.hh"
+#include "varray.hh"
/// data container.
struct Staff_elem_info {
};
struct Slur_register : Request_register {
- sstack<Slur_req*> requests_arr_;
- sstack<Slur *> slur_l_stack_;
+ Array<Slur_req*> requests_arr_;
+ Array<Slur *> slur_l_stack_;
Array<Slur*> end_slur_l_arr_;
/****************/
Real distance;
Real strength;
/****************/
+ Spacing_req();
REQUESTMETHODS(Spacing_req, spacing);
};
mwa = music {
$
- ab % ok, warning, still output?
-% \bla % ok, fatal
-% & % ok, fatal
-% c d ) ] % ok, fatal
- c [ d
-% c ) d ] e % no location :-(
-
+ a ) b ] c % warning
+ & % ok; error
+ a b ) ] % ok; error
+% a......... % fatal error -- assert
+ a b c
+ ||| %
+ abc % ok; print error, no output
+ \bla % no warning-> this STRING, reduced to lyric_elt.
+ a [ b % warning, still output
+ { a( b } % warning, still output
+ a b ,c
+ a b c-*
+ a b c&
$
}
bla = music {
@
- These Gates will open just like windows.
+ These Gates will open just like windows. % ok; warning
@
}
melodic music { mwa }
}
commands {
- meter 2*4
+ meter 3*4
}
}
$
}
+score {
+ staff {
+ melodic music { ii_menuetto }
+ commands {
+ key $bes$
+ clef "alto"
+ skip 8:0
+ clef "violin"
+ skip 5:0
+ clef "alto"
+ skip 12:0
+ }
+ }
+ commands {
+ meter 3*4
+ skip 8:0
+ bar ":|:"
+% clef "violin"
+ skip 5:0
+% \clef "alto"
+ skip 12:0
+ bar ":||"
+ }
+ paper {
+ symboltables { table_sixteen }
+ width 195mm
+% unitspace 12mm % this should do, really
+ unitspace 8mm % to get lily to use only three lines
+ output "scsii-menuetto.out"
+ }
+}
+% scsii-menuetto.ly
+%
+% Solo Cello Suites
+% J. S. Bach
+%
+% Suite II part v
+% Menuetto I
+%
+% Copyright (c) 1995,1996,1997 Jan Nieuwenhuizen <jan@digicash.com>
+%
+% The purpose of this file is to demonstrate features of LilyPond.
+% (there is an accompanying LaTeX file, scsii-menuetto.tex)
+%
+
+% \lefttitle{Menuetto}
+% \tempo{Moderato}
+% \metron{4=120}
+%
+% \meter{3/4}
+% \key\F % key is F ( f-major )
+% \clef\alto % use alto clef
+% \duration8 % default duration is 'eight note
+%
+% \verb{\nobarnumbers} % issue MusiXTeX command
+% \barnumbering0
+% \slope{30} % Fool MusiXTeX into 30 / 10 steeper beam
+% \stemlength3 % shorter stemlength
+% % because piece is set very tightly
+%%1 % double comments are included in .tex file
+ii_menuetto = music {
+ $
+ \octave{}
+ \duration{8}
+ { a2 f2 d2_"\f" } bes4-. |
+%%2
+ { [ bes^"1" e c_"2"_"4" }
+% (^ )
+ a bes-. g-. ] a4-.^"4" |
+%%3
+% { d4 `bes4-.\stemup } stemup: 2 voices?
+ { d4 `bes4-. } g4-. [ f-. e-. ] |
+%%4
+% { f `a } (^ e ) d cis-. `b-. `a-. ]
+% [ f ( e ) d cis-. `b-. `a-. ]
+ { [ f `a } e d cis-. `b-. `a-. ]
+%%5
+ { a2 f2 d2 } bes4-. | % @bes4-. |
+%%6
+% { bes( e } ) a
+ { [ bes e } a bes-. g-. ]
+ 'c4-. | % ='c4-. |
+%%7
+ { a4-. f4}
+% { 'd4-.-\upbow f4 `bes4\stemdown }
+ { 'd4-.-\upbow f4 `bes4 }
+% { 'e4-.-\downbow g4 `g4\stemdown } |
+ { 'e4-.-\downbow g4 `g4 } |
+%%8
+% { 'cis2.-\upbow e2. `a2.\stemdown } :||:
+ { 'cis2.-\upbow e2. `a2. } | % :||:
+%%9
+% \clef "violin"
+% { 'e2 a2_f\stemdown }
+ { 'e2 a2_"\f" }
+ [ 'd( 'e16 )'f16 ] |
+%%10
+% [ { 'e( g } ) 'd 'cis_{ }_{ }_2 'e
+ { [ 'e g } 'd 'cis_"2" 'e a( )g ] |
+%%11
+% { a4\stemup( f2\stemdown } ) 'd4\stemup
+% { 'cis4\stemup-. e4\stemdown }
+ { \music { a4 'd4 'cis4-. } \music { f2 e4 } } |
+%%12
+% { 'g^4 d\stemdown } (^ 'f 'e ) 'f 'd^3(^ ) ='c ] |
+ { [ 'g^"4" d } 'f 'e 'f 'd^"3"( ) 'c ] |
+% %13
+% { bes2\stemup g4\stemdown } ( ) f4
+% { 'c4\stemup e4\stemdown }
+% { bes2 g4 } f4 { 'c4 e4 } | % \clef "alto" |
+ { \music { bes2 'c4 } \music { g4 f4 e4 } } |
+%%%14
+%% [ { a( f } ) g a f ] { 'd4-\upbow e4 `bes4\stemdown } |
+ { [ a f } g a f ] { 'd4-\upbow e4 `bes4 } |
+%%%15
+%% { 'c4-\downbow f4 `a4\stemdown } [ bes( )a g a ] |
+% { 'c4-\downbow f4 `a4 } [ bes( )a g a ] |
+%%%16
+ [ f( e )f a-. g-. bes-. ] |
+%% \tighten % use one line less
+%% \newline % start new line
+%% |
+%%%17
+%% { a2^0^\tr fis2_3 } bes4 |
+ { a2^"0" fis2_"3" } bes4 |
+%%%18
+%% [ { 'c( es } ) bes 'c a ] fis4^\tr |
+ { [ 'c es } bes 'c a ] fis4 |
+%%%19
+%% { 'd4-\downbow g4 `bes4\stemdown } { 'c4-\upbow g4 c4\stemdown } [ { bes d } a ] |
+ { 'd4-\downbow g4 `bes4 } { 'c4-\upbow g4 c4 } { [ bes d } a ] |
+%%%20
+%% [ { 'c( d `g } bes a ) bes g ( ) bes ] |
+ { [ 'c d `g } bes a bes g( )bes ] |
+%%%21
+%% { 'd4\stemup g2\stemdown } (^ ) 'cis4\stemup { 'd4\stemup =f4\stemdown } |
+% { 'd4 g2 } 'cis4 { 'd4 f4 } |
+ { \music { 'd4 'cis4 'd4 } \music { g2 f4 } } |
+%%%22
+%% [ { g( cis } )f g e ] { f4 d4 } |
+ { [ g cis } f g e ] { f4 d4 } |
+%%%23
+%% [ `g g ] { e4.\stemup^\tr `a4.\stemdown } d\stemup-\upbow |
+ [ `g g ] { e4. `a4. } d-\upbow |
+%%%24
+%% { d2.^{fine} `a2. `d2.\stemup_{ }_{ }_{3 mins.}} s4 :||
+%% { \textstyle "italic" d2.^"fine" `a2. \textstyle "roman" `d2._"3 mins."} | % :||
+ { d2.^"fine" `a2. `d2._"3 mins."} | % :||
+%% \tighten % use one line less
+ $
+}
+
score {
staff {
melodic
{ a2 fis2_"\pp" } { a4 fis4 }
%%33
%#% { b2(^ g2 } [v { 'd8.( b8. } { b16 ) ) g16 } ]
- { b2( g2 } { [ 'd8. b8. } { b16 g16 ] }
+ { b2 g2 } { [ 'd8. b8. } { b16 g16 ] }
%%34
%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ]
{ a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] }
{ `d2.^\fermata ``d2. }
$ }
+
tekst1 = music {
- @
- \duration{4}
- _ _ _
- _ _ _
- _ _ _
- _ _ _
- % 5
- \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8
- \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
- Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 }
- dir;2 _
- _ _ _
- _ _ _
- % 11
- \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8
- \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
- Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 }
- mir!2 _
- _ _ _
- _ _ _
-
- % 17
- Fl\"us-8. ternd16 schlan-4. ke8
- Wip-8. fel16 rau-4. schen8
- \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8
- Licht;2.
- _ _ _
- _ _ _
-
- % 23
- Des8. Ver-16 r\"a-4. ters8
- feind-8. lich16 Lau-4. schen8
- \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8
- nicht.2.
- _ _ _
- _ _ _
-
- % volta 1
- % 29
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
-
- % volta 2
- % 37
- La\ss8. auch16 dir8. die16 Brust8. be-16
- we- gen, _
- Lieb-4. chen,8 h\"o-8. re16
- mich!2 _
- _ _ _
- _ _ _
- Be-8. bend16 harr' ich8 _8
- dir8. ent-16 ge- gen!8 _8
- \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8
- mich!2.
- % 47
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- % 57
- _ _ _ _ _ _
- @
- }
-
- tekst2 = music {
- @
- \duration{4}
- _ _ _
- _ _ _
- _ _ _
- _ _ _
- % 5
- \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8
- \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
- Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 }
- dich,2 _
- _ _ _
- _ _ _
-
- % 11
- \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
- \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
- Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
- mich.2 _
- _ _ _
- _ _ _
-
- % 17 ok tot hier
- Sie-8. ver-16 stehn4. des8
- Bus-8. ens16 Seh-4. nen,8
- \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8
- schmerz,2.
- _ _ _
- _ _ _
-
- % 23
- R\"uh-8. ren16 mit4. den8
- Sil-8. ber-16 t\"o-4. nen8
- \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8
- Herz.2.
- _ _ _
- _ _ _
-
- % volta 1
- % 29
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
- _ _ _ _ _ _
-
- % volta 2
- % 37
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % 47
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % _ _ _ _ _ _
- % 57
- % _ _ _ _ _ _
- @
- }
-
+ @
+ \duration{4}
+ _ _ _
+ _ _ _
+ _ _ _
+ _ _ _
+% 5
+ \plet{ 2/3 } Lei- se8 \plet{ 1/1 } fleh-4. en8
+ \plet{ 2/3 } mei- ne8 \plet{ 1/1 } Lie- der8 _8
+ Durch4. die8 \plet{ 2/3 } Nacht zu8 \plet{ 1/1 }
+ dir;2 _
+ _ _ _
+ _ _ _
+% 11
+ \plet{ 2/3 } In den8 \plet{ 1/1 } stil-4. len8
+ \plet{ 2/3 } Hain her-8 \plet{ 1/1 } nie-4. der,8
+ Lieb4. chen,8 \plet{ 2/3 } komm zu8 \plet{ 1/1 }
+ mir!2 _
+ _ _ _
+ _ _ _
+
+% 17
+ Fl\"us-8. ternd16 schlan-4. ke8
+ Wip-8. fel16 rau-4. schen8
+ \plet{ 2/3 } In des8 \plet{ 1/1 } Mon-4. des8
+ Licht;2.
+ _ _ _
+ _ _ _
+
+% 23
+ Des8. Ver-16 r\"a-4. ters8
+ feind-8. lich16 Lau-4. schen8
+ \plet{ 2/3 } F\"urch- te,8 \plet{ 1/1 } Hol-4. de,8
+ nicht.2.
+ _ _ _
+ _ _ _
+
+% volta 1
+% 29
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+
+% volta 2
+% 37
+ La\ss8. auch16 dir8. die16 Brust8. be-16
+ we- gen, _
+ Lieb-4. chen,8 h\"o-8. re16
+ mich!2 _
+ Be-8. bend16 harr' ich8 _8
+ dir8. ent-16 ge- gen!8 _8
+ \plet{ 2/3 } Komm, be-8 \plet{ 1/1 } gl\"u4. cke8
+ mich!2.
+ _ _ _ _ _ _
+% 47
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+% 57
+ _ _ _ _ _ _
+ @
+}
+
+tekst2 = music {
+ @
+ \duration{4}
+ _ _ _
+ _ _ _
+ _ _ _
+ _ _ _
+% 5
+ \plet{ 2/3 } H\"orst die8 \plet{ 1/1 } Nach-4. ti-8
+ \plet{ 2/3 } gal- len8 \plet{ 1/1 } schla- gen?8 _8
+ Ach!4. sie8 \plet{ 2/3 } fleh- en8 \plet{ 1/1 }
+ dich,2 _
+ _ _ _
+ _ _ _
+
+% 11
+ \plet{ 2/3 } Mit der8 \plet{ 1/1 } T\"o-4. ne8
+ \plet{ 2/3 } s\"u\ss- en8 \plet{ 1/1 } Kla-4. gen8
+ Fleh-4. en8 \plet{ 2/3 } sie f\"ur8 \plet{ 1/1 }
+ mich.2 _
+ _ _ _
+ _ _ _
+
+% 17 ok tot hier
+ Sie-8. ver-16 stehn4. des8
+ Bus-8. ens16 Seh-4. nen,8
+ \plet{ 2/3 } Ken- nen8 \plet{ 1/1 } Lieb-4. es-8
+ schmerz,2.
+ _ _ _
+ _ _ _
+
+% 23
+ R\"uh-8. ren16 mit4. den8
+ Sil-8. ber-16 t\"o-4. nen8
+ \plet{ 2/3 } Jed- es8 \plet{ 1/1 } wei-4. che8
+ Herz.2.
+ _ _ _
+ _ _ _
+
+% volta 1
+% 29
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+ _ _ _ _ _ _
+
+% volta 2
+% 37
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% 47
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% _ _ _ _ _ _
+% 57
+% _ _ _ _ _ _
+ @
+}
+
score {
- paper {
- symboltables { table_sixteen }
- output "standchen.uit"
- unitspace 2.4 cm
- % unitspace 4.0 cm % leaves all text stand free
- geometric 1.4
+ staff {
+ lyric
+ music { tekst1 }
+ music { tekst2 }
}
staff {
- melodic
+ melodic
music { melodie }
commands {
key $bes$
clef "violin"
}
}
- staff {
- lyric
- music { tekst1 }
- music { tekst2 }
- }
staff {
- melodic
+ melodic
music { begeleiding }
commands {
key $bes$
- clef "bass"
+ clef "bass"
}
}
commands {
score {
staff { melodic
+
+ % every "music {} " in a staff has its own "voicegroup"
music { dux }
music { comes }
default:
$(MAKE) -C ..
+win32:
+ $(MAKE) -C .. Windows_NT
+
DISTFILES=Makefile $(mycc) $(othersrc)
dist:
ln $(DISTFILES) $(DDIR)/$(SUBDIR)
for (iter_top(pscore_.cols,c); c.ok(); c++)
if (c->breakable())
retval.push(c);
- assert(retval.last() == pscore_.cols.bottom().ptr());
+ assert(retval.top() == pscore_.cols.bottom().ptr());
return retval;
}
sp.add_column(curline[0], true, 0.0);
for (int i=1; i< curline.size()-1; i++)
sp.add_column(curline[i]);
- sp.add_column(curline.last(), true, linelength);
+ sp.add_column(curline.top(), true, linelength);
// misschien moeven uit Spacing_problem?
for (iter_top(pscore_.suz,i); i.ok(); i++) {
Array<Real> the_sol=sp.solve();
Col_hpositions col_hpos;
col_hpos.cols = curline;
- col_hpos.energy = the_sol.last();
- the_sol.pop();
+ col_hpos.energy = the_sol.pop();
col_hpos.config = the_sol;
col_hpos.OK();
return col_hpos;
#include "complexstaff.hh"
#include "sccol.hh"
#include "complexwalker.hh"
+#include "main.hh"
if (j->barcheck()) {
if (tdescription_->whole_in_measure) {
- error( "Barcheck failed", j->defined_ch_c_l_m );
+ warning( "Barcheck failed", j->defined_ch_c_l_m );
+// staff_l_->the_line_->pscore_l_->heu errorlevel_i_ |= 1;
}
continue;
}
}
if (!b)
- warning("junking request: " + String(req->name()),
- req->defined_ch_c_l_m);
+ warning("junking request: " + String(req->name()), req->defined_ch_c_l_m);
}
void
else
return
MInterval(children[0]->interval().left,
- children.last()->interval().right);
+ children.top()->interval().right);
}
void
Rhythmic_grouping::child_fit_query(Moment start)
{
if (children.size())
- return ( children.last()->interval().right== start);
+ return ( children.top()->interval().right== start);
return true;
}
Array<Rhythmic_grouping*> a(children);
for (int i=0; i < a.size(); i++) {
a[i] =new Rhythmic_grouping(*children[i]);
- a[i]->translate(children.last()->interval().right);
+ a[i]->translate(children.top()->interval().right);
}
children.concat(a);
}
if (beam_p_) {
if (stem_req_l_->balltype<= 4)
- warning( "stem doesn't fit in Beam.",
+ warning( "stem doesn't fit in Beam",
stem_req_l_->defined_ch_c_l_m);
else
beam_p_->add(stem_p_);
#include "stcol.hh"
#include "staff.hh"
#include "assoc.hh"
+#include "lexer.hh"
void
Commands_at::print() const
} else if (s=="GOTO") {
ptr = top();
String m(c.args[1]);
- if (!marks_assoc_r.elt_query(m))
- error("Unknown marker: `" +m + "\'");
+ if (!marks_assoc_r.elt_query(m)) {
+ warning( "Unknown marker: `" +m + "\'", 0 );
+ return;
+ }
ptr.find_moment(marks_assoc_r[m]);
} else {
#include "lyricstaff.hh"
#include "staff.hh"
#include "complexstaff.hh"
+#include "lexer.hh"
void
Input_staff::add(Array<Input_command*> &s)
else if (type == "lyric")
p = new Lyric_staff;
else
- error("Unknown staff-type `" + type +"\'");
-
+ error( "Unknown staff-type `" + type +"\'", 0 );
+
p->score_l_ = score_l;
p->define_spot_str_ = ""; // todo
//ignore
}
. {
-// error( "lexer error: illegal character '"+String(YYText()[0])+ "' encountered");
- error( String( "illegal character: " ) + String( YYText()[0] ) + ": ",
- here_ch_c_l() );
+ error( String( "illegal character: " ) + String( YYText()[0] ), here_ch_c_l() );
return YYText()[0];
}
return lexer->yylex();
}
-void
-yyerror(const char *s)
-{
- lexer->LexerError(s);
-}
-
bool
busy_parsing()
{
String pf(s);
if (pf=="") {
is = &cin;
+ defined_ch_c_l_m = 0;
sourcefile_l_ = 0;
}
else {
source_global_l->add( sourcefile_p );
sourcefile_l_ = sourcefile_p;
is = sourcefile_l_->istream_l();
+ defined_ch_c_l_m = sourcefile_l_->ch_c_l();
}
cout << "["<<pf<<flush;
}
Symbol
Lookup::stem(Real y1,Real y2)
{
- assert(y1 <= y2);
+ if (y1 > y2) {
+ Real t = y1;
+ y1 = y2;
+ y2 = t;
+ }
Symbol s;
s.dim.x = Interval(0,0);
#include "lyriccolumn.hh"
#include "sccol.hh"
#include "pscore.hh"
-
+#include "main.hh"
Lyric_column::Lyric_column(Score_column*s, Lyric_staff* lstaff_l)
: Staff_column(s)
Request* req_l = j;
if (req_l->barcheck()) {
if (tdescription_->whole_in_measure) {
- error( "Barcheck failed ", req_l->defined_ch_c_l_m );
+ warning( "Barcheck failed ", req_l->defined_ch_c_l_m );
}
}
if (req_l->lreq_l()) {
#include "keyword.hh"
#include "assoc.hh"
#include "lexer.hh"
-#include "sstack.hh"
#include "debug.hh"
#include "notename.hh"
#include "sourcefile.hh"
+#include "parseconstruct.hh"
static Keyword_ent the_key_tab[]={
"bar", BAR,
if (p[0] < 0) {
errorlevel_i_ |= 1;
- warning( String( "notename does not exist: " ) +YYText() + ": ", ch_c_l );
+ warning( String( "notename does not exist: " ) + YYText(), ch_c_l );
p[0] = p[1] = 0;
}
return NOTENAME;
char const*
My_flex_lexer::here_ch_c_l()
{
- return data_ch_c_l_m + yyin->tellg();
+ return data_ch_c_l_m ? data_ch_c_l_m + yyin->tellg() : 0;
}
void
*mlog << "error at EOF" << s << '\n';
} else {
char const* ch_c_l = here_ch_c_l();
- ch_c_l--;
- while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
- ch_c_l--;
- ch_c_l++;
- error( s, ch_c_l );
+ if ( ch_c_l ) {
+ ch_c_l--;
+ while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) )
+ ch_c_l--;
+ ch_c_l++;
+ }
+ errorlevel_i_ |= 1;
+ warning( s, ch_c_l );
}
}
void
My_flex_lexer::new_input(String s)
{
- if (!include_stack.empty())
+ if (!include_stack.empty()) {
include_stack.top()->line = lineno();
+ // should this be saved at all?
+ include_stack.top()->defined_ch_c_l_m = defined_ch_c_l;
+ }
Input_file *newin = new Input_file(s);
include_stack.push(newin);
switch_streams(newin->is);
- data_ch_c_l_m = newin->sourcefile_l_->ch_c_l();
+ if ( newin->sourcefile_l_ )
+ data_ch_c_l_m = newin->sourcefile_l_->ch_c_l();
+ else
+ data_ch_c_l_m = 0;
+
yylineno = 1;
}
Input_file *i = include_stack.top();
switch_streams(i->is);
yylineno = i->line;
+ defined_ch_c_l = i->defined_ch_c_l_m;
}
delete old;
return ok;
get_note_element(String pitch, int * notename, int * duration )
{
Voice_element*v = new Voice_element;
+ v->defined_ch_c_l_m = defined_ch_c_l;
int i=0;
int dur = duration[0];
int dots=duration[1];
if (dur >= 2) {
- Stem_req * st = new Stem_req(dur,dots);
- st->plet_factor = Moment(default_plet_dur, default_plet_type);
- v->add(st);
+ Stem_req * stem_req_p = new Stem_req(dur,dots);
+ stem_req_p->plet_factor = Moment(default_plet_dur, default_plet_type);
+ stem_req_p->defined_ch_c_l_m = defined_ch_c_l;
+ v->add(stem_req_p);
}
if ( !defined_ch_c_l )
rq->print();
v->add(rq);
- v->defined_ch_c_l_m = defined_ch_c_l;
return v;
}
get_word_element(Text_def* tdef_p, int* duration)
{
Voice_element* velt_p = new Voice_element;
-
+ velt_p->defined_ch_c_l_m = defined_ch_c_l;
int dur = duration[0];
int dots=duration[1];
lreq_p->dots = dots;
lreq_p->plet_factor = Moment(default_plet_dur, default_plet_type);
lreq_p->print();
+ lreq_p->defined_ch_c_l_m = defined_ch_c_l;
velt_p->add(lreq_p);
Voice_element *
get_rest_element(String, int * duration )
{
- Voice_element*v = new Voice_element;
+ Voice_element* velt_p = new Voice_element;
+ velt_p->defined_ch_c_l_m = defined_ch_c_l;
- Rest_req * rq = new Rest_req;
- rq->plet_factor = Moment(default_plet_dur, default_plet_type);
- rq->balltype = duration[0];
- rq->dots = duration[1];
- rq->print();
- v->add(rq);
+ Rest_req * rest_req_p = new Rest_req;
+ rest_req_p->plet_factor = Moment(default_plet_dur, default_plet_type);
+ rest_req_p->balltype = duration[0];
+ rest_req_p->dots = duration[1];
+ rest_req_p->print();
+ rest_req_p->defined_ch_c_l_m = defined_ch_c_l;
- return v;
+ velt_p->add(rest_req_p);
+
+ return velt_p;
}
void
Request*
get_script_req(int d , Script_def*def)
{
- return new Script_req(d, def);
+ Script_req* script_req_p = new Script_req(d, def);
+ script_req_p->defined_ch_c_l_m = defined_ch_c_l;
+ return script_req_p;
}
Request*
get_text_req(int d , Text_def*def)
{
- return new Text_req(d, def);
+ Text_req* text_req_p = new Text_req(d, def);
+ text_req_p->defined_ch_c_l_m = defined_ch_c_l;
+ return text_req_p;
}
Voice_element*
get_mark_element(String s)
{
Voice_element*v_p = new Voice_element;
- v_p->add( new Mark_req(s));
-
+ v_p->defined_ch_c_l_m = defined_ch_c_l;
+ Mark_req* mark_req_p = new Mark_req(s);
+ mark_req_p->defined_ch_c_l_m = defined_ch_c_l;
+ v_p->add(mark_req_p);
return v_p;
}
Voice_element*
get_command_element(Input_command*com_p)
{
- Voice_element *v_p = new Voice_element;
- v_p->add(new Staff_command_req(com_p));
- return v_p;
+ Voice_element *velt_p = new Voice_element;
+ velt_p->defined_ch_c_l_m = defined_ch_c_l;
+ Staff_command_req* scommand_req_p = new Staff_command_req(com_p);
+ scommand_req_p->defined_ch_c_l_m = defined_ch_c_l;
+ velt_p->add(scommand_req_p);
+ return velt_p;
}
Voice_element*
get_barcheck_element()
{
- Voice_element*v_p = new Voice_element;
- v_p->add( new Barcheck_req);
-
- return v_p;
+ Voice_element* velt_p = new Voice_element;
+ velt_p->defined_ch_c_l_m = req_defined_ch_c_l;
+ Barcheck_req* barcheck_req_p = new Barcheck_req;
+ barcheck_req_p->defined_ch_c_l_m = req_defined_ch_c_l;
+ velt_p->add(barcheck_req_p);
+ return velt_p;
}
Voice_element*
get_stemdir_element(int d)
{
Voice_element*v_p = new Voice_element;
+ v_p->defined_ch_c_l_m = req_defined_ch_c_l;
Group_feature_req * gfreq_p = new Group_feature_req;
gfreq_p->stemdir_i_ =d;
+ gfreq_p->defined_ch_c_l_m = req_defined_ch_c_l;
v_p->add(gfreq_p);
return v_p;
}
#endif
Array<Request*> pre_reqs, post_reqs;
-sstack<const char *> define_spots;
+Array<const char *> define_spots;
Paperdef*default_paper();
char const* defined_ch_c_l;
char const* req_defined_ch_c_l;
+int fatal_error_i = 0;
%}
delete $1;
}
| declarable_identifier error '}' {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
score_commands_block:
COMMANDS '{' score_commands_body '}' { $$ =$3;}
| COMMANDS '{' error '}' {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
| paper_body UNITSPACE dim { $$->whole_width = $3; }
| paper_body GEOMETRIC REAL { $$->geometric_ = $3; }
| paper_body error {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
delete $2;
}
| staff_body error {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
$$->add($2);
}
| music_voice_body error {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
$$ ->add_elt($2);
}
| music_chord_body error {
- warning( "parse error", lexer->here_ch_c_l() );
+// warning( "parse error", lexer->here_ch_c_l() );
}
;
}
| COMMAND '{' staff_command '}' { $$=get_command_element($3); }
| COMMAND '{' score_command '}' { $$=get_command_element($3); }
- | '|' { $$ = get_barcheck_element(); }
+ | '|' {
+ req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = get_barcheck_element();
+ }
| STEM '{' int '}' {
+ req_defined_ch_c_l = lexer->here_ch_c_l();
$$ = get_stemdir_element($3);
}
| lyrics_elt
post_request:
close_request_parens {
- $$ = get_request($1);
req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = get_request($1);
}
| script_req
| textscript_req
close_request_parens:
'(' {
- $$='(';
req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$='(';
}
| ']' {
- $$ = ']';
req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = ']';
}
;
open_request_parens:
')' {
- $$=')';
req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$=')';
}
| '[' {
- $$='[';
req_defined_ch_c_l = lexer->here_ch_c_l();
+ $$='[';
}
;
mudela_text:
STRING {
+ defined_ch_c_l = lexer->here_ch_c_l();
$$ = get_text(*$1);
delete $1;
- defined_ch_c_l = lexer->here_ch_c_l();
}
;
warning( "too many staccato dots", lexer->here_ch_c_l() );
$$ = get_scriptdef('.');
}
+ | error {
+ $$ = get_scriptdef('.');
+ yyerrok;
+ }
;
script_dir:
pre_request:
open_request_parens {
- $$ = get_request($1);
defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = get_request($1);
}
;
;
pitchmod: {
- $$ = new String;
defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = new String;
}
| PITCHMOD {
- $$ = $1;
defined_ch_c_l = lexer->here_ch_c_l();
+ $$ = $1;
}
;
%%
+void
+yyerror(const char *s)
+{
+// if ( YYRECOVERING() )
+// return;
+ lexer->LexerError(s);
+
+ if ( fatal_error_i )
+ exit( fatal_error_i );
+}
+
void
parse_file(String init, String s)
{
PScore::process()
{
clean_cols();
- *mlog << "Preprocessing ... ";
+ *mlog << "Preprocessing" << endl;
preprocess();
- *mlog << "Calculating ... ";
+ *mlog << "Calculating" << endl;
calc_breaking();
- *mlog << "Postprocessing ... ";
+ *mlog << "Postprocessing" << endl;
postprocess();
}
void
Score::process()
{
- *mlog << "\nProcessing music ... ";
+ *mlog << "\nProcessing music" << endl;
assert (paper_p_);
if (last() == Moment(0)) {
// debugging
OK();
pscore_p_->process();
- *mlog << "\n";
}
// remove empty cols.
current_iscore_l()
{
if ( score_array_global.size() )
- return score_array_global.last(); // UGH
+ return score_array_global.top(); // UGH
else
return 0;
}
Request *rq= j;
if (rq->barcheck()) {
if (tdescription_->whole_in_measure) {
-// error("Barcheck failed, " + tdescription_->str());
- error( "Barcheck failed", rq->defined_ch_c_l_m );
+ warning( "Barcheck failed", rq->defined_ch_c_l_m );
}
}
if (rq->rhythmic()){
notes.push(rq->rhythmic());
}
if (rq->script()) {
- notes.last().scripts.push(rq->script());
+ notes.top().scripts.push(rq->script());
}
if (rq->stem()) {
stem_ = rq->stem();
Offset
Slur::center() const
{
- int pos1 = encompass.last()->position;
+ int pos1 = encompass.top()->position;
int pos2 = encompass[0]->position;
int dy = pos1-pos2;
void
Slur::do_pre_processing()
{
- right = encompass.last()->pcol_l_;
+ right = encompass.top()->pcol_l_;
left = encompass[0]->pcol_l_;
}
assert(encompass.size()>0); // todo
Notehead *lnote_p =encompass[0];
- Notehead *rnote_p =encompass.last();
+ 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);
char const*
Source_file::ch_c_l()
{
+ assert( this );
return (char const*)data_caddr_m;
}
String
Source_file::error_str( char const* pos_ch_c_l )
{
+ assert( this );
if ( !in_b( pos_ch_c_l ) )
return "";
}
end_ch_c_l--;
-// String( char const* p, int size ) is missing!?
+// String( char const* p, int length ) is missing!?
// String line_str( begin_ch_c_l, end_ch_c_l - begin_ch_c_l );
- int size_i = end_ch_c_l - begin_ch_c_l;
- char* ch_p = new char[ size_i ];
- strncpy( ch_p, begin_ch_c_l, size_i );
- ch_p[ size_i ] = 0;
+ int length_i = end_ch_c_l - begin_ch_c_l;
+ char* ch_p = new char[ length_i + 1 ];
+ strncpy( ch_p, begin_ch_c_l, length_i );
+ ch_p[ length_i ] = 0;
String line_str( ch_p );
delete ch_p;
bool
Source_file::in_b( char const* pos_ch_c_l )
{
- return ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_m );
+ return ( pos_ch_c_l && ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_m ) );
}
istream*
Source_file::istream_l()
{
assert( fildes_i_m );
- if ( !istream_p_m )
- istream_p_m = new istrstream( ch_c_l(), size_off_m );
+ if ( !istream_p_m ) {
+ if ( size_off_m ) // can-t this be done without such a hack?
+ istream_p_m = new istrstream( ch_c_l(), size_off_m );
+ else {
+ istream_p_m = new istrstream( "", 0 );
+ istream_p_m->set(ios::eofbit);
+ }
+ }
return istream_p_m;
}
if ( !in_b( pos_ch_c_l ) )
return 0;
- int i = 0;
+ int i = 1;
char const* scan_ch_c_l = ch_c_l();
while ( scan_ch_c_l < pos_ch_c_l )
if ( *scan_ch_c_l++ == '\n' )
void
Source_file::map()
{
- data_caddr_m = (caddr_t)mmap( (void*)0, size_off_m, PROT_READ, MAP_FILE | MAP_SHARED, fildes_i_m, 0 );
+ data_caddr_m = (caddr_t)mmap( (void*)0, size_off_m, PROT_READ, MAP_SHARED, fildes_i_m, 0 );
if ( (int)data_caddr_m == -1 ) {
cerr << "lilypond: can't map: " << name_str_m << ": " << strerror( errno ) << endl;
{
heads.sort(Notehead::compare);
heads[0]->extremal = -1;
- heads.last()->extremal = 1;
+ heads.top()->extremal = 1;
int parity=1;
int lastpos = heads[0]->position;
for (int i=1; i < heads.size(); i ++) {
+#include "proto.hh"
+#include "plist.tcc"
#include "register.hh"
#include "voicegroup.hh"
-#include "pcursor.tcc"
-#include "plist.tcc"
IPL_instantiate(Voice_registers);
IPL_instantiate(Voice_group_registers);
s+= "at ";
s+=when;
s+="\nmeter " + String(whole_per_measure/one_beat) +":" +
- String(Rational(1/one_beat));
+ String(Rational(Rational(1)/one_beat));
s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n";
return s;
}
if (!accepted_req_arr_.size())
return;
- Request* req_l = accepted_req_arr_.last();
+ Request* req_l = accepted_req_arr_.top();
if (req_l->note()) {
Notehead*n_p = new Notehead(8); // ugh
note_p_ = n_p;
// end slur: move the slur to other array
if (slur_req_l->spantype == Span_req::STOP) {
if (slur_l_stack_.empty())
- warning("can't find slur to end; ",
+ warning("can't find slur to end",
slur_req_l->defined_ch_c_l_m);
else {
end_slur_l_arr_.push(slur_l_stack_.pop());
Slur_register::~Slur_register()
{
for (int i=0; i < requests_arr_.size(); i++) {
- warning("unterminated slur: ", requests_arr_[i]->defined_ch_c_l_m);
+ warning("unterminated slur", requests_arr_[i]->defined_ch_c_l_m);
}
}
if (busy_parsing())
yyerror(s);
else
- cerr << "\nerror: " << s << "\n";
+ cerr << "error: " << s << "\n";
exit(1);
}
String str = "lilypond: ";
Source_file* sourcefile_l = source_global_l->sourcefile_l( context_ch_c_l );
if ( sourcefile_l ) {
- str += sourcefile_l->file_line_no_str(context_ch_c_l);
+ str += sourcefile_l->file_line_no_str(context_ch_c_l) + String(": ");
}
str += message_str;
if ( sourcefile_l ) {
- str += "\n";
+ str += ":\n";
str += sourcefile_l->error_str( context_ch_c_l );
}
- cerr << endl << str << endl;
+ if ( busy_parsing() )
+ cerr << endl;
+ cerr << str << endl;
}
void
#ifdef _WIN32
#include <sys/types.h>
+#include <sys/mman.h>
#include <winbase.h>
/*
DWORD dwNumberOfBytesToMap // number of bytes to map
);
+
+io.h:
+long _get_osfhandle( int filehandle );
*/
+// cygnus's gnu-win32-b17.1 does not have _get_osfhandle
+// however, after some hacking, it turns out that:
+
+static const int OSF_OFFSET_i = 72;
+static const int OSF_BASE_i = -3;
+static const int OSF_FACTOR_i = 8;
+// let-s hope bill doesn-t change his mind any time soon :-)
+
+// so that, while waiting for cygnus's mmap, we can write:
+
+// #define HAVE_GET_OSFHANDLE // no we still cannot; works only with cl.exe
+long
+_get_osfhandle( int filedes_i )
+{
+ return (long)( OSF_OFFSET_i + ( filedes_i + OSF_BASE_i ) * OSF_FACTOR_i );
+}
+
+#ifdef HAVE_GET_OSFHANDLE
+
+#include <iostream.h>
+
caddr_t
mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
{
(void)flags;
(void)prot;
- HANDLE file_handle = CreateFileMapping( fd, (void*)0, PAGE_READONLY,
+ (void)addr;
+ HANDLE osf = (HANDLE)_get_osfhandle( fd );
+ HANDLE file_handle = CreateFileMapping( osf, (void*)0, PAGE_READONLY,
0, len, 0 );
- return (caddr_t)MapViewOfFile( file_handle, addr, 0, offset, len );
+ return (caddr_t)MapViewOfFile( file_handle, FILE_MAP_READ, 0, offset, len );
}
return UnmapViewOfFile( addr );
}
+#else // ! HAVE_GET_OSFHANDLE //
+
+caddr_t
+mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+ (void)flags;
+ (void)prot;
+ (void)addr;
+ (void)offset;
+ char* ch_p = new char[ len ];
+ if ( ch_p )
+ read( fd, (void*)ch_p, len );
+ return ch_p;
+}
+
+
+int
+munmap(caddr_t addr, size_t len)
+{
+ (void)len;
+ delete (char*)addr;
+ return 0;
+}
+
+#endif // !HAVE_GET_OSFHANDLE //
+
+
#endif // _WIN32 //
// add nobreak version of breakable column
- current.cols.last()=breakpoints[break_idx_i];
+ current.cols.top()=breakpoints[break_idx_i];
curcol ++;
break_idx_i++;
}