From fe3f57f573545248c6245ebeff71884c23c35a84 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 20 Jan 1997 01:19:48 +0100 Subject: [PATCH] release: 0.0.23 --- .dstreamrc | 14 +- Documentation/CodingStyle.pod | 6 +- Documentation/Makefile | 7 +- Documentation/README.pod | 136 ++++++----- Documentation/error.pod | 29 +++ Documentation/faq.pod | 26 ++ Documentation/lilyinput.pod | 9 +- Generate.make | 26 ++ Initial.make | 12 + Makefile | 56 +---- NEWS | 21 +- Sources.make | 34 ++- TODO | 117 +++++++++ Variables.make | 42 ++-- cadenza.ly | 38 --- clean | 4 + configure | 7 + deps/Makefile | 4 + dimen.tex | 4 +- hdr/Makefile | 5 +- hdr/accidental.hh | 2 +- hdr/bar.hh | 2 +- hdr/beam.hh | 2 +- hdr/break.hh | 2 +- hdr/clef.hh | 2 +- hdr/clefitem.hh | 2 +- hdr/debug.hh | 5 +- hdr/directionalspanner.hh | 2 +- hdr/getcommand.hh | 2 +- hdr/grouping.hh | 5 +- hdr/idealspacing.hh | 2 +- hdr/identifier.hh | 2 +- hdr/identparent.hh | 2 +- hdr/inputcommand.hh | 4 +- hdr/inputcommands.hh | 6 +- hdr/inputmusic.hh | 2 +- hdr/inputscore.hh | 4 + hdr/inputstaff.hh | 9 +- hdr/key.hh | 2 +- hdr/keyitem.hh | 2 +- hdr/keyword.hh | 2 +- hdr/leastsquares.hh | 2 +- hdr/lexer.hh | 1 + hdr/localkeyitem.hh | 2 +- hdr/lookup.hh | 2 +- hdr/main.hh | 1 + hdr/melodicstaff.hh | 2 +- hdr/meter.hh | 2 +- hdr/moment.hh | 2 +- hdr/notehead.hh | 2 +- hdr/notename.hh | 2 +- hdr/offset.hh | 2 +- hdr/parseconstruct.hh | 4 +- hdr/proto.hh | 5 +- hdr/request.hh | 28 ++- hdr/rest.hh | 2 +- hdr/rhythmstaff.hh | 2 +- hdr/sccol.hh | 2 +- hdr/score.hh | 10 +- hdr/scoreline.hh | 2 +- hdr/script.hh | 2 +- hdr/scriptdef.hh | 2 +- hdr/simplestaff.hh | 4 +- hdr/simplewalker.hh | 2 +- hdr/slur.hh | 2 +- hdr/spanner.hh | 2 +- hdr/staff.hh | 6 +- hdr/staffcommands.hh | 2 +- hdr/staffelem.hh | 7 +- hdr/staffline.hh | 2 +- hdr/stcol.hh | 2 +- hdr/stem.hh | 2 +- hdr/swalker.hh | 2 +- hdr/symtable.hh | 2 +- hdr/textdef.hh | 2 +- hdr/textitem.hh | 2 +- hdr/textspanner.hh | 2 +- hdr/timedescription.hh | 23 +- init/Makefile | 2 +- symbol.ini => init/symbol.ini | 0 init/table_sixteen.ini | 4 +- input/Makefile | 7 + input/cadenza.ly | 64 +++++ kortjakje.ly => input/kortjakje.ly | 2 +- maartje.ly => input/maartje.ly | 47 ++-- pavane.ly => input/pavane.ly | 19 +- input/scales.ly | 64 +++++ input/standchen.lily | 375 +++++++++++++++++++++++++++++ lilyponddefs.tex | 6 +- objects/Makefile | 3 + scales.ly | 36 --- src/Makefile | 3 +- src/beam.cc | 7 +- src/debug.cc | 8 +- src/getcommands.cc | 8 +- src/grouping.cc | 34 ++- src/inputcommand.cc | 22 +- src/inputcommands.cc | 43 ++-- src/inputscore.cc | 17 +- src/inputstaff.cc | 27 ++- src/lexer.l | 2 +- src/lexerinit.cc | 21 +- src/linespace.cc | 22 +- src/main.cc | 62 ++++- src/mylexer.cc | 16 +- src/note.cc | 8 + src/parser.y | 61 ++++- src/pcol.cc | 3 +- src/pscore.cc | 2 +- src/request.cc | 20 +- src/score.cc | 27 ++- src/scores.cc | 2 +- src/script.cc | 29 +-- src/simpleprint.cc | 10 +- src/simplestaff.cc | 3 +- src/simplewalker.cc | 7 +- src/staff.cc | 48 +++- src/staffcommands.cc | 1 + src/staffelem.cc | 29 ++- src/stcol.cc | 2 +- src/texbeam.cc | 7 +- src/textspanner.cc | 6 + src/timedescription.cc | 34 ++- src/voice.cc | 13 +- src/warn.cc | 14 +- standchen.tex | 13 + test.tex | 2 +- 127 files changed, 1556 insertions(+), 509 deletions(-) create mode 100644 Documentation/error.pod create mode 100644 Documentation/faq.pod create mode 100644 Generate.make create mode 100644 Initial.make create mode 100644 TODO delete mode 100644 cadenza.ly create mode 100755 clean create mode 100755 configure create mode 100644 deps/Makefile rename symbol.ini => init/symbol.ini (100%) create mode 100644 input/Makefile create mode 100644 input/cadenza.ly rename kortjakje.ly => input/kortjakje.ly (98%) rename maartje.ly => input/maartje.ly (58%) rename pavane.ly => input/pavane.ly (91%) create mode 100644 input/scales.ly create mode 100644 input/standchen.lily create mode 100644 objects/Makefile delete mode 100644 scales.ly create mode 100644 standchen.tex diff --git a/.dstreamrc b/.dstreamrc index 0c3afc09bd..12afafc563 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -2,7 +2,7 @@ My_flex_lexer 1 yyFlexLexer 1 -PCol 1 +PCol 0 Score_column 0 Ineq_constrained_qp 1 Spacing_problem 0 @@ -12,17 +12,17 @@ PScore 1 Idealspacing 1 # yydebug -Parser 1 +Parser 0 # FlexLexer debug -Lexer 1 +Lexer 0 parse_duration 1 parse_pitchmod 1 Col_configuration 1 -Request 1 +Request 0 Note_req 0 -Rhythmic_req 1 +Rhythmic_req 0 Rest_req 1 delete_identifiers 1 Command 1 @@ -33,6 +33,6 @@ Score 1 Voice 0 Voice_element 0 Input_cursor 1 -Commands_at 1 +Commands_at 0 Input_command 0 -Time_description 1 \ No newline at end of file +Time_description 0 \ No newline at end of file diff --git a/Documentation/CodingStyle.pod b/Documentation/CodingStyle.pod index 995188dec2..460935f859 100644 --- a/Documentation/CodingStyle.pod +++ b/Documentation/CodingStyle.pod @@ -32,9 +32,10 @@ in emacs: =head2 DATA MEMBERS Class::member() - Class::member_type_() + Type Class::member_type_ + +the C is a Hungarian notation postfix for $C$. -the C is a Hungarian notation postfix =head2 COMMENTS @@ -63,6 +64,7 @@ F Unfortunately most of the code isn't really documented that good. + =head2 CLASSNAMES (2) A lot of classes in LilyPond start with 'P', this is to distinguish diff --git a/Documentation/Makefile b/Documentation/Makefile index 5eb21d58ce..618bd6f111 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,7 +1,8 @@ -PODS=README.pod CodingStyle.pod lilygut.pod lilyinput.pod +PODS=README.pod CodingStyle.pod lilygut.pod lilyinput.pod error.pod\ + faq.pod TXTS=$(PODS:.pod=.txt) MANS=$(PODS:.pod=.1) -DOCFILES=$(PODS) Makefile +DISTFILES=$(PODS) Makefile default: @@ -10,7 +11,7 @@ default: doc: $(TXTS) dist: - ln $(DOCFILES) $(DDIR)/Documentation/ + ln $(DISTFILES) $(DDIR)/$(SUBDIR) clean: rm -f $(TXTS) $(MANS) diff --git a/Documentation/README.pod b/Documentation/README.pod index 750aa773ea..491c18e06a 100644 --- a/Documentation/README.pod +++ b/Documentation/README.pod @@ -9,10 +9,10 @@ Lilypond - a music typesetter =head1 DESCRIPTION LilyPond typesets music. It translates script files (mudela files or -F<.ly>'s) into TeX input. Typesetting music is a complex task, +F<*.ly>'s) into TeX input. Typesetting music is a complex task, whereas the message that printed music conveys is usually a simple one. LilyPond is a try at providing a simple interface for setting -music LilyPond has these features: +music. LilyPond has these features: =over 5 @@ -39,27 +39,25 @@ a different file. =head1 DESIGN CONSIDERATIONS -LilyPond was written with some -considerations in mind: +LilyPond was written with some considerations in mind: =over 5 -=item * -Describing a well-defined language for defining music. We call this -language (rather arrogantly) The Musical Definition Language (mudela -for short). LilyPond reads a mudela sourcefile -and outputs a TeX file. This musical definition language should: +=item * Describing a well-defined language for defining music. We call +this language (rather arrogantly) The Musical Definition Language +(mudela for short). LilyPond reads a mudela sourcefile and outputs a +TeX file. This musical definition language should: =over 5 -=item 1 +=item 1. define the musical message of the writer as unambigiously as possible. -=item 2 +=item 2. be easily readable. (as compared to, say, MusixTeX input) -=item 3 +=item 3. be writable in ASCII (with a simple texteditor). =back @@ -80,7 +78,7 @@ issue: in a future version, LilyPond might bypass TeX, but at the moment TeX is very convenient for producing output. =item * - Generate high-quality output. Ideally it should be of a professional +Generate high-quality output. Ideally it should be of a professional quality. We'd like to render Herbert Chlapiks words, "Fine music setting is not possible without a knowledgeable printer," untrue. @@ -111,21 +109,25 @@ broken systems. =over 5 +=item B<-I,--include>=F + +add F to the search path for input files. + =item B<-d,--debug>, debugging. LilyPond will read the file F<.dstreamrc>, which tells for what functions to produce copious debugging output. =item B<-w,--warranty>, -warranty +Show the warranty with which LilyPond comes. (It comes with B!) -=item B<-o,--output>, +=item B<-o,--output=>F, -default output file +Set the default output file to F. =item B<-h,--help>, -help +Show a summary of usage =back @@ -146,41 +148,37 @@ Compilation: =item * Unix. Any decent Linux distribution is fine. LilyPond is known to run -on Linux and Solaris +on Linux, AIX, Digital Unix and Solaris =item * - GNU C++ v2.7 or better (with libg++ ) +GNU C++ v2.7 or better, with libg++. Version 2.7.2 or better recommended. =item * - GNU make. +GNU make. =item * - flex (2.5.1 or better) +flex (2.5.1 or better) =item * -bison/yacc +Bison or YACC. -=item * -The "flower" library, -which should be available from the -same source you got this from. +=item * The "Flower" library, which should be available from the same +source you got this from. -=item * -perl +=item * perl. The Makefile uses perl for trivial operations, and you +could tinker with it to use sed or awk. =back - -The Makefile uses perl for trivial operations, and you could tinker -with it to use sed or awk. - -Operation: +LilyPond does use a lot of resources. For operation you need the following: =over 5 -=item * TeX +=item * +TeX -=item * the MusixTeX fonts +=item * +The MusixTeX fonts. (I use version T.59) =back @@ -193,6 +191,7 @@ Do: cd flower; make; cd .. tar zxf lilypond-1.2.13.tar.gz cd lilypond-1.2.13 + configure make You might want to edit Variables.make to tailor the compilation flags. @@ -206,16 +205,16 @@ builtin bool =item * typeof -=item * +=item * operator ? -=item * +=item * the new for-scope =item * class Rational (libg++) -=item * +=item * named return values =back @@ -231,18 +230,19 @@ Han-Wen Nienhuys , Main author Jan Nieuwenhuizen , bits of FlowerLib, general comments. =item * -Mats Bengtsson , bugfixes, testing. +Mats Bengtsson , bugfixes, testing, general comments. =back Your name could be here! If you want to help, then take a look at the -SMALLISH PROJECTS section of LilyPond. Some do not involve coding C++ +SMALLISH PROJECTS section of in the file F. Some do not involve +coding C++ =head1 EXAMPLES At this time, LilyPond is only suited for Quick & Dirty jobs (the -output quality still is too low). If you're not discouraged; this is -what I type in my xterm: +output quality of multistaff material still is too low). If you're not +discouraged; this is what I type in my xterm: lilypond someinput.ly tex test @@ -250,24 +250,25 @@ what I type in my xterm: This is what the output looks like over here: - hw:~/musix/spacer$ lilypond maartje.ly - LilyPond 0.0.17/FlowerLib 1.0.14. Compile: Dec 17 1996, 11:33:54 (g++ 2.7.2) - Parsing ... [symbol.ini][maartje.ly] - Processing ... Calculating ... Postprocessing ... - output to lelie.uit... + hw:~/musix/spacer$ lilypond input/maartje + LilyPond 0.0.23/FlowerLib 1.0.20. Compile: Jan 20 1997, 00:51:06 (g++ 2.7.2) + Parsing ... [./init//symbol.ini[./init/dutch.ini][./init/script.ini][./init/table_sixteen.ini]][./input/maartje.ly] + Processing music ... warning: process_requests(): beamed note should have a stem (t = 5/8) + Preprocessing ... Calculating ... Postprocessing ... + output to lelie.out... hw:~/musix/spacer$ tex test This is TeX, Version 3.14159 (C version 6.1) (test.tex Hyphenation patterns for english, dutch, loaded. (lilyponddefs.tex) (lelie.uit) [1] [2] ) - Output written on test.dvi (2 pages, 8072 bytes). + Output written on test.dvi (2 pages, 8420 bytes). Transcript written on test.log. hw:~/musix/spacer$ xdvi test& - [1] 1468 + [1] 855 -Check out kortjakje.ly, it has some comments +Check out F, it has some comments =head1 PROBLEMS @@ -275,7 +276,7 @@ Check out kortjakje.ly, it has some comments If LilyPond bombs out, then please recompile using B<-g>, and send a copy of the input which causes the error and a gdb stacktrace of the crash. It also helps if you can print the values of the objects. So if -you trace is +your trace is (gdb) backtrace 12 #0 Interval::operator+= (this=0x11fffec60..) @@ -286,7 +287,7 @@ you trace is : Than it would help if you send a dump of the Interval and the Item -(use: 'print *this' or use LilyPond print() methods). +(use: C or use LilyPond C methods). This is a beta version of LilyPond. Please send your helpful comments and patches to me (see AUTHORS section) @@ -303,9 +304,36 @@ includes files from the directory F. =head1 SEE ALSO -lilygut(1), lilyinput(1) +There are some documentation files in the subdirectory F, +among others: lilygut, lilyinput, error, faq, -=head1 REMARKS +=head1 REMARKS LilyPond has no connection with the music package RoseGarden, other than the names being similar. + + +=head1 HISTORY + +(for a detailed changelog, see F) + +LilyPond's roots lie in MPP, a preprocessor to the rather arcane +MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen +wrote the first 44 versions (0.01 to 0.44), then his program caught my +attention, and I was slowly sucked in to the interesting problem of +easily producing beautifully printed music. I contributed some +code. We soon realised that MPP's design was too fundamentally broken +to be repaired. It was decided to rewrite MPP. We debated a lot about +the requirements to an inputformat (fall 1995). I sat down and started +with a parser-first, bottom-up rewrite called mpp95 (which totally +failed, obviously). + +After long and hard thinking, I came up with an algorithm for the +horizontal spacing of multiple staffs (april 1996) I coded it (and did +not test it). After starting with this fundamental piece, I slowly +added the stages which come before spacing, and after a few months, I +had a first working version, (october 1996). I announced Patchlevel 0.0.7 +(or 8) to the mutex list after asking some technical details on +spacing; it was downloaded approximately 4 times. Then I got the hang +of it, and in the subsequent two months, I coded until it had +doubled in size (pl 23). diff --git a/Documentation/error.pod b/Documentation/error.pod new file mode 100644 index 0000000000..1888beaf98 --- /dev/null +++ b/Documentation/error.pod @@ -0,0 +1,29 @@ +=head1 NAME + +LilyError - LilyPond error messages + +=head1 DESCRIPTION + +This page documents error messages. + +A correctly parsed F does not guarantuee output. A lot +(most) of the checking is done B parsing (some checks even are +done after the break calc!); I'm sorry. + +The parser's job is to construct appropriate objects. It will B +detect parse errors. + + can't find slur to end + +Eg. with: + + {d g ( } ) g8 + +The {} part generates two one-note Cs, the C another, which +is translated to start right after the chord. Slurs are contained +within voices. LilyPond can't find a slur which started in this +C's voice. (what should C<{ d( g ( } )g8 )g8 }> look like? Use + + { \music { d } \music { g()g8 } } + + diff --git a/Documentation/faq.pod b/Documentation/faq.pod new file mode 100644 index 0000000000..0b841b9705 --- /dev/null +++ b/Documentation/faq.pod @@ -0,0 +1,26 @@ +=head1 NAME + +FAQ - LilyPond FAQs + +=head1 DESCRIPTION + + + +Q: I want to enter meterchanges inside the music. + +A: You can't; a meterchange is scorewide (well, staffwide in some +modern music). If allowed inside the music, we get complicated and +conflicting situations if two voices asked for (possibly different) +meterchanges. + +You can mark certain spots, though: please check out F + + +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 + + a()a()a + + diff --git a/Documentation/lilyinput.pod b/Documentation/lilyinput.pod index 99c58aaee2..d359bb39bd 100644 --- a/Documentation/lilyinput.pod +++ b/Documentation/lilyinput.pod @@ -61,17 +61,10 @@ Not really crystallized; you can use '#' or '%' as line comment =head2 other -A correctly parsed .ly does not guarantuee output. A lot (most) of the -checking is done B parsing (some checks even are done after the -break calc!); I'm sorry. - -The parser's job is to construct appropriate objects. It will *only* -detect parse errors. - LilyPond first reads 'symbol.ini', which contains declarations crucial to proper operation of LilyPond (symbol tables, note names). This language looks a lot like Rayce's which in turn owes a lot to the POVRay raytracer. Now, I know, musictypesetting and Raytracing do not necessarily require the same input format, but I was just to lazy to -make up a new and/or better input format. Suggestions welcome. +make up a new and/or better input format. Suggestions appreciated. diff --git a/Generate.make b/Generate.make new file mode 100644 index 0000000000..08d53ba78c --- /dev/null +++ b/Generate.make @@ -0,0 +1,26 @@ + +parsheadorig=$(CCDIR)/parser.tab.h +parsheadnew=$(HEADERDIR)/parser.hh + +# +# take some trouble to avoid overwriting the old y.tab.h +$(CCDIR)/parser.cc: $(CCDIR)/parser.y + $(BISON) -d $< + (if diff $(parsheadorig) $(parsheadnew)>/dev/null; then \ + echo leaving $(parsheadnew); \ + else \ + mv $(parsheadorig) $(parsheadnew); \ + fi ) + mv $(CCDIR)/parser.tab.c $@ + +$(parsheadnew): $(CCDIR)/parser.cc + +$(HEADERDIR)/version.hh: Variables.make make_version + make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) "$(CXX) $(CXXVER)" > $@ + +$(CCDIR)/lexer.cc: $(CCDIR)/lexer.l + $(FLEX) -t $< > $@ + + + + diff --git a/Initial.make b/Initial.make new file mode 100644 index 0000000000..1c2d8abb10 --- /dev/null +++ b/Initial.make @@ -0,0 +1,12 @@ +include Variables.make + +initdefault: $(CCDIR)/parser.cc $(CCDIR)/lexer.cc hdr/version.hh alldeps + +include Generate.make + +alldeps: #$(ALLDEPS) + touch $(DEPDIR)/dummy.dep + +$(DEPDIR)/%.dep: $(CCDIR)/%.cc + $(DODEP) $(CXX) -E $(CXXFLAGS) $^ > /dev/null + diff --git a/Makefile b/Makefile index 5044425dcd..584d0dc60c 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,19 @@ include Variables.make .SUFFIXES: -.SUFFIXES: .cc .o .hh .y .l .pod .txt .1 +.SUFFIXES: .cc .o .hh .y .l .pod .txt .1 .dep $(exe): $(obs) $(CXX) -o $@ $^ $(LOADLIBES) +depend: ; # automatically by gnu make. clean: -# $(MAKE) -C objects clean rm -f $(exe) objects/*.o $(DOCDIR)/* core $(MAKE) -C $(CCDIR) clean $(MAKE) -C $(HEADERDIR) clean distclean: clean - rm -f depend version.hh $(gencc) .GENERATE *~ + rm -f version.hh $(gencc) .GENERATE *~ deps/*.dep all: kompijl doc @@ -25,62 +25,32 @@ docpp: $(progdocs) -mkdir $(DOCDIR) doc++ -p -I -d $(DOCDIR) $^ -depend: Sources.make .GENERATE - touch depend - $(MAKE) realdepend +%.o: $(CCDIR)/%.cc + $(DODEP)\ + $(CXX) -c $(CXXFLAGS) $^ -o $(OBJECTDIR)/$@ $(OBJECTDIR)/%.o: $(CCDIR)/%.cc - $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) + $(DODEP)\ + $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) -# hack to create these sources once, before the dependencies -.GENERATE: - touch .GENERATE depend - $(MAKE) version.hh - $(MAKE) $(gencc) - rm -f depend -realdepend: $(cc) - $(CXX) $(CXXFLAGS) -MM $^ | perl -ne 's#hdr/proto.hh##; s/^(.+)\.o/'$(OBJECTDIR)'\/\1.o/; print;' > depend - -include depend - -parsheadorig=$(CCDIR)/parser.tab.h -parsheadnew=$(HEADERDIR)/parser.hh - -# -# take some trouble to avoid overwriting the old y.tab.h -$(CCDIR)/parser.cc: parser.y - $(BISON) -d $< - (if diff -q $(parsheadorig) $(parsheadnew); then \ - echo leaving $(parsheadnew); \ - else \ - mv $(parsheadorig) $(parsheadnew); \ - fi ) - mv $(CCDIR)/parser.tab.c $@ - -$(parsheadnew): $(CCDIR)/parser.cc +include $(DEPDIR)/*.dep version.o: $(obs) version.hh -hdr/version.hh: Variables.make make_version - make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) "$(CXX) $(CXXVER)" > $@ - -$(CCDIR)/lexer.cc: lexer.l - $(FLEX) -t $< > $@ +include Generate.make dist: -mkdir $(DDIR) ln $(DFILES) $(DDIR)/ - for a in $(SUBDIRS); \ - do mkdir $(DDIR)/$$a; \ - $(MAKE) -C $$a dist;\ + for SUBDIR in $(SUBDIRS); \ + do mkdir $(DDIR)/$$SUBDIR; \ + $(MAKE) SUBDIR=$$SUBDIR -C $$SUBDIR dist;\ done tar cfz $(DNAME).tar.gz $(DNAME)/ rm -rf $(DDIR)/ - - TAGS: $(MAKE) -C $(HEADERDIR) TAGS $(MAKE) -C $(CCDIR) TAGS diff --git a/NEWS b/NEWS index a2033eb366..93baaa2807 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,30 @@ + +pl 23: + - TODO file inc'd + - cadenza mode. + - default extension, search path. + - error.pod,faq.pod + - Markers + - configure script + - scrapped VPATH + - inputfile name in output. +Internal changes: + - Split Input_* parsing steps to enable marking +Bugfixes: + - unconnected columns + + pl 22: - doco from mpp - repeat signs - | checks for bar in a voice (Barcheck_req) Internal changes: - naming (Hungarian notation, svec vs. Array) - - huge memleak fixed; unearthed lots of bugs - - bug noteheadswap - cleanup PScore, Score - removed Staff_commands, plugging commands into Staff_column directly +Bugfixes: + - bug noteheadswap + - huge memleak fixed; unearthed lots of bugs pl 21: - scripts diff --git a/Sources.make b/Sources.make index 0be964c269..afadfff786 100644 --- a/Sources.make +++ b/Sources.make @@ -1,26 +1,20 @@ # -*- Makefile-*- # sourcefiles to be shipped. Also for dependencies -hdr= qlp.hh linespace.hh qlpsolve.hh\ - pcol.hh proto.hh pstaff.hh scoreline.hh staffline.hh\ - const.hh glob.hh molecule.hh boxes.hh pscore.hh item.hh tex.hh\ - request.hh voice.hh command.hh staff.hh linestaff.hh \ - tstream.hh rhythmstaff.hh\ - parseconstruct.hh debug.hh globvars.hh keyword.hh\ - misc.hh score.hh notename.hh lexer.hh symtable.hh\ - symbol.hh main.hh dimen.hh paper.hh lookup.hh\ - spanner.hh beam.hh directionalspanner.hh slur.hh textspanner.hh\ - sccol.hh stcol.hh staffcommands.hh melodicstaff.hh\ - identifier.hh simplestaff.hh stem.hh\ - notehead.hh leastsquares.hh rest.hh\ - swalker.hh bar.hh meter.hh accidental.hh\ - key.hh keyitem.hh localkeyitem.hh simplewalker.hh\ - clef.hh clefitem.hh inputcommands.hh\ - getcommand.hh inputmusic.hh timedescription.hh\ - inputscore.hh inputstaff.hh identparent.hh\ - inputcommand.hh grouping.hh moment.hh offset.hh\ - staffelem.hh idealspacing.hh break.hh\ - scriptdef.hh script.hh textdef.hh textitem.hh +hdr= accidental.hh bar.hh beam.hh boxes.hh break.hh clef.hh clefitem.hh\ + command.hh const.hh debug.hh dimen.hh directionalspanner.hh\ + getcommand.hh glob.hh globvars.hh grouping.hh idealspacing.hh\ + identifier.hh identparent.hh inputcommand.hh inputcommands.hh\ + inputmusic.hh inputscore.hh inputstaff.hh item.hh key.hh keyitem.hh\ + keyword.hh leastsquares.hh lexer.hh linespace.hh linestaff.hh\ + localkeyitem.hh lookup.hh main.hh melodicstaff.hh meter.hh misc.hh\ + molecule.hh moment.hh notehead.hh notename.hh offset.hh paper.hh\ + parseconstruct.hh pcol.hh proto.hh pscore.hh pstaff.hh qlp.hh\ + qlpsolve.hh request.hh rest.hh rhythmstaff.hh sccol.hh score.hh\ + scoreline.hh script.hh scriptdef.hh simplestaff.hh simplewalker.hh\ + slur.hh spanner.hh staff.hh staffcommands.hh staffelem.hh staffline.hh\ + stcol.hh stem.hh swalker.hh symbol.hh symtable.hh tex.hh textdef.hh\ + textitem.hh textspanner.hh timedescription.hh tstream.hh voice.hh mycc=bar.cc beam.cc boxes.cc break.cc calcideal.cc clef.cc\ clefitem.cc command.cc debug.cc dimen.cc directionalspanner.cc\ diff --git a/TODO b/TODO new file mode 100644 index 0000000000..70e3590b8a --- /dev/null +++ b/TODO @@ -0,0 +1,117 @@ +BUGS + * first clef + + * position of key acc's + +SEVERELY LACKING: + + * grace notes + +INPUTLANGUAGE + + * figured bass? + + * transposition + + * voicegroups. + + * rest name configurable + +SMALLISH PROJECTS + + * Lookup::tex_glissando, Lookup::tex_bracket, + Lookup::tex_cresc, Lookup::tex_decresc (use texbeam.cc as an + example.) + + * Decent TeX titledefs (\tempo, \metron, etc. ) + + * command priority into enum + + * C meter iso 4/4 + + * textspanner: dir of beam. + + * script-spacing + + * Brackets + + * space rest. + + * use (char *) iso. String for communication between lexer and parser. + + * As vs. as notename. + + * configure idealspacing: arithmetic spacing + + * fix symbols in parser.o: `Warning: size of symbol' + + * Viola clef (->jan?!) + +DOC + + * beam generation. + + * all errors + +FUTURE + + * Text_pstaff/Lyric_staff + + * put requests on barcommands + + * glissando + + * guitar chord + + * better beamslope calculation + + * implement better breaking algorithm + + * check out linux -> go32 crosscompiler: dos port + + * Implement all requests + + * QLP for beams? + + * stacked slurs. + + * revise calcideal + + * eentje/tweetje + +IDEAS + + * itemcolumns + + * check out PMX + + * dependencies: -> implement children more elegantly. Handle + spanner with broken deps. + + * use an embedded language: scheme, lisp, S-lang, Perl, ? + + * Broadcasts in Walker of Request and Item. + + * y -dims in internote? + + * hack up mf sources for decent spacing info (and then maybe + read TFM directly) + + * merge Atom and Symbol? + + * merge Command/Input_command. + + * merge common code of Item, Atom/Molecule + + * Spacing_request for manually adjusting spacing + + * Staff_group. + + * SHIT: meters/bars should be aligned, which is difficult if + we get different keychanges in different staffs. + + * Integrating (objectiveC) MusicKit with LilyPond + + * MusixTeX output possible? + + * PostScript output (esp. Beams, Slurs, etc) diff --git a/Variables.make b/Variables.make index eea032df7f..768dcc5adb 100644 --- a/Variables.make +++ b/Variables.make @@ -7,7 +7,7 @@ OPTIFLAG=-DNDEBUG -DNPRINT -O2 DEBUGFLAG=-g # turn off -pipe if linker doesn't support it -EXTRACXXFLAGS=-pipe -Wall -W -Wmissing-prototypes +#EXTRACXXFLAGS=-pipe -Wall -W -Wmissing-prototypes # # -lefence = ElectricFence. @@ -37,12 +37,12 @@ endif # version info MAJVER=0 MINVER=0 -PATCHLEVEL=22 +PATCHLEVEL=23 VERSION=$(MAJVER).$(MINVER).$(PATCHLEVEL) CXXVER=`$(CXX) --version` #flower version -NEEDEFLOWERVER=1.0.17 +NEEDEFLOWERVER=1.0.20 # directories TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) @@ -50,11 +50,14 @@ OBJECTDIR=objects HEADERDIR=hdr CCDIR=src INITDIR=init -vpath %.cc $(CCDIR) -vpath %.hh $(HEADERDIR) -vpath %.y $(CCDIR) -vpath %.l $(CCDIR) -vpath %.o $(OBJECTDIR) +DEPDIR=deps +INPUTDIR=input +#vpath %.cc $(CCDIR) +#vpath %.hh $(HEADERDIR) +#vpath %.y $(CCDIR) +#vpath %.l $(CCDIR) +#vpath %.o $(OBJECTDIR) +#vpath %.dep $(DEPDIR) # # @@ -62,8 +65,10 @@ include Sources.make progdocs=$(hdr) $(mycc) gencc=parser.cc lexer.cc cc=$(mycc) $(gencc) -obs=$(cc:.cc=.o) +CCSOURCE=$(addprefix $(CCDIR)/, $(cc)) +obs=$(addprefix $(OBJECTDIR)/,$(cc:.cc=.o)) +ALLDEPS=$(addprefix $(DEPDIR)/,$(cc:.cc=.dep)) #dist .EXPORT_ALL_VARIABLES: @@ -75,12 +80,12 @@ DNAME=$(PACKAGENAME)-$(VERSION) # distribution files. othersrc=lexer.l parser.y -SCRIPTS=make_version make_patch genheader -IFILES=dimen.tex symbol.ini kortjakje.ly pavane.ly maartje.ly\ - lilyponddefs.tex test.tex .dstreamrc cadenza.ly scales.ly\ - titledefs.tex pavane.tex -OFILES=Makefile Variables.make Sources.make COPYING README NEWS -DFILES=$(OFILES) $(IFILES) $(SCRIPTS) +SCRIPTS=make_version make_patch genheader clean +MAKFILES=Makefile Variables.make Sources.make Initial.make Generate.make \ + configure +OFILES=COPYING README NEWS TODO +IFILES= standchen.tex titledefs.tex pavane.tex lilyponddefs.tex test.tex .dstreamrc dimen.tex +DFILES=$(MAKFILES) $(OFILES) $(IFILES) $(SCRIPTS) #compiling LOADLIBES=-L$(FLOWERDIR) -lflower $(EXTRALIB) @@ -92,4 +97,9 @@ BISON=bison exe=$(PACKAGENAME) OUTPUT_OPTION=$< -o $@ DDIR=$(TOPDIR)/$(DNAME) -SUBDIRS=Documentation $(OBJECTDIR) $(CCDIR) $(HEADERDIR) $(INITDIR) +SUBDIRS=Documentation $(OBJECTDIR) $(CCDIR) $(HEADERDIR) $(INITDIR) $(DEPDIR) \ + $(INPUTDIR) + +depfile=deps/$(subst .o,.dep,$(notdir $@)) +DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(OBJECTDIR)/$(notdir $@)" + diff --git a/cadenza.ly b/cadenza.ly deleted file mode 100644 index b61616cf02..0000000000 --- a/cadenza.ly +++ /dev/null @@ -1,38 +0,0 @@ -% -% Cadenza to Mozart Horn/3 -% - -cad = music { $ - \duration { 8} - \textstyle "italic" - 'c4._"f" g8 - \textstyle "roman" - ['e^"accel" ()'d 'c b] - [b()'c] g-\fermata c [c_"rubato" e g 'c] - \octave{'} - e4. e [g ()f_"rit" e d] - - \duration{16} - dis4()e4 r8 [c d] [e f g gis] - \duration{4} - a-> `f()`e g - f-> `d()`cis e - \duration{8} - d4^\fermata r8 `a [`b cis] - \duration{16} - [d cis d e] - f4()[f e d c] `b4 - \octave{} \plet{2/3} ['d8 'c8 a8] \plet{1/1} % triplet! - g2 [g c e g] ['c e g 'c]\octave{'} - [e `g c e] g4^\fermata %()% BUG! - [g8.(_"a tempo" e g8. )e] - a4. g8 [f8 e8 d8 c8] - `g2 d2^"tr" - c4 $} - -score { - staff { melodic - music { cad } - } - commands { meter 4 4 skip 13:0 } -} diff --git a/clean b/clean new file mode 100755 index 0000000000..34eb6c982d --- /dev/null +++ b/clean @@ -0,0 +1,4 @@ +#!/bin/sh + +# unclobber current dir. +rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~ \ No newline at end of file diff --git a/configure b/configure new file mode 100755 index 0000000000..37d5742e10 --- /dev/null +++ b/configure @@ -0,0 +1,7 @@ +#!/bin/sh + +PREFIX="." +echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh + +touch depend +make -f Initial.make \ No newline at end of file diff --git a/deps/Makefile b/deps/Makefile new file mode 100644 index 0000000000..0d303b3d38 --- /dev/null +++ b/deps/Makefile @@ -0,0 +1,4 @@ +DISTFILES=Makefile +dist: + ln $(DISTFILES) $(DDIR)/$(SUBDIR) + \ No newline at end of file diff --git a/dimen.tex b/dimen.tex index b8a062179a..e53263181d 100644 --- a/dimen.tex +++ b/dimen.tex @@ -1,6 +1,6 @@ -\font\musicfnt=musix20 +\font\musicfont=musixsps \font\slurfont=xslu16 -\def\thefont{\slurfont} +\def\thefont{\musicfont} \def\mb#1{{\thefont\char#1}} diff --git a/hdr/Makefile b/hdr/Makefile index 29358a5d9d..2ee609e881 100644 --- a/hdr/Makefile +++ b/hdr/Makefile @@ -1,8 +1,9 @@ default: $(MAKE) -C .. - +DISTFILES=Makefile $(hdr) dist: - ln Makefile $(hdr) $(DDIR)/$(HEADERDIR) + ln $(DISTFILES) $(DDIR)/$(SUBDIR) + TAGS: $(hdr) etags -CT $(hdr) diff --git a/hdr/accidental.hh b/hdr/accidental.hh index 8c601863ae..a1c5d80d30 100644 --- a/hdr/accidental.hh +++ b/hdr/accidental.hh @@ -1,7 +1,7 @@ /* accidental.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef ACCIDENTAL_HH diff --git a/hdr/bar.hh b/hdr/bar.hh index 634940121e..2a360b0d73 100644 --- a/hdr/bar.hh +++ b/hdr/bar.hh @@ -1,7 +1,7 @@ /* bar.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef BAR_HH diff --git a/hdr/beam.hh b/hdr/beam.hh index 912f47dc72..96c65b12b0 100644 --- a/hdr/beam.hh +++ b/hdr/beam.hh @@ -1,7 +1,7 @@ /* beam.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef BEAM_HH diff --git a/hdr/break.hh b/hdr/break.hh index 4475e7d173..2f471fd4fd 100644 --- a/hdr/break.hh +++ b/hdr/break.hh @@ -1,7 +1,7 @@ /* break.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef BREAK_HH diff --git a/hdr/clef.hh b/hdr/clef.hh index 3b61ca3bc7..2c56cb497e 100644 --- a/hdr/clef.hh +++ b/hdr/clef.hh @@ -1,7 +1,7 @@ /* clef.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef CLEF_HH diff --git a/hdr/clefitem.hh b/hdr/clefitem.hh index 525aa0aeb0..ccedc4e9a7 100644 --- a/hdr/clefitem.hh +++ b/hdr/clefitem.hh @@ -2,7 +2,7 @@ /* clefitem.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef CLEFITEM_HH diff --git a/hdr/debug.hh b/hdr/debug.hh index 2f5c4ba47e..0e35476b39 100644 --- a/hdr/debug.hh +++ b/hdr/debug.hh @@ -1,12 +1,15 @@ #ifndef DEBUG_HH #define DEBUG_HH + #include #include #include "dstream.hh" #include "real.hh" +#include "proto.hh" void error(String s); // errors - +void error_t(const String& s, Time_description const & t_tdes); +void error_t(String const &s, const Moment &when); // warnings void warning(String s); #define WARN warnout << "warning: "<<__FUNCTION__ << "(): " diff --git a/hdr/directionalspanner.hh b/hdr/directionalspanner.hh index 3c734b3474..f0e4716432 100644 --- a/hdr/directionalspanner.hh +++ b/hdr/directionalspanner.hh @@ -1,7 +1,7 @@ /* directionalspanner.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef DIRECTIONALSPANNER_HH diff --git a/hdr/getcommand.hh b/hdr/getcommand.hh index e2ce456cf7..77123e85dc 100644 --- a/hdr/getcommand.hh +++ b/hdr/getcommand.hh @@ -1,7 +1,7 @@ /* getcommand.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef GETCOMMAND_HH diff --git a/hdr/grouping.hh b/hdr/grouping.hh index 6e13f3217e..6f89456d8b 100644 --- a/hdr/grouping.hh +++ b/hdr/grouping.hh @@ -1,7 +1,7 @@ /* grouping.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef GROUPING_HH @@ -44,6 +44,9 @@ struct Rhythmic_grouping { Array generate_beams(Array, int&); + /// multiply self to span #i# + void extend(MInterval i); + void translate(Moment); private: void init(); void junk(); diff --git a/hdr/idealspacing.hh b/hdr/idealspacing.hh index 801818e7a3..05f58ba9c8 100644 --- a/hdr/idealspacing.hh +++ b/hdr/idealspacing.hh @@ -1,7 +1,7 @@ /* idealspacing.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef IDEALSPACING_HH diff --git a/hdr/identifier.hh b/hdr/identifier.hh index f634e216dc..04bee62255 100644 --- a/hdr/identifier.hh +++ b/hdr/identifier.hh @@ -2,7 +2,7 @@ /* identifier.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef IDENTIFIER_HH diff --git a/hdr/identparent.hh b/hdr/identparent.hh index f4e1705d41..c74be844c8 100644 --- a/hdr/identparent.hh +++ b/hdr/identparent.hh @@ -1,7 +1,7 @@ /* identparent.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef IDENTPARENT_HH diff --git a/hdr/inputcommand.hh b/hdr/inputcommand.hh index 61f968ee53..2654d06b7c 100644 --- a/hdr/inputcommand.hh +++ b/hdr/inputcommand.hh @@ -1,7 +1,7 @@ /* inputcommand.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef INPUTCOMMAND_HH @@ -19,6 +19,7 @@ struct Input_command { operator Command(); }; +Input_command*get_cadenza_toggle(int i); Input_command *get_meterchange_command( int,int); Input_command *get_key_interpret_command(Array); Input_command *get_clef_interpret_command(String w); @@ -28,6 +29,7 @@ Input_command *get_skip_command(int,Moment); Input_command *get_grouping_command(Array); Input_command *get_bar_command(String); Input_command *get_newmeasure_command(); +Input_command *get_goto_command(String); Array get_default_grouping(int count); #endif // INPUTCOMMAND_HH diff --git a/hdr/inputcommands.hh b/hdr/inputcommands.hh index 20e6a1cb06..6457c1c686 100644 --- a/hdr/inputcommands.hh +++ b/hdr/inputcommands.hh @@ -1,7 +1,7 @@ /* inputcommands.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef INPUTCOMMANDS_HH @@ -19,7 +19,7 @@ struct Commands_at : public IPointerList { /****************/ Moment when(); - void parse(Staff_commands_at*); + void parse(Staff_commands_at*); void print() const; Moment barleft(); void add(Input_command*); @@ -45,7 +45,7 @@ struct Input_commands : public IPointerList { /****************/ void find_moment(Moment); - void add(Input_command c); + void add(Input_command c,Assoc &marks_assoc_r); void do_skip(int bars, Moment wholes); Input_commands(); diff --git a/hdr/inputmusic.hh b/hdr/inputmusic.hh index 5b6da2968a..4ef8eebb46 100644 --- a/hdr/inputmusic.hh +++ b/hdr/inputmusic.hh @@ -1,7 +1,7 @@ /* inputmusic.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef INPUTMUSIC_HH diff --git a/hdr/inputscore.hh b/hdr/inputscore.hh index 39e6a367fd..973d4814da 100644 --- a/hdr/inputscore.hh +++ b/hdr/inputscore.hh @@ -3,10 +3,14 @@ #include "varray.hh" #include "proto.hh" #include "plist.hh" +#include "string.hh" /// the total music def of one movement struct Input_score { + /// defined where? + String define_spot_str_; + /// paper_, staffs_ and commands_ form the problem definition. Paperdef *paper_; IPointerList staffs_; diff --git a/hdr/inputstaff.hh b/hdr/inputstaff.hh index 6fac204643..01062de99c 100644 --- a/hdr/inputstaff.hh +++ b/hdr/inputstaff.hh @@ -1,7 +1,7 @@ /* inputstaff.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef INPUTSTAFF_HH @@ -13,6 +13,9 @@ #include "proto.hh" struct Input_staff { + + /// defined where? + String define_spot_str_; String type; IPointerList commands_; IPointerList music_; @@ -20,10 +23,10 @@ struct Input_staff { /****************/ void add(Input_music*m); - Input_staff(Input_staff&); + Input_staff(Input_staff const&); Input_staff(String); void add(Array &s); - Staff* parse(PointerList, Score*); + Staff* parse(Score*); void print() const; }; diff --git a/hdr/key.hh b/hdr/key.hh index 791c0861cf..a0ea3e833d 100644 --- a/hdr/key.hh +++ b/hdr/key.hh @@ -1,7 +1,7 @@ /* key.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef KEY_HH diff --git a/hdr/keyitem.hh b/hdr/keyitem.hh index 43ce9ca0a7..72f9680e1a 100644 --- a/hdr/keyitem.hh +++ b/hdr/keyitem.hh @@ -1,7 +1,7 @@ /* keyitem.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef KEYITEM_HH diff --git a/hdr/keyword.hh b/hdr/keyword.hh index b081df3a62..152d9dc15d 100644 --- a/hdr/keyword.hh +++ b/hdr/keyword.hh @@ -1,7 +1,7 @@ /* keyword.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef KEYWORD_HH diff --git a/hdr/leastsquares.hh b/hdr/leastsquares.hh index e7368e398b..4d3931ee94 100644 --- a/hdr/leastsquares.hh +++ b/hdr/leastsquares.hh @@ -1,7 +1,7 @@ /* leastsquare.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef LEASTSQUARE_HH diff --git a/hdr/lexer.hh b/hdr/lexer.hh index 767a12c95e..7cbbbe3747 100644 --- a/hdr/lexer.hh +++ b/hdr/lexer.hh @@ -36,6 +36,7 @@ struct My_flex_lexer : yyFlexLexer { int lookup_keyword(String); void lookup_notename(int &large, int &small, String s); void LexerError(const char *); + String spot() const; Identifier*lookup_identifier(String s); My_flex_lexer(); void add_identifier(Identifier*i); diff --git a/hdr/localkeyitem.hh b/hdr/localkeyitem.hh index 6276977b77..c8cca9d7c1 100644 --- a/hdr/localkeyitem.hh +++ b/hdr/localkeyitem.hh @@ -1,7 +1,7 @@ /* localkeyitem.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef LOCALKEYITEM_HH diff --git a/hdr/lookup.hh b/hdr/lookup.hh index f947a7d734..ac479b8549 100644 --- a/hdr/lookup.hh +++ b/hdr/lookup.hh @@ -1,5 +1,5 @@ /* - lilypond, (c) 1996 Han-Wen Nienhuys + lilypond, (c) 1996,97 Han-Wen Nienhuys */ #ifndef LOOKUPSYMS_HH #define LOOKUPSYMS_HH diff --git a/hdr/main.hh b/hdr/main.hh index f5a795a951..e73ba2390b 100644 --- a/hdr/main.hh +++ b/hdr/main.hh @@ -7,6 +7,7 @@ void set_debug(bool); void do_scores(); void add_score(Input_score * s); void set_default_output(String s); +String find_file(String); const char *get_version(); #endif diff --git a/hdr/melodicstaff.hh b/hdr/melodicstaff.hh index db7dd88b83..e3a5ff1f61 100644 --- a/hdr/melodicstaff.hh +++ b/hdr/melodicstaff.hh @@ -1,7 +1,7 @@ /* rhythmstaf.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef MELODICSTAFF_HH diff --git a/hdr/meter.hh b/hdr/meter.hh index ca364cf59c..11166232ad 100644 --- a/hdr/meter.hh +++ b/hdr/meter.hh @@ -1,7 +1,7 @@ /* meter.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef METER_HH diff --git a/hdr/moment.hh b/hdr/moment.hh index 1f34eae5ab..0037d94078 100644 --- a/hdr/moment.hh +++ b/hdr/moment.hh @@ -8,7 +8,7 @@ #include "rational.hh" class String; typedef Rational Moment; -void error_t(String const &s, Moment when); + #endif // diff --git a/hdr/notehead.hh b/hdr/notehead.hh index 860d16280d..18612b06c6 100644 --- a/hdr/notehead.hh +++ b/hdr/notehead.hh @@ -1,7 +1,7 @@ /* notehead.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef NOTEHEAD_HH diff --git a/hdr/notename.hh b/hdr/notename.hh index fc134c926f..b533f4d360 100644 --- a/hdr/notename.hh +++ b/hdr/notename.hh @@ -1,7 +1,7 @@ /* notename.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef NOTENAME_HH diff --git a/hdr/offset.hh b/hdr/offset.hh index b1867007fa..e0b62bba76 100644 --- a/hdr/offset.hh +++ b/hdr/offset.hh @@ -1,7 +1,7 @@ /* offset.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef OFFSET_HH diff --git a/hdr/parseconstruct.hh b/hdr/parseconstruct.hh index 8afb32d94b..6a22127a38 100644 --- a/hdr/parseconstruct.hh +++ b/hdr/parseconstruct.hh @@ -1,13 +1,15 @@ /* parseconstruct.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef PARSECONSTRUCT_HH #define PARSECONSTRUCT_HH #include "proto.hh" + +Voice_element*get_mark_element(String); void set_default_duration(int *); void get_default_duration(int *); void set_default_octave(String); diff --git a/hdr/proto.hh b/hdr/proto.hh index ac215970fe..8be03e72f7 100644 --- a/hdr/proto.hh +++ b/hdr/proto.hh @@ -2,7 +2,7 @@ /* proto.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef PROTO_HH @@ -42,8 +42,11 @@ struct Local_key; struct Local_key_item; struct Lookup; struct Lyric_req; +struct Mark_req; struct Mixed_qp; struct Molecule; +struct Rational; +typedef Rational Moment; struct Note_req; struct Notehead; struct Offset; diff --git a/hdr/request.hh b/hdr/request.hh index a6ae0fbc88..12382d0bf7 100644 --- a/hdr/request.hh +++ b/hdr/request.hh @@ -32,6 +32,7 @@ struct Request { virtual Slur_req *slur() { return 0 ; } virtual Rhythmic_req*rhythmic() { return 0; } virtual Melodic_req *melodic() { return 0; } + virtual Mark_req * mark() { return 0; } }; /** @@ -107,6 +108,7 @@ struct Stem_req : Request { virtual Stem_req *stem() {return this;} Stem_req(int s) { stem_number = s; } Request*clone() const; + virtual void print() const; }; /// requests to start or stop something. @@ -178,6 +180,16 @@ struct Text_req : Request { Text_req(Text_req const&); }; +/// designate this spot with a name. +struct Mark_req : Request { + String mark_str_; + /****************/ + Mark_req(String); + Mark_req* mark() { return this; } + virtual void print() const; + Request *clone() const; +}; + #if 0 @@ -214,12 +226,12 @@ Start/stop a bracket at this note. if #nplet# is set, the staff will try to put an appropriate number over the bracket */ -struct Subtle_request { +struct Subtle_req { Moment subtime; }; /// helper in the hierarchy -struct Dynamic:Subtle_request { +struct Dynamic:Subtle_req { }; /** Each dynamic is bound to one note ( a crescendo spanning multiple @@ -249,7 +261,7 @@ struct Absdynamic_req : Request, Dynamic { Loudness loudness; }; -struct Grace_req : Subtle_request { +struct Grace_req : Subtle_req { }; @@ -264,5 +276,15 @@ struct Grace_note : Melodic_req { struct Grace_notes { }; + +struct Spacing_req { + Moment next; + Real distance; +}; + +struct Glissando_req : Span_req { + +}; + #endif #endif diff --git a/hdr/rest.hh b/hdr/rest.hh index 2280611be8..e13c540212 100644 --- a/hdr/rest.hh +++ b/hdr/rest.hh @@ -1,7 +1,7 @@ /* rest.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef REST_HH diff --git a/hdr/rhythmstaff.hh b/hdr/rhythmstaff.hh index 978594dcd3..741be45e78 100644 --- a/hdr/rhythmstaff.hh +++ b/hdr/rhythmstaff.hh @@ -1,7 +1,7 @@ /* rhythmstaf.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef RHYTHMSTAF_HH diff --git a/hdr/sccol.hh b/hdr/sccol.hh index 615376309c..75f1bcd89b 100644 --- a/hdr/sccol.hh +++ b/hdr/sccol.hh @@ -1,7 +1,7 @@ /* sccol.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCCOL_HH diff --git a/hdr/score.hh b/hdr/score.hh index f58367c30e..152e578493 100644 --- a/hdr/score.hh +++ b/hdr/score.hh @@ -4,6 +4,7 @@ #include "proto.hh" #include "plist.hh" #include "moment.hh" +#include "assoc.hh" /// the total music def of one movement struct Score { @@ -15,13 +16,17 @@ struct Score { IPointerList cols_; PScore *pscore_p_; + String define_spot_str_; + + Assoc markers_assoc_; /****************************************************************/ /// construction Score(Paperdef*); ~Score(); - void add(Staff*); + void add(Staff*); + void add_marks(Array, Array); /// do everything except outputting to file void process(); @@ -37,9 +42,10 @@ struct Score { PCursor find_col(Moment,bool); /// when does the last *musical* element finish? Moment last() const; - + private: Score(Score const&){} + /// void do_cols(); /** make the pcol_l_ fields of each Score_column point to the correct PCol, diff --git a/hdr/scoreline.hh b/hdr/scoreline.hh index 233496932a..26e1285c44 100644 --- a/hdr/scoreline.hh +++ b/hdr/scoreline.hh @@ -1,7 +1,7 @@ /* scoreline.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCORELINE_HH diff --git a/hdr/script.hh b/hdr/script.hh index 01dd75c53d..7b6cf37b24 100644 --- a/hdr/script.hh +++ b/hdr/script.hh @@ -1,7 +1,7 @@ /* script.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCRIPT_HH diff --git a/hdr/scriptdef.hh b/hdr/scriptdef.hh index ea5793e21c..fb1dc4317f 100644 --- a/hdr/scriptdef.hh +++ b/hdr/scriptdef.hh @@ -1,7 +1,7 @@ /* scriptdef.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCRIPTDEF_HH diff --git a/hdr/simplestaff.hh b/hdr/simplestaff.hh index f074dc169d..bdd1f06136 100644 --- a/hdr/simplestaff.hh +++ b/hdr/simplestaff.hh @@ -1,7 +1,7 @@ /* simplestaff.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SIMPLESTAFF_HH @@ -32,7 +32,7 @@ struct Simple_column : Staff_column { Stem_req *stem_; Moment stem_requester_len; Beam_req *beam_; - Simple_staff* staff_; + Simple_staff* staff_l_; Text_req *text_; /****************/ diff --git a/hdr/simplewalker.hh b/hdr/simplewalker.hh index 34403e465c..192419ef2e 100644 --- a/hdr/simplewalker.hh +++ b/hdr/simplewalker.hh @@ -1,7 +1,7 @@ /* simplewalker.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SIMPLEWALKER_HH diff --git a/hdr/slur.hh b/hdr/slur.hh index 9a3333f063..8c0cbd4ebe 100644 --- a/hdr/slur.hh +++ b/hdr/slur.hh @@ -1,7 +1,7 @@ /* slur.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SLUR_HH diff --git a/hdr/spanner.hh b/hdr/spanner.hh index fd646a4b91..d04f0736a6 100644 --- a/hdr/spanner.hh +++ b/hdr/spanner.hh @@ -1,7 +1,7 @@ /* spanner.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SPANNER_HH diff --git a/hdr/staff.hh b/hdr/staff.hh index 7d6be0e12f..d02f944373 100644 --- a/hdr/staff.hh +++ b/hdr/staff.hh @@ -14,10 +14,14 @@ struct Staff { Score *score_l_; PScore *pscore_l_; - + String define_spot_str_; /****************************************************************/ void add(PointerList &s); + void do_commands(PointerList score_wide, + PointerList staff_wide); + void get_marks(Array&, Array&); + /// throw away cols later the #l# void truncate_cols(Moment l); diff --git a/hdr/staffcommands.hh b/hdr/staffcommands.hh index e0e27be4be..1a25b9bdb4 100644 --- a/hdr/staffcommands.hh +++ b/hdr/staffcommands.hh @@ -1,5 +1,5 @@ /* - lilypond, (c) 1996 Han-Wen Nienhuys + lilypond, (c) 1996,97 Han-Wen Nienhuys */ #ifndef SCORECOMMANDS_HH #define SCORECOMMANDS_HH diff --git a/hdr/staffelem.hh b/hdr/staffelem.hh index bd10f216a8..e48170d4d2 100644 --- a/hdr/staffelem.hh +++ b/hdr/staffelem.hh @@ -1,7 +1,7 @@ /* staffelem.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef STAFFELEM_HH @@ -63,6 +63,11 @@ private: NULL. */ }; +/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend + on other Staff_elem's, eg, Beam needs to know and set direction of + Stem. So the Beam has to be calculated *before* Stem. This is + accomplished with the dependencies field of struct Staff_elem. + */ #endif // STAFFELEM_HH diff --git a/hdr/staffline.hh b/hdr/staffline.hh index 663c9584b2..e08aabd17e 100644 --- a/hdr/staffline.hh +++ b/hdr/staffline.hh @@ -1,7 +1,7 @@ /* staffline.hh -- horizontal structures for broken scores. - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef STAFFLINE_HH diff --git a/hdr/stcol.hh b/hdr/stcol.hh index 2bdd3b8bb9..b9e3a9bba8 100644 --- a/hdr/stcol.hh +++ b/hdr/stcol.hh @@ -1,7 +1,7 @@ /* stcol.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef STCOL_HH diff --git a/hdr/stem.hh b/hdr/stem.hh index b7d7e05e29..977a719ae9 100644 --- a/hdr/stem.hh +++ b/hdr/stem.hh @@ -1,7 +1,7 @@ /* stem.hh -- - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef STEM_HH diff --git a/hdr/swalker.hh b/hdr/swalker.hh index 046ded590e..d224477b60 100644 --- a/hdr/swalker.hh +++ b/hdr/swalker.hh @@ -2,7 +2,7 @@ /* swalker.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef SWALKER_HH diff --git a/hdr/symtable.hh b/hdr/symtable.hh index b4217c12b8..61dc38b42e 100644 --- a/hdr/symtable.hh +++ b/hdr/symtable.hh @@ -1,5 +1,5 @@ /* - lilypond, (c) 1996 Han-Wen Nienhuys + lilypond, (c) 1996,97 Han-Wen Nienhuys */ #ifndef SYMTABLE_HH #define SYMTABLE_HH diff --git a/hdr/textdef.hh b/hdr/textdef.hh index 784420c44b..2befb6bb4d 100644 --- a/hdr/textdef.hh +++ b/hdr/textdef.hh @@ -1,7 +1,7 @@ /* textdef.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef TEXTDEF_HH diff --git a/hdr/textitem.hh b/hdr/textitem.hh index 1d37be3286..ffeeafbb82 100644 --- a/hdr/textitem.hh +++ b/hdr/textitem.hh @@ -1,7 +1,7 @@ /* text.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef TEXT_ITEM_HH diff --git a/hdr/textspanner.hh b/hdr/textspanner.hh index 1e9d06d543..4baf832a39 100644 --- a/hdr/textspanner.hh +++ b/hdr/textspanner.hh @@ -1,7 +1,7 @@ /* textspanner.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef TEXTSPANNER_HH diff --git a/hdr/timedescription.hh b/hdr/timedescription.hh index 2194ee0a16..5fb7749793 100644 --- a/hdr/timedescription.hh +++ b/hdr/timedescription.hh @@ -1,7 +1,7 @@ /* moment.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef tdes_HH @@ -10,26 +10,33 @@ #include "real.hh" #include "moment.hh" +/// full info on where we are struct Time_description { - Rational when; + Moment when; + + /// if true, no bars needed, no reduction of whole_in_measure + bool cadenza_b_; + /// current measure info - Rational whole_per_measure; + Moment whole_per_measure; /// where am i - Rational whole_in_measure; + Moment whole_in_measure; /// how long is one beat? - Rational one_beat; + Moment one_beat; /// idem int bars; + /****************/ + void set_cadenza(bool); void OK() const; - Time_description(Rational, const Time_description*); + Time_description(Moment, const Time_description*); String str()const; void print() const; - void setpartial(Rational p); - Rational barleft(); + void setpartial(Moment p); + Moment barleft(); void set_meter(int,int); static int compare (Time_description&, Time_description&); }; diff --git a/init/Makefile b/init/Makefile index 19dfcbfcaf..bb93a1c6fd 100644 --- a/init/Makefile +++ b/init/Makefile @@ -1,5 +1,5 @@ DFILES=dutch.ini table_sixteen.ini table_twenty.ini\ - english.ini script.ini + english.ini script.ini symbol.ini default: echo huh? diff --git a/symbol.ini b/init/symbol.ini similarity index 100% rename from symbol.ini rename to init/symbol.ini diff --git a/init/table_sixteen.ini b/init/table_sixteen.ini index 5eb42dde18..77297efbfa 100644 --- a/init/table_sixteen.ini +++ b/init/table_sixteen.ini @@ -11,8 +11,8 @@ symboltables { % index TeXstring, xmin xmax ymin ymax "scripts" = table { - "fermata" "\fermata" 0pt 0pt 0pt 11.25pt - "-fermata" "\ifermata" 0pt 0pt -11.25pt 0pt + "fermata" "\fermata" 0pt 0pt 0pt 6pt + "-fermata" "\ifermata" 0pt 0pt -6pt 0pt "portato" "\portato" 0pt 0pt 0pt 0pt "-portato" "\iportato" 0pt 0pt 0pt 0pt "tenuto" "\tenuto" 0pt 0pt 0pt 0pt diff --git a/input/Makefile b/input/Makefile new file mode 100644 index 0000000000..439a77eddc --- /dev/null +++ b/input/Makefile @@ -0,0 +1,7 @@ +default: ; + +DISTFILES=Makefile kortjakje.ly pavane.ly maartje.ly\ + cadenza.ly scales.ly standchen.lily + +dist: + ln $(DISTFILES) $(DDIR)/$(SUBDIR) diff --git a/input/cadenza.ly b/input/cadenza.ly new file mode 100644 index 0000000000..445ec08823 --- /dev/null +++ b/input/cadenza.ly @@ -0,0 +1,64 @@ +% +% Cadenza to Mozart Horn/3 +% + +cad = music { $ + \duration { 8} + \textstyle "italic" + 'c4._"f" g8 + \textstyle "roman" + ['e^"accel" ()'d 'c b] + [b()'c] g-\fermata + \mark"br1" + c [c_"rubato" e g 'c] + \octave{'} + e4. e [g ()f_"rit" e d] + + \duration{16} + dis4()e4 + \mark"br2" + r8 [c d] [e f g gis] + \duration{4} + a-> `f()`e g + f-> `d()`cis e + \duration{8} + d4^\fermata + \mark"br3" + + r8 `a [`b cis] + \duration{16} [d cis d e] + f4()[f e d c] + `b4 + \octave{} \plet{2/3} ['d8 'c8 a8] + \plet{1/1} + g2 + \mark "br4" + [g c e g] ['c e g 'c]\octave{'} + [e `g c e] g4^\fermata %()% BUG! + \mark "br5" + [g8.(_"a tempo" e g8. )e] + a4. g8 [f8 e8 d8 c8] + `g2 d2^"tr" + c4 + $} + + score { + staff { melodic + music { cad } + } + commands { + meter 4*4 + cadenza 1 + grouping 1 + goto "br1" + bar "empty" + goto "br2" + bar "empty" + goto "br3" + bar "empty" + goto "br4" + bar "empty" + goto "br5" + bar "empty" + } +} diff --git a/kortjakje.ly b/input/kortjakje.ly similarity index 98% rename from kortjakje.ly rename to input/kortjakje.ly index ac78340c4f..fa54120b50 100644 --- a/kortjakje.ly +++ b/input/kortjakje.ly @@ -71,7 +71,7 @@ score { unitspace 2.5cm % a whole note takes 2.5 cm ideally. } commands { - meter 2 4 % a 2/4 meter. + meter 2* 4 % a 2/4 meter. skip 33:0 % skip 32 measures, and generate the bars % meter 6 8 % another meter } diff --git a/maartje.ly b/input/maartje.ly similarity index 58% rename from maartje.ly rename to input/maartje.ly index f585c27b80..894118206d 100644 --- a/maartje.ly +++ b/input/maartje.ly @@ -1,18 +1,14 @@ ritme = staff {rhythmic music {$ c8 - [a8() a8. a8 a16 a16 a16] c4. + |[a8() a8. a8 a16 a16 a16] c4. %[c8( )'a8() c8 c8]% BUG! - c2 c2 + |c2 c2 - [fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16] - c2 r32 r32 r16 r8 r4 - [c8. c16] - [c16 c8.] - [c16 c16 c8] - [c16 c8 c16] -% [c16 r8 c16] + |[fis16 'dis16( fis16 'dis16 ][fis16) 'dis16 fis16 'dis16] + | r32 r32 r16 r8 r4 r2 + |[c8. c16] [c16 c8.] [c16 c16 c8] [c16 c8 c16] c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 @@ -22,10 +18,10 @@ ritme = staff {rhythmic melody= staff { melodic music{$ -c8 - r4 r4 r4 r4 - 'cis2.. r8 - r4 r8 r16 r32 r32 + c8 + |r4 r4 r4 r4 + |'cis2.. r8 + | r4 r8 r16 r32 r32 \duration {4} { @@ -38,23 +34,22 @@ c8 { c4 'c4 } [d8 e8 'f8 g8] d8 e8 f8 g8 - ''fis2 - a8 b8 'c8 'd8 ''c8 ```c8 c4 c4 c4 c4 + |''fis2 + | a8 b8 'c8 'd8 |''c8 ```c8 c4 |c4 c4 |c4 \duration{ 16 } `b `a `g `f \duration{ 4} - c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c + |c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c $} commands { - - skip 3:0%BUG - key $ fis cis gis $ - skip 2:0 - key $ $%BUG - skip 5:0 - clef bass -} + skip 3:0 + key $ fis cis gis $ + skip 2:0 + key + skip 5:0 + clef bass + } } score { @@ -65,12 +60,12 @@ score { staff { ritme } staff { melody } commands { - meter 4 4 + meter 4* 4 partial 8 skip 1:2 bar ":|:" skip 2:0 - meter 2 4 + meter 2* 4 skip 19:0 } } diff --git a/pavane.ly b/input/pavane.ly similarity index 91% rename from pavane.ly rename to input/pavane.ly index a5ad5cc311..ec31ea1aa0 100644 --- a/pavane.ly +++ b/input/pavane.ly @@ -1,10 +1,10 @@ -% pavane pour une Infante d\'efunte -% -% Maurice Ravel +% Pavane pour une Infante d\'efunte +% by Maurice Ravel % % (Ravel has been dead for over 50 years. This does not have copyright) % - +% (there is an accompanying LaTeX file, pavane.tex) +% horn = staff {melodic music{ $ @@ -99,20 +99,21 @@ score { output "pavane.out" unitspace 1.5 cm geometric 1.4 + width 12cm } commands { - meter 4 4 + meter 4 *4 skip 18:0 - meter 2 4 + meter 2 *4 skip 1:0 - meter 4 4 + meter 4 *4 skip 20:0 bar "|:" skip 9:0 - meter 2 4 + meter 2* 4 skip 1:0 bar ":|" - meter 4 4 + meter 4* 4 skip 13:0 bar "||" } diff --git a/input/scales.ly b/input/scales.ly new file mode 100644 index 0000000000..92229d02e2 --- /dev/null +++ b/input/scales.ly @@ -0,0 +1,64 @@ + +blah = +staff {melodic + music{ $ +\duration { 8 } + \octave{ } + \plet { 6/9 } |[ a a a a a a a a a ] \plet { 1/1 } + \octave{ ' } + \plet { 6/9 } |[ a a a a a a a a a ] \plet { 1/1 } + \octave { ` } + \plet { 6/9 } [ `c `g d a 'e 'b ''f '''c '''g ] \plet { 1/1 } + \plet { 6/9 } [ '''g '''c ''f 'b 'e a d `g `c ] \plet { 1/1 } + \octave{ ' } + \plet { 6/9 } [ `c `g d a 'e 'b ''f '''c '''g ] \plet { 1/1 } + \plet { 6/9 } [ '''g '''c ''f 'b 'e a d `g `c ] \plet { 1/1 } + \octave { } + \plet { 2/3 } [ c g 'd ] \plet { 1/1 } + \plet { 2/3 } [ 'd g c ] \plet { 1/1 } + \plet { 2/3 } [ f 'c 'g ] \plet { 1/1 } + \plet { 2/3 } [ 'g 'c f ] \plet { 1/1 } + \octave{ ' } + \plet { 2/3 } [ c g 'd ] \plet { 1/1 } + \plet { 2/3 } [ 'd g c ] \plet { 1/1 } + \plet { 2/3 } [ f 'c 'g ] \plet { 1/1 } + \plet { 2/3 } [ 'g 'c f ] \plet { 1/1 } + +c1 + \duration { 8} + [c-> d-> e-> f->][g-> a-> b-> 'c->] % 1 +\octave{'} ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^] +\octave{} ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^] + [c-. d-. e-. f-.][g-. a-. b-. 'c-.] + ['c-- b-- a-- g][f-- e-- d c--] % 5 + [c-\portato d-\portato e-\portato f-\portato] + [g-\portato a-\portato b-\portato 'c-\portato] + ['c-\upbow b-\upbow a-\downbow g-\downbow] + [f-\downbow e-\downbow d-\upbow c-\upbow] + [c-| d-| e-| f-|][g-| a-| b-| 'c-|] + ['c b a g][f e d c] + [c d e f][g a b 'c] % 10 + |['c b a g][f e d c] + + $} + commands { + } +} +score { + staff { + blah + } + paper { + symboltables { table_sixteen} + unitspace 1.5 cm + geometric 1.4 + } + commands { + meter 6 8 + skip 6:0 + meter 4 4 + skip 2:0 + skip 11:0 + + } +} \ No newline at end of file diff --git a/input/standchen.lily b/input/standchen.lily new file mode 100644 index 0000000000..9af02f0a5d --- /dev/null +++ b/input/standchen.lily @@ -0,0 +1,375 @@ +% st\"andchen.lily +% Franz Schubert +% +% comments with # note missing stuff +% heu, make that %#% +% +%% Still looks fairly on the "ugh" side the beauty scale, mainly because of +%% LilyPond's naive idealspacing calc. +%% + +% +%#%% +%#%\title{St\"andchen} +%#%\subtitle{Serenade} +%#%% +%#%\composer{`franz Schubert} +%#%\tempo{M\"a\ss ig} +%#%% +%#%\meter{3/4} +%#%\key\`f +%#%\clef\treble +%#%% +%#%\barnumbering5 +%#%%\staffnumbers +%#%\barnumberstyle\boxed +%#%% +%#%\staffseparation{12} +%#%% +%#%\duration8 +%%1 +melodie = music { $ + \duration{ 8 } + r_"pp" { [ d `a-^ } f-^ { d `a-^ } f-^ { d `a-^ ] } +%%2 + r { [ d `bes-^ } f-^ { d `bes-^ } f-^ { d `bes-^ ] } +%%3 + r_"simile" { [ d `bes } e { d `bes } e { d `bes ] } +%%4 + r { [ `a cis } e { `a cis } e { `a cis ] } +%#%:| +%%5 + \plet{ 2/3 } [ a()bes a ] \plet{ 1/1 } 'd4. a +%%6 + \plet{ 2/3 } [ g()a g ] \plet{ 1/1 } 'd4 a r +%#%\tighten +%#%\newline +%%7 + a4.^> g \plet{ 2/3 } [ g( f )e ] \plet{ 1/1 } +%%8 + f2 r4 +%%9 +%#% { 'a4.( 'cis4.\stemdown_p } { ) 'g 'e_{dolce} } +%#% { 'g( 'e } 'f ) 'e + 'a4.( )g \plet{ 2/3 } { 'g 'e } { 'f } { 'e } \plet{ 1/1 } +%%10 + { 'f2. 'd2. } +%%11 + \plet { 2/3 } [ a_"pp"( )bes a ] \plet { 1/1 } 'f4. a +%%12 + \plet { 2/3 } [ g( ) a g ] \plet { 1/1 } 'e4. 'd +%%13 + 'c4. bes \plet { 2/3 } [ bes( ) a g ] \plet { 1/1 } +%%14 +%#% a2 r { 'd(^ f_p(v } + a2 r { 'd f_"p" } +%%15 +%#% { ) e4. ) 'c4.\stemup_{dolce} } { bes g } + { e4. 'c4._"dolce" } { bes g } + \plet { 2/3 } { [ bes g } a g ] \plet { 1/1 } +%%16 + { a2. f2. } +%%17 + [ a8._"cresc." 'cis16 ] 'f4. 'e +%%18 + [ 'd8. a16 ] f4. d +%%19 +%#% 'c\grace\stemup + \plet { 2/3 } [ bes_"pp"( ) a bes ] \plet { 1/1 } 'd4. bes +%%20 + a2. +%%21 +%#% a\grace + \plet { 2/3 } [ g( )fis g ] \plet { 1/1 } bes4.^> g +%%22 +%#% =f2. + f2. +%%23 + [ a8._"mf" 'cis16 ] 'f4. 'e +%%24 + [ 'd8. a16 ] fis4. d +%%25 +%#% 'cis\grace\stemup + \plet { 2/3 } [ b_"mf"( ) ais b ] \plet { 1/1 } 'd4. b +%%26 + { a2. fis2. } +%#%\tighten\newline +%%27 + \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4. 'cis +%%28 + { 'd2. fis2. } +%#%\volta1 +%%29 +%#% { bes2(^++++ g2_{mf} } + { bes2 g2_"mf" } +%#% [v { 'd8.( bes8. } { bes16 ) )++ g16 } ] + { [ 'd8. bes8. } { bes16 g16 ] } +%%30 + { a4. fis4. } +%#% [ { [ a_. f_.( } { a_. f_. } { a_. ) f_. } ] + { [ a_. f_. } { a_. f_. } { a_. f_. ] } +%%31 + { a4. g4. } +%#% [ { a cis_.( } { a e_. } { a )- g_. } ] + { [ a cis_. } { a e_. } { a g_. ] } +%%32 + { a2 fis2_"pp" } { a4 fis4 } +%%33 +%#% { b2(^ g2 } [v { '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_. ] } +%%35 +%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ] + { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] } +%%36 + { a2. fis2. } +%#%\volta2 +%#%:| +%%37 + [ a8. a16 ] [ 'cis8. 'cis16 ] [ 'e8. 'e16 ] +%%38 + 'd4( )'cis4 r4 +%%39 +%#% > a4. [ 'cis 'e8. >! 'd16 ] + a4. [ 'cis 'e8. 'd16 ] +%%40 + 'cis2 r4 +%%41 +%#% { > 'fis4. 'cis4._f } 'e [ 'e( ) 'd >! 'cis ] \plet { 1/1 } + { 'fis4. 'cis4._"f" } 'e \plet { 2/3 } [ 'e( )'d 'cis ] \plet { 1/1 } +%%42 + [ b8. 'cis16 ] 'd4^> b r +%%43 +%#% [^ { b8._{ }_{ }_{ }_{ }_{ }_f g2. } 'cis16 ] 'd4^> b r + [ b8._"f" 'cis16 ] 'd4^> b r +%%44 +%#% [^ { > b8. fis2 } 'cis16 ] 'd4^> b >! r + [ b8. 'cis16 ] 'd4^> b r +%%45 +%#% 'cis\grace\stemup + \plet { 2/3 } [ b_"p"( )ais b ] \plet { 1/1 } 'd4. b +%%46 +%#% { =a2. fis2. } + { a2. fis2. } +%%47 + \plet { 2/3 } [ 'e_"f"( )'dis 'e ] \plet { 1/1 } 'g4.^> 'cis +%%48 +%#% { fis2.(v ='d2.\stemup(^ } + { fis2. 'd2. } +%%49 +%#% { ) 'd4 ) =f2._> } { r4 s4_{decr} } 'd4\stemup + 'd4 r4_"decresc." 'd4 +%%50 + { bes2. e2. } +%%51 + { a2. cis2. } +%%52 + { fis2 d2 } { a4 f4_"pp" } +%%53 +%#% { bes2 g2 } [ { 'd8.^>( bes8. } { ) bes16 g16 } ] + { bes2 g2 } { [ 'd8.^> bes8. } { bes16 g16 ] } +%%54 +%#% { a4. fis4. } [ { a_. fis_.( } { a_. fis_. } { a_. ) fis_. } ] + { a4. fis4. } { [ a_. fis_. } { a_. fis_. } { a_. fis_. ] } +%%55 +%#% { a4. g4. } [ { a cis_.( } { a e_. } { a )- g_. } ] + { a4. g4. } { [ a cis_. } { a e_. } { a g_. ] } +%%56 + { a2. fis2._"dim." } +%%57 + { a2. fis2. } +%%58 + { a2.^\fermata fis2. } +%#%\tighten +$ } + +begeleiding = music { $ + \duration{2} + `d r4 +%%2 + ``bes r4 + +%%3 + ``g r4 + +%%4 + ``a r4 +%#%:| +%%5 +%#%\stemlength2 +\duration{ 8 } +%#% { =`f `d2 } `a d `a { d r4 } `a +% i-d rather type: +% { \music{ [ `f `a d `a d `a ] } \music{ `d2 r4 } } +% output little better... +% { `d2 \music{ [ `f `a d `a } } { \music{ d `a ] } r4 } + [ `f `a d `a d `a ] +%%6 +%#% { `d ``bes2 } `e `g `e { `g r4 } `e + [ `d `e `g `e `g `e ] +%%7 +%#% { `cis ``a2 } `e `g `e { `g r4 } `e + [ `cis `e `g `e `g `e ] +%%8 +%#% { `d `d2 } `a d `a { d r4 } `a + [ `d `a d `a d `a ] +%%9 +%#% `a e f e f e + [ `a e f e f e ] +%%10 +%#% `d `a d `a d `a + [ `d `a d `a d `a ] +%%11 +%#% [^ { `f `d2 } `a d `a { d r4 } `a ] + [ `f `a d `a d `a ] + +%%12 == 6 +%#% { `d ``bes2 } `e `g `e { `g r4 } `e + [ `d `e `g `e `g `e ] +%%13 +%#% { `e ``bes2 } `e `g `e { `g r4 } `e + [ `e `e `g `e `g `e ] +%%14 +%#% { `a `f2 } c f c { f r4 } c + [ `a c f c f c ] +%%15 + [ `c `g `bes `g `bes `g ] +%%16 + [ ``f `c `f `c `f `c ] +%%17 +%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ] + [ ``a `e `g `e `g `e ] +%%18 +%#% [^ { `d `d2 } `a d `a { d r4 } `a ] + [ `d `a d `a d `a ] +%%19 +%#% s8 % skip space of `grace note +%#% [^ { ``bes ``bes2 } `f `bes `f { `bes r4 } `f ] + [ ``bes `f `bes `f `bes `f ] +%%20 +%#% [^ { ``f ``f2 } `c `f `c { `f r4 } `c ] + [ ``f `c `f `c `f `c ] +%%21 +%#% s8 % skip space of `grace note +%#% [ { `e `c } `g c `g c `g ] + { [ `e `c } `g c `g c `g ] +%%22 + [ `f `a c `a `f `c ] +%%23 +%#% [^ { ``a ``a2 } `e `g `e { `g r4 } `e ] + [ ``a `e `g `e `g `e ] +%%24 +%#% [^ { `d `d2 } `fis `a `fis { `a r4 } `fis] + [ `d `fis `a `fis `a `fis ] +%%25 +%#% s8 % skip space of `grace note +%#% [^ { ``g ``g2 } `d `b `d { `b r4 } `d] + [ ``g `d `b `d `b `d ] +%%26 +%#% [^ { `d `d2 } `a d `a { d r4 } `a] + [ `d `a d `a d `a ] +%%27 + { [ `cis ``a } `e `a `e `a `e ] +%%28 + [ `d `a d `a d `a ] +%%29 +%#% [ `d `g @ `bes `g `bes `g ] + [ `d `g `bes `g `bes `g ] +%#%\volta1 +%%30 + [ `d `fis `a `fis `a `fis ] +%%31 + [ `a `e `a `e `a `e ] +%%32 + [ `d `fis `a `fis `a `fis ] +%%33 + [ `d `g `b `g `b `g ] +%%34 + [ `d `fis `a `fis `a `fis ] +%%35 + [ `a `e `a `e `a `e ] +%%36 + [ `d `fis `a `fis `a `fis ] +%#%\volta2 +%#%:| +%%37 + [ `a `e `g `e ``bes^> `e ] +%%38 + [ `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 ] } +%%41 + [ `ais `e `gis `e `gis `e ] +%%42 + { [ `d ``b } `fis `b `fis `b `fis ] +%%43 + { [ `e ``b } `g `b `g `b `g ] +%%44 + { [ `d ``b } `fis `b `fis `b `fis ] +%%45 +%#% s8 % skip space of `grace note +%#% [^{ ``g ``g2 } `d `b `d { `b r4 } `d] + [ ``g `d `b `d `b `d ] +%%46 +%#% [^ { `d `d2 } `a d `a { d r4 } `a ] + [ `d `a d `a d `a ] +%%47 + { [ `cis ``a } `e `a `e `a `e ] +%%48 + [ `d `fis `a `fis `a `fis ] +%%49 + [ `d `a d `a d `a ] +%%50 + [ ``g `e `g `e `g `e ] +%%51 + [ `a `e `g `e `g `e ] +%%52 + [ ``d `d `fis `d `fis `d ] +%%53 + [ `d `g `bes `g `bes `g ] +%%54 + [ `d `fis `a `fis `a `fis ] +%%55 + [ `a `e `g `e `g `e ] +%%56 + [ ``d ``a `d ``a `d ``a ] +%%57 + [ ``d ``a `d ``a `d ``a ] +%%58 + { `d2.^\fermata ``d2. } +$ } + +score { + paper { + symboltables { table_sixteen } + output "standchen.uit" + unitspace 2.4 cm + geometric 1.4 + } + staff { + melodic music { melodie } + commands { + key $bes$ + clef violin + } + } + staff { + melodic music { begeleiding } + commands { + key $bes$ + clef bass + } + } + commands { + meter 3 4 + skip 4:0 + bar ":|" + skip 32:0 + bar ":|" + skip 22:0 + } +} diff --git a/lilyponddefs.tex b/lilyponddefs.tex index eadca08e81..0a1fdeef8a 100644 --- a/lilyponddefs.tex +++ b/lilyponddefs.tex @@ -125,7 +125,7 @@ \def\maatstreep{\vrule height\balkhoog} \def\finishbar{\vrule height\balkhoog width 1pt} \maccentdef\repeatcolon{55}{2/1} - +\def\emptybar{} \def\repeatbar{\rightalign{\repeatcolon\kern 2pt\finishbar}} \def\startrepeat{\hbox{\finishbar\kern 2pt\repeatcolon}} \def\repeatbarstartrepeat{\hbox{\repeatbar\kern 1pt\startrepeat}} @@ -193,8 +193,8 @@ \maccentdef\iportato{19}{9/10} \maccentdef\tenuto{26}{0/1} \maccentdef\itenuto{27}{0/1} -\mdef\fermata{80} -\mdef\ifermata{81} +\maccentdef\fermata{80}{-1/1} +\maccentdef\ifermata{81}{1/1} diff --git a/objects/Makefile b/objects/Makefile new file mode 100644 index 0000000000..228fde37ed --- /dev/null +++ b/objects/Makefile @@ -0,0 +1,3 @@ +DISTFILES=Makefile +dist: + ln $(DISTFILES) $(DDIR)/$(SUBDIR) \ No newline at end of file diff --git a/scales.ly b/scales.ly deleted file mode 100644 index 99d6f5630a..0000000000 --- a/scales.ly +++ /dev/null @@ -1,36 +0,0 @@ - -blah = -staff {melodic - music{ $ c1 - \duration { 8} - [c-> d-> e-> f->][g-> a-> b-> 'c->] -\octave{'} ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^] - -\octave{} ['c-^ b-^ a-^ g-^][f-^ e-^ d-^ c-^] - - [c-. d-. e-. f-.][g-. a-. b-. 'c-.] - ['c-- b-- a-- g][f-- e-- d c--] - [c-\portato d-\portato e-\portato f-\portato][g-\portato a-\portato b-\portato 'c-\portato] - ['c-\upbow b-\upbow a-\downbow g-\downbow][f-\downbow e-\downbow d-\upbow c-\upbow] - [c-| d-| e-| f-|][g-| a-| b-| 'c-|] - ['c b a g][f e d c] - [c d e f][g a b 'c] - ['c b a g][f e d c] - $} - commands { - } -} -score { - staff { - blah - } - paper { - symboltables { table_sixteen} - unitspace 1.5 cm - geometric 1.4 - } - commands {meter 4 4 - - skip 18:0 - } -} \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index a3cc55c1e4..99c4f0a6b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,9 @@ default: $(MAKE) -C .. +DISTFILES=Makefile $(mycc) $(othersrc) dist: - ln Makefile $(mycc) $(othersrc) $(DDIR)/src + ln $(DISTFILES) $(DDIR)/$(SUBDIR) TAGS: $(mycc) etags -CT $(mycc) diff --git a/src/beam.cc b/src/beam.cc index 1016320dea..c65dc58115 100644 --- a/src/beam.cc +++ b/src/beam.cc @@ -34,6 +34,7 @@ Stem_info::Stem_info(const Stem*s) } /****************/ + Offset Beam::center()const { @@ -42,9 +43,9 @@ Beam::center()const Beam*me_p = (Beam*)this; me_p->do_post_processing(); } - Real w=width().length()/2; - return Offset(w, - (left_pos + w* slope)*paper()->interline()); + + Real w=(paper()->note_width() + width().length())/2.0; + return Offset(w, (left_pos + w* slope)*paper()->interline()); } diff --git a/src/debug.cc b/src/debug.cc index ea0cb4b8c4..228f7c7019 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -7,7 +7,13 @@ #include "vector.hh" Dstream monitor(&cout,".dstreamrc"); -ostream * nulldev = new ofstream("/dev/null"); +ostream * nulldev =0; + +struct _Dinit { + _Dinit() { nulldev = new ofstream("/dev/null");} + ~_Dinit() { delete nulldev; } +} dinit; + /* diff --git a/src/getcommands.cc b/src/getcommands.cc index 6545c0ec1c..a11e2c0fe3 100644 --- a/src/getcommands.cc +++ b/src/getcommands.cc @@ -49,10 +49,7 @@ split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com, if(s=="default") s = "|"; - if (s == "|" || s == ":|" || s == "||") { - c.args.add(s); - pre_com= no_break_com= c; - } else if (s == ":|:") { + if (s == ":|:") { no_break_com=post_com=pre_com = c; pre_com.args.add( ":|"); @@ -61,5 +58,8 @@ split_bar_command(Command &pre_com, Command &no_break_com, Command &post_com, }else if (s=="|:") { c.args.add(s); no_break_com=post_com=c; + } else { + c.args.add(s); + pre_com= no_break_com= c; } } diff --git a/src/grouping.cc b/src/grouping.cc index 4b8efaee6c..4f02b75378 100644 --- a/src/grouping.cc +++ b/src/grouping.cc @@ -100,11 +100,15 @@ Rhythmic_grouping::intersect(MInterval t) } +/* I really should be documenting what is happening here, but I find + that difficult, since I don't really understand what's going on here. + + */ void Rhythmic_grouping::split(Array splitpoints) { //check on splitpoints.. - int j = 0, i=0, starti = 0, startj = 0; + int j = 0, i = 0, starti = 0, startj = 0; Array ch; while (1) { @@ -162,8 +166,7 @@ Rhythmic_grouping::Rhythmic_grouping(Array r) Rhythmic_grouping::~Rhythmic_grouping() { - junk(); - + junk(); } void @@ -289,3 +292,28 @@ Rhythmic_grouping::generate_beams(Array flags, int &flagidx) return beams; } +void +Rhythmic_grouping::translate(Moment m) +{ + if (interval_) + *interval_ += m; + else + for (int i=0; i < children.size(); i++) + children[i]->translate(m); +} + +void +Rhythmic_grouping::extend(MInterval m) +{ + assert(m.left >= interval().left); + while (m.right >interval().right ) { + Array a(children); + for (int i=0; i < a.size(); i++) { + a[i] =new Rhythmic_grouping(*children[i]); + a[i]->translate(children.last()->interval().right); + } + children.concat(a); + } + assert(m.right <= interval().right); + OK(); +} diff --git a/src/inputcommand.cc b/src/inputcommand.cc index 9cedc52c2a..02e7e72813 100644 --- a/src/inputcommand.cc +++ b/src/inputcommand.cc @@ -44,6 +44,24 @@ get_partial_command(Moment u) return c; } +Input_command* +get_goto_command(String s) +{ + Input_command*c = new Input_command; + c->args.add("GOTO"); + c->args.add(s); + return c; +} + +Input_command* +get_cadenza_toggle(int i) +{ + + Input_command*c = new Input_command; + c->args.add("CADENZA"); + c->args.add(i); + return c; +} Input_command* get_grouping_command(Arraya ) { @@ -90,9 +108,7 @@ Input_command * get_newmeasure_command() { Input_command*c = new Input_command; - c->args.add( "NEWMEASURE"); - return c; } @@ -112,6 +128,7 @@ get_skip_command(int n, Moment m) void Input_command::print()const { +#ifndef NPRINT mtor << "{ "; if (args.size()) { mtor<< " args: "; @@ -119,6 +136,7 @@ Input_command::print()const mtor << "`"<tdescription_ : 0) { - if (prev&& !tdescription_.whole_in_measure) { + if (prev && !tdescription_.whole_in_measure) { bottom().add(get_newmeasure_command()); } } @@ -42,7 +45,6 @@ Commands_at::add(Input_command *i) int o = i->args[2]; tdescription_.set_meter(l,o); bottom().add(get_grouping_command( get_default_grouping(l))); - } } @@ -88,7 +90,10 @@ Input_cursor::find_moment(Moment w) while (1) { if (! ok() ) { *this = list().bottom(); - Moment dt = (w - when()) barleft(); + + Moment dt = (w - when()); + if ( !ptr()->tdescription_.cadenza_b_ ) + dt = dt barleft(); Commands_at * c = new Commands_at(dt, *this); assert(c->when() <= w); @@ -113,6 +118,7 @@ Input_cursor::find_moment(Moment w) /****************/ + Input_commands::Input_commands(Input_commands const&src) : ptr(src.ptr) { @@ -145,25 +151,35 @@ Input_commands::do_skip(int bars, Moment wholes) void -Input_commands::add(Input_command c) -{ - if (c.args[0] == "PARTIAL") { +Input_commands::add(Input_command c, Assoc &marks_assoc_r) +{ + String s(c.args[0]); + if (s == "CADENZA") { + ptr->tdescription_.set_cadenza(c.args[1]); + } if (s == "PARTIAL") { ptr->setpartial(c.args[1]); - } else if (c.args[0] == "GROUPING") { + } else if (s == "GROUPING") { Input_command *ic = new Input_command(c); ic->args.insert(ptr->tdescription_.one_beat, 1); ptr->add(ic); - } else if (c.args[0] == "METER") { + } else if (s == "METER") { int beats_per_meas = c.args[1]; int one_beat = c.args[2]; Input_command *ch = get_meterchange_command(beats_per_meas, one_beat); ptr->add(ch); - } else if (c.args[0] == "SKIP") { + } else if (s == "SKIP") { int bars = c.args[1] ; Moment wholes= c.args[2]; do_skip(bars, wholes); - } else if (c.args[0] == "RESET") { + } else if (s == "RESET") { ptr= top(); + } else if (s=="GOTO") { + ptr = top(); + String m(c.args[1]); + if (!marks_assoc_r.elt_query(m)) + error("Unknown marker: `" +m + "\'"); + + ptr.find_moment(marks_assoc_r[m]); } else { Input_command *ic = new Input_command(c); ptr->add(ic); @@ -185,13 +201,6 @@ Input_commands::parse(Staff * staff_l) const if (!i->when()) { /* all pieces should start with a breakable. */ com_l->set_breakable(); - #if 0 - Command c;//(0.0); - c.code = INTERPRET; - c.args.add("BAR"); - c.args.add("empty"); - com_l->add(c); - #endif } i->parse(com_l); diff --git a/src/inputscore.cc b/src/inputscore.cc index cdc348c725..28e1f71599 100644 --- a/src/inputscore.cc +++ b/src/inputscore.cc @@ -4,6 +4,7 @@ #include "inputstaff.hh" #include "score.hh" #include "paper.hh" +#include "staff.hh" void Input_score::add(Array &s) @@ -25,17 +26,27 @@ Input_score::set(Paperdef*p) delete paper_; paper_ = p; } +Input_score::Input_score(Input_score const&) +{ + assert(false); +} Score* Input_score::parse() { Paperdef* paper_p=new Paperdef(*paper_); Score *s_p = new Score(paper_p); - + s_p->define_spot_str_ = define_spot_str_; + Array parsed_staffs; for (iter_top(staffs_,i); i.ok(); i++) { - Staff* staf_p=i->parse(commands_, s_p); + Staff* staf_p=i->parse(s_p); + parsed_staffs.add(staf_p); s_p->add(staf_p); } + int j = 0; + for (iter_top(staffs_,i); i.ok(); i++,j++) { + parsed_staffs[j]->do_commands(commands_, i->commands_); + } return s_p; } @@ -54,9 +65,11 @@ Input_score::Input_score() void Input_score::print()const { + #ifndef NPRINT mtor << "Input_score {\n"; for (iter_top(staffs_,i); i.ok(); i++) { i->print(); } mtor << "}\n"; +#endif } diff --git a/src/inputstaff.cc b/src/inputstaff.cc index 1786f3e293..c121984cd0 100644 --- a/src/inputstaff.cc +++ b/src/inputstaff.cc @@ -1,8 +1,8 @@ #include "getcommand.hh" #include "debug.hh" +#include "score.hh" #include "inputmusic.hh" #include "inputstaff.hh" -#include "inputcommands.hh" #include "inputcommand.hh" #include "staffcommands.hh" #include "melodicstaff.hh" @@ -30,7 +30,7 @@ Input_staff::add(Input_music*m) } Staff* -Input_staff::parse(PointerList score_wide, Score*score_l) +Input_staff::parse(Score*score_l) { Staff *p=0; @@ -39,29 +39,30 @@ Input_staff::parse(PointerList score_wide, Score*score_l) else if (type == "rhythmic") p = new Rhythmic_staff; p->score_l_ = score_l; + p->define_spot_str_ = define_spot_str_; + for (iter_top(music_,i); i.ok(); i++) { Voice_list vl = i->convert(); p->add(vl); } - - Input_commands commands; - for (iter_top(score_wide,i); i.ok(); i++) - commands.add(**i); - for (iter_top(commands_,i); i.ok(); i++) - commands.add(**i); - - commands.parse(p); - + + { + Array mark_arr; + Array moment_arr; + p->get_marks(mark_arr, moment_arr); + score_l->add_marks(mark_arr, moment_arr); + } + return p; } -Input_staff::Input_staff(Input_staff&s) +Input_staff::Input_staff(Input_staff const&s) { for (iter_top(s.commands_,i); i.ok(); i++) commands_.bottom().add(new Input_command(**i)); for (iter_top(s.music_,i); i.ok(); i++) add(i->clone()); - + define_spot_str_ = s.define_spot_str_; type = s.type; } diff --git a/src/lexer.l b/src/lexer.l index 9f99dd2713..2b15b352e8 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -184,7 +184,7 @@ include { BEGIN(incl); } mtor << "parens\n"; return YYText()[0]; } -[:=] { +[*:=] { char c = YYText()[0]; mtor << "misc char" < #include "lexer.hh" #include "debug.hh" +#include "main.hh" My_flex_lexer *lexer=0; @@ -41,16 +42,18 @@ Input_file::Input_file(String s) { name = s; line = 1; - if (s=="") + String pf(s); + if (pf=="") is = &cin; - else - is = new ifstream( s ); - - if ( ! *is) { - String e("can\'t open `" + s+"\'"); - error(e); - } - cout << "["< COLFUDGE) { + if (cols[i].fixed()&& + abs(cols[i].fixed_position() - v(i)) > COLFUDGE) return false; - } + if (!i) continue; @@ -73,19 +77,9 @@ Spacing_problem::check_constraints(Vector v) const bool b = (dif > - COLFUDGE); -#if 1 if (!b) return false; -#else - mtor << "dif= "<fudge= "<< - b << "\n"; - - /* fucks up for unknown reasons */ - if (dif < -COLFUDGE) - return false; -#endif - } return true; } diff --git a/src/main.cc b/src/main.cc index c4b48ff238..67ccf5dfeb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -4,14 +4,20 @@ #include "misc.hh" #include "string.hh" #include "main.hh" +#include "path.hh" +#include "config.hh" extern void parse_file(String s); + +void +destill_inname( String &inName); long_option_init theopts[] = { 1, "output", 'o', 0, "warranty", 'w', 0, "help", 'h', 0, "debug", 'd', + 1, "include", 'I', 0,0,0 }; @@ -23,15 +29,17 @@ help() "--warranty, -w show warranty & copyright\n" "--output, -o set default output\n" "--debug, -d enable debug output\n" + "--include, -I add to file search path.\n" ; } + void notice() { cout << "\n" "LilyPond, a music typesetter.\n" - "Copyright (C) 1996 by\n" + "Copyright (C) 1996,97 by\n" " Han-Wen Nienhuys \n" " Jan-Nieuwenhuizen \n" "\n" @@ -50,11 +58,22 @@ void notice() "USA.\n"; } +static File_path * path =0; +struct Main_init { + Main_init() { + path = new File_path(LIBDIR); + path->add(String(LIBDIR)+"init/"); + debug_init(); + } + ~Main_init() { + delete path; + } +} main_init; + int main (int argc, char **argv) -{ +{ Getopt_long oparser(argc, argv,theopts); - debug_init(); cout << get_version(); while (long_option_init * opt = oparser()) { @@ -66,6 +85,9 @@ main (int argc, char **argv) notice(); exit(0); break; + case 'I': + path->add(oparser.optarg); + break; case 'h': help(); exit(0); @@ -82,7 +104,9 @@ main (int argc, char **argv) int p=0; char *arg ; while ( (arg= oparser.get_next_arg()) ) { - parse_file(arg); + String f(arg); + destill_inname(f); + parse_file(f); do_scores(); p++; } @@ -90,6 +114,32 @@ main (int argc, char **argv) parse_file(""); do_scores(); } - - exit (0); + + return 0; } + +String +find_file(String f) +{ + return path->find(f); +} + +/// make input file name: add default extension. "" is stdin. +void +destill_inname( String &inName) +{ + if ( inName.len() ) + { + if( inName[ 0 ] != '-' ) + { + String a,b,c,d; + split_path(inName,a,b,c,d); + + // add extension if not present. + if (d == "") + d = ".ly"; + inName = a+b+c+d; + } + } else inName = ""; +} + diff --git a/src/mylexer.cc b/src/mylexer.cc index 53763a6ab2..824a1ac809 100644 --- a/src/mylexer.cc +++ b/src/mylexer.cc @@ -13,13 +13,16 @@ static Keyword_ent the_key_tab[]={ "bar", BAR, "bass", BASS, + "cadenza", CADENZA, "clef", CLEF, "cm", CM, "commands", COMMANDS, "duration", DURATIONCOMMAND, "geometric", GEOMETRIC, + "goto", GOTO, "in", IN, - "key", KEY, + "key", KEY, + "mark", MARK, "melodic", MELODIC, "meter", METER, "mm", MM, @@ -92,14 +95,19 @@ My_flex_lexer::~My_flex_lexer() delete the_id_tab; } +String +My_flex_lexer::spot()const +{ + return include_stack.top()->name + ": " + lineno(); +} + void My_flex_lexer::LexerError(const char *s) { if (lexer->include_stack.empty()) { - *mlog << "error at EOF" << s; + *mlog << "error at EOF" << s << '\n'; }else - *mlog << lexer->include_stack.top()->name << ": " << - lexer->lineno() << ": error:" << s << '\n'; + *mlog << spot() << ": error:" << s << '\n'; exit(1); } // set the new input to s, remember old file. diff --git a/src/note.cc b/src/note.cc index 4454e67727..5c132038bc 100644 --- a/src/note.cc +++ b/src/note.cc @@ -236,3 +236,11 @@ get_text_req(int d , Text_def*def) return new Text_req(d, def); } +Voice_element* +get_mark_element(String s) +{ + Voice_element*v_p = new Voice_element; + v_p->add( new Mark_req(s)); + + return v_p; +} diff --git a/src/parser.y b/src/parser.y index a2603284b3..c11143f0d1 100644 --- a/src/parser.y +++ b/src/parser.y @@ -19,6 +19,7 @@ #endif Array pre_reqs, post_reqs; +sstack define_spots; Paperdef*default_paper(); %} @@ -40,6 +41,7 @@ Paperdef*default_paper(); int i; char c; int ii[10]; + Moment *moment; Array * strvec; Array *commandvec; @@ -62,8 +64,9 @@ Paperdef*default_paper(); %token CM IN PT MM PAPER WIDTH METER UNITSPACE SKIP COMMANDS %token GEOMETRIC START_T DURATIONCOMMAND OCTAVECOMMAND %token KEY CLEF VIOLIN BASS MULTI TABLE CHORD VOICES -%token PARTIAL RHYTHMIC MELODIC MUSIC GROUPING +%token PARTIAL RHYTHMIC MELODIC MUSIC GROUPING CADENZA %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET +%token MARK GOTO %token IDENTIFIER %token NEWIDENTIFIER @@ -81,7 +84,7 @@ Paperdef*default_paper(); %type paper_block paper_body %type dim %type duration -%type duration_length +%type duration_length %type voice_elt full_element %type score_command staff_command skipcommand %type score_block score_body @@ -182,7 +185,11 @@ notename_tab_body: { /* SCORE */ -score_block: SCORE '{' score_body '}' { $$ = $3; +score_block: SCORE + { define_spots.push(lexer->spot()); } + '{' score_body '}' { + $$ = $4; + $$->define_spot_str_ = define_spots.pop(); if (!$$->paper_) $$->paper_ = default_paper(); } @@ -209,7 +216,7 @@ score_commands_body: { $$ = new Array; } } ; -staff_commands_block: COMMANDS '{' staff_commands_body '}' { +staff_commands_block: COMMANDS '{' staff_commands_body '}' { $$ = $3; } ; @@ -233,14 +240,22 @@ staff_command: ; duration_length: - duration { - $$ = wholes($1[0], $1[1]); + duration { + $$ = new Moment(wholes($1[0], $1[1])); + } + |int '*' duration { + $$ = new Moment($1 * wholes($3[0], $3[1])); } ; skipcommand: SKIP int ':' duration_length { - $$ = get_skip_command($2, $4); + $$ = get_skip_command($2, *$4); + delete $4; + } + | GOTO STRING { + $$ = get_goto_command(*$2); + delete $2; } score_command: @@ -249,16 +264,20 @@ score_command: $$ = get_bar_command(*$2); delete $2; } - | METER int int { - $$ = get_meterchange_command($2, $3); + | METER int '*' int { + $$ = get_meterchange_command($2, $4); } | PARTIAL duration_length { - $$ = get_partial_command($2); + $$ = get_partial_command(*$2); + delete $2; } | GROUPING int_list { $$ = get_grouping_command(*$2); delete $2; } + | CADENZA int { + $$ = get_cadenza_toggle($2); + } ; @@ -267,7 +286,9 @@ score_command: PAPER */ paper_block: - PAPER '{' paper_body '}' { $$ = $3; } + PAPER + + '{' paper_body '}' { $$ = $3; } ; paper_body: @@ -287,7 +308,11 @@ paper_body: STAFFs */ staff_block: - STAFF '{' staff_body '}' { $$ = $3; } + STAFF { define_spots.push(lexer->spot()); } +/*cont*/ '{' staff_body '}' { + $$ = $4; + $$->define_spot_str_ = define_spots.pop(); + } ; @@ -475,18 +500,23 @@ duration: { | int { get_default_duration($$); $$[0] = $1; + $$[1] = 0; } | int DOTS { $$[0] = $1; $$[1] = $2; } + | DOTS { + get_default_duration($$); + $$[1] = $1; + } ; pitchmod: { $$ = new String; } |PITCHMOD ; -voice_elt: +voice_elt: pitchmod NOTENAME duration { $$ = get_note_element(*$1, $2, $3); delete $1; @@ -496,6 +526,10 @@ voice_elt: delete $1; } + | MARK STRING { + $$ = get_mark_element(*$2); + delete $2; + } ; /* @@ -623,6 +657,7 @@ parse_file(String s) lexer->new_input(s); yyparse(); kill_lexer(); + assert(define_spots.empty()); } Paperdef* diff --git a/src/pcol.cc b/src/pcol.cc index b64873345d..4c9ef91afc 100644 --- a/src/pcol.cc +++ b/src/pcol.cc @@ -43,7 +43,8 @@ PCol::print() const postbreak_p_->print(); } else if (daddy_l_) { mtor<<'\n' << ((this == daddy_l_->prebreak_p_) ? - "prebreak_p_" : "postbreak"); + "prebreak" : "postbreak"); + mtor << '\n'; } mtor << "extent: " << width().str() << "\n"; mtor << "}\n"; diff --git a/src/pscore.cc b/src/pscore.cc index 696c542838..8251135cde 100644 --- a/src/pscore.cc +++ b/src/pscore.cc @@ -33,7 +33,7 @@ PScore::clean_cols() { for (iter_top(cols,c); c.ok(); ) if (!c->used()) { - c.del(); + delete c.get(); } else c++; } diff --git a/src/request.cc b/src/request.cc index f87f103a6c..8cc3bf1495 100644 --- a/src/request.cc +++ b/src/request.cc @@ -11,6 +11,7 @@ RCONS(Rest_req); RCONS(Barcheck_req); RCONS(Text_req); RCONS(Rhythmic_req); +RCONS(Mark_req); RCONS(Stem_req); RCONS(Script_req); RCONS(Note_req); @@ -18,7 +19,11 @@ RCONS(Melodic_req); RCONS(Span_req); RCONS(Slur_req); RCONS(Beam_req); - +void +Stem_req::print() const +{ + mtor << "Stem\n"; +} void Barcheck_req::print() const { @@ -80,7 +85,7 @@ Rhythmic_req::print() const while (d--) mtor << '.'; - mtor<<"xPlet factor"<truncate_cols(last()); @@ -25,6 +27,7 @@ Score::process() // do this after processing, staffs first have to generate PCols. find_col(last(), false)->set_breakable(); do_cols(); + print(); calc_idealspacing(); // debugging @@ -42,7 +45,7 @@ Score::clean_cols() for (iter_top(cols_,c); c.ok(); ) { if (!c->pcol_l_->used()) { - c.del(); + delete c.get(); } else { c->preprocess(); c++; @@ -53,7 +56,6 @@ Score::clean_cols() this sux. We should have Score_column create the appropriate PCol. Unfortunately, PCols don't know about their position. */ -// todo PCursor Score::create_cols(Moment w) { @@ -174,7 +176,9 @@ Score::output(String s) paper_p_->outfile = s; *mlog << "output to " << paper_p_->outfile << "...\n"; - Tex_stream the_output(paper_p_->outfile); + + Tex_stream the_output(paper_p_->outfile); + the_output << "% outputting Score, defined at: " << define_spot_str_ << "\n"; pscore_p_->output(the_output); } @@ -187,3 +191,16 @@ Score::add(Staff*s) staffs_.bottom().add(s); } +void +Score::add_marks(Array s_arr, Array m_arr) +{ + for (int i=0; i < s_arr.size(); i++) { + String mark_str (s_arr[i]); + if (markers_assoc_.elt_query(mark_str) && + m_arr[i] != markers_assoc_[mark_str]) + + error("Conflicting marker: `" + s_arr[i]+ "\'"); + else + markers_assoc_[s_arr[i]] = m_arr[i]; + } +} diff --git a/src/scores.cc b/src/scores.cc index 1b7b6558de..bdd5371645 100644 --- a/src/scores.cc +++ b/src/scores.cc @@ -5,7 +5,7 @@ static Array score_array_global; -static String outfn="lelie.uit"; +static String outfn="lelie.out"; // todo: check we don't overwrite default output. void diff --git a/src/script.cc b/src/script.cc index 4f5ed1c0e7..54e6d652fa 100644 --- a/src/script.cc +++ b/src/script.cc @@ -40,16 +40,17 @@ Script::set_default_dir() void Script::set_default_pos() { - Real inter= paper()->internote(); + Real inter_f= paper()->internote(); Interval dy = symbol().dim.y; int d = specs_l_->staffdir; + Real y ; if (!d) { Interval v= support->height(); - pos = rint((v[dir] -dy[-dir])/inter) + dir* 2; + y = v[dir] -dy[-dir] + 2*dir*inter_f; } else { Real y = (d > 0) ? staffsize + 2: -2; // ug - y *=inter; + y *=inter_f; Interval v= support->height(); if (d > 0) { @@ -57,18 +58,18 @@ Script::set_default_pos() } else if (d < 0) { y = y height(); - if (stem_l_) { - Interval v= stem_l_->height(); - - if (d > 0) { - y = y >? v.max(); - }else if (d < 0) { - y = y 0 || (!d && dir > 0)) { + y = y >? v.max(); + }else if (d < 0 || (!d && dir < 0)) { + y = y lookup_p_->script(preidx+specs_l_->symidx); + String preidx_str = (symdir < 0) ?"-" :""; + return paper()->lookup_p_->script(preidx_str + specs_l_->symidx); } void diff --git a/src/simpleprint.cc b/src/simpleprint.cc index de3d6ec921..e5b992ec3f 100644 --- a/src/simpleprint.cc +++ b/src/simpleprint.cc @@ -49,13 +49,13 @@ Simple_column::typeset_item(Item *i, int breakst) { assert(i); - staff_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_, - staff_->theline,breakst); + staff_l_->pscore_l_->typeset_item(i, score_column_l_->pcol_l_, + staff_l_->theline,breakst); if (breakst == BREAK_PRE - BREAK_PRE) { Array to_move( - staff_->pscore_l_->select_items(staff_->theline, + staff_l_->pscore_l_->select_items(staff_l_->theline, score_column_l_->pcol_l_->prebreak_p_)); Interval column_wid = itemlist_width(to_move); assert(!column_wid.empty()); @@ -67,7 +67,7 @@ Simple_column::typeset_item(Item *i, int breakst) } void -Simple_column::typeset_item_directional(Item *i, int dir, int breakst) +Simple_column::typeset_item_directional(Item *i, int dir, int breakst) // UGH! { assert(i); PCol * c=score_column_l_->pcol_l_; @@ -76,7 +76,7 @@ Simple_column::typeset_item_directional(Item *i, int dir, int breakst) else if (breakst == 2) c = c->postbreak_p_; - Array to_move(staff_->pscore_l_->select_items(staff_->theline, + Array to_move(staff_l_->pscore_l_->select_items(staff_l_->theline, c)); typeset_item(i, breakst); diff --git a/src/simplestaff.cc b/src/simplestaff.cc index f0087ebd3f..83bce6d7e4 100644 --- a/src/simplestaff.cc +++ b/src/simplestaff.cc @@ -16,7 +16,7 @@ Simple_column::Simple_column(Score_column*s, Simple_staff *rs) { stem_requester_len = 0; stem_ = 0; - staff_ = rs; + staff_l_ = rs; beam_ = 0; text_=0; } @@ -47,7 +47,6 @@ Simple_column::process_requests() error("Barcheck failed, " + tdescription_->str()); } } - if (rq->rhythmic()){ notes.add(rq->rhythmic()); } diff --git a/src/simplewalker.cc b/src/simplewalker.cc index 21ed11573a..33ddf1ea69 100644 --- a/src/simplewalker.cc +++ b/src/simplewalker.cc @@ -185,7 +185,7 @@ Simple_walker::process_requests() if (sl->spantype == Span_req::START) { if (find_slur(sl->elt_l_->voice_ )>=0) - error_t("Too many slurs in voice", col()->when()); + error_t("Too many slurs in voice", *col()->tdescription_); pending_slur_reqs.add(sl); pending_slurs.add(new Slur); } @@ -206,7 +206,7 @@ Simple_walker::process_requests() if (beam_) { if (!stem_) WARN <<"beamed note should have a stem (t = " - <when())<<"\n"; + <when())<<")\n"; else beam_->add(stem_); @@ -219,6 +219,7 @@ Simple_walker::process_requests() } if (c->beam_&& c->beam_->spantype == Span_req::STOP) { + default_grouping.extend(current_grouping->interval()); beam_->set_grouping(default_grouping, *current_grouping); pscore_->typeset_spanner(beam_, s->theline); @@ -251,7 +252,7 @@ Simple_walker::process_requests() if (sl->spantype == Span_req::STOP) { int idx = find_slur(sl->elt_l_->voice_); if (idx < 0) - error_t("can't find slur to end; ", c->when()); + error_t("can't find slur to end; ", *c->tdescription_); pscore_->typeset_spanner(pending_slurs[idx], s->theline); diff --git a/src/staff.cc b/src/staff.cc index ef54dbe466..c6a65e016e 100644 --- a/src/staff.cc +++ b/src/staff.cc @@ -6,6 +6,22 @@ #include "sccol.hh" #include "staffcommands.hh" #include "debug.hh" +#include "inputcommands.hh" +#include "inputcommand.hh" +#include "request.hh" + +void +Staff::do_commands(PointerList score_wide, + PointerList staff_wide) +{ + Input_commands commands; + for (iter_top(score_wide,i); i.ok(); i++) + commands.add(**i, score_l_->markers_assoc_); + for (iter_top(staff_wide,i); i.ok(); i++) + commands.add(**i,score_l_->markers_assoc_); + + commands.parse(this); +} void Staff::add(PointerList &l) @@ -19,7 +35,9 @@ Staff::truncate_cols(Moment l) { iter_bot(cols, i); for (; i->when() > l; i=cols.bottom()) { - i.del(); + Staff_column * col_p = i.get(); + assert(col_p->when() > l); + delete col_p; } } @@ -35,7 +53,7 @@ Staff::clean_cols() iter_top(cols,i); for(; i.ok(); ){ if (!i->score_column_l_->used()) - i.del(); + delete i.get(); else i++; } @@ -80,8 +98,22 @@ Staff::get_col(Moment w, bool mus) return newst; } - - +void +Staff::get_marks(Array&s_arr, Array&m_arr) +{ + for (iter_top(voices,i); i.ok(); i++) { + Moment now = i->start; + for (iter_top(i->elts,j); j.ok(); j++) { + for (iter_top(j->reqs, k); k.ok(); k++) { + if (k->mark()) { // ugh. 4 levels + s_arr.add(k->mark()->mark_str_); + m_arr.add(now); + } + } + now += j->duration; + } + } +} /* put all stuff grouped vertically in the Staff_cols */ @@ -90,11 +122,11 @@ Staff::setup_staffcols() { for (iter_top(voices,i); i.ok(); i++) { Moment now = i->start; - for (iter_top(i->elts,ve); ve.ok(); ve++) { + for (iter_top(i->elts,j); j.ok(); j++) { - Staff_column *sc=get_col(now,true); - sc->add(ve); - now += ve->duration; + Staff_column *s_l=get_col(now,true); + s_l->add(j); + now += j->duration; } } set_time_descriptions(); diff --git a/src/staffcommands.cc b/src/staffcommands.cc index f99a3d9726..82286bd7d6 100644 --- a/src/staffcommands.cc +++ b/src/staffcommands.cc @@ -8,6 +8,7 @@ Staff_commands_at::when() { return tdescription_.when; } + void Staff_commands_at::print() const { diff --git a/src/staffelem.cc b/src/staffelem.cc index d942732e7c..e1b5e4228b 100644 --- a/src/staffelem.cc +++ b/src/staffelem.cc @@ -37,24 +37,35 @@ Interval Staff_elem::width() const { Molecule*m= brew_molecule(); - Interval r = m->extent().x; - - if (!r.empty()) // float exception on DEC Alpha - r+=offset_.x; + Interval r; + + if (!output){ + Molecule*m = brew_molecule(); + r = m->extent().x; + delete m; + } else + r = output->extent().x; + + if (!r.empty()) // float exception on DEC Alpha + r+=offset_.x; - delete m; return r; } Interval Staff_elem::height() const { - Molecule*m= brew_molecule(); - Interval r = m->extent().y; + Interval r; - + if (!output){ + Molecule*m = brew_molecule(); + r = m->extent().y; + delete m; + } else + r = output->extent().y; + if (!r.empty()) r+=offset_.y; - delete m; + return r; } diff --git a/src/stcol.cc b/src/stcol.cc index 46c04cbead..9d070aa4cc 100644 --- a/src/stcol.cc +++ b/src/stcol.cc @@ -12,7 +12,7 @@ Staff_column::OK() const assert(tdescription_->when == when()); assert(*tdescription_ == staff_commands_p_->tdescription_); } - #endif +#endif } bool diff --git a/src/texbeam.cc b/src/texbeam.cc index 652360eee8..bded0d7751 100644 --- a/src/texbeam.cc +++ b/src/texbeam.cc @@ -66,9 +66,10 @@ Lookup::beam(Real &slope, Real width) int sidx = slope_index(slope); if (!slope) return rule_symbol(convert_dimen(2,"pt"), width); - if (width < convert_dimen(2,"pt")) - error("Beam too narrow. " ); - + if (width < convert_dimen(2,"pt")) { + WARN<<"Beam too narrow.\n"; + width = convert_dimen(2,"pt"); + } Real elemwidth = convert_dimen(64,"pt"); int widx = 5; diff --git a/src/textspanner.cc b/src/textspanner.cc index 3fd9683926..43cfda3f35 100644 --- a/src/textspanner.cc +++ b/src/textspanner.cc @@ -2,6 +2,7 @@ #include "boxes.hh" #include "textspanner.hh" #include "textdef.hh" +#include "debug.hh" Text_spanner::Text_spanner(Directional_spanner*d) { @@ -33,10 +34,15 @@ Text_spanner::brew_molecule() const output->add( tsym ); return output; } + void Text_spanner::print() const // todo { +#ifndef NDEBUG + mtor << "Text_spanner\n"; +#endif } + void Text_spanner::do_pre_processing() { diff --git a/src/timedescription.cc b/src/timedescription.cc index ce9b667aaf..9ffb981c85 100644 --- a/src/timedescription.cc +++ b/src/timedescription.cc @@ -3,7 +3,8 @@ String Time_description::str()const { - String s( "Time_description { at "); + String s( "Time_description { "); + s+=String( " cadenza: ") + cadenza_b_ + " at "; s+=when; s+="\nmeter " + String(whole_per_measure/one_beat) +":" +(1/one_beat); s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n"; @@ -19,19 +20,34 @@ void Time_description::OK() const { #ifdef NDEBUG - assert(whole_in_measure < whole_per_measure && 0 <= whole_in_measure); + if (!cadenza_b_) + assert(whole_in_measure < whole_per_measure); + assert(0 <= whole_in_measure); assert(one_beat); #endif } +void +Time_description::set_cadenza(bool b) +{ + if (cadenza_b_ && !b) { + if (whole_in_measure) { + bars ++; + whole_in_measure = 0; + } + } + cadenza_b_ = b ; +} + Time_description::Time_description(Moment dt, Time_description const *prev) { if (prev) { assert(dt >= 0); *this = *prev; - when += + dt; + when += dt; whole_in_measure += dt; - while ( whole_in_measure >= whole_per_measure ) { + + while ( !cadenza_b_ && whole_in_measure >= whole_per_measure ) { whole_in_measure -= whole_per_measure; bars ++; } @@ -41,7 +57,8 @@ Time_description::Time_description(Moment dt, Time_description const *prev) one_beat = 0.25; when = 0.0; bars = 0; - } + cadenza_b_ = false; + } } void @@ -50,21 +67,24 @@ Time_description::set_meter(int l, int o) assert(o); one_beat = 1/Moment(o); whole_per_measure = Moment(l) * one_beat; + if(whole_in_measure) + error_t("Meterchange should be at start of measure", when); } void Time_description::setpartial(Moment p) { if (when) - error_t ("Partial measure only allowed at beginning.", when); + error_t ("Partial measure only allowed at beginning.", *this); if (p<0||p > whole_per_measure) - error_t ("Partial measure has incorrect size", when); + error_t ("Partial measure has incorrect size", *this); whole_in_measure = whole_per_measure - p; } Moment Time_description::barleft() { + assert(!cadenza_b_); return whole_per_measure-whole_in_measure; } diff --git a/src/voice.cc b/src/voice.cc index f4372893af..334d1b4a5f 100644 --- a/src/voice.cc +++ b/src/voice.cc @@ -27,17 +27,20 @@ Voice::print() const { #ifndef NPRINT mtor << "start: "<< start<print(); + for (iter_top(elts,i); i.ok(); i++) + i->print(); #endif } Moment Voice::last() const { - Moment l =start; - for (iter_top(elts,vec); vec.ok(); vec++) - l += vec->duration; + Moment l =0; + if (elts.size()) + l = start; + + for (iter_top(elts,i); i.ok(); i++) + l += i->duration; return l; } /****************************************************************/ diff --git a/src/warn.cc b/src/warn.cc index 0c3cac1186..82a004875a 100644 --- a/src/warn.cc +++ b/src/warn.cc @@ -1,6 +1,7 @@ #include "debug.hh" #include "lexer.hh" #include "moment.hh" +#include "timedescription.hh" ostream &warnout (cerr); ostream *mlog(&cerr); @@ -24,10 +25,17 @@ error(String s) } void -error_t(const String& s, Moment r) +error_t(const String& s, const Moment& r) { - String e=s+ "(t = " + String(r) + ")"; + String t_mom = String(trunc(r)) + (r - Moment(trunc(r))); + String e=s+ "(t = " + t_mom + ")"; error(e); - exit(1); } + +void +error_t(const String& s, Time_description const &t_tdes) +{ + String e=s+ "(at " + t_tdes.bars + ": " + t_tdes.whole_in_measure + ")\n"; + error(e); +} diff --git a/standchen.tex b/standchen.tex new file mode 100644 index 0000000000..5ef590b060 --- /dev/null +++ b/standchen.tex @@ -0,0 +1,13 @@ +\documentclass{article} %UGH +\usepackage{a4} +\begin{document} +\input lilyponddefs +\input titledefs +\def\interscoreline{\vskip12pt} +\title{St\"andchen} +\composer{Franz Schubert} +\instrument{M\"a\ss ig} % heu +%#%\tempo{M\"a\ss ig} +\maketit +\input standchen.uit +\end{document} diff --git a/test.tex b/test.tex index b6bcb4fe13..b55575709d 100644 --- a/test.tex +++ b/test.tex @@ -1,3 +1,3 @@ \input lilyponddefs -\input lelie.uit +\input lelie.out \vfil\bye \ No newline at end of file -- 2.39.5