My_flex_lexer 1
yyFlexLexer 1
-PCol 1
+PCol 0
Score_column 0
Ineq_constrained_qp 1
Spacing_problem 0
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
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
=head2 DATA MEMBERS
Class::member()
- Class::member_type_()
+ Type Class::member_type_
+
+the C<type> is a Hungarian notation postfix for $C<Type>$.
-the C<type> is a Hungarian notation postfix
=head2 COMMENTS
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
-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:
doc: $(TXTS)
dist:
- ln $(DOCFILES) $(DDIR)/Documentation/
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
clean:
rm -f $(TXTS) $(MANS)
=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
=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
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.
=over 5
+=item B<-I,--include>=F<FILE>
+
+add F<FILE> 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<NO WARRANTY>!)
-=item B<-o,--output>,
+=item B<-o,--output=>F<FILE>,
-default output file
+Set the default output file to F<FILE>.
=item B<-h,--help>,
-help
+Show a summary of usage
=back
=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
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.
=item *
typeof
-=item *
+=item *
operator <?, operator >?
-=item *
+=item *
the new for-scope
=item *
class Rational (libg++)
-=item *
+=item *
named return values
=back
Jan Nieuwenhuizen <jan@digicash.com>, bits of FlowerLib, general comments.
=item *
-Mats Bengtsson <matsb@s3.kth.se>, bugfixes, testing.
+Mats Bengtsson <matsb@s3.kth.se>, 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<TODO>. 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
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<kortjakje.ly>, it has some comments
=head1 PROBLEMS
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..)
:
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<print *this> or use LilyPond C<print()> methods).
This is a beta version of LilyPond. Please send your helpful comments
and patches to me (see AUTHORS section)
=head1 SEE ALSO
-lilygut(1), lilyinput(1)
+There are some documentation files in the subdirectory F<Documentation/>,
+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<NEWS>)
+
+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).
--- /dev/null
+=head1 NAME
+
+LilyError - LilyPond error messages
+
+=head1 DESCRIPTION
+
+This page documents error messages.
+
+A correctly parsed F<input.ly> does not guarantuee output. A lot
+(most) of the checking is done B<after> 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<only>
+detect parse errors.
+
+ can't find slur to end
+
+Eg. with:
+
+ {d g ( } ) g8
+
+The {} part generates two one-note C<Voice>s, the C<g8> 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<g8>'s voice. (what should C<{ d( g ( } )g8 )g8 }> look like? Use
+
+ { \music { d } \music { g()g8 } }
+
+
--- /dev/null
+=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<cadenza.ly>
+
+
+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
+
+
=head2 other
-A correctly parsed .ly does not guarantuee output. A lot (most) of the
-checking is done B<after> 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.
--- /dev/null
+
+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 $< > $@
+
+
+
+
--- /dev/null
+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
+
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
-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
+
+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
# -*- 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\
--- /dev/null
+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)
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.
# 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)
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)
#
#
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:
# 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)
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 $@)"
+
+++ /dev/null
-%
-% 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 }
-}
--- /dev/null
+#!/bin/sh
+
+# unclobber current dir.
+rm -v *.aux *.log `grep -li "^% Creator: LilyPond" *.out` *.orig *~
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+PREFIX="."
+echo '#define LIBDIR "'$PREFIX'/"'> hdr/config.hh
+
+touch depend
+make -f Initial.make
\ No newline at end of file
--- /dev/null
+DISTFILES=Makefile
+dist:
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
+
\ No newline at end of file
-\font\musicfnt=musix20
+\font\musicfont=musixsps
\font\slurfont=xslu16
-\def\thefont{\slurfont}
+\def\thefont{\musicfont}
\def\mb#1{{\thefont\char#1}}
default:
$(MAKE) -C ..
-
+DISTFILES=Makefile $(hdr)
dist:
- ln Makefile $(hdr) $(DDIR)/$(HEADERDIR)
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
+
TAGS: $(hdr)
etags -CT $(hdr)
/*
accidental.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef ACCIDENTAL_HH
/*
bar.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef BAR_HH
/*
beam.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef BEAM_HH
/*
break.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef BREAK_HH
/*
clef.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef CLEF_HH
/*
clefitem.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef CLEFITEM_HH
#ifndef DEBUG_HH
#define DEBUG_HH
+
#include <assert.h>
#include <iostream.h>
#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__ << "(): "
/*
directionalspanner.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef DIRECTIONALSPANNER_HH
/*
getcommand.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef GETCOMMAND_HH
/*
grouping.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef GROUPING_HH
Array<int> generate_beams(Array<int>, int&);
+ /// multiply self to span #i#
+ void extend(MInterval i);
+ void translate(Moment);
private:
void init();
void junk();
/*
idealspacing.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef IDEALSPACING_HH
/*
identifier.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef IDENTIFIER_HH
/*
identparent.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef IDENTPARENT_HH
/*
inputcommand.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef INPUTCOMMAND_HH
operator Command();
};
+Input_command*get_cadenza_toggle(int i);
Input_command *get_meterchange_command( int,int);
Input_command *get_key_interpret_command(Array<int >);
Input_command *get_clef_interpret_command(String w);
Input_command *get_grouping_command(Array<int>);
Input_command *get_bar_command(String);
Input_command *get_newmeasure_command();
+Input_command *get_goto_command(String);
Array<int> get_default_grouping(int count);
#endif // INPUTCOMMAND_HH
/*
inputcommands.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef INPUTCOMMANDS_HH
/****************/
Moment when();
- void parse(Staff_commands_at*);
+ void parse(Staff_commands_at*);
void print() const;
Moment barleft();
void add(Input_command*);
/****************/
void find_moment(Moment);
- void add(Input_command c);
+ void add(Input_command c,Assoc<String,Moment> &marks_assoc_r);
void do_skip(int bars, Moment wholes);
Input_commands();
/*
inputmusic.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef INPUTMUSIC_HH
#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<Input_staff*> staffs_;
/*
inputstaff.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef INPUTSTAFF_HH
#include "proto.hh"
struct Input_staff {
+
+ /// defined where?
+ String define_spot_str_;
String type;
IPointerList<Input_command*> commands_;
IPointerList<Input_music*> music_;
/****************/
void add(Input_music*m);
- Input_staff(Input_staff&);
+ Input_staff(Input_staff const&);
Input_staff(String);
void add(Array<Input_command*> &s);
- Staff* parse(PointerList<Input_command*>, Score*);
+ Staff* parse(Score*);
void print() const;
};
/*
key.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef KEY_HH
/*
keyitem.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef KEYITEM_HH
/*
keyword.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef KEYWORD_HH
/*
leastsquare.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef LEASTSQUARE_HH
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);
/*
localkeyitem.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef LOCALKEYITEM_HH
/*
- lilypond, (c) 1996 Han-Wen Nienhuys
+ lilypond, (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef LOOKUPSYMS_HH
#define LOOKUPSYMS_HH
void do_scores();
void add_score(Input_score * s);
void set_default_output(String s);
+String find_file(String);
const char *get_version();
#endif
/*
rhythmstaf.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef MELODICSTAFF_HH
/*
meter.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef METER_HH
#include "rational.hh"
class String;
typedef Rational Moment;
-void error_t(String const &s, Moment when);
+
#endif //
/*
notehead.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef NOTEHEAD_HH
/*
notename.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef NOTENAME_HH
/*
offset.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef OFFSET_HH
/*
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);
/*
proto.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef PROTO_HH
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;
virtual Slur_req *slur() { return 0 ; }
virtual Rhythmic_req*rhythmic() { return 0; }
virtual Melodic_req *melodic() { return 0; }
+ virtual Mark_req * mark() { return 0; }
};
/**
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.
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
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
Loudness loudness;
};
-struct Grace_req : Subtle_request {
+struct Grace_req : Subtle_req {
};
struct Grace_notes {
};
+
+struct Spacing_req {
+ Moment next;
+ Real distance;
+};
+
+struct Glissando_req : Span_req {
+
+};
+
#endif
#endif
/*
rest.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef REST_HH
/*
rhythmstaf.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef RHYTHMSTAF_HH
/*
sccol.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCCOL_HH
#include "proto.hh"
#include "plist.hh"
#include "moment.hh"
+#include "assoc.hh"
/// the total music def of one movement
struct Score {
IPointerList<Score_column*> cols_;
PScore *pscore_p_;
+ String define_spot_str_;
+
+ Assoc<String, Moment> markers_assoc_;
/****************************************************************/
/// construction
Score(Paperdef*);
~Score();
- void add(Staff*);
+ void add(Staff*);
+ void add_marks(Array<String>, Array<Moment>);
/// do everything except outputting to file
void process();
PCursor<Score_column *> 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,
/*
scoreline.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCORELINE_HH
/*
script.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCRIPT_HH
/*
scriptdef.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCRIPTDEF_HH
/*
simplestaff.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SIMPLESTAFF_HH
Stem_req *stem_;
Moment stem_requester_len;
Beam_req *beam_;
- Simple_staff* staff_;
+ Simple_staff* staff_l_;
Text_req *text_;
/****************/
/*
simplewalker.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SIMPLEWALKER_HH
/*
slur.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SLUR_HH
/*
spanner.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SPANNER_HH
Score *score_l_;
PScore *pscore_l_;
-
+ String define_spot_str_;
/****************************************************************/
void add(PointerList<Voice*> &s);
+ void do_commands(PointerList<Input_command*> score_wide,
+ PointerList<Input_command*> staff_wide);
+ void get_marks(Array<String>&, Array<Moment>&);
+
/// throw away cols later the #l#
void truncate_cols(Moment l);
/*
- lilypond, (c) 1996 Han-Wen Nienhuys
+ lilypond, (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SCORECOMMANDS_HH
#define SCORECOMMANDS_HH
/*
staffelem.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef STAFFELEM_HH
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
/*
staffline.hh -- horizontal structures for broken scores.
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef STAFFLINE_HH
/*
stcol.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef STCOL_HH
/*
stem.hh --
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef STEM_HH
/*
swalker.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SWALKER_HH
/*
- lilypond, (c) 1996 Han-Wen Nienhuys
+ lilypond, (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef SYMTABLE_HH
#define SYMTABLE_HH
/*
textdef.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef TEXTDEF_HH
/*
text.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef TEXT_ITEM_HH
/*
textspanner.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef TEXTSPANNER_HH
/*
moment.hh -- part of LilyPond
- (c) 1996 Han-Wen Nienhuys
+ (c) 1996,97 Han-Wen Nienhuys
*/
#ifndef tdes_HH
#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&);
};
DFILES=dutch.ini table_sixteen.ini table_twenty.ini\
- english.ini script.ini
+ english.ini script.ini symbol.ini
default:
echo huh?
--- /dev/null
+
+
+include "init/dutch.ini"
+include "init/script.ini"
+include "init/table_sixteen.ini"
+
+
% 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
--- /dev/null
+default: ;
+
+DISTFILES=Makefile kortjakje.ly pavane.ly maartje.ly\
+ cadenza.ly scales.ly standchen.lily
+
+dist:
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
--- /dev/null
+%
+% 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"
+ }
+}
--- /dev/null
+% "Ah, je vous dirai, maman" (Mozart)
+%
+% bare bones version. (written down from memory :-)
+
+% the % is a comment.
+
+% declare music (which will be in *one* staff ) for the lead voice
+
+melodie = music {
+ $ % switch Lilypond in note-mode
+ \octave {} % set the default octave
+ % the default note duratino is 4
+ %%% theme
+ c c | % the '|' checks if there is a new measure here.
+ g g|
+ a a|
+
+ g2| % g2 means a "g-1" pitched half-note
+ f f| e e| d d| c2
+ g g| f f| e e| d d| g g| f f| e e| d d|
+ %%% var 1
+ c r8 c8 % r8 means an 8th rest.
+ (| % start a slur
+ % NOTE: the slurstart should be directly after the note
+ ) % end a slur.
+ g r8 g8 (| ) a r8 a8 (| ) g r4
+ f r8 f8 (| ) e4 r8 e8 ( |) d4 r8 d8 (| ) c4 r4
+$}
+
+ % more of this.
+begeleiding =
+$
+ \music { % as you can see, the $ sign obliges
+ % you to precede keyword by a backslash: \
+ \octave { ` } % default octave: 1 below the first octave.
+
+ %%% theme
+ `c % ` means one octave lower.
+ % Similarly: ' means one higher.
+ c e c f c e c d `b c `a `f `g `c2
+ \octave { ` }
+ e `g d `g c `g `b `g e `g d `g c `g `b `g
+ %%%% var 1
+ r8 e8() c r8 e8() c r8 f8()c r8 e8()c
+ r8 d8()`b r8 c8()`a r8 `a8()`f r8 `e8()`c
+}$
+
+
+% create a staff named bstaf
+bstaf = staff {
+ melodic
+ music { begeleiding } % use the declared music
+ commands { % commands with Staff-wide impact.
+ clef bass % bass-clef
+ }
+ }
+
+% another one
+vstaf = staff {
+ melodic
+ music { melodie }
+ commands { clef violin }
+ % default clef is violin clef
+ }
+
+
+score {
+ staff { vstaf }
+ staff { bstaf }
+ paper {
+ unitspace 2.5cm % a whole note takes 2.5 cm ideally.
+ }
+ commands {
+ meter 2* 4 % a 2/4 meter.
+ skip 33:0 % skip 32 measures, and generate the bars
+% meter 6 8 % another meter
+ }
+}
+
--- /dev/null
+ritme = staff {rhythmic
+ music {$
+ c8
+ |[a8() a8. a8 a16 a16 a16] c4.
+
+ %[c8( )'a8() c8 c8]% BUG!
+ |c2 c2
+
+ |[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
+
+ $}
+}
+
+melody=
+staff { melodic
+ music{$
+ c8
+ |r4 r4 r4 r4
+ |'cis2.. r8
+ | r4 r8 r16 r32 r32
+
+ \duration {4}
+ {
+ \music { c () `bes [c8 c8] }
+ \music { 'fis ()'gisis fis8 fis8 }
+ \music { d () d dis8 dis8 }
+ \music { a () bes eis8 eis8 }
+ \music { fis () g gis8 gis8 }
+ }
+ { c4 'c4 }
+
+ [d8 e8 'f8 g8] d8 e8 f8 g8
+ |''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
+ $}
+
+ commands {
+ skip 3:0
+ key $ fis cis gis $
+ skip 2:0
+ key
+ skip 5:0
+ clef bass
+ }
+}
+
+score {
+ paper {
+ geometric 1.4
+ unitspace 3.0 cm
+ }
+ staff { ritme }
+ staff { melody }
+ commands {
+ meter 4* 4
+ partial 8
+ skip 1:2
+ bar ":|:"
+ skip 2:0
+ meter 2* 4
+ skip 19:0
+ }
+}
+
+
+
--- /dev/null
+% 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{ $
+ \octave { ' }
+ \duration { 8}
+
+% 1
+ d2( [)d e cis `b] |
+ `a4 [`b cis] [cis `b] `b4 |
+ fis2( [)fis g e d] |
+ cis4 [d e(] [)e fis d cis] |
+ `b4 [cis d(] [)d e cis `b] |
+ cis2 r2^"c\'edez" |
+ r4 fis2 fis4 |
+ fis2^"en mesure" ()[fis e a fis]|
+ fis4-- e4-- d4-- e4-- |
+ `b2()[`b^"un peu retenu" `a( d cis]|
+% 11
+ )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
+ `fis2 r2 |
+ cis4^"1er mouvement" d4^"tr\`es lontain" ()[d cis d e]
+ \octave { }
+ | a4 gis2. |
+ a4 b4()[b a b 'cis] |
+ fis4 e4 cis2 |
+ e4 fis4 () [fis e fis gis] |
+ cis4 `b4()`b8 r8 r4^"tr\`es soutenu" |
+
+ r4 r4 | %2/4 meter
+
+ 'cis4_"\dyn ppp" 'd4 () ['d 'cis 'd 'e] |
+ a4 gis2. |
+ a4 b4()[b a b 'cis] |
+ fis4 e4 cis2 |
+ e4_"\dyn pp" fis4()[fis e fis gis] |
+ cis4_"\dyn mf" `b4()`b8 r8 r4^"un peu plus lent" |
+ r1 |
+ r2 r4 r4 %^\fermata
+%% cut 'n paste.
+ \octave { ' }
+ | d2^"Reprenez le mouvement"( [)d e cis `b] |
+ `a4 [`b cis] [cis `b] `b4 |
+ fis2( [)fis g e d] |
+ cis4 [d e(] [)e fis d cis] |
+ `b4 [cis d(] [)d e cis `b] |
+ cis2 r2^"c\'edez" |
+ r4 fis2 fis4 |
+ fis2^"en mesure"()[fis e a fis] |
+ fis4-- e4-- d4-- e4-- |
+ `b2() [`b `a-. d-. cis-.] |
+ `b-. [`fis^"large" `a `b] cis4 `b4 `fis2 r2 |
+
+ %% mark B
+ r1^"1er mouvement"
+ \duration {8}
+ | r2 [c-.( e-. c-. )`a-. ]
+ \plet {2/3}\octave{} |
+ | [c e a ] \plet{1/1} b4-> () [b c-- e-- a--] |
+ b4. b8()g2 |
+ r1 |
+ r2 [f a f d]
+ \plet {2/3}
+ | [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->] |
+ 'e4._"sf" 'e8()'c4 r4 |
+ r1 |
+ r4 r4-\fermata
+ \octave { ' }
+ |d2( [)d e cis `b] |
+ `a4 [`b cis] [cis `b] `b4 |
+ fis2( [)fis g e d] |
+ cis4 [d e(] [)e fis d cis] |
+ `b4 [cis d(] [)d e cis `b] |
+ cis2 r2^"c\'edez" |
+ r4 fis2 fis4 |
+ fis2()[fis e a fis] |
+ fis4-- e4-- d4-- e4--
+ \octave{ }
+ | b2()[b a 'd 'cis] |
+ b [fis a b ] 'cis4 b4 |
+ fis2 r2 |
+ r1-\fermata
+ $}
+ commands {
+ key $fis cis $
+ }
+}
+score {
+ staff {
+ horn
+ }
+ paper {
+ output "pavane.out"
+ unitspace 1.5 cm
+ geometric 1.4
+ width 12cm
+ }
+ commands {
+ meter 4 *4
+ skip 18:0
+ meter 2 *4
+ skip 1:0
+ meter 4 *4
+ skip 20:0
+ bar "|:"
+ skip 9:0
+ meter 2* 4
+ skip 1:0
+ bar ":|"
+ meter 4* 4
+ skip 13:0
+ bar "||"
+ }
+}
\ No newline at end of file
--- /dev/null
+
+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
--- /dev/null
+% 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
+ }
+}
+++ /dev/null
-% "Ah, je vous dirai, maman" (Mozart)
-%
-% bare bones version. (written down from memory :-)
-
-% the % is a comment.
-
-% declare music (which will be in *one* staff ) for the lead voice
-
-melodie = music {
- $ % switch Lilypond in note-mode
- \octave {} % set the default octave
- % the default note duratino is 4
- %%% theme
- c c | % the '|' checks if there is a new measure here.
- g g|
- a a|
-
- g2| % g2 means a "g-1" pitched half-note
- f f| e e| d d| c2
- g g| f f| e e| d d| g g| f f| e e| d d|
- %%% var 1
- c r8 c8 % r8 means an 8th rest.
- (| % start a slur
- % NOTE: the slurstart should be directly after the note
- ) % end a slur.
- g r8 g8 (| ) a r8 a8 (| ) g r4
- f r8 f8 (| ) e4 r8 e8 ( |) d4 r8 d8 (| ) c4 r4
-$}
-
- % more of this.
-begeleiding =
-$
- \music { % as you can see, the $ sign obliges
- % you to precede keyword by a backslash: \
- \octave { ` } % default octave: 1 below the first octave.
-
- %%% theme
- `c % ` means one octave lower.
- % Similarly: ' means one higher.
- c e c f c e c d `b c `a `f `g `c2
- \octave { ` }
- e `g d `g c `g `b `g e `g d `g c `g `b `g
- %%%% var 1
- r8 e8() c r8 e8() c r8 f8()c r8 e8()c
- r8 d8()`b r8 c8()`a r8 `a8()`f r8 `e8()`c
-}$
-
-
-% create a staff named bstaf
-bstaf = staff {
- melodic
- music { begeleiding } % use the declared music
- commands { % commands with Staff-wide impact.
- clef bass % bass-clef
- }
- }
-
-% another one
-vstaf = staff {
- melodic
- music { melodie }
- commands { clef violin }
- % default clef is violin clef
- }
-
-
-score {
- staff { vstaf }
- staff { bstaf }
- paper {
- unitspace 2.5cm % a whole note takes 2.5 cm ideally.
- }
- commands {
- meter 2 4 % a 2/4 meter.
- skip 33:0 % skip 32 measures, and generate the bars
-% meter 6 8 % another meter
- }
-}
-
\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}}
\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}
+++ /dev/null
-ritme = staff {rhythmic
- music {$
- c8
- [a8() a8. a8 a16 a16 a16] c4.
-
- %[c8( )'a8() c8 c8]% BUG!
- 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]
-
- c2 c2 c2 c2 c2 c2 c2 c2 c2 c2
-
- $}
-}
-
-melody=
-staff { melodic
- music{$
-c8
- r4 r4 r4 r4
- 'cis2.. r8
- r4 r8 r16 r32 r32
-
- \duration {4}
- {
- \music { c () `bes [c8 c8] }
- \music { 'fis ()'gisis fis8 fis8 }
- \music { d () d dis8 dis8 }
- \music { a () bes eis8 eis8 }
- \music { fis () g gis8 gis8 }
- }
- { c4 'c4 }
-
- [d8 e8 'f8 g8] d8 e8 f8 g8
- ''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
- $}
-
- commands {
-
- skip 3:0%BUG
- key $ fis cis gis $
- skip 2:0
- key $ $%BUG
- skip 5:0
- clef bass
-}
-}
-
-score {
- paper {
- geometric 1.4
- unitspace 3.0 cm
- }
- staff { ritme }
- staff { melody }
- commands {
- meter 4 4
- partial 8
- skip 1:2
- bar ":|:"
- skip 2:0
- meter 2 4
- skip 19:0
- }
-}
-
-
-
--- /dev/null
+DISTFILES=Makefile
+dist:
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
\ No newline at end of file
+++ /dev/null
-% pavane pour une Infante d\'efunte
-%
-% Maurice Ravel
-%
-% (Ravel has been dead for over 50 years. This does not have copyright)
-%
-
-horn =
-staff {melodic
- music{ $
- \octave { ' }
- \duration { 8}
-
-% 1
- d2( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
- cis4 [d e(] [)e fis d cis] |
- `b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
- r4 fis2 fis4 |
- fis2^"en mesure" ()[fis e a fis]|
- fis4-- e4-- d4-- e4-- |
- `b2()[`b^"un peu retenu" `a( d cis]|
-% 11
- )`b [`fis^"en \'elargissant"-- `a-- `b--] cis4-- `b4--|
- `fis2 r2 |
- cis4^"1er mouvement" d4^"tr\`es lontain" ()[d cis d e]
- \octave { }
- | a4 gis2. |
- a4 b4()[b a b 'cis] |
- fis4 e4 cis2 |
- e4 fis4 () [fis e fis gis] |
- cis4 `b4()`b8 r8 r4^"tr\`es soutenu" |
-
- r4 r4 | %2/4 meter
-
- 'cis4_"\dyn ppp" 'd4 () ['d 'cis 'd 'e] |
- a4 gis2. |
- a4 b4()[b a b 'cis] |
- fis4 e4 cis2 |
- e4_"\dyn pp" fis4()[fis e fis gis] |
- cis4_"\dyn mf" `b4()`b8 r8 r4^"un peu plus lent" |
- r1 |
- r2 r4 r4 %^\fermata
-%% cut 'n paste.
- \octave { ' }
- | d2^"Reprenez le mouvement"( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
- cis4 [d e(] [)e fis d cis] |
- `b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
- r4 fis2 fis4 |
- fis2^"en mesure"()[fis e a fis] |
- fis4-- e4-- d4-- e4-- |
- `b2() [`b `a-. d-. cis-.] |
- `b-. [`fis^"large" `a `b] cis4 `b4 `fis2 r2 |
-
- %% mark B
- r1^"1er mouvement"
- \duration {8}
- | r2 [c-.( e-. c-. )`a-. ]
- \plet {2/3}\octave{} |
- | [c e a ] \plet{1/1} b4-> () [b c-- e-- a--] |
- b4. b8()g2 |
- r1 |
- r2 [f a f d]
- \plet {2/3}
- | [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->] |
- 'e4._"sf" 'e8()'c4 r4 |
- r1 |
- r4 r4-\fermata
- \octave { ' }
- |d2( [)d e cis `b] |
- `a4 [`b cis] [cis `b] `b4 |
- fis2( [)fis g e d] |
- cis4 [d e(] [)e fis d cis] |
- `b4 [cis d(] [)d e cis `b] |
- cis2 r2^"c\'edez" |
- r4 fis2 fis4 |
- fis2()[fis e a fis] |
- fis4-- e4-- d4-- e4--
- \octave{ }
- | b2()[b a 'd 'cis] |
- b [fis a b ] 'cis4 b4 |
- fis2 r2 |
- r1-\fermata
- $}
- commands {
- key $fis cis $
- }
-}
-score {
- staff {
- horn
- }
- paper {
- output "pavane.out"
- unitspace 1.5 cm
- geometric 1.4
- }
- commands {
- meter 4 4
- skip 18:0
- meter 2 4
- skip 1:0
- meter 4 4
- skip 20:0
- bar "|:"
- skip 9:0
- meter 2 4
- skip 1:0
- bar ":|"
- meter 4 4
- skip 13:0
- bar "||"
- }
-}
\ No newline at end of file
+++ /dev/null
-
-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
default:
$(MAKE) -C ..
+DISTFILES=Makefile $(mycc) $(othersrc)
dist:
- ln Makefile $(mycc) $(othersrc) $(DDIR)/src
+ ln $(DISTFILES) $(DDIR)/$(SUBDIR)
TAGS: $(mycc)
etags -CT $(mycc)
}
/****************/
+
Offset
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());
}
#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;
+
/*
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( ":|");
}else if (s=="|:") {
c.args.add(s);
no_break_com=post_com=c;
+ } else {
+ c.args.add(s);
+ pre_com= no_break_com= c;
}
}
}
+/* 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<MInterval> splitpoints)
{
//check on splitpoints..
- int j = 0, i=0, starti = 0, startj = 0;
+ int j = 0, i = 0, starti = 0, startj = 0;
Array<Rhythmic_grouping*> ch;
while (1) {
Rhythmic_grouping::~Rhythmic_grouping()
{
- junk();
-
+ junk();
}
void
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<Rhythmic_grouping*> a(children);
+ for (int i=0; i < a.size(); i++) {
+ a[i] =new Rhythmic_grouping(*children[i]);
+ a[i]->translate(children.last()->interval().right);
+ }
+ children.concat(a);
+ }
+ assert(m.right <= interval().right);
+ OK();
+}
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(Array<int>a )
{
get_newmeasure_command()
{
Input_command*c = new Input_command;
-
c->args.add( "NEWMEASURE");
-
return c;
}
void
Input_command::print()const
{
+#ifndef NPRINT
mtor << "{ ";
if (args.size()) {
mtor<< " args: ";
mtor << "`"<<args[i] <<"',";
}
mtor << "}\n";
+#endif
}
Input_command*
#include "command.hh"
#include "stcol.hh"
#include "staff.hh"
+#include "assoc.hh"
void
Commands_at::print() const
mtor << "}\n";
#endif
}
+
Moment
Commands_at::when()
{
return tdescription_.when;
}
+
Commands_at::Commands_at(Moment dt, Commands_at* prev)
: tdescription_(dt, (prev)? &prev->tdescription_ : 0)
{
- if (prev&& !tdescription_.whole_in_measure) {
+ if (prev && !tdescription_.whole_in_measure) {
bottom().add(get_newmeasure_command());
}
}
int o = i->args[2];
tdescription_.set_meter(l,o);
bottom().add(get_grouping_command( get_default_grouping(l)));
-
}
}
while (1) {
if (! ok() ) {
*this = list().bottom();
- Moment dt = (w - when()) <? ptr()->barleft();
+
+ Moment dt = (w - when());
+ if ( !ptr()->tdescription_.cadenza_b_ )
+ dt = dt <? ptr()->barleft();
Commands_at * c = new Commands_at(dt, *this);
assert(c->when() <= w);
/****************/
+
Input_commands::Input_commands(Input_commands const&src)
: ptr(src.ptr)
{
void
-Input_commands::add(Input_command c)
-{
- if (c.args[0] == "PARTIAL") {
+Input_commands::add(Input_command c, Assoc<String,Moment> &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);
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);
#include "inputstaff.hh"
#include "score.hh"
#include "paper.hh"
+#include "staff.hh"
void
Input_score::add(Array<Input_command*> &s)
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<Staff*> 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;
}
void
Input_score::print()const
{
+ #ifndef NPRINT
mtor << "Input_score {\n";
for (iter_top(staffs_,i); i.ok(); i++) {
i->print();
}
mtor << "}\n";
+#endif
}
#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"
}
Staff*
-Input_staff::parse(PointerList<Input_command*> score_wide, Score*score_l)
+Input_staff::parse(Score*score_l)
{
Staff *p=0;
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<String> mark_arr;
+ Array<Moment> 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;
}
mtor << "parens\n";
return YYText()[0];
}
-[:=] {
+[*:=] {
char c = YYText()[0];
mtor << "misc char" <<c<<"\n";
return c;
#include <fstream.h>
#include "lexer.hh"
#include "debug.hh"
+#include "main.hh"
My_flex_lexer *lexer=0;
{
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 << "["<<s<<flush;
+ else {
+ pf =find_file(pf);
+ if (pf=="") {
+ String e("can\'t open `" + s+"\'");
+ error(e);
+ }
+ is = new ifstream( pf);
+ }
+ cout << "["<<pf<<flush;
}
Input_file::~Input_file()
for (int i = 0; i < cols.size(); i++) {
bool c=false;
for (int j =0; j<fixed.size(); j++)
- c |= connected.equiv(j,i);
+ c |= connected.equiv(fixed[j],i);
+ if (!c)
+ WARN << "You have unconnected columns. \n"
+ "Check if bars and music fit each other\n"
+ "(crashing :-)\n";
assert(c);
}
#endif
Spacing_problem::check_constraints(Vector v) const
{
int dim=v.dim();
- // mtor << "checking solution " << v << '\n';
for (int i=0; i < dim; i++) {
- if (cols[i].fixed()&& abs(cols[i].fixed_position() - v(i)) > COLFUDGE) {
+ if (cols[i].fixed()&&
+ abs(cols[i].fixed_position() - v(i)) > COLFUDGE)
return false;
- }
+
if (!i)
continue;
bool b = (dif > - COLFUDGE);
-#if 1
if (!b)
return false;
-#else
- mtor << "dif= "<<dif<<" fudge= " << COLFUDGE<< " dif >fudge= "<<
- b << "\n";
-
- /* fucks up for unknown reasons */
- if (dif < -COLFUDGE)
- return false;
-#endif
-
}
return true;
}
#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
};
"--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 <hanwen@stack.nl>\n"
" Jan-Nieuwenhuizen <jan@digicash.com>\n"
"\n"
"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()) {
notice();
exit(0);
break;
+ case 'I':
+ path->add(oparser.optarg);
+ break;
case 'h':
help();
exit(0);
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++;
}
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 = "";
+}
+
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,
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.
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;
+}
#endif
Array<Request*> pre_reqs, post_reqs;
+sstack<String> define_spots;
Paperdef*default_paper();
%}
int i;
char c;
int ii[10];
+ Moment *moment;
Array<String> * strvec;
Array<Input_command*> *commandvec;
%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 <id> IDENTIFIER
%token <string> NEWIDENTIFIER
%type <paper> paper_block paper_body
%type <real> dim
%type <ii> duration
-%type <real> duration_length
+%type <moment> duration_length
%type <el> voice_elt full_element
%type <command> score_command staff_command skipcommand
%type <score> score_block score_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();
}
}
;
-staff_commands_block: COMMANDS '{' staff_commands_body '}' {
+staff_commands_block: COMMANDS '{' staff_commands_body '}' {
$$ = $3; }
;
;
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:
$$ = 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);
+ }
;
PAPER
*/
paper_block:
- PAPER '{' paper_body '}' { $$ = $3; }
+ PAPER
+
+ '{' paper_body '}' { $$ = $3; }
;
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();
+ }
;
| 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;
delete $1;
}
+ | MARK STRING {
+ $$ = get_mark_element(*$2);
+ delete $2;
+ }
;
/*
lexer->new_input(s);
yyparse();
kill_lexer();
+ assert(define_spots.empty());
}
Paperdef*
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";
{
for (iter_top(cols,c); c.ok(); )
if (!c->used()) {
- c.del();
+ delete c.get();
} else
c++;
}
RCONS(Barcheck_req);
RCONS(Text_req);
RCONS(Rhythmic_req);
+RCONS(Mark_req);
RCONS(Stem_req);
RCONS(Script_req);
RCONS(Note_req);
RCONS(Span_req);
RCONS(Slur_req);
RCONS(Beam_req);
-
+void
+Stem_req::print() const
+{
+ mtor << "Stem\n";
+}
void
Barcheck_req::print() const
{
while (d--)
mtor << '.';
- mtor<<"xPlet factor"<<plet_factor<<"\n";
+ mtor<<", plet factor"<<plet_factor<<"\n";
}
void
delete spec;
}
+Mark_req::Mark_req(String s)
+{
+ mark_str_ = s;
+}
+void
+Mark_req::print()const
+{
+#ifndef NDEBUG
+ mtor<< "Mark `" << mark_str_ << "\'\n";
+#endif
+}
*mlog << "\nProcessing music ... ";
assert (paper_p_);
-
- /// distribute commands to disciples
+ if (last() == Moment(0)) {
+ error("Need to have music in a score.");
+ }
+ // distribute commands to disciples
pscore_p_ = new PScore(paper_p_);
for (iter_top(staffs_,i); i.ok(); i++) {
i->truncate_cols(last());
// do this after processing, staffs first have to generate PCols.
find_col(last(), false)->set_breakable();
do_cols();
+ print();
calc_idealspacing();
// debugging
for (iter_top(cols_,c); c.ok(); ) {
if (!c->pcol_l_->used()) {
- c.del();
+ delete c.get();
} else {
c->preprocess();
c++;
this sux. We should have Score_column create the appropriate PCol.
Unfortunately, PCols don't know about their position.
*/
-// todo
PCursor<Score_column*>
Score::create_cols(Moment w)
{
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);
}
staffs_.bottom().add(s);
}
+void
+Score::add_marks(Array<String> s_arr, Array<Moment> 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];
+ }
+}
static Array<Input_score*> score_array_global;
-static String outfn="lelie.uit";
+static String outfn="lelie.out";
// todo: check we don't overwrite default output.
void
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) {
} else if (d < 0) {
y = y <? v.min();
}
+ }
+ if (stem_l_) {
+ Interval v= stem_l_->height();
- if (stem_l_) {
- Interval v= stem_l_->height();
-
- if (d > 0) {
- y = y >? v.max();
- }else if (d < 0) {
- y = y <? v.min();
- }
+ if (d > 0 || (!d && dir > 0)) {
+ y = y >? v.max();
+ }else if (d < 0 || (!d && dir < 0)) {
+ y = y <? v.min();
}
- pos = int(rint(Real(y)/inter));
}
+
+ pos = int(rint(Real(y)/inter_f));
}
Interval
Symbol
Script::symbol()const
{
- String preidx = (symdir < 0) ?"-" :"";
- return paper()->lookup_p_->script(preidx+specs_l_->symidx);
+ String preidx_str = (symdir < 0) ?"-" :"";
+ return paper()->lookup_p_->script(preidx_str + specs_l_->symidx);
}
void
{
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<Item*> 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());
}
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_;
else if (breakst == 2)
c = c->postbreak_p_;
- Array<Item*> to_move(staff_->pscore_l_->select_items(staff_->theline,
+ Array<Item*> to_move(staff_l_->pscore_l_->select_items(staff_l_->theline,
c));
typeset_item(i, breakst);
{
stem_requester_len = 0;
stem_ = 0;
- staff_ = rs;
+ staff_l_ = rs;
beam_ = 0;
text_=0;
}
error("Barcheck failed, " + tdescription_->str());
}
}
-
if (rq->rhythmic()){
notes.add(rq->rhythmic());
}
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);
}
if (beam_) {
if (!stem_)
WARN <<"beamed note should have a stem (t = "
- <<String(c->when())<<"\n";
+ <<String(c->when())<<")\n";
else
beam_->add(stem_);
}
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);
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);
#include "sccol.hh"
#include "staffcommands.hh"
#include "debug.hh"
+#include "inputcommands.hh"
+#include "inputcommand.hh"
+#include "request.hh"
+
+void
+Staff::do_commands(PointerList<Input_command*> score_wide,
+ PointerList<Input_command*> 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<Voice*> &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;
}
}
iter_top(cols,i);
for(; i.ok(); ){
if (!i->score_column_l_->used())
- i.del();
+ delete i.get();
else
i++;
}
return newst;
}
-
-
+void
+Staff::get_marks(Array<String>&s_arr, Array<Moment>&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
*/
{
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();
{
return tdescription_.when;
}
+
void
Staff_commands_at::print() const
{
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;
}
assert(tdescription_->when == when());
assert(*tdescription_ == staff_commands_p_->tdescription_);
}
- #endif
+#endif
}
bool
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;
#include "boxes.hh"
#include "textspanner.hh"
#include "textdef.hh"
+#include "debug.hh"
Text_spanner::Text_spanner(Directional_spanner*d)
{
output->add( tsym );
return output;
}
+
void
Text_spanner::print() const // todo
{
+#ifndef NDEBUG
+ mtor << "Text_spanner\n";
+#endif
}
+
void
Text_spanner::do_pre_processing()
{
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";
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 ++;
}
one_beat = 0.25;
when = 0.0;
bars = 0;
- }
+ cadenza_b_ = false;
+ }
}
void
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;
}
{
#ifndef NPRINT
mtor << "start: "<< start<<eol;
- for (iter_top(elts,vec); vec.ok(); vec++)
- vec->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;
}
/****************************************************************/
#include "debug.hh"
#include "lexer.hh"
#include "moment.hh"
+#include "timedescription.hh"
ostream &warnout (cerr);
ostream *mlog(&cerr);
}
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);
+}
--- /dev/null
+\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}
+++ /dev/null
-
-
-include "init/dutch.ini"
-include "init/script.ini"
-include "init/table_sixteen.ini"
-
-
\input lilyponddefs
-\input lelie.uit
+\input lelie.out
\vfil\bye
\ No newline at end of file