From a41a7fb966e8552cc8da7c4eab1b60eb7b8eff3a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 25 Mar 1997 13:26:42 +0100 Subject: [PATCH] release: 0.0.45 --- .dstreamrc | 4 +- .version | 2 +- Documentation/INSTALL.pod | 2 +- Documentation/Makefile | 8 +- Documentation/index.pod | 23 +- Documentation/lilygut.pod | 77 +--- Documentation/lilyinput-pre-0.1.pod | 79 ++++ Documentation/lilypond.pod | 2 +- Documentation/mudela.pod | 134 ++++++- INSTALL.text | 8 +- NEWS | 44 ++- TODO | 9 +- configure | 112 ++++-- configure.in | 82 ++-- flower/Makefile | 3 + flower/NEWS | 2 +- flower/matrix.cc | 9 +- init/dutch.ini | 146 +++---- init/swedish.ini | 75 ++-- input/cadenza.ly | 7 +- input/coriolan-alto.ly | 10 +- input/error.ly | 19 +- input/fugue1.midi.ly | 372 ++++++++++++------ input/kortjakje.ly | 43 +- input/maartje.ly | 55 ++- input/martien.ly | 32 +- input/midi.ly | 32 +- input/mlalt.ly | 5 +- input/mlcello.ly | 6 +- input/mlvio1.ly | 5 +- input/mlvio2.ly | 6 +- input/plet.ly | 28 +- input/pre1.midi.ly | 312 +++++++++------ input/rhythm.ly | 24 +- input/scales.ly | 11 +- input/scsii-menuetto.ly | 26 +- input/standchen.ly | 49 +-- input/twinkle.ly | 83 +--- input/wohltemperirt.ly | 50 ++- lib/duration-convert.cc | 75 ++-- lib/duration.cc | 34 +- lib/include/duration-convert.hh | 9 +- lily/.version | 3 +- lily/bar-reg.cc | 14 +- lily/bar.cc | 2 + lily/beam.cc | 2 + lily/clef-item.cc | 1 + lily/clef-reg.cc | 1 + lily/command-request.cc | 103 ++++- lily/crescendo.cc | 2 + lily/dynamic-reg.cc | 2 + lily/headreg.cc | 2 + lily/include/class-name.hh | 10 +- lily/include/command-request.hh | 19 +- lily/include/input-music.hh | 6 +- lily/include/p-col.hh | 22 +- .../{registergroup.hh => register-group.hh} | 2 + lily/include/register.hh | 1 + lily/include/rest.hh | 2 + lily/include/score.hh | 2 +- lily/include/staff-elem-info.hh | 3 + lily/include/voice-element.hh | 7 +- lily/include/voice-group-regs.hh | 4 +- lily/include/voice-regs.hh | 3 +- lily/include/voice.hh | 5 +- lily/include/walk-regs.hh | 2 +- lily/input-music.cc | 26 +- lily/item.cc | 2 + lily/key-item.cc | 1 + lily/key-reg.cc | 1 + lily/lexer.l | 2 +- lily/local-key-item.cc | 1 + lily/local-key-reg.cc | 1 + lily/main.cc | 22 +- lily/meter-reg.cc | 11 +- lily/meter.cc | 1 + lily/midi-output.cc | 17 +- lily/midi-walker.cc | 17 + lily/musical-request.cc | 57 ++- lily/my-lily-lexer.cc | 5 +- lily/my-lily-parser.cc | 8 +- lily/notehead.cc | 2 + lily/p-col.cc | 22 +- lily/p-score.cc | 7 +- lily/parser.y | 40 +- lily/qlpsolve.cc | 6 +- lily/{registergroup.cc => register-group.cc} | 22 +- lily/register.cc | 4 +- lily/rest.cc | 2 + lily/score.cc | 25 +- lily/script-reg.cc | 1 + lily/script.cc | 1 + lily/slur-reg.cc | 1 + lily/slur.cc | 1 + lily/spanner.cc | 2 + lily/staff-elem.cc | 1 + lily/staff.cc | 13 +- lily/staffsym.cc | 2 + lily/stem-beam-reg.cc | 2 + lily/stem.cc | 2 + lily/text-item.cc | 2 + lily/text-reg.cc | 1 + lily/text-spanner.cc | 2 + lily/voice-elt.cc | 14 +- lily/voice-group-regs.cc | 27 +- lily/voice-regs.cc | 8 +- lily/voice.cc | 6 +- make/Configure_variables.make.in | 5 +- make/Makefile | 2 +- make/Rules.make | 8 +- make/Targets.make | 2 +- Makefile => make/Toplevel.make.in | 11 +- make/Variables.make | 4 +- mi2mu/.version | 4 +- mi2mu/include/midi-event.hh | 2 +- mi2mu/include/midi-global.hh | 16 +- mi2mu/include/my-midi-lexer.hh | 2 +- mi2mu/main.cc | 120 +++--- mi2mu/midi-event.cc | 31 +- mi2mu/midi-lexer.l | 74 ++-- mi2mu/midi-parser.y | 31 +- mi2mu/midi-score.cc | 38 +- mi2mu/midi-track.cc | 65 +-- mi2mu/midi-voice.cc | 8 +- mi2mu/my-midi-lexer.cc | 10 +- mi2mu/my-midi-parser.cc | 6 +- 126 files changed, 1942 insertions(+), 1219 deletions(-) rename lily/include/{registergroup.hh => register-group.hh} (96%) rename lily/{registergroup.cc => register-group.cc} (83%) rename Makefile => make/Toplevel.make.in (82%) diff --git a/.dstreamrc b/.dstreamrc index 63a0a94456..5a6d7a577f 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -33,8 +33,8 @@ Staff_commands 1 Stem 1 Staff 1 Score 1 -Voice 1 -Voice_element 1 +Voice 0 +Voice_element 0 Input_cursor 1 Commands_at 1 Input_command 1 diff --git a/.version b/.version index 18dcdc6982..da73d6405e 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 44 +TOPLEVEL_PATCH_LEVEL = 45 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 4615b850f2..3c1b07819b 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -35,7 +35,7 @@ AT&T CC. =item * Bash. Most scripts will continue to work with a stock sh, but they -will generate (harmless) syntax errors +might generate (harmless) syntax errors =item * GNU make. diff --git a/Documentation/Makefile b/Documentation/Makefile index 272ea0d279..817fbeb423 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -51,9 +51,11 @@ include ./$(depth)/make/Rules.make localclean: rm -f $(TEXTFILES) $(HTMLFILES) $(GROFFFILES) -localinstall: $(outdir)/lilypond.1 +localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5 + $(INSTALL) -d $(mandir)/man5 $(INSTALL) -d $(mandir)/man1 - $(INSTALL) -m 755 $< $(mandir)/man1 - + $(INSTALL) -m 755 $(outdir)/lilypond.1 $(mandir)/man1 + $(INSTALL) -m 755 $(outdir)/mudela.5 $(mandir)/man5 + localuninstall: rm -f $(mandir)/man1/lilypond.1 diff --git a/Documentation/index.pod b/Documentation/index.pod index ce39a3e5b8..d1e05d00e7 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -11,9 +11,9 @@ Excuse me for this poor page. I don't really have time for doing this.. =head1 DOCUMENTATION =item * - -README +The manual page @@ -25,16 +25,16 @@ internal structures. > =item * - -notes on the input format +Mudela, the input format =item * -FAQ +FAQs @@ -46,15 +46,22 @@ errors > =item * - -The lilypond logo (in PNG format) +The lilypond logo (Big) + + +=item * + +The lilypond logo (in gif format) =item * - An example inputfile: from Bach's WTK: c-minor fugue ] - -Any Voice_element can do a number of requests. A request is done -to the C which contains the C. The staff decides -whether to to honor the request, ignore it, or merge it with other -requests. Merging of requests is preferably done with other -requests done by members of the same voicegroups (beams, brackets, stems) - -Please refer to the documentation of the Child classes of -C for explanation of each request type. - -The result of a request will be an C or a C, which -will be put on a C. Note that the C and the original -C need not have anything in common. For example, the -``double'' piano Staff could interpret commands which juggle -melodies across the left and right hand, and may put the result in -two five-line PStaffs (maybe with extra PStaffs to carry the dynamic -signs and any lyric. - -The class C should be thought as a container for the -Cs, and an interpreter for Cs and Cs. -Different staffs can produce different outputs; a melodious voice -which is put into a percussion-Staff, will be typeset as the rythm of -that voice. - -After C made up her mind, the resultant items and -spanners are put on the PScore. - -=over 5 - -=item C - -Checks during music processing if start of this voice element -coincides with the start of a measure. Handy to check if you left out -some voice elts. - -=item C - -Staff has to decide if the ball should be hanging left or right. This -influences the horizontal dimensions of a column, and this is why -request processing should be done before horizontal spacing. - -Other voices' frivolities may cause the need for accidentals, so this -is also for the C to decide. The C can decide on positioning -based on ottava commands and the appropriate clef. - -=item C - -Why a request? It might be a good idea to not typeset the rest, if the -paper is too crowded. - -=item C - -This type of request typically results in the creation of a C - -=item C - -Staff has to combine this request with the stem_request, since the -number of flags that a stem wants to carry will determine the -number of beams. - -=item C - -Each dynamic is bound to one note (a crescendo spanning multiple -notes is thought to be made of two "dynamics": a start and a stop). -Dynamic changes can occur in a smaller time than the length of its -note, therefore fore each C request carries a time, measured -from the start of its note. - -This subfield would come in handy, if LilyPond was adapted for midi -support. =back @@ -130,10 +57,10 @@ this only solves one half of the problem. The other half is deciding which requests should be honored, which should merged with other requests, and which should be ignored. Consider this (pseudo)input - { % chord + < % chord \music { [c() c] } \music { [e() e] } - } + > Both the c and e are part of a chord (they are in the same Voice_group), so they should share the beams, and the two [ ] pairs diff --git a/Documentation/lilyinput-pre-0.1.pod b/Documentation/lilyinput-pre-0.1.pod index 885b303306..1e04b19df0 100644 --- a/Documentation/lilyinput-pre-0.1.pod +++ b/Documentation/lilyinput-pre-0.1.pod @@ -69,3 +69,82 @@ Not really crystallized; you can use '#' or '%' as line comment 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 (Rayce is a raytracer that I've +written as a hobby project. I used as a practice program for writing +(among others) C++ and Yacc. It also gave me RSI :-( ) 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 +appreciated. +=head1 NAME + +LilyInput - LilyPond input format + +=head1 DESCRIPTION + +This page globally documents the the LilyPond input format, mudela. +To get a better impression, please study some examples. + +=head2 Overview + +General format of a construct: + + BLOCKNAME { } + +Some types allow declarations: + + IDENTIFIER = BLOCKNAME { + + } + + .. + + BLOCKNAME { + IDENTIFIER + ... + } + + +In musicmode, eg, + + ''!c8.-"text"_v + +and in lyricmode, eg, + + Twin- kle, twin- kle lit- tle star,2 + +a lot of characters parse differently +than in "command" mode, eg, + + identifier = score { .. } + +So you have to signal this to the tokenizer. This is done with +'$'. '$' is a delimiter, which used by the tokenizer only. The same +goes for lyrics, it has a '@' delimiter. + +=item * +musicmode: The brace still is used to group grammatical groups. + +=item * +musicmode: "word" are preceded by a '\' (backslash) + +This means you can write some stuff in a zillion ways: + +=item 1. + $\var = \blockname { ... } $ + +=item 2. + var = blockname { $ ... $ } + +=item 3. + var = $ $ $\blockname { ... $ } + +=head2 Comments + +Not really crystallized; you can use '#' or '%' as line comment + +=head2 other + +LilyPond first reads 'symbol.ini', which contains declarations crucial +to proper operation of LilyPond (symbol tables, note names). diff --git a/Documentation/lilypond.pod b/Documentation/lilypond.pod index bc02a12617..f4dd08b08c 100644 --- a/Documentation/lilypond.pod +++ b/Documentation/lilypond.pod @@ -184,7 +184,7 @@ Han-Wen Nienhuys , Main author Jan Nieuwenhuizen , Context errors, Lyrics, mi2mu, MIDI stuff, make structure, bits of FlowerLib, general -comments. +comments, Mudela design. =item * diff --git a/Documentation/mudela.pod b/Documentation/mudela.pod index 02f06aeffb..abce9ee643 100644 --- a/Documentation/mudela.pod +++ b/Documentation/mudela.pod @@ -6,7 +6,7 @@ Mudela - LilyPond input format 0.1 This document describes the the LilyPond input format, which is an effective language for definining music. We call this language -(rather arrogantly) The Musical Definition Language (S). +(rather arrogantly) The Musical Definition Language (S). The first aim of Mudela is to define a piece of music, being complete from both from a musical typesetting, @@ -127,12 +127,18 @@ Identifiers in their normal form consist start with a alpha character, followed by alpha-numerics. Identifiers can contain any characters (except whitespace, C<$> and C<%>), if you use this construct: - $Id_with###@weird92chars = + $i'm_a_weird###identifier + +(which is the identifier with the name +C ). C<$> Takes any sequence of +characters which are not whitespace, C<$> and C<%>. + + \$i'm_a_weird###escaped_word =head2 Nesting characters Mudela uses the brace (C<{> and C<}>) for hierarchical structures. To -aid the eye in reading, for chords the C<<> and the C<>> are used as +aid the eye in reading, for chords the < and the > are used as nesting braces. =head2 Identifiers @@ -154,7 +160,7 @@ at top level. Currently declarations can only be done at top level) Most instantiations that use an IDENTIFIER are specified as follows: - \TYPE { IDENTIFIER [...] } + \TYPE{ IDENTIFIER [...] } Some exceptions on this rule have been made to prevent inputting Mudela becoming tedious @@ -424,8 +430,128 @@ Examples are included with the LilyPond distribution. For the sake of maintenance no long examples are included in this document. +=head1 INTERNALS + +This chapter deals with the internals of Mudela. In the end Mudela +converted to Voice, which contain Voice_elements which (in turn) +contain Requests. The former 2 types are basically containers. +Consider the following simple mudela + + \music { c4 } + +After the parsing, this is converted to: (from the debug output) + + Voice { start: 0 + voice_element { dur :1/4 + Stem_req {duration { 4}} + Note_req {notename: 0 acc: 0 oct: -1 + duration { 4}} + Group_change_req {} + } + voice_element { dur :0 + Terminate_voice_req {} + } + } + + Voice { start: 1/4 + voice_element { dur :1/4 + Stem_req {duration { 4}} + Note_req {notename: 2 acc: 0 oct: -1 + duration { 4}} + Group_change_req {} + } + voice_element { dur :0 + Terminate_voice_req {} + } + } + + Voice { start: 1/4 + voice_element { dur :1/4 + Stem_req {duration { 4}} + Note_req {notename: 4 acc: 0 oct: -1 + duration { 4}} + Group_change_req {} + } + voice_element { dur :0 + Terminate_voice_req {} + } + } + + =head2 Requests +As you can see, most information is stored in the form of a request. +In music typesetting, the user might want to cram a lot more symbols +on the paper than actually fits. To reflect this idea (the user asks +more than we can do), the container for this data is called Request. + +A request is done to +the C which contains the C. The staff decides +whether to to honor the request, ignore it, or merge it with other +requests. Merging of requests is preferably done with other requests +done by members of the same voicegroups (beams, brackets, stems) + +Please refer to the documentation of the Child classes of +C for explanation of each request type. + +The result of a request will be an C or a C, which +will be put on a C. Note that the C and the original +C need not have anything in common. For example, the +``double'' piano Staff could interpret commands which juggle +melodies across the left and right hand, and may put the result in +two five-line PStaffs (maybe with extra PStaffs to carry the dynamic +signs and any lyric. + +The class C should be thought as a container for the +Cs, and an interpreter for Cs and Cs. +Different staffs can produce different outputs; a melodious voice +which is put into a percussion-Staff, will be typeset as the rythm of +that voice. + +After C made up her mind, the resultant items and +spanners are put on the PScore. + +=over 5 + +=item C + +Checks during music processing if start of this voice element +coincides with the start of a measure. Handy to check if you left out +some voice elts. + +=item C + +Staff has to decide if the ball should be hanging left or right. This +influences the horizontal dimensions of a column, and this is why +request processing should be done before horizontal spacing. + +Other voices' frivolities may cause the need for accidentals, so this +is also for the C to decide. The C can decide on positioning +based on ottava commands and the appropriate clef. + +=item C + +Why a request? It might be a good idea to not typeset the rest, if the +paper is too crowded. + +=item C + +This type of request typically results in the creation of a C + +=item C + +Staff has to combine this request with the stem_request, since the +number of flags that a stem wants to carry will determine the +number of beams. + +=item C + +Each dynamic is bound to one note (a crescendo spanning multiple +notes is thought to be made of two "dynamics": a start and a stop). +Dynamic changes can occur in a smaller time than the length of its +note, therefore fore each C request carries a time, measured +from the start of its note. + =head2 Voice =head2 Voice_element diff --git a/INSTALL.text b/INSTALL.text index a42ca956da..66e6a45bce 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -34,7 +34,7 @@ PPPPRRRREEEERRRREEEEQQQQUUUUIIIISSSSIIIITTTTEE it will not compile with AT&T CC. +o Bash. Most scripts will continue to work with a stock - sh, but they will generate (harmless) syntax errors + sh, but they might generate (harmless) syntax errors +o GNU make. @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -24/Mar/97 LilyPond 0.0.44 1 +25/Mar/97 LilyPond 0.0.45 1 @@ -127,7 +127,7 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG -24/Mar/97 LilyPond 0.0.44 2 +25/Mar/97 LilyPond 0.0.45 2 @@ -193,6 +193,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS -24/Mar/97 LilyPond 0.0.44 3 +25/Mar/97 LilyPond 0.0.45 3 diff --git a/NEWS b/NEWS index 7b7354de36..ea2ae1e6df 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,33 @@ +pl 45 + - Removing unused Voice_regs & Voice_groups + - -O2 bugfix + +pl 44.jcn1 + - merged 42.3 42.jcn4 code trees (see stuff below) + - moving towards Mudela 0.1 (again) + * keyword "music" dropped for horizontal music + * keywords "\lyric" "\melodic" introduced, e.g.: + melody = \melodic { c c | g g } + * removed level of indirection: + - staff initialisable with music identifier list: + \staff{ global melody } + - \score and staffs alike + - gnu standard(?) help texts + - configure "creates" toplevel Makefile from make/Toplevel.make + +Bugfix + - fixed mi2mu + - write meter to track0 too... + - default octave + - new Sources in My_midi_lexer: sourcefile_p_ = get_file_l(): oeps. + (ain-t hungarian grand?) + +Examples + - updated for mudela 0.1 + ****** pl 44 + - naming: _c_l -> _C - pure parser, My_lily_parser - ''a iso ``a - Includable_lexer @@ -18,13 +46,27 @@ pl 43 - declaration used check. - +pl 42.jcn4 + - lily writes midi meter/key changes from requests + - mi2mu: + + write mudela 0.1 + + write bar change requests + + more tunable quantisation + +Examples + - half-new-menuetto.ly converted to mudela -almost- 0.1 + - new mi2mu of bach's wtk pre1/fugue1 + +pl 42.3 (jcn version) + - oeps, branched source tree + pl 42.hwn3 - const naming change (T const <-> const T) - Mudela 0.1 (roughly the same as below..) pl 42.3 - moving towards Mudela 0.1: - * (almost) all keywords must be preceded by backslash '\' + * all keywords must be preceded by backslash '\' * explicit lexer switches '$' and '@' dropped * keyword "music" dropped for horizontal music * keywords "\lyric" " introduced, e.g.: diff --git a/TODO b/TODO index 5e14b414d8..95fbfc6845 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ before 0.1 - * fix -O2 -NDEBUG compile - * remove spurious/outdated comments in .ly, debug .ly * pushgroup, popgroup. @@ -40,8 +38,6 @@ BUGS * cis ( | ) cis - * Group_feature at start of music. - * parser error handling (can you say Segfault?) SEVERELY LACKING: @@ -78,6 +74,8 @@ INPUTLANGUAGE SMALLISH PROJECTS * key transposition + + * caching breakpoints / saving them. * key { C } @@ -87,6 +85,9 @@ SMALLISH PROJECTS * use tors feature in lily + * do conventional keys (C G A, F B E, a e fis, d as des, etc ), + besides lists of flats/sharps + * midi esp.: use I32 iso int where 32 bits are needed (or assumed...) * fix Staff_elem::width() derivs to use offset_ diff --git a/configure b/configure index 3c13edc01f..ad504fd23d 100755 --- a/configure +++ b/configure @@ -539,41 +539,51 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross - +printing_b=no +checking_b=yes +debug_b=yes +optimise_b=no +profile_b=no + # Check whether --enable-printing or --disable-printing was given. if test "${enable_printing+set}" = set; then enableval="$enable_printing" - : -else - DEFINES="$DEFINES -DNPRINT=1" + printing_b=$enableval fi + + # Check whether --enable-checking or --disable-checking was given. if test "${enable_checking+set}" = set; then enableval="$enable_checking" - DEFINES="$DEFINES -DNDEBUG=1" + checking_b=$enableval fi + + + # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" - : -else - DEFINES="$DEFINES -g" + debug_b=$enableval fi + # Check whether --enable-optimise or --disable-optimise was given. if test "${enable_optimise+set}" = set; then enableval="$enable_optimise" - DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED" + optimise_b=$enableval fi + + # Check whether --enable-profiling or --disable-profiling was given. if test "${enable_profiling+set}" = set; then enableval="$enable_profiling" - DEFINES="$DEFINES -pg" + profile_b=$enableval fi + # Check whether --enable-texprefix or --disable-texprefix was given. if test "${enable_texprefix+set}" = set; then enableval="$enable_texprefix" @@ -582,7 +592,26 @@ else TEXPREFIX=auto fi + +if test $profile_b = yes; then + EXTRA_LIBES="-pg" + DEFINES="$DEFINES -pg" +fi + +if test $printing_b = no; then + DEFINES="$DEFINES -DNPRINT=1" +fi + +if test $debug_b = yes; then + DEFINES="$DEFINES -g" +fi +if test $checking_b = no; then + DEFINES="$DEFINES -DNDEBUG=1" +fi +if test $optimise_b = yes; then + DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED" +fi AUTOHEADER="This file was automatically generated by configure" CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk for ac_prog in $CCC c++ g++ gcc CC cxx cc++ @@ -590,7 +619,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:594: checking for $ac_word" >&5 +echo "configure:623: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -621,7 +650,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:625: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:654: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -631,11 +660,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -655,12 +684,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:659: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:688: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:664: checking whether we are using GNU C++" >&5 +echo "configure:693: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -669,7 +698,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -684,7 +713,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:688: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:717: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -714,7 +743,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:718: checking for $ac_word" >&5 +echo "configure:747: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -770,7 +799,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:774: checking for a BSD compatible install" >&5 +echo "configure:803: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -824,7 +853,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:828: checking for $ac_word" >&5 +echo "configure:857: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -871,7 +900,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:875: checking for $ac_word" >&5 +echo "configure:904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -905,7 +934,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:909: checking for $ac_word" >&5 +echo "configure:938: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -939,7 +968,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:943: checking for $ac_word" >&5 +echo "configure:972: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -973,7 +1002,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:977: checking for $ac_word" >&5 +echo "configure:1006: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1009,7 +1038,7 @@ if test $TEXPREFIX = auto ; then # do something sensible if root hasn't specced dir yet attempts install echo $ac_n "checking TeX installation directory""... $ac_c" 1>&6 -echo "configure:1013: checking TeX installation directory" >&5 +echo "configure:1042: checking TeX installation directory" >&5 ac_tmp_prefix=$prefix test "x$ac_tmp_prefix" = xNONE && ac_tmp_prefix=$ac_default_prefix @@ -1041,7 +1070,7 @@ if test $MAKE = "error" then { echo "configure: error: Please install GNU make" 1>&2; exit 1; } else - $MAKE -v| grep -q GNU + $MAKE -v| grep GNU >& /dev/null if test "$?" = 1 then echo "configure: warning: Please install *GNU* make" 1>&2 @@ -1064,7 +1093,7 @@ then echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2 fi -if $CXX --version | grep -q '2\.7' +if $CXX --version | grep '2\.7' >& /dev/null then true else @@ -1072,7 +1101,7 @@ else fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1076: checking how to run the C++ preprocessor" >&5 +echo "configure:1105: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1085,12 +1114,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1110,17 +1139,17 @@ echo "$ac_t""$CXXCPP" 1>&6 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1114: checking for FlexLexer.h" >&5 +echo "configure:1143: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1139,7 +1168,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then true else echo "$ac_t""no" 1>&6 -{ echo "configure: error: can't find flex header. Please install Flex headers correctly" 1>&2; exit 1; } +echo "configure: warning: can't find flex header. Please install Flex headers correctly" 1>&2 fi subdirs="flower" @@ -1257,7 +1286,9 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in + Makefile:make/Toplevel.make.in + " | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -1517,7 +1551,7 @@ fi eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" echo $ac_n "checking ""... $ac_c" 1>&6 -echo "configure:1521: checking " >&5 +echo "configure:1555: checking " >&5 cat << EOF > lib/out/config.hh @@ -1541,8 +1575,8 @@ sed 's/TOPLEVEL_//g' < .version > lily/.version ) (cd flower; ) -cat << END +cat << END Finished configuring. For making everything, do: make all diff --git a/configure.in b/configure.in index 309488cae9..f3837945ae 100644 --- a/configure.in +++ b/configure.in @@ -38,30 +38,60 @@ AC_INIT(flower/choleski.cc) AC_LANG_CPLUSPLUS - +printing_b=no +checking_b=yes +debug_b=yes +optimise_b=no +profile_b=no + AC_ARG_ENABLE(printing, - [ enable-printing set debug printing], - [], - [DEFINES="$DEFINES -DNPRINT=1"]) + [ enable-printing set debug printing], + [printing_b=$enableval]) + + AC_ARG_ENABLE(checking, - [ disable-checking set runtime checks], - [DEFINES="$DEFINES -DNDEBUG=1"], - []) + [ disable-checking set runtime checks], + [checking_b=$enableval] ) + + + AC_ARG_ENABLE(debug, - [ disable-debug set debug info], - [], - [DEFINES="$DEFINES -g"]) + [ disable-debug set debug info], + [debug_b=$enableval]) + AC_ARG_ENABLE(optimise, - [ enable-optimise use maximal speed optimisations], - [DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"]) -AC_ARG_ENABLE(profiling, - [ enable-profiling compile with gprof support], - [DEFINES="$DEFINES -pg"]) + [ enable-optimise use maximal speed optimisations], + [optimise_b=$enableval]) + + +AC_ARG_ENABLE(profiling, + [ enable-profiling compile with gprof support], + [profile_b=$enableval]) + AC_ARG_ENABLE(texprefix, - [ texprefix=DIR set the tex-directory to put the lilypond subdir in.], - [TEXPREFIX=$enableval], - [TEXPREFIX=auto] ) + [ texprefix=DIR set the tex-directory to put the lilypond subdir in.], + [TEXPREFIX=$enableval], + [TEXPREFIX=auto] ) + +if test $profile_b = yes; then + EXTRA_LIBES="-pg" + DEFINES="$DEFINES -pg" +fi + +if test $printing_b = no; then + DEFINES="$DEFINES -DNPRINT=1" +fi + +if test $debug_b = yes; then + DEFINES="$DEFINES -g" +fi +if test $checking_b = no; then + DEFINES="$DEFINES -DNDEBUG=1" +fi +if test $optimise_b = yes; then + DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED" +fi dnl COMPILEINFO="$HOST $host $TARGET $target" AUTOHEADER="This file was automatically generated by configure" CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk @@ -81,7 +111,7 @@ AC_SUBST(AUTOHEADER) AC_SUBST(BISON) AC_SUBST(FLEX) AC_SUBST(TEXPREFIX) - +AC_SUBST(EXTRA_LIBES) AC_CHECK_PROGS(BISON, bison, error) AC_CHECK_PROGS(FLEX, flex, error) @@ -96,7 +126,7 @@ if test $MAKE = "error" then AC_MSG_ERROR(Please install GNU make) else - $MAKE -v| grep -q GNU + $MAKE -v| grep GNU >& /dev/null if test "$?" = 1 then AC_MSG_WARN(Please install *GNU* make) @@ -119,7 +149,7 @@ then AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better)) fi -if $CXX --version | grep -q '2\.7' +if $CXX --version | grep '2\.7' >& /dev/null then true else @@ -127,9 +157,11 @@ else fi AC_CHECK_HEADER(FlexLexer.h, true, - AC_MSG_ERROR(can't find flex header. Please install Flex headers correctly)) + AC_MSG_WARN(can't find flex header. Please install Flex headers correctly)) AC_CONFIG_SUBDIRS(flower) -AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in) +AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in + Makefile:make/Toplevel.make.in + ) @@ -158,13 +190,11 @@ dnl echo 0 > out/.build # rgu sed 's/TOPLEVEL_//g' < .version > lily/.version (cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh -dnl echo 0 > out/.build ) (cd flower; -dnl echo 0 > out/.build ) -cat << END +cat << END Finished configuring. For making everything, do: make all diff --git a/flower/Makefile b/flower/Makefile index f24e0f3d24..3e04a98362 100644 --- a/flower/Makefile +++ b/flower/Makefile @@ -52,3 +52,6 @@ include ./$(depth)/make/Rules.make # localdist: configure + +-include /dev/null $(DEPFILES) +# diff --git a/flower/NEWS b/flower/NEWS index 3ee8480d71..5a62d17bd0 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -8,7 +8,7 @@ pl 1.1.8 pl 1.1.7 - PQueue blondification. - String_convert::i2hex_str fix, unsigned eqvs introduced - - long long deprecioated, now named I64 + - long long depreciated, now named I64 - type I32 introduced. should be used iso int where 32 bits are needed(or, brr, assumed...) diff --git a/flower/matrix.cc b/flower/matrix.cc index 9d229c0ae1..885d69f683 100644 --- a/flower/matrix.cc +++ b/flower/matrix.cc @@ -201,9 +201,10 @@ Matrix::set_product(Matrix const &m1, Matrix const &m2) void Matrix::insert_row(Vector v, int k) { + int c = cols(); assert(v.dim()==cols()); dat->insert_row(k); - for (int j=0; j < cols(); j++) + for (int j=0; j < c; j++) dat->elem(k,j)=v(j); } @@ -212,7 +213,8 @@ void Matrix::swap_columns(int c1, int c2) { assert(c1>=0&& c1 < cols()&&c2 < cols() && c2 >=0); - for (int i=0; i< rows(); i++) { + int r = rows(); + for (int i=0; i< r; i++) { Real r=dat->elem(i,c1); dat->elem(i,c1) = dat->elem(i,c2); dat->elem(i,c2)=r; @@ -223,7 +225,8 @@ void Matrix::swap_rows(int c1, int c2) { assert(c1>=0&& c1 < rows()&&c2 < rows() && c2 >=0); - for (int i=0; i< cols(); i++) { + int c = cols(); + for (int i=0; i< c; i++) { Real r=dat->elem(c1,i); dat->elem(c1,i) = dat->elem(c2,i); dat->elem(c2,i)=r; diff --git a/init/dutch.ini b/init/dutch.ini index 8aed19fa95..84e24a0f73 100644 --- a/init/dutch.ini +++ b/init/dutch.ini @@ -2,41 +2,47 @@ % common dutch names for notes. "es" means flat, "is" means sharp % -ceses = \melodic { -1 0 -2 } -ces = \melodic { -1 0 -1 } -c = \melodic { -1 0 0 } -cis = \melodic { -1 0 1 } -cisis = \melodic { -1 0 2 } -deses = \melodic { -1 1 -2 } -des = \melodic { -1 1 -1 } -d = \melodic { -1 1 0 } -dis = \melodic { -1 1 1 } -disis = \melodic { -1 1 2 } -eses = \melodic { -1 2 -2 } -es = \melodic { -1 2 -1 } -e = \melodic { -1 2 0 } -eis = \melodic { -1 2 1 } -eisis = \melodic { -1 2 2 } -feses = \melodic { -1 3 -2 } -fes = \melodic { -1 3 -1 } -f = \melodic { -1 3 0 } -fis = \melodic { -1 3 1 } -fisis = \melodic { -1 3 2 } -geses = \melodic { -1 4 -2 } -ges = \melodic { -1 4 -1 } -g = \melodic { -1 4 0 } -gis = \melodic { -1 4 1 } -gisis = \melodic { -1 4 2 } -ases = \melodic { -1 5 -2 } -as = \melodic { -1 5 -1 } -a = \melodic { -1 5 0 } -ais = \melodic { -1 5 1 } -aisis = \melodic { -1 5 2 } -beses = \melodic { -1 6 -2 } -bes = \melodic { -1 6 -1 } -b = \melodic { -1 6 0 } -bis = \melodic { -1 6 1 } -bisis = \melodic { -1 6 2 } + +% +% Please note that, while these names are used to enter *notes*, they +% actually are *melodic*s, i.e. they represent a pitch solely. Notes +% have a rhythmic part too. This is the reason that we don't write 'note { .. }' +% +ceses = \melodic_request { -1 0 -2 } +ces = \melodic_request { -1 0 -1 } +c = \melodic_request { -1 0 0 } +cis = \melodic_request { -1 0 1 } +cisis = \melodic_request { -1 0 2 } +deses = \melodic_request { -1 1 -2 } +des = \melodic_request { -1 1 -1 } +d = \melodic_request { -1 1 0 } +dis = \melodic_request { -1 1 1 } +disis = \melodic_request { -1 1 2 } +eses = \melodic_request { -1 2 -2 } +es = \melodic_request { -1 2 -1 } +e = \melodic_request { -1 2 0 } +eis = \melodic_request { -1 2 1 } +eisis = \melodic_request { -1 2 2 } +feses = \melodic_request { -1 3 -2 } +fes = \melodic_request { -1 3 -1 } +f = \melodic_request { -1 3 0 } +fis = \melodic_request { -1 3 1 } +fisis = \melodic_request { -1 3 2 } +geses = \melodic_request { -1 4 -2 } +ges = \melodic_request { -1 4 -1 } +g = \melodic_request { -1 4 0 } +gis = \melodic_request { -1 4 1 } +gisis = \melodic_request { -1 4 2 } +ases = \melodic_request { -1 5 -2 } +as = \melodic_request { -1 5 -1 } +a = \melodic_request { -1 5 0 } +ais = \melodic_request { -1 5 1 } +aisis = \melodic_request { -1 5 2 } +beses = \melodic_request { -1 6 -2 } +bes = \melodic_request { -1 6 -1 } +b = \melodic_request { -1 6 0 } +bis = \melodic_request { -1 6 1 } +bisis = \melodic_request { -1 6 2 } % @@ -44,40 +50,40 @@ bisis = \melodic { -1 6 2 } % -Ceses = \melodic { -2 0 -2 } -Ces = \melodic { -2 0 -1 } -C = \melodic { -2 0 0 } -Cis = \melodic { -2 0 1 } -Cisis = \melodic { -2 0 2 } -Deses = \melodic { -2 1 -2 } -Des = \melodic { -2 1 -1 } -D = \melodic { -2 1 0 } -Dis = \melodic { -2 1 1 } -Disis = \melodic { -2 1 2 } -Eses = \melodic { -2 2 -2 } -Es = \melodic { -2 2 -1 } -E = \melodic { -2 2 0 } -Eis = \melodic { -2 2 1 } -Eisis = \melodic { -2 2 2 } -Feses = \melodic { -2 3 -2 } -Fes = \melodic { -2 3 -1 } -F = \melodic { -2 3 0 } -Fis = \melodic { -2 3 1 } -Fisis = \melodic { -2 3 2 } -Geses = \melodic { -2 4 -2 } -Ges = \melodic { -2 4 -1 } -G = \melodic { -2 4 0 } -Gis = \melodic { -2 4 1 } -Gisis = \melodic { -2 4 2 } -Ases = \melodic { -2 5 -2 } -As = \melodic { -2 5 -1 } -A = \melodic { -2 5 0 } -Ais = \melodic { -2 5 1 } -Aisis = \melodic { -2 5 2 } -Beses = \melodic { -2 6 -2 } -Bes = \melodic { -2 6 -1 } -B = \melodic { -2 6 0 } -Bis = \melodic { -2 6 1 } -Bisis = \melodic { -2 6 2 } +Ceses = \melodic_request { -2 0 -2 } +Ces = \melodic_request { -2 0 -1 } +C = \melodic_request { -2 0 0 } +Cis = \melodic_request { -2 0 1 } +Cisis = \melodic_request { -2 0 2 } +Deses = \melodic_request { -2 1 -2 } +Des = \melodic_request { -2 1 -1 } +D = \melodic_request { -2 1 0 } +Dis = \melodic_request { -2 1 1 } +Disis = \melodic_request { -2 1 2 } +Eses = \melodic_request { -2 2 -2 } +Es = \melodic_request { -2 2 -1 } +E = \melodic_request { -2 2 0 } +Eis = \melodic_request { -2 2 1 } +Eisis = \melodic_request { -2 2 2 } +Feses = \melodic_request { -2 3 -2 } +Fes = \melodic_request { -2 3 -1 } +F = \melodic_request { -2 3 0 } +Fis = \melodic_request { -2 3 1 } +Fisis = \melodic_request { -2 3 2 } +Geses = \melodic_request { -2 4 -2 } +Ges = \melodic_request { -2 4 -1 } +G = \melodic_request { -2 4 0 } +Gis = \melodic_request { -2 4 1 } +Gisis = \melodic_request { -2 4 2 } +Ases = \melodic_request { -2 5 -2 } +As = \melodic_request { -2 5 -1 } +A = \melodic_request { -2 5 0 } +Ais = \melodic_request { -2 5 1 } +Aisis = \melodic_request { -2 5 2 } +Beses = \melodic_request { -2 6 -2 } +Bes = \melodic_request { -2 6 -1 } +B = \melodic_request { -2 6 0 } +Bis = \melodic_request { -2 6 1 } +Bisis = \melodic_request { -2 6 2 } diff --git a/init/swedish.ini b/init/swedish.ini index fd7333a3ad..d9c170fb4d 100644 --- a/init/swedish.ini +++ b/init/swedish.ini @@ -1,41 +1,44 @@ -% +%% +% Please note that, while these names are used to enter *notes*, they +% actually are *melodic*s, i.e. they represent a pitch solely. Notes +% have a rhythmic part too. This is the reason that we don't write 'note % common Swedish names for notes. "-ess" means flat, "-iss" means sharp % % by Mats Bengtsson. -cessess = \melodic { 0 0 -2 } -cess = \melodic { 0 0 -1 } -c = \melodic { 0 0 0 } -ciss = \melodic { 0 0 1 } -cississ = \melodic { 0 0 2 } -dessess = \melodic { 0 1 -2 } -dess = \melodic { 0 1 -1 } -d = \melodic { 0 1 0 } -diss = \melodic { 0 1 1 } -dississ = \melodic { 0 1 2 } -essess = \melodic { 0 2 -2 } -ess = \melodic { 0 2 -1 } -e = \melodic { 0 2 0 } -eiss = \melodic { 0 2 1 } -eississ = \melodic { 0 2 2 } -fessess = \melodic { 0 3 -2 } -fess = \melodic { 0 3 -1 } -f = \melodic { 0 3 0 } -fiss = \melodic { 0 3 1 } -fississ = \melodic { 0 3 2 } -gessess = \melodic { 0 4 -2 } -gess = \melodic { 0 4 -1 } -g = \melodic { 0 4 0 } -giss = \melodic { 0 4 1 } -gississ = \melodic { 0 4 2 } -assess = \melodic { 0 5 -2 } -ass = \melodic { 0 5 -1 } -a = \melodic { 0 5 0 } -aiss = \melodic { 0 5 1 } -aississ = \melodic { 0 5 2 } -hessess = \melodic { 0 6 -2 } -b = \melodic { 0 6 -1 } -h = \melodic { 0 6 0 } -hiss = \melodic { 0 6 1 } -hississ = \melodic { 0 6 2 } +cessess = \melodic_request { 0 0 -2 } +cess = \melodic_request { 0 0 -1 } +c = \melodic_request { 0 0 0 } +ciss = \melodic_request { 0 0 1 } +cississ = \melodic_request { 0 0 2 } +dessess = \melodic_request { 0 1 -2 } +dess = \melodic_request { 0 1 -1 } +d = \melodic_request { 0 1 0 } +diss = \melodic_request { 0 1 1 } +dississ = \melodic_request { 0 1 2 } +essess = \melodic_request { 0 2 -2 } +ess = \melodic_request { 0 2 -1 } +e = \melodic_request { 0 2 0 } +eiss = \melodic_request { 0 2 1 } +eississ = \melodic_request { 0 2 2 } +fessess = \melodic_request { 0 3 -2 } +fess = \melodic_request { 0 3 -1 } +f = \melodic_request { 0 3 0 } +fiss = \melodic_request { 0 3 1 } +fississ = \melodic_request { 0 3 2 } +gessess = \melodic_request { 0 4 -2 } +gess = \melodic_request { 0 4 -1 } +g = \melodic_request { 0 4 0 } +giss = \melodic_request { 0 4 1 } +gississ = \melodic_request { 0 4 2 } +assess = \melodic_request { 0 5 -2 } +ass = \melodic_request { 0 5 -1 } +a = \melodic_request { 0 5 0 } +aiss = \melodic_request { 0 5 1 } +aississ = \melodic_request { 0 5 2 } +hessess = \melodic_request { 0 6 -2 } +b = \melodic_request { 0 6 -1 } +h = \melodic_request { 0 6 0 } +hiss = \melodic_request { 0 6 1 } +hississ = \melodic_request { 0 6 2 } diff --git a/input/cadenza.ly b/input/cadenza.ly index 8e8b5e8c73..0acc9d037a 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -4,7 +4,7 @@ % author: unknown. Copyright: none % -cad = \music { +cad = \melodic{ \cadenza {1} \grouping{1*4}\duration { 8} \textstyle "italic" @@ -47,10 +47,7 @@ cad = \music { } \score { - \staff { \melodic - \music { cad } - } - + \staff { cad } \paper {} \midi { \tempo 4:90 } } diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index eed877bb8c..55f2bbb575 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -11,7 +11,7 @@ % (maybe even sooner :-) % -alto = \music { +alto = \melodic{ \meter {4/4} \grouping {4*4} \duration{ 8 } @@ -70,11 +70,9 @@ alto = \music { } -\score { - \staff { \melodic \music { alto }} - - - \paper { +\score{ + \staff{ alto } + \paper{ \unitspace 14\mm \geometric 1.4 } diff --git a/input/error.ly b/input/error.ly index 9a432233b0..d63164147e 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,6 +1,7 @@ include "this-is-hopefully-a-nonexisting-file" -mwa = \music { + +mwa = \melodic{ \meter{3/4} [ a8 a8 a8 a8 a8 ] % [ a8 ] % @@ -23,17 +24,17 @@ mwa = \music { } -bla = \lyrics { +bla = \lyric{ These Gates will open just like windows. % ok; warning } +% Setting up music ...lilypond: ../flower/include/cursor.inl:98: class Cursor Cursor::operator ++(int): Assertion 'pointer_' failed. +%IOT trap/Abort +% als geen music in staff + include "this-is-hopefully-a-nonexisting-file" -\score { - \staff { - lyric \music { bla } - } - \staff { - \melodic \music { mwa } - } +\score{ + \staff{ bla } + \staff{ mwa } } diff --git a/input/fugue1.midi.ly b/input/fugue1.midi.ly index 7ebb6970f4..c4ac8dfeb2 100644 --- a/input/fugue1.midi.ly +++ b/input/fugue1.midi.ly @@ -1,144 +1,268 @@ -% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:11:21 -% Automatically generated, at Wed Mar 12 02:22:22 1997 -% from input file: fugue1.\midi +% Creator: This is mi2mu 0.0.12.1 #5/FlowerLib 1.1.9 #0 of Mar 24 1997 21:30:32 +% Automatically generated, at Mon Mar 24 23:39:09 1997 +% from input file: fugue1.midi -track0 = \music { - % \midi copyright: +track0 = \melodic{ + % midi copyright: % instrument: + % 1 + + % 26:2. + | + % 27 } % track0 -track1 = \music { - % \midi copyright: +track1 = \melodic{ + % midi copyright: % instrument: - g8 a8 b8 c'8. { \music{ d'16 } } { \music{ c'16 } } - { \music{ b8 } } e'8 a8 { \music{ d'8. } } e'16 - d'16 c'16 b16 g16 a16 b16 c'16 b16 c'16 d'16 e'16 - d'16 e'16 fis'16 g'8 b8 c'8 a8 d'16 c'16 b16 a16 { - \music{ g8. } } g16 f16 e16 f16 g16 a16 g16 a16 b16 - c'2 b4 c'8 d'8 e'8 f'8. { \music{ f'16 } \music{ - g'16 } } e'8 a'8 d'8 g'8. a'16 g'16 f'16 e'8 a'8. - b'16 a'16 g'16 f'2 e'8. fis'16 g'2 fis'4 g'16 f'16 - e'16 d'16 c'16 d'16 c'16 b16 a16 c'16 b16 a16 c'16 - a16 gis8 e'8 d'8 c'16 b16 a16 gis16 a16 b16 c'16 - fis16 gis16 a16 b8 a16 b16 c'8 f'8 e'8 d'4 c'16 b16 - { \music{ c'16 } } { \music{ b16 } } { \music{ b16 - b16 } \music{ c'16 c'16 } \music{ b16 } \music{ - c'16 c'16 } } { } { \music{ b16 } } { \music{ a16 } - } a4 g8 a8 b8 c'8. { \music{ d'16 } } { \music{ - c'16 } } { \music{ b8 } } c'8 d'8 e'8 f'8. { \music{ - g'16 } } { \music{ f'16 } } { \music{ e'8 } } a'8 - d'8 g'8. a'16 g'16 f'16 e'8 a'8 d'8 ais'8 a'8 g'16 - f'16 g'16 f'16 g'16 e'16 f'16 { \music{ g'16 } } { - \music{ g'16 } } { \music{ a'16 } } { \music{ g'16 } - } { } { } { \music{ f'16 } } { \music{ g'16 } } { - \music{ a'16 } } cis'16 d'16 g'16 { \music{ f'16 } - } { \music{ e'16 } } { \music{ f'16 } } { \music{ - e'16 } } { } { \music{ f'16 } } { } { } { } { - \music{ e'8 } } { } d'16 d'8 g8 a8 b8 c'8 d'16 { - \music{ c'16 } } { \music{ b8 } } e'8 a8 { \music{ - d'8. } } e'16 d'16 c'16 b16 c'16 d'16 e'16 f'16 - g'16 a'16 g'16 f'16 e'16 d'16 c'16 { \music{ c'16 } - } { \music{ b16 } } { \music{ c'16 } } { } { } { - \music{ b8. } } c'8 d'8 g8 { \music{ c'4 } } b8 c'4 - b8 ais8 a8 { \music{ d'4 } } c'8 d'8 e'8 f'4 a'16 { - \music{ g'16 } } f'16 e'16 { \music{ f'16 } } { - \music{ e'16 } } d'16 c'2 g16 { \music{ a16 } } b16 - c'16 d'16 e'16 { \music{ f'8. } } { \music{ d'16 } - \music{ c'16 e'16 } } f'16 { \music{ g'16 } } { - \music{ a'8. } } b'16 c''2 + % 1 + + % 2:4*5/32 + g8 a8 b8 c'8. + % 3:4*5/128 + < { d'16 } > < { c'16 } > < { b8 } > e'8 a8 < { + d'8. } > e'16 d'16 c'16 b16 g16 a16 b16 c'16 b16 + c'16 d'16 e'16 d'16 e'16 fis'16 g'8 b8 c'8 a8 d'16 + c'16 b16 a16 + % 5:4*47/384 + < { g8. } > g16 f16 e16 f16 g16 a16 g16 a16 b16 c'2 + b4 | + % 7 + c'8 d'8 e'8 f'8. < { f'16 } { g'16 } > e'8 a'8 d'8 + g'8. a'16 g'16 f'16 e'8 a'8. b'16 a'16 g'16 f'2 + e'8. fis'16 g'2 fis'4 g'16 f'16 e'16 d'16 c'16 d'16 + c'16 b16 a16 c'16 b16 a16 + % 11:4 + c'16 a16 gis8 e'8 d'8 c'16 b16 a16 gis16 a16 b16 + c'16 fis16 gis16 a16 b8 a16 b16 c'8 f'8 e'8 d'4 + c'16 b16 + % 13:4*45/256 + < { c'16 } > < { b16 } > < { b16 b16 } { c'16 c'16 } + { b16 } { c'16 c'16 } > < > < { b16 } > < { a16 } + > | + % 14 + a4 + % 15:4*5/32 + g8 a8 b8 c'8. + % 16:4*5/128 + < { d'16 } > < { c'16 } > < { b8 } > c'8 d'8 e'8 + f'8. < { g'16 } > < { f'16 } > | + % 17 + < { e'8 } > a'8 d'8 g'8. a'16 g'16 f'16 e'8 a'8 d'8 + ais'8 a'8 g'16 f'16 g'16 f'16 g'16 e'16 f'16 + % 18:4*155/768 + < { g'16 } > < { g'16 } > < { a'16 } > < { g'16 } > + < > < > < { f'16 } > < { g'16 } > | + % 19 + < { a'16 } > cis'16 d'16 g'16 < { f'16 } > < { e'16 + } > < { f'16 } > < { e'16 } > < > < { f'16 } > < > + < > < > < { e'8 } > < > d'16 d'8 + % 20:4*7/32 + g8 a8 b8 + % 21:4 + c'8 d'16 < { c'16 } > < { b8 } > e'8 a8 < { d'8. } + > + % 22:4*5/384 + e'16 d'16 c'16 b16 c'16 d'16 e'16 f'16 g'16 a'16 + g'16 f'16 e'16 d'16 c'16 < { c'16 } > < { b16 } > < + { c'16 } > | + % 23 + < > < > < { b8. } > c'8 d'8 g8 < { c'4 } > b8 c'4 + b8 ais8 a8 + % 24:4*59/384 + < { d'4 } > c'8 d'8 e'8 + % 25:4 + f'4 a'16 < { g'16 } > f'16 e'16 < { f'16 } > < { + e'16 } > d'16 | + % 26 + c'2 g16 < { a16 } > b16 c'16 d'16 e'16 < { f'8. } > + | + % 27 + < { d'16 } { c'16 e'16 } > f'16 < { g'16 } > < { + a'8. } > b'16 c''2 } % track1 -track2 = \music { - % \midi copyright: +track2 = \melodic{ + % midi copyright: % instrument: - c8 d8 e8 f8. { \music{ g16 } } { \music{ f16 } } { - \music{ e8 } } a8 d8 { \music{ g8. } } a16 g16 f16 - e16 f16 e16 d16 c16 d16 c16 'b16 'a8 fis8 { \music{ - g4. } } f16 e16 f8 d8 g8 f8 e8 d8 g4 f16 e16 f4 f16 - e8 d4 c8 f8 g16 f16 e16 f8 d8 g4.. g8 a8 b8 { - \music{ c'8. } } { \music{ d'16 } } { \music{ c'16 } - } { \music{ b8 } } e'8 a8 { \music{ d'8. } } e'16 - d'16 c'16 b8 d8 e8 fis8 { \music{ g8. } } { \music{ - a16 } } { \music{ g16 } } { \music{ f8 } } b8 e8 - a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 - a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 c8 d8 e8 - { \music{ f8. } } { \music{ g16 } } { \music{ f16 } - } { \music{ e8 } } a8 d8 g8. a16 g16 f16 e16 e16 - fis16 g4 fis8 gis8 { \music{ a4 } } g8 a8 b8 { - \music{ c'8. } } { \music{ d'16 } } { \music{ c'16 } - } { \music{ b8 } } e'8 a8 d'8. e'16 d'16 c'16 b8 - g'8 cis'8 d'8 e'8 cis'8 d'8 e'8 a8 e8 fis8 g8 { - \music{ a8. } } { \music{ b16 } } { \music{ a16 } } - { \music{ g8 } } c'8 fis8 { \music{ b8. } } c'16 - b16 a16 g16 fis16 e16 d16 e4 d4 a16 g16 f16 e16 g16 - f16 a16 g4 a16 ais8 { \music{ c'4 } } d'8 g8 { - \music{ g4. } } f4 e8 d4 e16 a4 g4 f8 g8 a8 { - \music{ ais8. } } { \music{ c'16 } } { \music{ - ais16 } } { \music{ a8 } } d'8 g8 { \music{ c'8. } - } d'16 c'16 ais16 a16 ais16 a16 g16 f16 g16 f16 e16 - g16 a4 f'16 d'8 { \music{ e'2 } \music{ g'2 } } + % 1 + c8 d8 e8 f8. < { g16 } > < { f16 } > < { e8 } > a8 + d8 + % 2:4*107/3840 + < { g8. } > a16 g16 f16 e16 f16 e16 d16 c16 d16 c16 + 'b16 'a8 fis8 + % 3:4*203/3840 + < { g4. } > f16 e16 f8 d8 g8 f8 e8 d8 + % 4:2 + g4 f16 e16 + % 5:4 + f4 f16 e8 d4 c8 f8 + % 6:4 + g16 f16 e16 f8 d8 g2 + % 7:4*241/3840 + + % 9:8 + g8 a8 b8 < { c'8. } > < { d'16 } > < { c'16 } > < { + b8 } > e'8 a8 + % 10:4*13/480 + < { d'8. } > e'16 d'16 c'16 b8 d8 e8 fis8 + % 11:4*23/384 + < { g8. } > < { a16 } > < { g16 } > < { f8 } > b8 + e8 a8. b16 a16 gis16 fis8 f8 e8 d8. e16 fis16 gis16 + a16 gis16 a16 b16 gis16 fis16 gis16 a16 b8 + % 13:4*5/32 + + % 14:8 + c8 d8 e8 < { f8. } > < { g16 } > < { f16 } > < { e8 + } > a8 d8 g8. a16 g16 f16 + % 15:2 + e16 e16 fis16 g4 + % 16:4*91/3840 + fis8 gis8 < { a4 } > g8 a8 b8 < { c'8. } > | + % 17 + < { d'16 } > < { c'16 } > < { b8 } > e'8 a8 d'8. + e'16 d'16 c'16 b8 g'8 cis'8 d'8 e'8 cis'8 d'8 e'8 + a8 + % 19:8 + e8 fis8 g8 < { a8. } > < { b16 } > < { a16 } > | + % 20 + < { g8 } > c'8 fis8 < { b8. } > c'16 b16 a16 g16 + fis16 e16 d16 e4 + % 21:4 + d4 a16 g16 f16 e16 g16 f16 a16 | + % 22 + g4 a16 ais8 < { c'4 } > d'8 g8 < { g4. } > | + % 23 + f4 e8 d4 | + % 24 + e16 a4 g4 f8 g8 a8 < { ais8. } > | + % 25 + < { c'16 } > < { ais16 } > < { a8 } > d'8 g8 < { + c'8. } > d'16 c'16 ais16 a16 ais16 a16 g16 f16 g16 + f16 e16 + % 26:2 + g16 a4 + % 27:4 + f'16 d'8 < { e'2 } { g'2 } > } % track2 -track3 = \music { - % \midi copyright: +track3 = \melodic{ + % midi copyright: % instrument: - 'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 } } - { \music{ 'b8 } } e8 'a8 { \music{ d8. } } e16 d16 - c16 'b8 c4 'ais8 'a8 d8 'g8 c8 'a16 'b16 c16 d4 'g4 - 'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 } } - { } 'b8 e8 'a8 d8. e16 d16 c16 'b8 e4. d4 'b16 c16 - 'a16 e16 d16 c16 'b16 c16 'a16 'b16 c16 d16 c16 - 'b16 'a16 'g4 'e8 'fis8 'gis8 'a8. { \music{ 'b16 } - } { \music{ 'a16 } } { \music{ 'g8 } } c8 'fis8 - 'b8. c16 'b16 'a16 'gis8 { \music{ 'a4 } } 'gis8 - 'a4 'g8 'a8 'b8 c8. { \music{ d16 } } { \music{ c16 - } } { \music{ 'b8 } } e8 'a8 d4 'g8 d4 c8 'a8 e4 d8 - 'a8 'b8 cis8 d8. { \music{ e16 } } { \music{ d16 } - } { \music{ c8 } } f8 'b8 e8. f16 e16 d16 cis8 'a8 - 'b8 cis8 d8. { \music{ e16 } } { \music{ d16 } } { - \music{ c8 } } fis8 'b8 e8. fis16 e16 d16 c4.. d16 - c16 'b16 'a16 'g16 'a16 'fis16 'g8 'b8 c8 { \music{ - d8 } } e8. { \music{ f16 } } { \music{ e16 } } { - \music{ d8 } } g8 c8 f8. g16 f16 e16 d4 e8 d4 { - \music{ 'g8 } } 'g4. 'c8 'd8 'e8 'f8. { \music{ - 'g16 } } { \music{ 'f16 } } { \music{ 'e8 } } 'a8 - 'd8 { \music{ 'g8. } } 'a16 'g16 'f16 'e16 'd16 - 'e16 'f16 'g16 'a16 'ais16 'g16 'a16 'e16 'f16 'g16 - 'a16 'b16 c16 { \music{ 'a16 } \music{ d2 } } c1 + % 1 + + % 4:8 + 'g8 'a8 'b8 c8. < { d16 } > < { c16 } > < { 'b8 } > + e8 'a8 + % 5:4*11/384 + < { d8. } > e16 d16 c16 'b8 c4 'ais8 'a8 d8 'g8 c8 + % 6:2 + 'a16 'b16 c16 d4 'g4 + % 7:4 + 'g8 'a8 'b8 c8. < { d16 } > < { c16 } > < > | + % 8 + 'b8 e8 'a8 d8. e16 d16 c16 'b8 e4. d4 + % 9:2 + 'b16 c16 'a16 e16 d16 c16 'b16 c16 'a16 'b16 c16 + d16 c16 'b16 'a16 'g4 + % 10:2. + + % 12:8 + 'e8 'fis8 'gis8 'a8. < { 'b16 } > < { 'a16 } > < { + 'g8 } > c8 'fis8 'b8. c16 'b16 'a16 + % 13:2 + 'gis8 < { 'a4 } > 'gis8 'a4 + % 14:4 + 'g8 'a8 'b8 c8. < { d16 } > < { c16 } > | + % 15 + < { 'b8 } > e8 'a8 d4 'g8 d4 c8 'a8 e4 d8 + % 16:4*5/32 + + % 17:8 + 'a8 'b8 cis8 d8. < { e16 } > < { d16 } > < { c8 } > + f8 'b8 e8. f16 e16 d16 cis8 + % 18:4*5/32 + + % 19:8 + 'a8 'b8 cis8 d8. < { e16 } > < { d16 } > < { c8 } > + fis8 'b8 e8. fis16 e16 d16 + % 20:2 + c2 d16 c16 'b16 'a16 'g16 'a16 'fis16 + % 21:2 + 'g8 'b8 c8 < { d8 } > e8. + % 22:4*5/128 + < { f16 } > < { e16 } > < { d8 } > g8 c8 f8. g16 + f16 e16 d4 e8 d4 + % 23:4*59/384 + < { 'g8 } > 'g4. 'c8 'd8 'e8 'f8. + % 24:4*21/128 + < { 'g16 } > < { 'f16 } > < { 'e8 } > 'a8 'd8 + % 25:4*11/384 + < { 'g8. } > 'a16 'g16 'f16 'e16 'd16 'e16 'f16 + 'g16 'a16 'ais16 'g16 'a16 'e16 'f16 'g16 'a16 'b16 + c16 + % 26:4*7/64 + < { 'a16 } { d2 } > | + % 27 + c1 } % track3 -track4 = \music { - % \midi copyright: +track4 = \melodic{ + % midi copyright: % instrument: - 'c8 'd8 'e8 'f8. { \music{ 'g16 } } { \music{ 'f16 } - } { \music{ 'e8 } } 'a8 'd8 { \music{ 'g8. } } - 'a16 'g16 'f16 'e16 'f16 'e16 'd16 'c16 'd16 'c16 - ''b16 ''a8 'd8 'a8 'fis8 'g16 'a16 'ais16 'g16 - 'cis8 'd8 'a4 'e4 'a16 'b16 c16 d16 c16 'b16 'a16 - 'g16 c8 ''g8 ''a8 ''b8 'c8. { \music{ 'd16 } } { - \music{ 'c16 } } { \music{ ''b8 } } 'e8 ''a8 'd8. - 'e16 'd16 'c16 { \music{ ''b8 } } 'e4 'd8 'c8 'f4 - 'e4 'd4 'e8 'f8 'e16 'd16 'e4 ''a4 ''g8 ''a8 ''b8 - 'c8. { \music{ 'd16 } } { \music{ 'c16 } } { \music{ - ''b8 } } 'e8 ''a8 'd8. 'e16 'd16 'c16 ''b8 ai''s8 - ''a8 ''g8 ''a8 'fis8 'g8 'e8 'd4 'e8 'f8 'g8. { - \music{ 'a16 } } { \music{ 'g16 } } { \music{ 'f8 } - } 'ais8 'e8 'a8. 'b16 { \music{ 'a16 } } 'g16 'f16 - 'e16 'f16 'd16 'g8 'a8 'd4.. 'e16 'd16 'c16 ''b16 - ''a16 ''g16 fi''s16 ''e8 'e8 'fis8 'g4 'a16 'g16 - 'fis8 'd8 'g1 'a4 'b8 c8 'f16 'a16 'g16 'f16 'e16 - 'd16 'c16 ''b16 'c16 'd16 'e16 'f16 'g8 ''g8 'b2 + % 1 + + % 5:4*5/32 + 'c8 'd8 'e8 'f8. + % 6:4*5/128 + < { 'g16 } > < { 'f16 } > < { 'e8 } > 'a8 'd8 < { + 'g8. } > 'a16 'g16 'f16 'e16 'f16 'e16 'd16 'c16 + 'd16 'c16 ''b16 ''a8 'd8 'a8 'fis8 'g16 'a16 'ais16 + 'g16 'cis8 'd8 'a4 'e4 'a16 'b16 c16 d16 c16 'b16 + 'a16 'g16 c8 + % 9:4*5/32 + + % 10:4*5/32 + ''g8 ''a8 ''b8 'c8. + % 11:4*5/128 + < { 'd16 } > < { 'c16 } > < { ''b8 } > 'e8 ''a8 + 'd8. 'e16 'd16 'c16 < { ''b8 } > | + % 12 + 'e4 'd8 'c8 'f4 'e4 'd4 'e8 'f8 'e16 'd16 'e4 ''a4 + % 14:4 + + % 15:8 + ''g8 ''a8 ''b8 'c8. < { 'd16 } > < { 'c16 } > < { + ''b8 } > 'e8 ''a8 'd8. 'e16 'd16 'c16 ''b8 ''ais8 + ''a8 ''g8 ''a8 'fis8 'g8 'e8 'd4 'e8 'f8 'g8. + % 18:4*5/128 + < { 'a16 } > < { 'g16 } > < { 'f8 } > 'ais8 'e8 + 'a8. 'b16 < { 'a16 } > 'g16 'f16 'e16 'f16 'd16 'g8 + 'a8 + % 19:2 + 'd2 'e16 'd16 'c16 ''b16 ''a16 ''g16 ''fis16 ''e8 + 'e8 'fis8 'g4 'a16 'g16 'fis8 'd8 'g1 'a4 'b8 c8 + 'f16 'a16 'g16 'f16 'e16 'd16 'c16 ''b16 'c16 'd16 + 'e16 'f16 'g8 ''g8 | + % 24 + + % 26:2 + 'b2 | + % 27 + } % track4 -score { - \staff { \melodic \music { track0 } } - \staff { \melodic \music { track1 } } - \staff { \melodic \music { track2 } } - \staff { \melodic \music { track3 } } - \staff { \melodic \music { track4 } } - - \midi { +\score{ + \staff{ track0 } + \staff{ track1 } + \staff{ track2 } + \staff{ track3 } + \staff{ track4 } + + \paper{ + \unitspace 20\mm + }\midi{ \tempo 4:60 } } diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 36cfbb1246..9bc116a99c 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -7,12 +7,13 @@ % % copyright: None % -% declare \music (which will be in *one* \staff ) for the lead \voice +% declare melody (which will be in *one* staff ) for the lead voice -melodie = \music { +melodie = \melodic{ % switch Lilypond in note-mode \clef\violin - \octave {} % set the default \octave + \meter{ 2/4 } + \octave{ c } % set the default octave % the default note duratino is 4 %%% theme c c | % the '|' checks if there is a new measure here. @@ -32,16 +33,13 @@ melodie = \music { } % more of this. -begeleiding = -% \clef bass % bass-\clef -% \music { % as you can see, the sign obliges - % you to precede \keyword by a backslash: \ - \music { +begeleiding = \melodic{ \clef "bass" - \octave { ' } % default \octave: 1 below the first \octave. + \meter{ 2/4 } + \octave{ c' } % default octave: 1 below the first octave. %%% theme - 'c % ' means one \octave lower. + 'c % ' means one octave lower. % Similarly: ' means one higher. c e c f c e c d 'b c 'a 'f 'g 'c2 \octave { ' } @@ -51,27 +49,10 @@ begeleiding = 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 - \music { \meter {2/4 } } - } - -% another one -vstaf = \staff { - \melodic - \music { melodie } - % default \clef is violin \clef - \music { \meter {2/4 } } - } - - -\score { - \staff { vstaf } - \staff { bstaf } - \paper { +\score{ + \staff{ melodie } + \staff{ begeleiding } + \paper{ \unitspace 2.5\cm % a whole note takes 2.5 \cm ideally. } } diff --git a/input/maartje.ly b/input/maartje.ly index 64fa7166ec..daaa42bffb 100644 --- a/input/maartje.ly +++ b/input/maartje.ly @@ -3,7 +3,7 @@ % COPYRIGHT: GPL % % -globals=\music{ +globals=\melodic{ \meter {4/ 4} \partial {8} \skip {1*8} @@ -13,30 +13,27 @@ globals=\music{ \meter {2/4} } -ritme = \staff { - rhythmic - \music{globals} - \music { - c8 - |[a8() a8. a8 a16 a16 a16] c4. - - %[c8( )a'8() c8 c8]% BUG! - |c2 c2 - - |[fis16 dis'16( fis16 dis'16 ][fis16) dis'16 fis16 dis'16] - | 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 - - } +ritme = \staff{ + globals +% rhythmic broken for now +% \rhytmic{ +% c8 +% |[a8() a8. a8 a16 a16 a16] c4. +% +% %[c8( )a'8() c8 c8]% BUG! +% |c2 c2 +% +% |[fis16 dis'16( fis16 dis'16 ][fis16) dis'16 fis16 dis'16] +% | 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 { globals } - \music{ +melody= \staff{ + globals + \melodic{ c8\key{fis cis gis} |r4 r4 r4 r4 |cis'2.. r8 @@ -64,16 +61,12 @@ melody= } -\score { - \paper { +\score{ + \paper{ \geometric 1.4 \unitspace 3.0 \cm } -% \staff { ritme } % broken for now - \staff { melody } - + ritme + melody } - - - diff --git a/input/martien.ly b/input/martien.ly index 56340bddab..b3917c6209 100644 --- a/input/martien.ly +++ b/input/martien.ly @@ -17,7 +17,7 @@ % \barnumbering5 % \barnumberstyle\boxed -globalmusic= \music { +globalmusic= \melodic{ \meter {2/4} % \key fis \skip {56*2} @@ -35,33 +35,17 @@ include "mlvio1.ly" include "mlvio2.ly" include "mlcello.ly" -\score { - \staff { - \melodic - \music { alto } - \music { globalmusic } - } - \staff { - \melodic - \music { violinI } - \music { globalmusic } - } - \staff { - \melodic - \music { violinII } - \music { globalmusic } - } - \staff { - \melodic - \music { cello } - \music { globalmusic } - } - \paper { +\score{ + \staff{ globalmusic alto } + \staff{ globalmusic violinI } + \staff{ globalmusic violinII } + \staff{ globalmusic cello } + \paper{ \unitspace 24\mm \width 195\mm \output "martien.out" } - \midi { + \midi{ \tempo 4:80 } } diff --git a/input/midi.ly b/input/midi.ly index 08c6ce4755..330b732414 100644 --- a/input/midi.ly +++ b/input/midi.ly @@ -1,39 +1,27 @@ % \midi.ly % test source for lilypond-s \midi \output -melodie = \music { +melodie = \melodic{ \clef\violin + \meter{ 2/4 } c c | g g | a a | g2 f f | e e | d d8.( e16 | )c2 | % :| } -begeleiding = \music { - - \clef \bass - \octave{-1} +begeleiding = \melodic{ + \clef\bass + \meter{ 2/4 } + \octave{'c} c c' | e' c' | f' c' | e' c' d' b | c' a | f g | c2 | } -mstaf = \staff { - \melodic - \music { melodie } -} - -bass_staf = \staff { - \melodic - \music { begeleiding } -} - -score { - \staff { mstaf } - \staff { bass_staf } - \co\mmands { - \meter { 2 * 4} - } - \midi { +\score{ + \staff{ melodie } + \staff{ begeleiding } + \midi{ \tempo 4:120 } } diff --git a/input/mlalt.ly b/input/mlalt.ly index 3e0e419e4a..0e78987584 100644 --- a/input/mlalt.ly +++ b/input/mlalt.ly @@ -11,11 +11,10 @@ % The purpose of this file is to demonstrate features of LilyPond; % respect the copyright. % -alto = \music { - +alto = \melodic{ \duration{16} \clef\alto - \octave{} + \octave{c} \key{fis} %1 [ 'b8. 'a ] [ 'g8 'b c ] | diff --git a/input/mlcello.ly b/input/mlcello.ly index 76d9519123..ad9f3126b6 100644 --- a/input/mlcello.ly +++ b/input/mlcello.ly @@ -11,9 +11,9 @@ % The purpose of this file is to demonstrate features of LilyPond; % respect the copyright. % -cello = \music { - -\clef"bass" \octave{'} +cello = \melodic{ + \clef"bass" + \octave{'c} \duration{4} \key{fis} %%1 diff --git a/input/mlvio1.ly b/input/mlvio1.ly index 0ef0d07821..bd0aea34ab 100644 --- a/input/mlvio1.ly +++ b/input/mlvio1.ly @@ -11,10 +11,9 @@ % The purpose of this file is to demonstrate features of LilyPond; % respect the copyright. % -violinI = \music { - +violinI = \melodic{ \clef "violin" - \octave{} + \octave{c} \duration{4} \key{fis} %1 diff --git a/input/mlvio2.ly b/input/mlvio2.ly index 9f87985537..33a376e920 100644 --- a/input/mlvio2.ly +++ b/input/mlvio2.ly @@ -11,9 +11,9 @@ % The purpose of this file is to demonstrate features of LilyPond; % respect the copyright. % -violinII = \music { - -\clef "violin" \octave{} +violinII = \melodic{ + \clef "violin" + \octave{c} \duration{4} \key{fis} %1 diff --git a/input/plet.ly b/input/plet.ly index d309296dda..255ee658a1 100644 --- a/input/plet.ly +++ b/input/plet.ly @@ -1,18 +1,18 @@ -melanie = \music { - +melanie = \melodic{ + \meter{2/4} \duration{8} [ c d ] { [ d d' } { c c' ] } | [ c d ] [ e { d g } c ]2/3 | [ c d ] [ c16 d16 e'16 e'16 d16 c16 ]4/6 | [ c d e e d c ]4/6 | - [c d ] { \music{ [ c d e ]2/3 } \music{ [ f g a ]2/3 } } | + [c d ] < { [ c d e ]2/3 } { [ f g a ]2/3 } > | [ c d ] [ d c ] | } -michelle = \music { - +michelle = \melodic{ + \meter{2/4} \duration{8} [ c c c c ] | [ c c c c ] | @@ -20,11 +20,10 @@ michelle = \music { [ c c c c ] | [ c c c c ] | [ c c c c ] | - } -mireille = \music { - @ +mireille = \lyric{ + \meter{2/4} \duration{8} o o o o | o o [ o o o ]2/3 | @@ -32,14 +31,11 @@ mireille = \music { [ o o o o o o]4/6 | o o [ o o o ]2/3 | o o o o | - @ } -score { - \staff { lyric \music { mireille } } - \staff { \melodic \music { melanie } } - \staff { \melodic \music { michelle } } - \co\mmands{ - \meter {2*4} - } +\score{ + \staff{ mireille } + \staff{ melanie } + \staff{ michelle } + \paper{} } diff --git a/input/pre1.midi.ly b/input/pre1.midi.ly index 132410ba9a..8a59b16269 100644 --- a/input/pre1.midi.ly +++ b/input/pre1.midi.ly @@ -1,128 +1,208 @@ -% Creator: This is mi2mu 0.0.11.2 #14/FlowerLib 1.1.7 #1 of Mar 12 1997 02:05:36 -% Automatically generated, at Wed Mar 12 02:09:07 1997 -% from input file: pre1.\midi -% jcn: using option -n +% Creator: This is mi2mu 0.0.12.1 #5/FlowerLib 1.1.9 #0 of Mar 24 1997 21:30:32 +% Automatically generated, at Mon Mar 24 23:24:05 1997 +% from input file: pre1.midi -track0 = \music { - % \midi copyright: +track0 = \melodic{ + % midi copyright: % instrument: - { } { } { } { } { } { } { } { } + % 1 + + % 34:8 + | + % 35 + } % track0 -track1 = \music { - % \midi copyright: +track1 = \melodic{ + % midi copyright: % instrument: - { \music{ g16 c'16 e'16 g16 c'16 e'16 } } { \music{ - g16 c'16 e'16 g16 c'16 e'16 } } { \music{ a16 d'16 - f'16 a16 d'16 f'16 } } { \music{ a16 d'16 f'16 a16 - d'16 f'16 } } { \music{ g16 d'16 f'16 g16 d'16 f'16 - } } { \music{ g16 d'16 f'16 g16 d'16 f'16 } } { - \music{ g16 c'16 e'16 g16 c'16 e'16 } } { \music{ - g16 c'16 e'16 g16 c'16 e'16 } } { \music{ a16 e'16 - a'16 a16 e'16 a'16 } } { \music{ a16 e'16 a'16 a16 - e'16 a'16 } } { \music{ fis16 a16 d'16 fis16 a16 - d'16 } } { \music{ fis16 a16 d'16 fis16 a16 d'16 } - } { \music{ g16 d'16 g'16 g16 d'16 g'16 } } { - \music{ g16 d'16 g'16 g16 d'16 g'16 } } { \music{ - e16 g16 c'16 e16 g16 c'16 } } { \music{ e16 g16 - c'16 e16 g16 c'16 } } { \music{ e16 g16 c'16 e16 - g16 c'16 } } { \music{ e16 g16 c'16 e16 g16 c'16 } - } { \music{ d16 fis16 c'16 d16 fis16 c'16 } } { - \music{ d16 fis16 c'16 d16 fis16 c'16 } } { \music{ - d16 g16 b16 d16 g16 b16 } } { \music{ d16 g16 b16 - d16 g16 b16 } } { \music{ e16 g16 cis'16 e16 g16 - cis'16 } } { \music{ e16 g16 cis'16 e16 g16 cis'16 } - } { \music{ d16 a16 d'16 d16 a16 d'16 } } { \music{ - d16 a16 d'16 d16 a16 d'16 } } { \music{ d16 f16 - b16 d16 f16 b16 } } { \music{ d16 f16 b16 d16 f16 - b16 } } { \music{ c16 g16 c'16 c16 g16 c'16 } } { - \music{ c16 g16 c'16 c16 g16 c'16 } } { \music{ - 'a16 c16 f16 'a16 c16 f16 } } { \music{ 'a16 c16 - f16 'a16 c16 f16 } } { \music{ 'a16 c16 f16 'a16 - c16 f16 } } { \music{ 'a16 c16 f16 'a16 c16 f16 } } - { \music{ 'g16 'b16 f16 'g16 'b16 f16 } } { \music{ - 'g16 'b16 f16 'g16 'b16 f16 } } { \music{ 'g16 c16 - e16 'g16 c16 e16 } } { \music{ 'g16 c16 e16 'g16 - c16 e16 } } { \music{ 'ais16 c16 e16 'ais16 c16 e16 - } } { \music{ 'ais16 c16 e16 'ais16 c16 e16 } } { - \music{ 'a16 c16 e16 'a16 c16 e16 } } { \music{ - 'a16 c16 e16 'a16 c16 e16 } } { \music{ 'a16 c16 - dis16 'a16 c16 dis16 } } { \music{ 'a16 c16 dis16 - 'a16 c16 dis16 } } { \music{ 'b16 c16 d16 'b16 c16 - d16 } } { \music{ 'b16 c16 d16 'b16 c16 d16 } } { - \music{ 'g16 'b16 d16 'g16 'b16 d16 } } { \music{ - 'g16 'b16 d16 'g16 'b16 d16 } } { \music{ 'g16 c16 - e16 'g16 c16 e16 } } { \music{ 'g16 c16 e16 'g16 - c16 e16 } } { \music{ 'g16 c16 f16 'g16 c16 f16 } } - { \music{ 'g16 c16 f16 'g16 c16 f16 } } { \music{ - 'g16 'b16 f16 'g16 'b16 f16 } } { \music{ 'g16 'b16 - f16 'g16 'b16 f16 } } { \music{ 'a16 c16 fis16 'a16 - c16 fis16 } } { \music{ 'a16 c16 fis16 'a16 c16 - fis16 } } { \music{ 'g16 c16 g16 'g16 c16 g16 } } { - \music{ 'g16 c16 g16 'g16 c16 g16 } } { \music{ - 'g16 c16 f16 'g16 c16 f16 } } { \music{ 'g16 c16 - f16 'g16 c16 f16 } } { \music{ 'g16 'b16 f16 'g16 - 'b16 f16 } } { \music{ 'g16 'b16 f16 'g16 'b16 f16 } - } { \music{ 'g16 'ais16 e16 'g16 'ais16 e16 } } { - \music{ 'g16 'ais16 e16 'g16 'ais16 e16 } } { - \music{ 'f16 'a16 c16 f16 c16 'a16 c16 'a16 'f16 - 'a16 'f16 'd16 'f16 'd16 } } { \music{ g16 b16 d'16 - f'16 d'16 b16 d'16 b16 g16 b16 d16 f16 e64 } } { - \music{ f64 } } { } { \music{ e32 } } { \music{ d16 - } } { \music{ c'1 } \music{ g1 } \music{ e1 } } + % 1 + g16 c'16 e'16 g16 c'16 e'16 g16 c'16 e'16 g16 c'16 + e'16 | + % 2 + a16 d'16 f'16 a16 d'16 f'16 a16 d'16 f'16 a16 d'16 + f'16 | + % 3 + g16 d'16 f'16 g16 d'16 f'16 g16 d'16 f'16 g16 d'16 + f'16 | + % 4 + g16 c'16 e'16 g16 c'16 e'16 g16 c'16 e'16 g16 c'16 + e'16 | + % 5 + a16 e'16 a'16 a16 e'16 a'16 a16 e'16 a'16 a16 e'16 + a'16 | + % 6 + fis16 a16 d'16 fis16 a16 d'16 fis16 a16 d'16 fis16 + a16 d'16 | + % 7 + g16 d'16 g'16 g16 d'16 g'16 g16 d'16 g'16 g16 d'16 + g'16 | + % 8 + e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 + | + % 9 + e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 e16 g16 c'16 + | + % 10 + d16 fis16 c'16 d16 fis16 c'16 d16 fis16 c'16 d16 + fis16 c'16 | + % 11 + d16 g16 b16 d16 g16 b16 d16 g16 b16 d16 g16 b16 | + % 12 + e16 g16 cis'16 e16 g16 cis'16 e16 g16 cis'16 e16 + g16 cis'16 | + % 13 + d16 a16 d'16 d16 a16 d'16 d16 a16 d'16 d16 a16 d'16 + | + % 14 + d16 f16 b16 d16 f16 b16 d16 f16 b16 d16 f16 b16 | + % 15 + c16 g16 c'16 c16 g16 c'16 c16 g16 c'16 c16 g16 c'16 + | + % 16 + 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 + | + % 17 + 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 'a16 c16 f16 + | + % 18 + 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 + f16 | + % 19 + 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 + | + % 20 + 'ais16 c16 e16 'ais16 c16 e16 'ais16 c16 e16 'ais16 + c16 e16 | + % 21 + 'a16 c16 e16 'a16 c16 e16 'a16 c16 e16 'a16 c16 e16 + | + % 22 + 'a16 c16 dis16 'a16 c16 dis16 'a16 c16 dis16 'a16 + c16 dis16 | + % 23 + 'b16 c16 d16 'b16 c16 d16 'b16 c16 d16 'b16 c16 d16 + | + % 24 + 'g16 'b16 d16 'g16 'b16 d16 'g16 'b16 d16 'g16 'b16 + d16 | + % 25 + 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 'g16 c16 e16 + | + % 26 + 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 + | + % 27 + 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 + f16 | + % 28 + 'a16 c16 fis16 'a16 c16 fis16 'a16 c16 fis16 'a16 + c16 fis16 | + % 29 + 'g16 c16 g16 'g16 c16 g16 'g16 c16 g16 'g16 c16 g16 + | + % 30 + 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 'g16 c16 f16 + | + % 31 + 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 f16 'g16 'b16 + f16 | + % 32 + 'g16 'ais16 e16 'g16 'ais16 e16 'g16 'ais16 e16 + 'g16 'ais16 e16 | + % 33 + 'f16 'a16 c16 f16 c16 'a16 c16 'a16 'f16 'a16 'f16 + 'd16 'f16 'd16 | + % 34 + g16 b16 d'16 f'16 d'16 b16 d'16 b16 g16 b16 d16 f16 + < { e16 } > < { f16 } > < { e16 } > < > < > d16 | + % 35 + < { c'1 } { g1 } { e1 } > } % track1 -% jcn: substituted some "2" \durations to "4." -track2 = \music { - % \midi copyright: +track2 = \melodic{ + % midi copyright: % instrument: - { \music{ e4. } } { \music{ e4. } } { \music{ d4. } - } { \music{ d4. } } { \music{ d4. } } { \music{ d4. - } } { \music{ e4. } } { \music{ e4. } } { \music{ - e4. } } { \music{ e4. } } { \music{ d4. } } { - \music{ d4. } } { \music{ d4. } } { \music{ d4. } } - { \music{ c4. } } { \music{ c4. } } { \music{ c4. } - } { \music{ c4. } } { \music{ 'a4. } } { \music{ - 'a4. } } { \music{ 'b4. } } { \music{ 'b4. } } { - \music{ 'ais4. } } { \music{ 'ais4. } } { \music{ - 'a4. } } { \music{ 'a4. } } { \music{ 'gis4. } } { - \music{ 'gis4. } } { \music{ 'g4. } } { \music{ - 'g4. } } { \music{ 'f4. } } { \music{ 'f4. } } { - \music{ 'f4. } } { \music{ 'f4. } } { \music{ 'd4. } - } { \music{ 'd4. } } { \music{ 'e4. } } { \music{ - 'e4. } } { \music{ 'g4. } } { \music{ 'c4. } } { } { - } { \music{ 'g4. } } { } { \music{ ''f4. } } { - \music{ 'f4. } } { \music{ ''f4. } } { \music{ 'f4. } - } { \music{ fi''s4. } } { \music{ fi''s4. } \music{ - 'c4. } } { } { \music{ 'c4. } } { \music{ gi''s4. } } - { \music{ gi''s4. } \music{ 'f4. } } { } { \music{ - 'f4. } } { \music{ ''g4. } } { \music{ ''g4. } \music{ - 'f4. } } { } { \music{ 'f4. } } { \music{ ''g4. } } - { \music{ ''g4. } \music{ 'e4. } } { } { \music{ ''g4. - } \music{ 'e4. } } { } { \music{ ''g4. } \music{ - 'd4. } } { } { \music{ ''g4. } \music{ 'd4. } } { } { - \music{ 'd4. } } { \music{ ''g4. } } { \music{ ''g4. } - \music{ 'd4. } } { } { \music{ 'dis4. } } { \music{ - ''g4. } } { \music{ 'dis4. } } { \music{ ''g4. } } { - \music{ 'e4. } } { \music{ ''g4. } } { \music{ 'e4. } - } { \music{ ''g4. } } { \music{ 'd4. } } { \music{ - ''g4. } } { \music{ 'd4. } } { \music{ ''g4. } } { - \music{ 'd4. } } { \music{ ''g4. } } { \music{ 'd4. } - } { \music{ ''c4. } } { \music{ 'c4. } } { \music{ - ''c4. } } { \music{ 'c4. } } { \music{ ''c1 } } { - \music{ 'c1 } } { \music{ ''c1 } \music{ ''b1 } } { - } { } { } { \music{ ''c1 } \music{ 'c1 } } -} % track4. + % 1 + e4. e4. + % 2:4*89/3840 + d4. d4. + % 3:4*3/128 + d4. d4. + % 4:4*89/3840 + e4. e4. + % 5:4*29/1280 + e4. e4. + % 6:4*29/1920 + d4. d4. + % 7:4*79/3840 + d4. d4. + % 8:4*83/3840 + c4. c4. + % 9:4*29/1280 + c4. c4. + % 10:4*5/192 + 'a4. 'a4. + % 11:4*91/3840 + 'b4. 'b4. + % 12:4*103/3840 + 'ais4. 'ais4. + % 13:4*83/3840 + 'a4. 'a4. + % 14:4*53/1920 + 'gis4. 'gis4. + % 15:4*1/40 + 'g4. 'g4. + % 16:4*91/3840 + 'f4. 'f4. + % 17:4*23/960 + 'f4. 'f4. + % 18:4*113/3840 + 'd4. 'd4. + % 19:4*91/3840 + 'e4. 'e4. + % 20:4*33/1280 + 'g4. < { 'c2 } > < { 'g4. } > ''f2 + % 21:4*11/384 + < { 'f4. } > ''f2 < { 'f4. } > ''fis2 + % 22:4*7/3840 + < { ''fis2 } { 'c2 } > < { 'c4. } > ''gis2 + % 23:4*39/1280 + < { ''gis2 } { 'f4. } > < { 'f4. } > ''g2 + % 24:4*59/1920 + < { ''g2 } { 'f4. } > < { 'f4. } > ''g2 + % 25:4*17/3840 + < { ''g2 } { 'e2 } > < { ''g2 } { 'e4. } > + % 26:4*19/640 + < { ''g2 } { 'd4. } > < { ''g2 } { 'd2 } > + % 27:4*1/1280 + < { 'd4. } > ''g2 < { ''g2 } { 'd4. } > + % 28:4*101/3840 + < { 'dis4. } > ''g2 < { 'dis4. } > ''g2 + % 29:4*17/640 + < { 'e4. } > ''g2 < { 'e4. } > ''g2 + % 30:4*3/128 + < { 'd4. } > ''g2 < { 'd4. } > ''g2 + % 31:4*101/3840 + < { 'd4. } > ''g2 < { 'd4. } > ''c2 + % 32:4*47/1920 + < { 'c4. } > ''c2 < { 'c4. } > ''c1 < { 'c1 } > + % 33:4*113/480 + < { ''c1 } { ''b1 } > < > + % 34:4*113/480 + | + % 35 + < { ''c1 } { 'c1 } > +} % track2 -score { - \staff { \melodic \music { track0 } } - \staff { \melodic \music { track1 } } - \staff { \melodic \music { track2 } } - - \co\mmands { - \meter { 4*4 } - } - \midi { +\score{ + \staff{ track0 } + \staff{ track1 } + \staff{ track2 } + + \paper{ + \unitspace 20\mm + }\midi{ \tempo 4:60 } } diff --git a/input/rhythm.ly b/input/rhythm.ly index a3f64906ae..d61b04f883 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -4,9 +4,7 @@ % add any impressive examples here, please ritme = \staff { - \melodic - - \music { + \rhythmic{ \partial {1*8} % doesnt' have to be here. \meter{ 4/4} c8 | @@ -39,26 +37,24 @@ ritme = \staff { } -another = \staff { - \melodic - \music { \meter{ 4/4} +another = \staff{ + \melodic{ \meter{ 4/4} c1 c1 c1 c4 c4 c4 c4 \meter{ 4/4} c1 c1 c1 } } -yanother = \staff { - \melodic - \music { \meter{ 4/4} +yanother = \staff{ + \melodic{ \meter{ 4/4} c1 c1 c1 c4 c4 c4 c4 c1 c1 c1 } } -\score { - \staff{ritme} - \staff { another } - \staff { yanother } +\score{ + ritme + another + yanother - \paper { + \paper{ \unitspace 2\cm \geometric 1.3 } diff --git a/input/scales.ly b/input/scales.ly index d31118d0bd..0c210cbf77 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -1,9 +1,8 @@ -blah = -\staff {\melodic\music{ \meter {6/8} +blah = \staff{\melodic{ \meter {6/8} \skip {36*8} \meter {4/4}} - \music{ + \melodic{ \duration { 8 } \octave{ } |[ a a a a a a a a a ]6/9 @@ -45,11 +44,9 @@ c1 } } -\score { - \staff { +\score{ blah - } - \paper { + \paper{ \symboltables {table_sixteen} \unitspace 1.5 \cm \geometric 1.4 diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index f53ff15fef..85c6a8e1e1 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -12,25 +12,23 @@ % (there is an accompanying LaTeX file, scsii-menuetto.tex) % +%% Stuff from MPP version % \lefttitle{Menuetto} % \tempo{Moderato} % \metron{4=120} % -% \meter{3/4} % \key\F % \key is F ( f-major ) -% \clef\alto % use alto \clef -% \duration8 % default \duration is eight' note % -% \verb{\no\barnumbers} % issue MusiXTeX \co\mmand -% \barnumbering0 % \slope{30} % Fool MusiXTeX into 30 / 10 steeper beam % \stemlength3 % shorter \stemlength % % because piece is set very tightly -%%1 % double co\mments are included in .tex file -ii_menuetto = \music { - \clef"alto"\meter{3/4} + +ii_menuetto = \melodic{ + \clef"alto" + \meter{3/4} \key {bes} - \octave{1} + \octave{c} + \duration{8} < a2 f2 d2 df > bes4-. | %%2 @@ -95,17 +93,15 @@ ii_menuetto = \music { } -\score { - \staff { - \melodic \music { $ii_menuetto } - } - \paper { +\score{ + \staff{ $ii_menuetto } + \paper{ \width 195\mm \unitspace 9\mm % to get lily to use only three lines \geometric 1.4 \output "scsii-menuetto.out" } - \midi { + \midi{ \tempo 4:120 \output "scsii-menuetto.midi" } diff --git a/input/standchen.ly b/input/standchen.ly index 0fae878df9..bd98824b16 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -13,9 +13,12 @@ % (except for grace notes) are printed % %%1 -melodie = \music { \clef\violin\octave{1} - \key{bes} - \meter{3/4}\duration{ 8 } +melodie = \melodic{ + \meter{ 3/4 } + \clef\violin + \key{ bes } + \octave{ c } + \duration{ 8 } r pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > | %%2 r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > | @@ -161,11 +164,13 @@ melodie = \music { \clef\violin\octave{1} %%58 < a2.^\fermata fis2. > | %#%\tighten - } +} -begeleiding = \music { - \key{bes}\meter{3/4} +begeleiding = \melodic{ + \meter{3/4} \clef\bass + \key{bes} + \octave{ c } \duration{2} 'd r4 | %%2 @@ -310,8 +315,8 @@ begeleiding = \music { } -tekstI = \lyrics { - \meter{3/4} +tekstI = \lyric{ + \meter{ 3/4 } \duration{4} _ _ _ _ _ _ @@ -377,7 +382,7 @@ tekstI = \lyrics { } -tekstII= \lyrics { +tekstII = \lyric{ \meter{3/4} \duration{4} _ _ _ @@ -441,24 +446,12 @@ tekstII= \lyrics { } -\score { - \staff { - lyric - \music { tekstI } - \music { tekstII } - } -% Setting up music ...lilypond: ../flower/include/cursor.inl:98: class Cursor Cursor::operator ++(int): Assertion 'pointer_' failed. -%IOT trap/Abort -% als geen music in staff - \staff { - \melodic - \music { melodie } - } - \staff { - \melodic - \music { begeleiding } - } - \paper { +\score{ + \staff{ lyric % this sux el grandioso. What about \lyricstaff, \melodicstaff etc. + tekstI tekstII } + \staff{ melodie } + \staff{ begeleiding } + \paper{ \width 195\mm % on two pages... @@ -466,7 +459,7 @@ tekstII= \lyrics { \geometric 1.2 \output "standchen.out" } - \midi { + \midi{ \tempo 4:54 } } diff --git a/input/twinkle.ly b/input/twinkle.ly index 6a2bf0dd9d..8bcad352ec 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -4,7 +4,7 @@ % % Copyright: none -melodie = \music { +melody = \melodic{ \clef\violin c4 c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 | % :| @@ -15,12 +15,11 @@ melodie = \music { c c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 % :| \bar ":|" - } -begeleiding = \music { +accompany = \melodic{ \clef \bass - \octave{-1} + \octave{'c} c c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 | @@ -30,14 +29,15 @@ begeleiding = \music { c c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 \bar ":|" - } -globalmusic=\music{ + +global = \melodic{ \meter {2 / 4} \skip {24*2} % \bar "||" } -tekst = \lyrics { + +tekst = \lyric{ Al- tijd is Kort- jak- je ziek,2 midden in_de week maar s'_zon- dags niet.2 s'_Zon- dags gaat ze naar de kerk,2 @@ -46,7 +46,7 @@ tekst = \lyrics { midden in_de week maar s'_zon- dags niet.2 } -hegedraagjetekst = \lyrics { +hegedraagjetekst = \lyric{ Al- tijd zuigt Bill Gates mijn piek,2 "\TeX" is slecht- ser dan mu- ziek.2 s'_Zon- dags gaat het door een raam,2 @@ -55,7 +55,7 @@ hegedraagjetekst = \lyrics { "\TeX" is slecht- ser dan mu- ziek.2 } -texte = \lyrics { +texte = \lyric{ \textstyle "italic" Ah! vous dir- ai_- je ma man2 @@ -67,7 +67,7 @@ texte = \lyrics { } -textI = \lyrics { +texti = \lyric{ \textstyle "roman" Twin- kle, twin- kle, lit- tle star,2 @@ -78,7 +78,7 @@ textI = \lyrics { How I won- der what you are!2 } -textII = \lyrics { +textii = \lyric{ \textstyle "roman" When the bla- zing sun is gone,2 When he no- thing shines up- on,2 @@ -89,7 +89,7 @@ textII = \lyrics { } -textIII = \lyrics{ +textiii = \lyric{ \textstyle "roman" Then the tra- veler in the dark2 @@ -101,59 +101,16 @@ textIII = \lyrics{ } -mstaf = \staff { - \melodic - \music { melodie } - \music { globalmusic } -} - -bassstaf = \staff { - \melodic - \music { begeleiding } - \music { globalmusic } -} - - -dutchstaf = \staff { - lyric - \music { tekst } - \music {hegedraagjetekst} - \music { globalmusic } -} - -frenchstaf = \staff { - lyric - \music { texte } - \music { globalmusic } -} - -englishstaf = \staff { - lyric - \music { textI } - \music { textII } - \music { textIII } - \music { globalmusic } -} - -tstaf = \staff { - lyric - \music { tekst } - \music { texte } - \music { globalmusic } -} - - -\score { - \staff { mstaf } - \staff { dutchstaf } - \staff { frenchstaf } - \staff { englishstaf } - \staff { bassstaf } - \paper { +\score{ + \staff{ global melody } + \staff{ global tekst hegedraagjetekst } + \staff{ global texte } + \staff{ global texti textii textiii } + \staff{ accompany } + \paper{ \unitspace 2.5\cm } - - \midi { + \midi{ \tempo 4:120 } } diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 9e3389a370..24888841b7 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -4,15 +4,17 @@ % % Public Domain -- typed by by HWN % -global=\music{\meter {4/4} - \grouping {2*2} - \key {bes es as} + global = \melodic{ + \meter{ 4/4 } + \grouping{ 2*2 } + \key{ bes es as } + } + + dux = \melodic{ + \clef\violin + \octave{ c } + \duration{ \last } -} - -dux = \music { - \clef \violin\octave{1} - \duration { \last } \stem{-1} r8-"dux" [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] | @@ -25,8 +27,9 @@ dux = \music { r8 [as g f] [g f16 es] [f8 d] | } -comes = \music { - \octave {2}\stem{1} +comes = \melodic{ + \octave{ c' } + \stem{1} r1 | r1 | r8-"comes" [g16 fis] [g8 c] [es g16 f] [g8 a]| @@ -38,9 +41,9 @@ comes = \music { } -bassdux = \music { +bassdux = \melodic{ \clef \bass - \octave {1} + \octave{ c } r1 | r | r | @@ -51,23 +54,14 @@ bassdux = \music { [G c16 B] [c8 d] [F16 G] As4 [G16 F] | } -trebstaf = \staff { \melodic - % every "\music {} " in a \staff has its own "\voicegroup" - \music { dux } - \music { comes } - \music{global} - } +% every "melody" declared in a staff has its own "voicegroup" +trebstaf = \staff{ global dux comes } -basstaf = \staff { \melodic - \music { bassdux } - \music{global} -} -\score { - \staff { trebstaf } - \staff { basstaf } - - \paper {} - \midi { +\score{ + trebstaf + \staff{ bassdux global } + \paper{} + \midi{ \tempo 4:90 } } diff --git a/lib/duration-convert.cc b/lib/duration-convert.cc index bb4d4fe400..80141d17d5 100644 --- a/lib/duration-convert.cc +++ b/lib/duration-convert.cc @@ -10,7 +10,8 @@ #include "debug.hh" // statics Duration_convert -bool Duration_convert::be_blonde_b_s = false; +bool const Duration_convert::midi_as_plet_b_s = true; +bool Duration_convert::no_quantify_b_s = false; bool Duration_convert::no_double_dots_b_s = false; bool Duration_convert::no_triplets_b_s = false; int Duration_convert::no_smaller_than_i_s = 0; @@ -80,9 +81,36 @@ Duration_convert::i2_mom( int time_i, int division_1_i ) } #endif -#if 0 Duration Duration_convert::mom2_dur( Moment mom ) +{ + /* this is cute, + but filling an array using Duration_iterator + might speed things up, a little + */ + Duration_iterator iter_dur; + assert( iter_dur ); + while ( iter_dur ) { + Duration dur = iter_dur++; + if ( mom == dur2_mom( dur ) ) + return dur; + } + if ( midi_as_plet_b_s ) { + Moment mom_4 = mom / Moment( 4 ); + long num = mom_4.numerator().as_long(); + long den = mom_4.denominator().as_long(); + Duration dur( 4, 0 ); + dur.set_plet( num, den ); + return dur; + } + assert( 0 ); + // no can do + Duration dur( 0 ); + return dur; +} + +Duration +Duration_convert::mom2standardised_dur( Moment mom ) { /* this is cute, but filling an array using Duration_iterator @@ -91,28 +119,20 @@ Duration_convert::mom2_dur( Moment mom ) Duration_iterator iter_dur; assert( iter_dur ); while ( iter_dur ) { - Duration lower_dur = iter_dur++; - Duration upper_dur( 0 ); - if ( iter_dur ) - upper_dur = iter_dur(); - Moment lower_mom = dur2_mom( lower_dur ); - Moment upper_mom = dur2_mom( upper_dur ); - if ( mom == lower_mom ) + Duration lower_dur = iter_dur++; + Duration upper_dur( 0 ); + if ( iter_dur ) + upper_dur = iter_dur(); + Moment lower_mom = dur2_mom( lower_dur ); + Moment upper_mom = dur2_mom( upper_dur ); + if ( mom < lower_mom ) return lower_dur; - if ( mom == upper_mom ) // don-t miss last (sic) - return upper_dur; - if ( ( mom >= lower_mom ) && ( mom <= upper_mom ) ) { - warning( String( "duration not exact: " ) + String( (Real)mom ) , 0 ); - if ( abs( mom - lower_mom ) < abs( mom - upper_mom ) ) - return lower_dur; - else - return upper_dur; - } - lower_dur = upper_dur; + if ( mom == lower_mom ) + return lower_dur; } - return Duration( 0 ); + return iter_dur(); } -#endif + Moment Duration_convert::plet_factor_mom( Duration dur ) @@ -133,6 +153,7 @@ Duration_convert::ticks2_dur( int ticks_i ) but filling an array using Duration_iterator might speed things up, a little */ + // should use mom2_dur Moment mom( ticks_i, Duration::division_1_i_s ); Duration_iterator iter_dur; assert( iter_dur ); @@ -141,6 +162,11 @@ Duration_convert::ticks2_dur( int ticks_i ) if ( mom == dur2_mom( dur ) ) return dur; } + if ( midi_as_plet_b_s ) { + Duration dur( 4, 0 ); + dur.set_plet( ticks_i, Duration::division_1_i_s / 4 ); + return dur; + } Duration dur( 0 ); dur.set_ticks( ticks_i ); return dur; @@ -153,6 +179,7 @@ Duration_convert::ticks2standardised_dur( int ticks_i ) but filling an array using Duration_iterator might speed things up, a little */ + // should use mom2standardised_dur Moment mom( ticks_i, Duration::division_1_i_s ); Duration_iterator iter_dur; assert( iter_dur ); @@ -187,7 +214,7 @@ Duration_iterator::Duration_iterator() cursor_dur_.type_i_ = 128; if ( Duration_convert::no_smaller_than_i_s ) cursor_dur_.type_i_ = Duration_convert::no_smaller_than_i_s; - cursor_dur_.set_plet( 0,1 ); // ugh? +// cursor_dur_.set_plet( 1, 1 ); } Duration @@ -240,13 +267,13 @@ Duration_iterator::forward_dur() assert( !cursor_dur_.plet_b() ); cursor_dur_.dots_i_ = 0; cursor_dur_.type_i_ /= 4; - cursor_dur_.set_plet( 2, 3 ); + cursor_dur_.set_plet( 2, 3 ); } else if ( cursor_dur_.plet_b() && ( cursor_dur_.plet_.iso_i_ == 2 ) && ( cursor_dur_.plet_.type_i_ == 3 ) ) { assert( !cursor_dur_.dots_i_ ); - cursor_dur_.set_plet( 0,1 ); + cursor_dur_.set_plet( 1, 1 ); cursor_dur_.type_i_ *= 2; cursor_dur_.dots_i_ = 1; } diff --git a/lib/duration.cc b/lib/duration.cc index e341d75831..48e07059a1 100644 --- a/lib/duration.cc +++ b/lib/duration.cc @@ -29,6 +29,13 @@ Duration::Duration( int type_i, int dots_i = 0) dots_i_ = dots_i; ticks_i_ = 0; } + +Moment +Duration::length() const +{ + return Duration_convert::dur2_mom(*this); +} + void Duration::set_plet(int i, int t) { @@ -36,11 +43,6 @@ Duration::set_plet(int i, int t) plet_.type_i_ = t; } -Moment -Duration::length() const -{ - return Duration_convert::dur2_mom(*this); -} void Duration::set_ticks( int ticks_i ) { @@ -48,34 +50,40 @@ Duration::set_ticks( int ticks_i ) assert( !dots_i_ ); ticks_i_ = ticks_i; } + String Duration::str()const { return Duration_convert::dur2_str(*this); } + +Plet::Plet() +{ + type_i_ = 1; + iso_i_ = 1; +} + Plet::Plet( int iso_i, int type_i ) { iso_i_ = iso_i; type_i_ = type_i; } + Moment Plet::mom()const { return Moment( iso_i_, type_i_ ); } -Plet::Plet() +bool +Duration::plet_b() { - type_i_ = 1; - iso_i_ = 1; + return !plet_.unit_b(); } + bool Plet::unit_b()const { return type_i_ == 1 && iso_i_ == 1; } -bool -Duration::plet_b() -{ - return !plet_.unit_b(); -} + diff --git a/lib/include/duration-convert.hh b/lib/include/duration-convert.hh index 9c8b53d709..ef80462f78 100644 --- a/lib/include/duration-convert.hh +++ b/lib/include/duration-convert.hh @@ -29,7 +29,8 @@ struct Duration_convert { /* Urgh. statics. */ - static bool be_blonde_b_s; // cute, but not informative. everythiing is blonde, right? HW + static bool const midi_as_plet_b_s = true; + static bool no_quantify_b_s; static bool no_double_dots_b_s; static bool no_triplets_b_s; static int no_smaller_than_i_s; @@ -55,6 +56,12 @@ struct Duration_convert { // /// Return Moment (fraction of whole) representation, best guess. // static Duration mom2_dur( Moment mom ); + /// Return duration from Moment (fraction of whole) representation. + static Duration mom2_dur( Moment mom ); + + /// Return standardised duration, best guess if not exact. + static Duration mom2standardised_dur( Moment mom ); + /// Return plet factor (not a Moment: should use Rational?). static Moment plet_factor_mom( Duration dur ); diff --git a/lily/.version b/lily/.version index c74b79390b..5cb028566e 100644 --- a/lily/.version +++ b/lily/.version @@ -1,8 +1,7 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 44 +PATCH_LEVEL = 45 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf MY_PATCH_LEVEL = -# diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index c28443df62..93334497cf 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -23,9 +23,11 @@ Bar_register::try_request(Request*r_l) Command_req* c_l = r_l->command(); if (!c_l|| !c_l->bar()) return false; - - assert(!bar_req_l_); - bar_req_l_ = c_l->bar(); + Bar_req * b= c_l->bar(); + if (bar_req_l_ && bar_req_l_->compare(*b)) + return false; + + bar_req_l_ = b; return true; } @@ -44,6 +46,8 @@ Bar_register::process_requests() } } + + void Bar_register::split_bar(Bar *& pre, Bar * no, Bar * &post) { @@ -77,3 +81,7 @@ Bar_register::post_move_processing() bar_req_l_ = 0; bar_p_ =0; } + +IMPLEMENT_STATIC_NAME(Bar_register); + + diff --git a/lily/bar.cc b/lily/bar.cc index 8b831d206a..f0afa9b402 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -12,6 +12,8 @@ Bar::Bar( String t) type = t; } +IMPLEMENT_STATIC_NAME(Bar); + void Bar::do_print()const { diff --git a/lily/beam.cc b/lily/beam.cc index 9a07bcc614..c4d62b54d2 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -281,6 +281,8 @@ Beam::brew_molecule_p() const return out; out->translate(Offset(x0 - left->hpos,0)); } +IMPLEMENT_STATIC_NAME(Beam); + void Beam::do_print()const { diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 72328b0954..a95c54d454 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -52,3 +52,4 @@ Clef_item::brew_molecule_p()const return output; } +IMPLEMENT_STATIC_NAME(Clef_item); diff --git a/lily/clef-reg.cc b/lily/clef-reg.cc index 2492703cdf..403dabb250 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -105,3 +105,4 @@ Clef_register::post_move_processing() set_type("violin"); } } +IMPLEMENT_STATIC_NAME(Clef_register); diff --git a/lily/command-request.cc b/lily/command-request.cc index 92e7097c43..7d95dd980d 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -11,6 +11,8 @@ #include "musical-request.hh" +IMPLEMENT_STATIC_NAME(Cadenza_req); + void Cadenza_req::do_print()const { @@ -30,6 +32,8 @@ Bar_req::compare(Bar_req const &c1)const return type_str_ == c1.type_str_; } +IMPLEMENT_STATIC_NAME(Bar_req); + void Bar_req::do_print() const { @@ -46,28 +50,25 @@ Partial_measure_req::Partial_measure_req(Moment m) duration_ =m; } /* *************** */ -Meter_change_req::Meter_change_req() -{ - beats_i_ = 0; - one_beat_i_ =0; -} -void -Meter_change_req::set(int b,int o) -{ - beats_i_=b; - one_beat_i_=o; -} + +IMPLEMENT_STATIC_NAME(Timing_req); void Timing_req::do_print()const{} +IMPLEMENT_STATIC_NAME(Command_req); + void Command_req::do_print()const{} /* *************** */ +IMPLEMENT_STATIC_NAME(Barcheck_req); + void Barcheck_req::do_print() const{} /* *************** */ +IMPLEMENT_STATIC_NAME(Clef_change_req); + void Clef_change_req::do_print() const { @@ -79,6 +80,8 @@ Clef_change_req::Clef_change_req(String s) clef_str_ = s; } /* *************** */ +IMPLEMENT_STATIC_NAME(Group_feature_req); + void Group_feature_req::do_print() const { @@ -90,32 +93,61 @@ Group_feature_req::Group_feature_req() stemdir_i_ = 0; } +IMPLEMENT_STATIC_NAME(Group_change_req); + void Group_change_req::do_print()const { mtor << "id : " << newgroup_str_; } /* *************** */ +IMPLEMENT_STATIC_NAME(Terminate_voice_req); + void Terminate_voice_req::do_print()const { } /* *************** */ +IMPLEMENT_STATIC_NAME(Partial_measure_req); + void Partial_measure_req::do_print() const { mtor << duration_; } +IMPLEMENT_STATIC_NAME(Meter_change_req); + void Meter_change_req::do_print() const { - mtor << beats_i_ << "*" << one_beat_i_; + mtor << beats_i_ << "/" << one_beat_i_; +} + +int +Meter_change_req::compare(Meter_change_req const &m) +{ + return m.beats_i_ == beats_i_ && one_beat_i_ == m.one_beat_i_; +} + +Meter_change_req::Meter_change_req() +{ + beats_i_ = 0; + one_beat_i_ =0; +} + +void +Meter_change_req::set(int b,int o) +{ + beats_i_=b; + one_beat_i_=o; } /* *************** */ +IMPLEMENT_STATIC_NAME(Measure_grouping_req); + void Measure_grouping_req::do_print() const { @@ -134,6 +166,8 @@ Key_change_req::transpose(Melodic_req const & d)const } } +IMPLEMENT_STATIC_NAME(Key_change_req); + void Key_change_req::do_print() const { @@ -144,16 +178,51 @@ Key_change_req::do_print() const Key_change_req::Key_change_req() { + minor_b_ = false; } + Key_change_req::Key_change_req(Key_change_req const&c) { - for (int i=0; i < c.melodic_p_arr_.size(); i++) { - melodic_p_arr_.push( c.melodic_p_arr_[i]->clone()->melodic() ); - } + for (int i=0; i < c.melodic_p_arr_.size(); i++) + melodic_p_arr_.push( c.melodic_p_arr_[i]->clone()->melodic() ); + minor_b_ = c.minor_b_; } Key_change_req::~Key_change_req() { - for (int i=0; i < melodic_p_arr_.size(); i++) - delete melodic_p_arr_[i]; + for (int i=0; i < melodic_p_arr_.size(); i++) + delete melodic_p_arr_[i]; +} + +int +Key_change_req::flats_i() +{ + int flats_i = 0; + for ( int i = 0; i < melodic_p_arr_.size(); i++ ) { + Melodic_req* mel_l = melodic_p_arr_[i]->melodic(); + assert( mel_l ); + if ( mel_l->accidental_i_ < 0 ) + flats_i++; + } + return flats_i; +} + +int +Key_change_req::minor_b() +{ + return minor_b_; } + +int +Key_change_req::sharps_i() +{ + int sharps_i = 0; + for ( int i = 0; i < melodic_p_arr_.size(); i++ ) { + Melodic_req* mel_l = melodic_p_arr_[i]->melodic(); + assert( mel_l ); + if ( mel_l->accidental_i_ > 0 ) + sharps_i++; + } + return sharps_i; +} + diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 9b2a169631..29aa3ab841 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -34,3 +34,5 @@ Crescendo::brew_molecule_p() const return m_p ; int pos = (dir_i_ >0) ? staff_size_i_ + 4 : - 4 ; m_p->translate(Offset(0,pos * paper()->internote())); } + +IMPLEMENT_STATIC_NAME(Crescendo); diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc index 0ea23ac689..5f137035fa 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-reg.cc @@ -77,3 +77,5 @@ Dynamic_register::set_feature(Features i) { dir_i_ = i.direction_i_; } + +IMPLEMENT_STATIC_NAME(Dynamic_register); diff --git a/lily/headreg.cc b/lily/headreg.cc index 93ea9b2d08..61232d25b8 100644 --- a/lily/headreg.cc +++ b/lily/headreg.cc @@ -73,3 +73,5 @@ Notehead_register::post_move_processing() { note_req_l_ = 0; } + +IMPLEMENT_STATIC_NAME(Notehead_register); diff --git a/lily/include/class-name.hh b/lily/include/class-name.hh index 643959d620..14ebf4c927 100644 --- a/lily/include/class-name.hh +++ b/lily/include/class-name.hh @@ -10,10 +10,16 @@ #ifndef CLASS_NAME_HH #define CLASS_NAME_HH -/// a macro to declare the classes name as a static and virtual function. +/** a macro to declare the classes name as a static and virtual function. + The static_name() can *not* be inlined (this might have the effect that + s->name() != S::static_name(). Overlapping strings need not be merged in C++ + */ #define NAME_MEMBERS(c) \ -static char const *static_name(){ return #c; }\ +static char const *static_name();\ virtual char const *name() const{ return c::static_name(); } \ int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out() + +#define IMPLEMENT_STATIC_NAME(c)\ + char const *c::static_name() { return #c; } #endif // CLASS-NAME_HH diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index f32dbea2fd..488728d2d9 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -49,6 +49,7 @@ struct Partial_measure_req : Timing_req { struct Meter_change_req : Timing_req { int beats_i_, one_beat_i_; + int compare(Meter_change_req const&); Meter_change_req(); void set(int,int); REQUESTMETHODS(Meter_change_req, meterchange); @@ -99,13 +100,29 @@ struct Group_feature_req : Command_req { }; +/** + Handle key changes. + Routines for sharps and flats are separated, + so that caller may identify non-conventional keys. +*/ struct Key_change_req : Command_req { Array melodic_p_arr_; - virtual void transpose(Melodic_req const &)const; + bool minor_b_; + Key_change_req(); Key_change_req(Key_change_req const&); ~Key_change_req(); REQUESTMETHODS(Key_change_req, keychange); + + /// return number of flats in key + int flats_i(); + + /// return number of sharps in key + int sharps_i(); + + void transpose(Melodic_req const & d) const; + /// is minor key? + int minor_b(); }; struct Clef_change_req : Command_req { diff --git a/lily/include/input-music.hh b/lily/include/input-music.hh index 36ca215f67..49e41d5729 100644 --- a/lily/include/input-music.hh +++ b/lily/include/input-music.hh @@ -35,7 +35,7 @@ struct Input_music { virtual ~Input_music(){} virtual void print() const =0; virtual void set_default_group(String)=0; - virtual bool find_plet_start_bo(char c, Moment& moment_r) = 0; + virtual bool find_plet_start_b(char c, Moment& moment_r) = 0; virtual void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i) = 0; virtual void transpose(Melodic_req const&) const =0; @@ -58,7 +58,7 @@ struct Simple_music : Input_music { virtual Voice_list convert()const; virtual void translate_time(Moment dt); virtual void print() const; - virtual bool find_plet_start_bo(char c, Moment& moment_r); + virtual bool find_plet_start_b(char c, Moment& moment_r); virtual void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i); virtual Input_music *clone() const { return new Simple_music(*this); @@ -76,7 +76,7 @@ struct Complex_music : Input_music { Complex_music(Complex_music const &); virtual void print() const ; void concatenate(Complex_music*); - virtual bool find_plet_start_bo(char c, Moment& moment_r); + virtual bool find_plet_start_b(char c, Moment& moment_r); virtual void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i); }; diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 48d6c62a19..2a2dd92afc 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -20,12 +20,11 @@ \end{itemize} */ -struct PCol { +class PCol { +public: PointerList its; PointerList stoppers, starters; - - /** prebreak is put before end of line. if broken here, then (*this) column is discarded, and prebreak is put at end of line, owned by Col @@ -42,8 +41,10 @@ struct PCol { /// if lines are broken then this column is in #line# Line_of_score const *line_l_; - /// if lines are broken then this column x-coord #hpos# - Real hpos; + /** if lines are broken then this column x-coord #hpos# if not + known, then hpos == -1.(ugh?) */ + + Real hpos; // should use ptr? PScore * pscore_l_; @@ -68,13 +69,20 @@ struct PCol { signed compare on columns. @return < 0 if c1 < c2. - */static int compare(const PCol &c1, const PCol &c2); - + */ + static int compare(const PCol &c1, const PCol &c2); + void set_rank(int); void OK() const; void set_breakable(); void print()const; private: + + /** + The ranking: left is smaller than right + -1 is uninitialised. + */ + int rank_i_; PCol(PCol const&){} }; diff --git a/lily/include/registergroup.hh b/lily/include/register-group.hh similarity index 96% rename from lily/include/registergroup.hh rename to lily/include/register-group.hh index 6d6e76a15b..278d150753 100644 --- a/lily/include/registergroup.hh +++ b/lily/include/register-group.hh @@ -33,6 +33,8 @@ public: */ virtual void terminate_register(Request_register * reg_l); + NAME_MEMBERS(Register_group_register); + /** Remove #reg_l# from the list, and return it. */ diff --git a/lily/include/register.hh b/lily/include/register.hh index da80db38fe..808b28d05c 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -90,6 +90,7 @@ protected: */ virtual Staff_info get_staff_info(); + virtual void do_print()const; public: /** Every Request_register (except for the 'top' which is directly diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 67ca259f54..90e5f518a3 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -8,6 +8,8 @@ #define REST_HH #include "item.hh" +/** typeset a Rest. A "vanilla" item. + */ struct Rest : Item { int dots; diff --git a/lily/include/score.hh b/lily/include/score.hh index 293801a98e..cf86ad342a 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -71,7 +71,7 @@ private: void paper(); // utils: - PCursor create_cols(Moment); + PCursor create_cols(Moment, PCursor &last); Score(Score const&){} diff --git a/lily/include/staff-elem-info.hh b/lily/include/staff-elem-info.hh index 2dcbc845a9..2d58add6fb 100644 --- a/lily/include/staff-elem-info.hh +++ b/lily/include/staff-elem-info.hh @@ -25,9 +25,12 @@ struct Staff_elem_info { Staff_elem_info(); }; +/// struct to pass staff info along a Request_register hierarchy. struct Staff_info { int *c0_position_i_; Staff_walker *walk_l_; + + /// when is now? Time_description const *time_C_; Rhythmic_grouping const *rhythmic_C_; bool break_allowed_b_; diff --git a/lily/include/voice-element.hh b/lily/include/voice-element.hh index 0b606f1301..aa72fb8122 100644 --- a/lily/include/voice-element.hh +++ b/lily/include/voice-element.hh @@ -17,7 +17,10 @@ /** one horizontal bit. Voice_element is nothing but a container for *the requests, */ struct Voice_element { - Moment duration; + /** the duration of the element. This can be 0; The duration is + determined from rhythmical requests contained in this + Voice_element */ + Moment duration_; char const* defined_ch_C_; Voice const *voice_l_; IPointerList reqs; @@ -28,7 +31,7 @@ struct Voice_element { Voice_element(Voice_element const & src ); void add(Request*); - bool find_plet_start_bo(char c, Moment& moment_r); + bool find_plet_start_b(char c, Moment& moment_r); void print ()const; void set_default_group(String id); void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i); diff --git a/lily/include/voice-group-regs.hh b/lily/include/voice-group-regs.hh index 7c1b4ed78a..5f17d8fa8b 100644 --- a/lily/include/voice-group-regs.hh +++ b/lily/include/voice-group-regs.hh @@ -10,11 +10,12 @@ #ifndef VOICEGROUPREGS_HH #define VOICEGROUPREGS_HH -#include "registergroup.hh" +#include "register-group.hh" struct Voice_group_registers : Register_group_register { String group_id_str_; Array voice_regs_l_; + Moment termination_mom_; /* *************** */ @@ -22,6 +23,7 @@ struct Voice_group_registers : Register_group_register { static bool static_acceptable_request_b(Request*); virtual void terminate_register(Request_register*); virtual void do_print() const; + virtual void post_move_processing(); virtual void add(Request_register*); Voice_group_registers(String id); virtual bool try_request(Request*); diff --git a/lily/include/voice-regs.hh b/lily/include/voice-regs.hh index 82070a704e..70735ff10f 100644 --- a/lily/include/voice-regs.hh +++ b/lily/include/voice-regs.hh @@ -10,11 +10,10 @@ #ifndef VOICEREGS_HH #define VOICEREGS_HH -#include "registergroup.hh" +#include "register-group.hh" class Voice_registers : public Register_group_register { - public: Voice *voice_l_; /* *************** */ diff --git a/lily/include/voice.hh b/lily/include/voice.hh index 4e7e615693..f5a950a2c9 100644 --- a/lily/include/voice.hh +++ b/lily/include/voice.hh @@ -15,6 +15,9 @@ */ struct Voice { + /** the elements, earliest first. + Please use the member #add()# to add a new element + */ IPointerList elts; Moment start; @@ -26,7 +29,7 @@ struct Voice { Moment last() const; void transpose(Melodic_req const &)const; void add(Voice_element*); - bool find_plet_start_bo(char c, Moment& moment_r); + bool find_plet_start_b(char c, Moment& moment_r); void print() const; void set_default_group(String id); void set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i); diff --git a/lily/include/walk-regs.hh b/lily/include/walk-regs.hh index 643ce57605..daa4690932 100644 --- a/lily/include/walk-regs.hh +++ b/lily/include/walk-regs.hh @@ -11,7 +11,7 @@ #define WALKREGS_HH -#include "registergroup.hh" +#include "register-group.hh" /** Top level registers: the interface to Complex_walker. diff --git a/lily/input-music.cc b/lily/input-music.cc index 26377e7f53..e407c87dd5 100644 --- a/lily/input-music.cc +++ b/lily/input-music.cc @@ -2,6 +2,7 @@ #include "input-music.hh" #include "voice.hh" #include "musical-request.hh" +#include "command-request.hh" #include "voice-element.hh" void @@ -10,7 +11,7 @@ Input_music::check_plet(Voice_element* velt_l) for (iter_top(velt_l->reqs,i); i.ok(); i++) if ( i->plet() ) { Moment start_moment = 0; - if ( !find_plet_start_bo( i->plet()->type_c_, start_moment ) ) { + if ( !find_plet_start_b( i->plet()->type_c_, start_moment ) ) { error( "begin of plet not found", i->defined_ch_C_ ); break; } @@ -48,7 +49,15 @@ Voice_list Simple_music::convert()const { Voice_list l; - l.bottom().add(new Voice(voice_)); + Voice * v_p = new Voice(voice_); + PCursor i= v_p->elts.bottom(); + // need-to-have, otherwise memory will be filled up with regs. + if (!i.ok() || i->duration_) { + v_p->add ( new Voice_element); + i=v_p->elts.bottom(); + } + i->add(new Terminate_voice_req); + l.bottom().add(v_p); return l; } @@ -56,17 +65,20 @@ Simple_music::convert()const void Simple_music::print() const { +#ifndef NPRINT mtor << "Simple_music {"; voice_.print(); mtor << "}\n"; +#endif } bool -Simple_music::find_plet_start_bo(char c, Moment& moment_r) +Simple_music::find_plet_start_b(char c, Moment& moment_r) { - return voice_.find_plet_start_bo(c, moment_r); + return voice_.find_plet_start_b(c, moment_r); } void -Simple_music::set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i) +Simple_music::set_plet_backwards(Moment& now_moment_r, Moment until_moment, + int num_i, int den_i) { voice_.set_plet_backwards(now_moment_r, until_moment, num_i, den_i); } @@ -115,10 +127,10 @@ Complex_music::set_default_group(String g) i->set_default_group(g); } bool -Complex_music::find_plet_start_bo(char c, Moment& moment_r) +Complex_music::find_plet_start_b(char c, Moment& moment_r) { for (iter_bot(elts,i); i.ok(); i--) { - if ( i->find_plet_start_bo(c, moment_r) ) + if ( i->find_plet_start_b(c, moment_r) ) return true; } return false; diff --git a/lily/item.cc b/lily/item.cc index e653c46ac6..f9adbba73c 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -8,6 +8,8 @@ Item::Item() pcol_l_ = 0; } +IMPLEMENT_STATIC_NAME(Item); + void Item::do_print() const { diff --git a/lily/key-item.cc b/lily/key-item.cc index 726af8cb30..7cc9fcbfa9 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -68,3 +68,4 @@ Key_item::brew_molecule_p()const output->add_right(m); return output; } +IMPLEMENT_STATIC_NAME(Key_item); diff --git a/lily/key-reg.cc b/lily/key-reg.cc index 8b8b2373b3..83fb84c0cd 100644 --- a/lily/key-reg.cc +++ b/lily/key-reg.cc @@ -97,3 +97,4 @@ Key_register::post_move_processing() default_key_b_ = false; kit_p_ = 0; } +IMPLEMENT_STATIC_NAME(Key_register); diff --git a/lily/lexer.l b/lily/lexer.l index 21ce7aa06b..560b49da11 100644 --- a/lily/lexer.l +++ b/lily/lexer.l @@ -86,7 +86,7 @@ include { mtor << "rest:"<< yylval.string; return RESTNAME; } -\$\\{BLACK}*{WHITE} { +\\\${BLACK}*{WHITE} { String s=YYText() + 2; s=s.left_str(s.length_i() - 1); return scan_escaped_word(s); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index ff0814f216..6a658b64c2 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -91,3 +91,4 @@ Local_acc::compare(Local_acc&a, Local_acc&b) assert(false); }; +IMPLEMENT_STATIC_NAME(Local_key_item); diff --git a/lily/local-key-reg.cc b/lily/local-key-reg.cc index 0ce36e955c..ea7e66b7d7 100644 --- a/lily/local-key-reg.cc +++ b/lily/local-key-reg.cc @@ -67,3 +67,4 @@ Local_key_register::process_requests() warning ("Help me! can't figure current key", 0); } } +IMPLEMENT_STATIC_NAME(Local_key_register); diff --git a/lily/main.cc b/lily/main.cc index 85a6bd923b..dd38e5cad5 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -38,16 +38,20 @@ Long_option_init theopts[] = { }; void -help() +usage() { cout << - "--help, -h This help\n" - "--warranty, -w show warranty & copyright\n" - "--output, -o set default output\n" - "--debug, -d enable debug output\n" - "--init, -i set init file\n" - "--include, -I add to file search path.\n" - "--midi, -M midi output only\n" + "Usage: lilypond [options] [mudela-file]\n" + "Typeset and or produce midi output from mudela-file or stdin\n" + "\n" + "Options:\n" + " -d, --debug enable debugging output\n" + " -I, --include=DIR add DIR to search path\n" + " -i, --init=FILE use FILE as init file\n" + " -h, --help this help\n" + " -w, --warranty show warranty and copyright\n" + " -o, --output=FILE set FILE as default output\n" + " -M, --midi produce midi output only\n" "\n" "LilyPond was compiled with the following settings:\n" #ifdef NDEBUG @@ -139,7 +143,7 @@ main (int argc, char **argv) init_str = oparser.optarg; break; case 'h': - help(); + usage(); exit(0); break; case 'd': diff --git a/lily/meter-reg.cc b/lily/meter-reg.cc index f15e5ddb09..3c500e6042 100644 --- a/lily/meter-reg.cc +++ b/lily/meter-reg.cc @@ -11,7 +11,6 @@ #include "command-request.hh" Meter_register::Meter_register() - { post_move_processing(); } @@ -22,10 +21,11 @@ Meter_register::try_request(Request*r_l) Command_req* creq_l= r_l->command(); if (!creq_l || !creq_l->meterchange()) return false; - - assert(!meter_req_l_); - meter_req_l_ = r_l->command()->meterchange(); - + Meter_change_req *m = creq_l->meterchange(); + if (meter_req_l_ && meter_req_l_->compare(*m)) + return false; + + meter_req_l_ = m; return true; } @@ -62,3 +62,4 @@ Meter_register::post_move_processing() meter_req_l_ = 0; meter_p_ =0; } +IMPLEMENT_STATIC_NAME(Meter_register); diff --git a/lily/meter.cc b/lily/meter.cc index c16d5d3d3f..4e45b61185 100644 --- a/lily/meter.cc +++ b/lily/meter.cc @@ -16,3 +16,4 @@ Meter::brew_molecule_p()const return new Molecule(Atom(s)); } +IMPLEMENT_STATIC_NAME(Meter); diff --git a/lily/midi-output.cc b/lily/midi-output.cc index 73d0260c2b..5992cf9505 100644 --- a/lily/midi-output.cc +++ b/lily/midi-output.cc @@ -55,20 +55,9 @@ Midi_output::do_staff(Staff*st_l,int track_i) Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, "piano" ); midi_track.add( Moment( 0 ), &instrument_name ); - // set key, help, where to get key, where to get major/minor? - int accidentals_i = 0; - int minor_i = 0; - - - Midi_key midi_key( accidentals_i, minor_i ); - midi_track.add( Moment( 0 ), &midi_key ); - Midi_tempo midi_tempo( midi_l_->get_tempo_i( Moment( 1, 4 ) ) ); midi_track.add( Moment( 0 ), &midi_tempo ); - Midi_time midi_time( Midi_def::num_i_s, Midi_def::den_i_s, 18 ); - midi_track.add( Moment( 0 ), &midi_time ); - for (Midi_walker w (st_l, &midi_track); w.ok(); w++) w.process_requests(); @@ -106,6 +95,12 @@ Midi_output::header() // set track name Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( 0, 0, '0' ) ); midi_track.add( Moment( 0 ), &track_name ); + + // ugh, to please lily when reparsing mi2mu output. + // lily currently barfs when no meter present. + Midi_time midi_time( 4, 4, 18 ); + midi_track.add( Moment( 0.0 ), &midi_time ); + *midi_stream_l_ << midi_track; } diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 88cd6b724d..ef1ea8382a 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -6,6 +6,7 @@ (c) 1997 Han-Wen Nienhuys , Jan Nieuwenhuizen */ +#include "command-request.hh" #include "musical-request.hh" #include "p-score.hh" #include "staff.hh" @@ -76,6 +77,22 @@ void Midi_walker::process_requests() { do_stop_notes(ptr()->when()); + + for ( int i = 0; i < ptr()->commandreq_l_arr_.size(); i++ ) { + Command_req *c_l = ptr()->commandreq_l_arr_[i]->command(); + Meter_change_req* meter_l = c_l->meterchange(); + if ( meter_l ) + output_event( Midi_time( meter_l->beats_i_, meter_l->one_beat_i_, 18 ), 0 ); + Key_change_req* key_l = c_l->keychange(); + if ( key_l ) { + int sharps_i = key_l->sharps_i(); + int flats_i = key_l->flats_i(); + // midi cannot handle non-conventional keys + if ( !( flats_i && sharps_i ) ) + output_event( Midi_key( sharps_i - flats_i, key_l->minor_b() ), 0 ); + } + } + for ( int i = 0; i < ptr()->musicalreq_l_arr_.size(); i++ ) { Rhythmic_req *n = ptr()->musicalreq_l_arr_[i]->rhythmic(); diff --git a/lily/musical-request.cc b/lily/musical-request.cc index e90be35ba3..c7a848a18f 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -14,6 +14,7 @@ #include "voice.hh" #include "voice-element.hh" +IMPLEMENT_STATIC_NAME(Stem_req); void Stem_req::do_print() const { @@ -29,7 +30,12 @@ Stem_req::Stem_req() } /* ************** */ -void Musical_req::do_print()const{} +IMPLEMENT_STATIC_NAME(Musical_req); +void +Musical_req::do_print()const{} + +IMPLEMENT_STATIC_NAME(Request); + void Request::do_print() const{} /* *************** */ @@ -46,6 +52,8 @@ Request::print() const +IMPLEMENT_STATIC_NAME(Span_req); + void Span_req::do_print() const { @@ -71,6 +79,8 @@ Spacing_req::Spacing_req() distance = 0; strength = 0; } +IMPLEMENT_STATIC_NAME(Spacing_req); + void Spacing_req::do_print()const { @@ -79,6 +89,8 @@ Spacing_req::do_print()const #endif } +IMPLEMENT_STATIC_NAME(Blank_req); + void Blank_req::do_print()const { @@ -108,6 +120,8 @@ Melodic_req::transpose(Melodic_req const & delta) } } +IMPLEMENT_STATIC_NAME(Melodic_req); + void Melodic_req::do_print() const { @@ -140,6 +154,8 @@ Plet_req::Plet_req() type_i_ = 1; } +IMPLEMENT_STATIC_NAME(Plet_req); + void Plet_req::do_print() const { @@ -165,11 +181,13 @@ Rhythmic_req::Rhythmic_req() { } +IMPLEMENT_STATIC_NAME(Rhythmic_req); + void Rhythmic_req::do_print() const { #ifndef NPRINT - mtor << duration_.str(); + mtor << "duration { " <duration_ = *duration_p; - lreq_p->print(); - lreq_p->defined_ch_C_ = here_ch_C(); + lreq_p->defined_ch_C_ = here_ch_C(); velt_p->add(lreq_p); @@ -126,8 +125,7 @@ My_lily_parser::get_rest_element(String, Duration * duration_p ) Rest_req * rest_req_p = new Rest_req; rest_req_p->duration_ = *duration_p; - rest_req_p->print(); - rest_req_p->defined_ch_C_ = here_ch_C(); + rest_req_p->defined_ch_C_ = here_ch_C(); velt_p->add(rest_req_p); delete duration_p; @@ -210,7 +208,7 @@ My_lily_parser::My_lily_parser(Sources * source_l) source_l_ = source_l; lexer_p_ = 0; default_duration_.type_i_ = 4; - default_octave_i_=0; + default_octave_i_ = 3; // retain old default textstyle_str_="roman"; // in lexer? error_level_i_ = 0; last_duration_mode = false; diff --git a/lily/notehead.cc b/lily/notehead.cc index b1f660ef17..528460f6f1 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -26,6 +26,8 @@ Notehead::set_rhythmic(Rhythmic_req*r_req_l) dots = r_req_l->duration_.dots_i_; } +IMPLEMENT_STATIC_NAME(Notehead); + void Notehead::do_print()const { diff --git a/lily/p-col.cc b/lily/p-col.cc index caaf264766..3ace8fba82 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -18,6 +18,7 @@ PCol::width() const int PCol::rank() const { +#if 0 if(!pscore_l_) return -1; PCursor me=pscore_l_->find_col( (PCol*)this); @@ -25,6 +26,19 @@ PCol::rank() const return -1; PCursor bot(pscore_l_->cols.top()); return me - bot; +#endif + assert(rank_i_ != -1); + return rank_i_; +} + +void +PCol::set_rank(int i) +{ + rank_i_ = i; + if (prebreak_p_) + prebreak_p_->rank_i_ = i; + if (postbreak_p_) + postbreak_p_->rank_i_ = i; } void @@ -34,7 +48,7 @@ PCol::print() const mtor << "PCol {"; if (rank() >= 0) - mtor << "rank: " << rank() << '\n'; + mtor << "rank: " << rank_i_ << '\n'; mtor << "# symbols: " << its.size() ; if (breakable_b()){ @@ -54,11 +68,7 @@ PCol::print() const int PCol::compare(PCol const &c1, PCol const &c2) { - PScore*ps_l = c1.pscore_l_; - PCursor ac(ps_l->find_col(&c1)); - PCursor bc(ps_l->find_col(&c2)); - assert(ac.ok() && bc.ok()); - return ac - bc; + return c1.rank() - c2.rank(); } void diff --git a/lily/p-score.cc b/lily/p-score.cc index 9e31523da1..800d3287cf 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -26,11 +26,15 @@ PScore::get_spacing(PCol*l, PCol*r) void PScore::clean_cols() { + int rank_i = 0; for (iter_top(cols,c); c.ok(); ) if (!c->used_b()) { delete c.remove_p(); - } else + } else { + c->set_rank(rank_i++); c++; + } + } @@ -248,6 +252,7 @@ void PScore::process() { clean_cols(); + *mlog << "Preprocessing ... " < defined_ch_C_ = THIS->define_spot_array_.pop(); } + | { THIS->remember_spot(); } +/*cont*/ STAFF_IDENTIFIER { + $$ = $2->staff(true); + $$-> defined_ch_C_ = THIS->define_spot_array_.pop(); + } ; staff_init: - STAFF_IDENTIFIER { $$ = $1->staff(true); } + /* empty */ { + $$ = new Input_staff( "melodic" ); + } | STRING { $$ = new Input_staff(*$1); delete $1; } - | MELODIC { - $$ = new Input_staff("melodic"); - } ; staff_body: staff_init | staff_body init_music { + $$ = $1; $2->set_default_group( "staff_music" + String($$->music_.size())); $$->add($2); } @@ -410,22 +416,25 @@ init_music: init_music_voice { $$ = $1; } | init_music_chord { $$ = $1; } | init_lyrics_voice { $$ = $1; } + | VOICE_IDENTIFIER { + $$ = $1->mvoice(true); + } ; init_lyrics_voice: - LYRICS { THIS->lexer_p_->push_lyric_state(); } + LYRIC { THIS->lexer_p_->push_lyric_state(); } music_voice { $$ = $3; THIS->lexer_p_->pop_state(); } ; init_music_voice: - MUSIC { THIS->lexer_p_->push_note_state(); } + MELODIC { THIS->lexer_p_->push_note_state(); } /* cont*/ music_voice { $$=$3; THIS->lexer_p_->pop_state(); } ; init_music_chord: - MUSIC { THIS->lexer_p_->push_note_state(); } + { THIS->lexer_p_->push_note_state(); } /* cont*/ music_chord - { $$=$3; THIS->lexer_p_->pop_state(); } + { $$=$2; THIS->lexer_p_->pop_state(); } ; /* MUSIC @@ -470,7 +479,8 @@ music_voice_body: | music_voice_body '>' { THIS->fatal_error_i_ = 1; THIS->parser_error("Confused by errors: bailing out"); - }; + } + ; music_chord: '<' music_chord_body '>' { $$ = $2; } ; @@ -638,7 +648,7 @@ steno_note_req: ; melodic_request: - MELODIC '{' int int int '}' {/* ugh */ + MELODIC_REQUEST '{' int int int '}' {/* ugh */ $$ = new Melodic_req; $$->octave_i_ = $3; $$->notename_i_ = $4; @@ -764,8 +774,10 @@ voice_command: THIS->default_duration_ = *$3; delete $3; } - | OCTAVECOMMAND '{' int '}' { - THIS->default_octave_i_ = $3; + | OCTAVECOMMAND { THIS->default_octave_i_ = 2; } +/* cont */ + '{' steno_melodic_req '}' { + THIS->default_octave_i_ = $4->octave_i_; } | TEXTSTYLE STRING { THIS->textstyle_str_ = *$2; diff --git a/lily/qlpsolve.cc b/lily/qlpsolve.cc index ebf71b7242..8083200bcb 100644 --- a/lily/qlpsolve.cc +++ b/lily/qlpsolve.cc @@ -25,7 +25,7 @@ Active_constraints::status() const void Active_constraints::OK() { - #ifndef NDEBUG +#ifndef NDEBUG H.OK(); A.OK(); assert(active.size() +inactive.size() == opt->cons.size()); @@ -113,10 +113,10 @@ Active_constraints::drop(int k) A -= A*opt->quad*Matrix(a,a/q); }else WARN << "degenerate constraints"; - #ifndef NDEBUG +#ifndef NDEBUG Vector rem_row(A.row(q)); assert(rem_row.norm() < EPS); - #endif +#endif A.delete_row(q); } diff --git a/lily/registergroup.cc b/lily/register-group.cc similarity index 83% rename from lily/registergroup.cc rename to lily/register-group.cc index a94f14560a..0725d6c16b 100644 --- a/lily/registergroup.cc +++ b/lily/register-group.cc @@ -8,7 +8,7 @@ #include "proto.hh" #include "plist.hh" -#include "registergroup.hh" +#include "register-group.hh" #include "register.hh" bool @@ -46,8 +46,12 @@ Register_group_register::process_requests() void Register_group_register::post_move_processing() { - for (iter_top(reg_list_, i); i.ok(); i++) - i->post_move_processing(); + iter_top(reg_list_, i); + while (i.ok()) { + // this construction to ensure clean deletion + Request_register *reg_l = i++; + reg_l->post_move_processing(); + } } void @@ -78,9 +82,15 @@ Register_group_register::contains_b(Request_register* reg_l) bool Register_group_register::try_request(Request*req_l) { - for (iter_top(reg_list_, i); i.ok(); i++) - if (i->try_request(req_l)) + iter_top(reg_list_, i); + while (i.ok()) { + + + // this construction to ensure clean deletion + Request_register *reg_l = i++; + if (reg_l->try_request( req_l )) return true; + } return false; } @@ -111,6 +121,8 @@ Register_group_register::terminate_register(Request_register*r_l) delete get_register_p(r_l); } +IMPLEMENT_STATIC_NAME(Register_group_register); + void Register_group_register::do_print()const { diff --git a/lily/register.cc b/lily/register.cc index dfaa3ce05b..b9edcf9d58 100644 --- a/lily/register.cc +++ b/lily/register.cc @@ -13,7 +13,7 @@ #include "complex-walker.hh" #include "local-key-item.hh" #include "complex-staff.hh" -#include "registergroup.hh" +#include "register-group.hh" #include "debug.hh" @@ -82,6 +82,8 @@ Request_register::print() const #endif } +IMPLEMENT_STATIC_NAME(Request_register); + void Request_register::do_print()const { diff --git a/lily/rest.cc b/lily/rest.cc index 97f91a6a6a..3e582511e9 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -22,6 +22,8 @@ Rest::Rest(Duration d) } +IMPLEMENT_STATIC_NAME(Rest); + void Rest::do_print()const { diff --git a/lily/score.cc b/lily/score.cc index 09b5439667..b6a3f2cd83 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -32,7 +32,6 @@ Score::setup_music() for (iter_top(staffs_,i); i.ok(); i++) { i->setup_staffcols(); - i->OK(); } } @@ -104,26 +103,27 @@ Score::clean_cols() } } -/** - Create columns at time #w#. - this sux. We should have Score_column create the appropriate PCol. - Unfortunately, PCols don't know about their position. +/** Create columns at time #w#. This sux. We should have + Score_column create the appropriate PCol. Unfortunately, PCols + don't know about their position. - @return cursor pointing to the nonmusical (first) column - */ + @return cursor pointing to the nonmusical (first) column */ PCursor -Score::create_cols(Moment w) +Score::create_cols(Moment w, PCursor &i) { Score_column* c1 = new Score_column(w); Score_column* c2 = new Score_column(w); c1->musical_b_ = false; c2->musical_b_ = true; - - iter_top(cols_,i); + if (i.ok()) { + i --; + } + if ( !i.ok() ) { + i = cols_.top(); + } for (; i.ok(); i++) { - assert(i->when() != w); if (i->when() > w) break; } @@ -152,7 +152,7 @@ Score::find_col(Moment w, bool mus) if (i->when() > w) break; } - i = create_cols(w); + i = create_cols(w,i); if (mus) i++; return i; @@ -247,7 +247,6 @@ Score::~Score() void Score::paper_output() { - OK(); if (paper_p_->outfile=="") paper_p_->outfile = default_out_fn + ".out"; diff --git a/lily/script-reg.cc b/lily/script-reg.cc index 7ba3212e92..b782066c31 100644 --- a/lily/script-reg.cc +++ b/lily/script-reg.cc @@ -74,3 +74,4 @@ Script_register::set_feature(Features i) if (i.direction_i_|| i.initialiser_b_) dir_i_ = i.direction_i_; } +IMPLEMENT_STATIC_NAME(Script_register); diff --git a/lily/script.cc b/lily/script.cc index 46c2535880..b92892de6f 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -127,3 +127,4 @@ Script::brew_molecule_p() const out->translate(Offset(0,dy * pos)); return out; } +IMPLEMENT_STATIC_NAME(Script); diff --git a/lily/slur-reg.cc b/lily/slur-reg.cc index a076664dd7..935a86468c 100644 --- a/lily/slur-reg.cc +++ b/lily/slur-reg.cc @@ -98,3 +98,4 @@ Slur_register::~Slur_register() warning("unterminated slur", requests_arr_[i]->defined_ch_C_); } } +IMPLEMENT_STATIC_NAME(Slur_register); diff --git a/lily/slur.cc b/lily/slur.cc index 1d9bceade8..8de13e023a 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -133,3 +133,4 @@ Slur::brew_molecule_p() const return output; } +IMPLEMENT_STATIC_NAME(Slur); diff --git a/lily/spanner.cc b/lily/spanner.cc index d89301bc10..87a01078aa 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -4,6 +4,8 @@ +IMPLEMENT_STATIC_NAME(Spanner); + void Spanner::do_print()const { diff --git a/lily/staff-elem.cc b/lily/staff-elem.cc index 0524f08b32..d623d3b49a 100644 --- a/lily/staff-elem.cc +++ b/lily/staff-elem.cc @@ -198,3 +198,4 @@ Staff_elem::add_dependency(Staff_elem * p) dependencies.push(p); p->dependants.push(p); } +IMPLEMENT_STATIC_NAME(Staff_elem); diff --git a/lily/staff.cc b/lily/staff.cc index 31cba7801f..b23f163d29 100644 --- a/lily/staff.cc +++ b/lily/staff.cc @@ -6,9 +6,6 @@ (c) 1997 Han-Wen Nienhuys */ - - - #include "proto.hh" #include "plist.hh" #include "staff.hh" @@ -23,6 +20,8 @@ #include "command-request.hh" // todo #include "midi-stream.hh" #include "pqueue.hh" + + void Staff::add(PointerList const &l) { @@ -94,9 +93,9 @@ void Staff::setup_staffcols() { PQueue subtle_req_pq; + PCursor last(cols_); for (iter_top(voice_list_,i); i.ok(); i++) { - PCursor last(cols_); Moment now = i->start; iter_top(i->elts,j); while( j.ok()) { @@ -113,14 +112,13 @@ Staff::setup_staffcols() } if(next == now) { s_l->add(j, subtle_req_pq); - now += j->duration; + now += j->duration_; j++; } } } - PCursor last(cols_); - + last = cols_.top(); while (subtle_req_pq.size()) { Moment front =subtle_req_pq.front_idx(); Staff_column *s_l = get_col(front, &last); @@ -128,7 +126,6 @@ Staff::setup_staffcols() s_l->setup_one_request(subtle_req_pq.get()); // ugh! } - OK(); } void diff --git a/lily/staffsym.cc b/lily/staffsym.cc index ad639e9c2d..0ad2411589 100644 --- a/lily/staffsym.cc +++ b/lily/staffsym.cc @@ -17,6 +17,8 @@ Staff_symbol::Staff_symbol(int l) no_lines_i_ = l; } +IMPLEMENT_STATIC_NAME(Staff_symbol); + void Staff_symbol::do_print()const { diff --git a/lily/stem-beam-reg.cc b/lily/stem-beam-reg.cc index ad947d2899..9169f78599 100644 --- a/lily/stem-beam-reg.cc +++ b/lily/stem-beam-reg.cc @@ -154,3 +154,5 @@ Stem_beam_register::set_feature(Features i) { default_dir_i_ = i.direction_i_; } + +IMPLEMENT_STATIC_NAME(Stem_beam_register); diff --git a/lily/stem.cc b/lily/stem.cc index 4b141cb2e8..5e6592c482 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -26,6 +26,8 @@ Stem::Stem(int c) //, Moment len) stem_xoffset=0; } +IMPLEMENT_STATIC_NAME(Stem); + void Stem::do_print() const { diff --git a/lily/text-item.cc b/lily/text-item.cc index adadda6632..2171a81d24 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -70,3 +70,5 @@ Text_item::brew_molecule_p() const return mol_p; } + +IMPLEMENT_STATIC_NAME(Text_item); diff --git a/lily/text-reg.cc b/lily/text-reg.cc index a15e47548e..fbe54a5db4 100644 --- a/lily/text-reg.cc +++ b/lily/text-reg.cc @@ -57,3 +57,4 @@ Text_register::post_move_processing() { text_req_l_ = 0; } +IMPLEMENT_STATIC_NAME(Text_register); diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 3f231223d8..77ab800bdb 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -19,6 +19,8 @@ Text_spanner::Text_spanner() support = 0; } +IMPLEMENT_STATIC_NAME(Text_spanner); + void Text_spanner::do_print() const { diff --git a/lily/voice-elt.cc b/lily/voice-elt.cc index 4c1249b140..4e33437886 100644 --- a/lily/voice-elt.cc +++ b/lily/voice-elt.cc @@ -27,7 +27,7 @@ void Voice_element::print() const { #ifndef NPRINT - mtor << "voice_element { dur :"<< duration <<"\n"; + mtor << "voice_element { dur :"<< duration_ <<"\n"; for (iter_top(reqs,rc); rc.ok(); rc++) { rc->print(); } @@ -39,8 +39,8 @@ void Voice_element::add(Request*r) { if (r->duration()) { - assert (!duration || duration == r->duration()); - duration = r->duration(); + assert (!duration_ || duration_ == r->duration()); + duration_ = r->duration(); } r->elt_l_ = this; @@ -51,7 +51,7 @@ Voice_element::add(Request*r) Voice_element::Voice_element() { voice_l_ = 0; - duration = 0; + duration_ = 0; defined_ch_C_ = 0; } @@ -65,10 +65,10 @@ Voice_element::Voice_element(Voice_element const&src) } bool -Voice_element::find_plet_start_bo(char c, Moment& moment_r) +Voice_element::find_plet_start_b(char c, Moment& moment_r) { assert( c == ']' ); - moment_r += duration; + moment_r += duration_; for ( PCursor i( reqs.top() ); i.ok(); i++ ) { if (i->beam() && i->beam()->spantype == Span_req::START ) return true; @@ -91,7 +91,7 @@ void Voice_element::set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i) { - now_moment_r += duration; + now_moment_r += duration_; if ( now_moment_r > until_moment ) return; for ( PCursor i( reqs.top() ); i.ok(); i++ ) { diff --git a/lily/voice-group-regs.cc b/lily/voice-group-regs.cc index 8a602a5201..b9351bd8e8 100644 --- a/lily/voice-group-regs.cc +++ b/lily/voice-group-regs.cc @@ -5,7 +5,7 @@ (c) 1997 Han-Wen Nienhuys */ - +#include "voice.hh" #include "proto.hh" #include "plist.hh" #include "musical-request.hh" @@ -32,6 +32,7 @@ Voice_group_registers::Voice_group_registers(String id) if (id=="") // UGH id = __FUNCTION__ + String(temp_id_count++); group_id_str_ = id; + termination_mom_ = 0; } bool @@ -65,17 +66,21 @@ Voice_group_registers::terminate_register(Request_register*r_l) for (int i=0; i name() == Voice_registers::static_name()) - voice_regs_l_.push( (Voice_registers*)r_l ); + if (r_l->name() == Voice_registers::static_name()) { + Voice_registers * vregs_l = (Voice_registers*)r_l; + voice_regs_l_.push( vregs_l ); + Voice *v_l = vregs_l->voice_l_; + termination_mom_ = termination_mom_ >? v_l -> last(); + mtor << "adding Voice_registers, now terminating at " << + termination_mom_<< "\n"; + } +} + +void +Voice_group_registers::post_move_processing() +{ + if ( get_staff_info().time_C_ ->when_ > termination_mom_ ){ + mtor << "Terminating voice_group\n"; + daddy_reg_l_->terminate_register(this); + } + Register_group_register::post_move_processing(); } diff --git a/lily/voice-regs.cc b/lily/voice-regs.cc index ca39524be0..2aa7f18eb0 100644 --- a/lily/voice-regs.cc +++ b/lily/voice-regs.cc @@ -55,13 +55,17 @@ Voice_registers::try_request(Request*r_l) bool Voice_registers::acceptable_request_b(Request*r) { -// return (r->rest() || r->note() || r->slur() || r->groupchange()); - return r->groupchange() + Command_req * c_l = r->command(); + return r->groupchange() || (c_l&&c_l->terminate()) || Register_group_register::acceptable_request_b(r); } +IMPLEMENT_STATIC_NAME(Voice_registers); + void Voice_registers::do_print() const { +#ifndef NPRINT mtor << "Voice= " << voice_l_<<'\n'; Register_group_register::do_print(); +#endif } diff --git a/lily/voice.cc b/lily/voice.cc index 2294d57b2e..d76b3ebe83 100644 --- a/lily/voice.cc +++ b/lily/voice.cc @@ -30,10 +30,10 @@ Voice::set_default_group(String s) } bool -Voice::find_plet_start_bo(char c, Moment& moment_r) +Voice::find_plet_start_b(char c, Moment& moment_r) { for (iter_bot(elts, i); i.ok(); i--) - if ( i->find_plet_start_bo(c, moment_r) ) + if ( i->find_plet_start_b(c, moment_r) ) return true; return false; } @@ -88,7 +88,7 @@ Voice::last() const l = start; for (iter_top(elts,i); i.ok(); i++) - l += i->duration; + l += i->duration_; return l; } diff --git a/make/Configure_variables.make.in b/make/Configure_variables.make.in index e38c13d9b0..35f616267c 100644 --- a/make/Configure_variables.make.in +++ b/make/Configure_variables.make.in @@ -3,7 +3,8 @@ # @configure_input@ INSTALL = @INSTALL@ -USER_CXXFLAGS = @CXXFLAGS@ +USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ + #CXX = @CXX@ prefix = @prefix@ @@ -13,7 +14,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ includedir = @includedir@ datadir = @datadir@ - +EXTRA_LIBES = @EXTRA_LIBES@ RANLIB = @RANLIB@ DEFS = @DEFS@ #SET_MAKE = @SET_MAKE@ diff --git a/make/Makefile b/make/Makefile index 1f8f6ca8c7..0928f016e2 100644 --- a/make/Makefile +++ b/make/Makefile @@ -20,7 +20,7 @@ NAME = make # list of distribution files: # -EXTRA_DISTFILES = Configure_variables.make.in lilypond.spec.in +EXTRA_DISTFILES = Configure_variables.make.in lilypond.spec.in Toplevel.make.in # # generic variables: diff --git a/make/Rules.make b/make/Rules.make index 3f3e5f86d1..b7ec413b65 100644 --- a/make/Rules.make +++ b/make/Rules.make @@ -48,9 +48,13 @@ $(outdir)/%.text: $(outdir)/%.1 $(depth)/%.text: $(outdir)/%.text cp $< $@ +$(outdir)/%.5: %.pod + $(pod2groff) $(outdir)/%.1: %.pod - pod2man --center="LilyPond documentation" --section="0"\ - --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@ + $(pod2groff) + + + # # outdirs: diff --git a/make/Targets.make b/make/Targets.make index 5ae0c4bdc5..de89f3d417 100644 --- a/make/Targets.make +++ b/make/Targets.make @@ -62,7 +62,7 @@ ifdef SUBDIRS endif distclean: clean - rm -rf $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen) + rm -rf Makefile $(lily-version) $(flower-version) $(mi2mu-version) .b $(build) *~ $(allout) $(allgen) # configure: diff --git a/Makefile b/make/Toplevel.make.in similarity index 82% rename from Makefile rename to make/Toplevel.make.in index 7ac03e335c..e9b0ef58d6 100644 --- a/Makefile +++ b/make/Toplevel.make.in @@ -1,3 +1,6 @@ +# -*-Makefile-*- +# +# @configure_input@ # # project LilyPond -- the musical typesetter # title top level makefile for LilyPond @@ -32,10 +35,12 @@ SUBDIRS = flower lib lily mi2mu \ # list of distribution files: # -# SYMLINKS = # naah, configure SCRIPTS = configure configure.in install-sh README_FILES = ANNOUNCE COPYING NEWS README TODO INSTALL.text EXTRA_DISTFILES= .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS) + +# do not dist ./Makefile (is copied from make/Toplevel.make) +DISTFILES:=$(EXTRA_DISTFILES)# Makefile $(ALL_SOURCES) # @@ -47,17 +52,17 @@ include ./$(depth)/make/Rules.make localdist: configure -# ugh. I know dep is not quite what is really needed. INSTALL.text: check-doc-deps rm -f INSTALL.text ln `find -name INSTALL.text|head -1` . localclean: rm -f $(allexe) core config.cache config.log config.status + rm -f $(outdir)/*.{class,html,gif} localinstall: all $(INSTALL) -d $(bindir) $(INSTALL) -m 755 $(allexe) $(bindir) localuninstall: - for i in $(allexe); do rm -f $(bindir)/`basename $$i`; done \ No newline at end of file + for i in $(allexe); do rm -f $(bindir)/`basename $$i`; done diff --git a/make/Variables.make b/make/Variables.make index abe60c7a9a..d1ca048581 100644 --- a/make/Variables.make +++ b/make/Variables.make @@ -169,7 +169,9 @@ LIBRARY = $(LIB_PREFIX)$(NAME)$(LIB_SUFFIX) STRIPDEBUG=true #replace to do stripping of certain objects DISTFILES=$(EXTRA_DISTFILES) Makefile $(ALL_SOURCES) -DOCDIR=$(depth)/doc++ +DOCDIR=$(depth)/$(outdir) progdocs=$(allhh) $(allcc) +pod2groff=pod2man --center="LilyPond documentation" --section="0"\ + --release="LilyPond $(TOPLEVEL_MAJOR_VERSION).$(TOPLEVEL_MINOR_VERSION).$(TOPLEVEL_PATCH_LEVEL)" $< > $@ diff --git a/mi2mu/.version b/mi2mu/.version index 94361e906e..abebfdd4a7 100644 --- a/mi2mu/.version +++ b/mi2mu/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 12 +PATCH_LEVEL = 13 # use to send patches, always empty for released version: -MY_PATCH_LEVEL = .1# include separator: "-1" or ".a" +MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/mi2mu/include/midi-event.hh b/mi2mu/include/midi-event.hh index df08ce5fed..2d57aa8336 100644 --- a/mi2mu/include/midi-event.hh +++ b/mi2mu/include/midi-event.hh @@ -45,7 +45,7 @@ public: virtual String mudela_str( bool command_mode_bo ); private: - bool const simple_plet_bo_ = false; + static bool const simple_plet_b_s = false; Duration dur_; String name_str_; }; diff --git a/mi2mu/include/midi-global.hh b/mi2mu/include/midi-global.hh index 13ef771067..0941232c0d 100644 --- a/mi2mu/include/midi-global.hh +++ b/mi2mu/include/midi-global.hh @@ -11,18 +11,12 @@ #define monitor_p_g &cout enum Verbose { QUIET_ver, BRIEF_ver, NORMAL_ver, VERBOSE_ver, DEBUG_ver }; extern Verbose level_ver; -#ifdef NPRINT -#define dtor if ( 0 ) *monitor_p_g -#define mtor if ( 0 ) *monitor_p_g -#define vtor if ( level_ver >= VERBOSE_ver ) *monitor_p_g -#define btor if ( level_ver >= BRIEF_ver ) *monitor_p_g -#define qtor if ( level_ver >= QUIET_ver ) *monitor_p_g +#if 0 // NPRINT + // not what i want, all output goes through tors. + // set verbosity level. + #define tor( threshold ) if ( 0 ) *monitor_p_g #else -#define dtor if ( level_ver >= DEBUG_ver ) *monitor_p_g -#define vtor if ( level_ver >= VERBOSE_ver ) *monitor_p_g -#define mtor if ( level_ver >= NORMAL_ver ) *monitor_p_g -#define btor if ( level_ver >= BRIEF_ver ) *monitor_p_g -#define qtor if ( level_ver >= QUIET_ver ) *monitor_p_g + #define tor( threshold ) if ( level_ver >= threshold ) *monitor_p_g #endif extern Sources* source_l_g; diff --git a/mi2mu/include/my-midi-lexer.hh b/mi2mu/include/my-midi-lexer.hh index 9db1c43614..67b53e8530 100644 --- a/mi2mu/include/my-midi-lexer.hh +++ b/mi2mu/include/my-midi-lexer.hh @@ -26,7 +26,7 @@ public: char const* here_ch_C(); static int varint2_i( String str ); int yylex(); - Source_file * source_file_p_ ; + Source_file * source_file_l_ ; private: int char_count_; public: // ugh diff --git a/mi2mu/main.cc b/mi2mu/main.cc index 31dfe9e5e0..b8795395af 100644 --- a/mi2mu/main.cc +++ b/mi2mu/main.cc @@ -58,31 +58,38 @@ error( String message_str, char const* context_ch_C ) } void -help() +usage() { - mtor << - "--be-blonde, -b use exact, blonde durations, e.g.: a[385]\n" - "--debug, -d be really verbose\n" - "--help, -h this help\n" - "--include=DIR, -I DIR add DIR to search path\n" - "--no-silly, -n assume no triplets and no smaller than 16\n" - "--output=FILE, -o FILE set FILE as default output\n" - "--quiet, -q be quiet\n" - "--verbose, -v be verbose\n" - "--warranty, -w show warranty & copyright\n" + tor( NORMAL_ver ) << + "Usage: mi2mu [options] midi-file\n" + "Translate midi-file to mudela\n" + "\n" + "Options:\n" + " -b, --no-quantify write exact durations, e.g.: a4*385/384\n" + " -d, --debug print lots of debugging stuff\n" + " -h, --help this help\n" + " -I, --include=DIR add DIR to search path\n" + " -n, --no-silly assume no plets or double dots, smallest is 16\n" + " -o, --output=FILE set FILE as default output\n" + " -p, --no-plets assume no plets\n" + " -q, --quiet be quiet\n" + " -s, --smallest=N assume no shorter (reciprocal) durations than N\n" + " -v, --verbose be verbose\n" + " -w, --warranty show warranty and copyright\n" + " -x, --no-double-dots assume no double dotted notes\n" ; } void identify() { - mtor << mi2mu_version_str() << endl; + tor( NORMAL_ver ) << mi2mu_version_str() << endl; } void notice() { - mtor << + tor( NORMAL_ver ) << "\n" "Mi2mu, translate midi to mudela.\n" "Copyright (C) 1997 by\n" @@ -114,9 +121,12 @@ main( int argc_i, char* argv_sz_a[] ) 0, "help", 'h', 0, "no-silly", 'n', 1, "output", 'o', + 1, "no-plets", 'p', 0, "quiet", 'q', + 1, "smallest", 's', 0, "verbose", 'v', 0, "warranty", 'w', + 0, "no-double-dots", 'x', 0,0,0 }; Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a ); @@ -125,39 +135,57 @@ main( int argc_i, char* argv_sz_a[] ) String output_str; while ( Long_option_init* long_option_init_p = getopt_long() ) switch ( long_option_init_p->shortname ) { - case 'b': - Duration_convert::be_blonde_b_s = true; - break; - case 'd': - level_ver = DEBUG_ver; - break; - case 'h': - help(); - exit( 0 ); - break; - case 'n': - Duration_convert::no_double_dots_b_s = false; - Duration_convert::no_triplets_b_s = true; - Duration_convert::no_smaller_than_i_s = 16; - break; - case 'o': - output_str = getopt_long.optarg; - break; - case 'q': - level_ver = QUIET_ver; - break; - case 'v': - level_ver = VERBOSE_ver; - break; - case 'w': - notice(); - exit( 0 ); - break; - default: - assert( 0 ); - break; - } - + case 'b': + Duration_convert::no_quantify_b_s = true; + break; + case 'd': + level_ver = DEBUG_ver; + break; + case 'h': + usage(); + exit( 0 ); + break; +// case 'I': +// path->push( getopt_long.optarg ); +// break; + case 'n': + Duration_convert::no_double_dots_b_s = true; + Duration_convert::no_triplets_b_s = true; + Duration_convert::no_smaller_than_i_s = 16; + break; + case 'o': + output_str = getopt_long.optarg; + break; + case 'p': + Duration_convert::no_triplets_b_s = true; + break; + case 'q': + level_ver = QUIET_ver; + break; + case 's': { + int i = String_convert::dec2_i( getopt_long.optarg ); + if ( !i ) { + usage(); + exit( 2 ); //usage + } + Duration_convert::no_smaller_than_i_s = i; + } + break; + case 'v': + level_ver = VERBOSE_ver; + break; + case 'w': + notice(); + exit( 0 ); + break; + case 'x': + Duration_convert::no_double_dots_b_s = false; + break; + default: + assert( 0 ); + break; + } + char* arg_sz = 0; while ( ( arg_sz = getopt_long.get_next_arg() ) ) { My_midi_parser midi_parser( arg_sz, & source ); diff --git a/mi2mu/midi-event.cc b/mi2mu/midi-event.cc index 4ab611cd4f..c909e07c7b 100644 --- a/mi2mu/midi-event.cc +++ b/mi2mu/midi-event.cc @@ -34,13 +34,13 @@ Midi_key::Midi_key( int accidentals_i, int minor_i ) String Midi_key::mudela_str( bool command_mode_bo ) { - String str = "key\\"; + String str = "\\key\\"; if ( !minor_i_ ) str += String( (char)( ( key_i_ + 2 ) % 7 + 'A' ) ); else // heu, -2: should be - 1 1/2: A -> fis str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a' ) ); - if ( !command_mode_bo ) - str = String( '\\' ) + str; +// if ( !command_mode_bo ) +// str = String( '\\' ) + str; str = String( "%" ) + str + "\n"; // "\key\F" not supported yet... return str; } @@ -73,13 +73,15 @@ Midi_key::notename_str( int pitch_i ) else notename_str += "es"; accidental_i--; - String octave_str; - octave_str += String( '\'', ( pitch_i - Midi_note::c0_pitch_i_c_ ) / 12 ); - octave_str += String( '`', ( Midi_note::c0_pitch_i_c_ + 11 - pitch_i ) / 12 ); - return octave_str + notename_str; + String de_octavate_str = String( '\'', ( Midi_note::c0_pitch_i_c_ + 11 - pitch_i ) / 12 ); + String octavate_str = String( '\'', ( pitch_i - Midi_note::c0_pitch_i_c_ ) / 12 ); + return de_octavate_str + notename_str + octavate_str; } +// statics Midi_note +bool const Midi_note::simple_plet_b_s = false; + Midi_note::Midi_note( String name_str, Duration dur ) { // do i want pitch too? @@ -91,9 +93,8 @@ String Midi_note::mudela_str( bool command_mode_bo ) { // assert( !command_mode_bo ); -// undefined ref to simple_plet_bo_ ?? -// if ( simple_plet_bo_ ) -// return name_str_ + Duration_convert::dur2_str( dur_ ); + if ( simple_plet_b_s ) + return name_str_ + Duration_convert::dur2_str( dur_ ); //ugh String str; @@ -134,7 +135,7 @@ Midi_tempo::mudela_str( bool command_mode_bo ) // assert( command_mode_bo ); if ( !command_mode_bo ) return ""; - String str = "tempo 4:"; + String str = "\\tempo 4:"; str += String( get_tempo_i( Moment( 1, 4 ) ) ); return str; } @@ -206,11 +207,11 @@ Midi_time::num_i() String Midi_time::mudela_str( bool command_mode_bo ) { - String str = "meter { " - + String( num_i_ ) + "*" + String( 1 << den_i_ ) + String str = "\\meter{ " + + String( num_i_ ) + "/" + String( 1 << den_i_ ) + " }"; - if ( !command_mode_bo ) - str = String( '\\' ) + str; +// if ( !command_mode_bo ) +// str = String( '\\' ) + str; return str; } diff --git a/mi2mu/midi-lexer.l b/mi2mu/midi-lexer.l index 6add2613c7..f61d2b4656 100644 --- a/mi2mu/midi-lexer.l +++ b/mi2mu/midi-lexer.l @@ -71,7 +71,7 @@ SSME [\0x7f][\x03] %% {HEADER}/{INT32} { // using /{INT32}; longer match than {INT32} - dtor << "lex: header" << endl; + tor( DEBUG_ver ) << "lex: header" << endl; yy_push_state( int16 ); yy_push_state( int16 ); yy_push_state( int16 ); @@ -80,7 +80,7 @@ SSME [\0x7f][\x03] } {TRACK}/{INT32} { // using /{INT32}; longer match than {INT32} - dtor << "lex: track" << endl; + tor( DEBUG_ver ) << "lex: track" << endl; yy_push_state( track ); yy_push_state( int32 ); return TRACK; @@ -91,7 +91,7 @@ SSME [\0x7f][\x03] exit( 1 ); } {INT32} { // really signed? - dtor << "lex: int32" << endl; + tor( DEBUG_ver ) << "lex: int32" << endl; assert( YYLeng() == 4 ); String str( (Byte const*)YYText(), YYLeng() ); yylval.i = String_convert::bin2_i( str ); @@ -99,7 +99,7 @@ SSME [\0x7f][\x03] return INT32; } {INT16} { // really signed? - dtor << "lex: int16" << endl; + tor( DEBUG_ver ) << "lex: int16" << endl; assert( YYLeng() == 2 ); String str( (Byte const*)YYText(), YYLeng() ); yylval.i = String_convert::bin2_i( str ); @@ -107,7 +107,7 @@ SSME [\0x7f][\x03] return INT16; } {I8} { - dtor << "lex: i8" << endl; + tor( DEBUG_ver ) << "lex: i8" << endl; assert( YYLeng() == 1 ); // yylval.byte = *(signed char*)YYText(); yylval.i = *(signed char*)YYText(); @@ -115,7 +115,7 @@ SSME [\0x7f][\x03] return I8; } {U8} { - dtor << "lex: u8" << endl; + tor( DEBUG_ver ) << "lex: u8" << endl; assert( YYLeng() == 1 ); // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); @@ -126,7 +126,7 @@ SSME [\0x7f][\x03] {VARINT} { String str( (Byte const*)YYText(), YYLeng() ); yylval.i = My_midi_lexer::varint2_i( str ); - dtor << String( "lex: track: varint(" ) + tor( DEBUG_ver ) << String( "lex: track: varint(" ) + String( yylval.i ) + "): " + String_convert::bin2hex_str( str ) << endl; yy_push_state( event ); @@ -140,7 +140,7 @@ SSME [\0x7f][\x03] {RUNNING_STATUS} { // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); - dtor << String ( "lex: running status: " ) + String( yylval.i ) << endl; + tor( DEBUG_ver ) << String ( "lex: running status: " ) + String( yylval.i ) << endl; yy_pop_state(); // yy_push_state( u8 ); yy_push_state( u8 ); @@ -149,23 +149,23 @@ SSME [\0x7f][\x03] {DATA_ENTRY} { // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); - dtor << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl; + tor( DEBUG_ver ) << String ( "lex: undefined data entry: " ) + String( yylval.i ) << endl; yy_pop_state(); yy_push_state( u8 ); return DATA_ENTRY; } {ALL_NOTES_OFF} { - dtor << "lex: all note off" << endl; + tor( DEBUG_ver ) << "lex: all note off" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); - dtor << String ( "lex: all notes off: " ) + String( yylval.i ) << endl; + tor( DEBUG_ver ) << String ( "lex: all notes off: " ) + String( yylval.i ) << endl; yy_pop_state(); yy_push_state( u8 ); yy_push_state( u8 ); return ALL_NOTES_OFF; } {NOTE_OFF} { - dtor << "lex: note off" << endl; + tor( DEBUG_ver ) << "lex: note off" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -174,7 +174,7 @@ SSME [\0x7f][\x03] return NOTE_OFF; } {NOTE_ON} { - dtor << "lex: note on" << endl; + tor( DEBUG_ver ) << "lex: note on" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -183,7 +183,7 @@ SSME [\0x7f][\x03] return NOTE_ON; } {POLYPHONIC_AFTERTOUCH} { - dtor << "lex: polyphonic aftertouch" << endl; + tor( DEBUG_ver ) << "lex: polyphonic aftertouch" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -192,7 +192,7 @@ SSME [\0x7f][\x03] return POLYPHONIC_AFTERTOUCH; } {CONTROLMODE_CHANGE} { - dtor << "lex: controlmode change" << endl; + tor( DEBUG_ver ) << "lex: controlmode change" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -201,7 +201,7 @@ SSME [\0x7f][\x03] return CONTROLMODE_CHANGE; } {PROGRAM_CHANGE} { - dtor << "lex: program change" << endl; + tor( DEBUG_ver ) << "lex: program change" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -209,7 +209,7 @@ SSME [\0x7f][\x03] return PROGRAM_CHANGE; } {CHANNEL_AFTERTOUCH} { - dtor << "lex: channel aftertouch" << endl; + tor( DEBUG_ver ) << "lex: channel aftertouch" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -218,7 +218,7 @@ SSME [\0x7f][\x03] return CHANNEL_AFTERTOUCH; } {PITCHWHEEL_RANGE} { - dtor << "lex: pitchwheel range" << endl; + tor( DEBUG_ver ) << "lex: pitchwheel range" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -227,20 +227,20 @@ SSME [\0x7f][\x03] return PITCHWHEEL_RANGE; } {SYSEX_EVENT1} { // len data - dtor << "lex: sysex1" << endl; + tor( DEBUG_ver ) << "lex: sysex1" << endl; yy_pop_state(); yy_push_state( data ); return SYSEX_EVENT1; } {SYSEX_EVENT2} { // len data - dtor << "lex: sysex2" << endl; + tor( DEBUG_ver ) << "lex: sysex2" << endl; yy_pop_state(); // yy_push_state( u8 ); //? yy_push_state( data ); return SYSEX_EVENT2; } {META_EVENT} { - dtor << "lex: meta" << endl; + tor( DEBUG_ver ) << "lex: meta" << endl; yy_push_state( meta_event ); return META_EVENT; } @@ -250,14 +250,14 @@ SSME [\0x7f][\x03] exit( 1 ); } {SEQUENCE} { // ssss sequence number - dtor << "lex: sequence" << endl; + tor( DEBUG_ver ) << "lex: sequence" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( int16 ); return SEQUENCE; } {YYTEXT} { // len data - dtor << "lex: text" << endl; + tor( DEBUG_ver ) << "lex: text" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -266,7 +266,7 @@ SSME [\0x7f][\x03] return YYTEXT; } {YYCOPYRIGHT} { - dtor << "lex: copyright" << endl; + tor( DEBUG_ver ) << "lex: copyright" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -275,7 +275,7 @@ SSME [\0x7f][\x03] return YYCOPYRIGHT; } {YYTRACK_NAME} { - dtor << "lex: track name" << endl; + tor( DEBUG_ver ) << "lex: track name" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -284,7 +284,7 @@ SSME [\0x7f][\x03] return YYTRACK_NAME; } {YYINSTRUMENT_NAME} { - dtor << "lex: instrument name" << endl; + tor( DEBUG_ver ) << "lex: instrument name" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -293,7 +293,7 @@ SSME [\0x7f][\x03] return YYINSTRUMENT_NAME; } {YYLYRIC} { - dtor << "lex: lyric" << endl; + tor( DEBUG_ver ) << "lex: lyric" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -302,7 +302,7 @@ SSME [\0x7f][\x03] return YYLYRIC; } {YYMARKER} { - dtor << "lex: marker" << endl; + tor( DEBUG_ver ) << "lex: marker" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -311,7 +311,7 @@ SSME [\0x7f][\x03] return YYMARKER; } {YYCUE_POINT} { - dtor << "lex: cue point" << endl; + tor( DEBUG_ver ) << "lex: cue point" << endl; // yylval.byte = *(Byte*)YYText(); yylval.i = *(Byte*)YYText(); yy_pop_state(); @@ -320,7 +320,7 @@ SSME [\0x7f][\x03] return YYCUE_POINT; } {TEMPO} { // tttttt usec - dtor << "lex: tempo" << endl; + tor( DEBUG_ver ) << "lex: tempo" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( u8 ); @@ -329,7 +329,7 @@ SSME [\0x7f][\x03] return TEMPO; } {SMPTE_OFFSET} { // hr mn se fr ff - dtor << "lex: smpte offset" << endl; + tor( DEBUG_ver ) << "lex: smpte offset" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( u8 ); @@ -340,7 +340,7 @@ SSME [\0x7f][\x03] return SMPTE_OFFSET; } {TIME} { // nn dd cc bb - dtor << "lex: time" << endl; + tor( DEBUG_ver ) << "lex: time" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( u8 ); @@ -350,7 +350,7 @@ SSME [\0x7f][\x03] return TIME; } {KEY} { // sf mi - dtor << "lex: key" << endl; + tor( DEBUG_ver ) << "lex: key" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( i8 ); @@ -358,14 +358,14 @@ SSME [\0x7f][\x03] return KEY; } {SSME} { // len data - dtor << "lex: smme" << endl; + tor( DEBUG_ver ) << "lex: smme" << endl; yy_pop_state(); yy_pop_state(); yy_push_state( data ); return SSME; } {END_OF_TRACK} { - dtor << "lex: end of track" << endl; + tor( DEBUG_ver ) << "lex: end of track" << endl; yy_pop_state(); yy_pop_state(); yy_pop_state(); @@ -383,7 +383,7 @@ SSME [\0x7f][\x03] } {VARINT} { - dtor << "lex: data" << endl; + tor( DEBUG_ver ) << "lex: data" << endl; String str( (Byte const*)YYText(), YYLeng() ); int i = My_midi_lexer::varint2_i( str ); String* str_p = new String; @@ -400,7 +400,7 @@ SSME [\0x7f][\x03] } <> { -// mtor << "<>"; +// tor( NORMAL_ver ) << "<>"; if ( !close_i() ) yyterminate(); // can't move this, since it actually rets a YY_NULL diff --git a/mi2mu/midi-parser.y b/mi2mu/midi-parser.y index 2402ee542e..7fab7a910d 100644 --- a/mi2mu/midi-parser.y +++ b/mi2mu/midi-parser.y @@ -81,7 +81,7 @@ header: track: TRACK INT32 { - mtor << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush; + tor( NORMAL_ver ) << "\ntrack " << midi_parser_l_g->track_i_ << ": " << flush; $$ = new Midi_track( midi_parser_l_g->track_i_++, // silly, cause not set yet! midi_parser_l_g->copyright_str_, @@ -99,7 +99,7 @@ event: if ( $2 ) { String str = $2->mudela_str( false ); if ( str.length_i() ) - dtor << str << " " << flush; + tor( DEBUG_ver ) << str << " " << flush; } } ; @@ -109,9 +109,10 @@ varint: midi_parser_l_g->forward( $1 ); if ( $1 ) { int bars_i = (int)( midi_parser_l_g->mom() / midi_parser_l_g->midi_time_p_->bar_mom() ); - if ( bars_i > midi_parser_l_g->bar_i_ ) - mtor << '[' << midi_parser_l_g->bar_i_++ - << ']' << flush; + if ( bars_i > midi_parser_l_g->bar_i_ ) { + tor( NORMAL_ver ) << '[' << midi_parser_l_g->bar_i_ << ']' << flush; + midi_parser_l_g->bar_i_ = bars_i; + } } } ; @@ -158,7 +159,7 @@ the_meta_event: $$ = new Midi_text( type, *$2 ); break; } - dtor << *$2 << endl; + tor( DEBUG_ver ) << *$2 << endl; delete $2; } | END_OF_TRACK { @@ -166,7 +167,7 @@ the_meta_event: } | TEMPO U8 U8 U8 { $$ = new Midi_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 ); - dtor << $$->mudela_str( false ) << endl; + tor( DEBUG_ver ) << $$->mudela_str( false ) << endl; midi_parser_l_g->set_tempo( ( $2 << 16 ) + ( $3 << 8 ) + $4 ); } | SMPTE_OFFSET U8 U8 U8 U8 U8 { @@ -174,7 +175,7 @@ the_meta_event: } | TIME U8 U8 U8 U8 { $$ = new Midi_time( $2, $3, $4, $5 ); - dtor << $$->mudela_str( true ) << endl; + tor( DEBUG_ver ) << $$->mudela_str( true ) << endl; midi_parser_l_g->set_time( $2, $3, $4, $5 ); } | KEY I8 I8 { @@ -189,25 +190,25 @@ the_meta_event: text_event: YYTEXT { - dtor << "\n% Text: "; + tor( DEBUG_ver ) << "\n% Text: "; } | YYCOPYRIGHT { - dtor << "\n% Copyright: "; + tor( DEBUG_ver ) << "\n% Copyright: "; } | YYTRACK_NAME { - dtor << "\n% Track name: "; + tor( DEBUG_ver ) << "\n% Track name: "; } | YYINSTRUMENT_NAME { - dtor << "\n% Instrument name: "; + tor( DEBUG_ver ) << "\n% Instrument name: "; } | YYLYRIC { - dtor << "\n% Lyric: "; + tor( DEBUG_ver ) << "\n% Lyric: "; } | YYMARKER { - dtor << "\n% Marker: "; + tor( DEBUG_ver ) << "\n% Marker: "; } | YYCUE_POINT { - dtor << "\n% Cue point: "; + tor( DEBUG_ver ) << "\n% Cue point: "; } ; diff --git a/mi2mu/midi-score.cc b/mi2mu/midi-score.cc index bab5dfabb7..0c0bb5098d 100644 --- a/mi2mu/midi-score.cc +++ b/mi2mu/midi-score.cc @@ -25,36 +25,32 @@ Midi_score::add_track( Midi_track* midi_track_p ) int Midi_score::output_mudela( String filename_str ) { - mtor << "Lily output to " << filename_str << " ..." << endl; + tor( NORMAL_ver ) << "Lily output to " << filename_str << " ..." << endl; int track_i = 0; Lily_stream lily_stream( filename_str ); for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { - mtor << "track " << track_i++ << ": " << flush; + tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush; i->output_mudela( lily_stream ); lily_stream.newline(); - mtor << endl; - } - - lily_stream << "score {"; - lily_stream.newline(); - - for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { - lily_stream << "\tstaff { melodic music { "; - lily_stream << i->name_str(); - lily_stream << " } }"; - lily_stream.newline(); + tor( NORMAL_ver ) << endl; } + lily_stream << "\\score{"; lily_stream.indent(); - lily_stream << "commands {"; - lily_stream.indent(); - // not use silly 0 track - midi_track_p_list_.bottom()->midi_time_p_->output_mudela( lily_stream, true ); + for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { + lily_stream << "\\staff{ "; + lily_stream << i->name_str(); + lily_stream << " }"; + lily_stream.newline(); + } + lily_stream.newline(); + lily_stream << "\\paper{"; + lily_stream.indent(); + lily_stream << "\\unitspace 20\\mm"; lily_stream.tnedni(); lily_stream << "}"; - lily_stream.newline(); - lily_stream << "midi {"; + lily_stream << "\\midi{"; lily_stream.indent(); // not use silly 0 track midi_track_p_list_.bottom()->midi_tempo_p_->output_mudela( lily_stream, true ); @@ -73,9 +69,9 @@ Midi_score::process() { int track_i = 0; for ( PCursor i( midi_track_p_list_.top() ); i.ok(); i++ ) { - mtor << "track " << track_i++ << ": " << flush; + tor( NORMAL_ver ) << "track " << track_i++ << ": " << flush; i->process(); - mtor << endl; + tor( NORMAL_ver ) << endl; } } diff --git a/mi2mu/midi-track.cc b/mi2mu/midi-track.cc index 6a20de9d20..18de844098 100644 --- a/mi2mu/midi-track.cc +++ b/mi2mu/midi-track.cc @@ -30,7 +30,7 @@ Midi_track::add_begin_at( PointerList& open_voices_r, Moment mom ) { for ( PCursor i( midi_voice_p_list_.top() ); i.ok(); i++ ) if ( i->begin_mom() == mom ) { - dtor << "open_voices (" << open_voices_r.size() << "): +1\n"; + tor( DEBUG_ver ) << "open_voices (" << open_voices_r.size() << "): +1\n"; open_voices_r.bottom().add( *i ); } } @@ -104,75 +104,92 @@ Midi_track::process() for ( PCursor i( tcol_p_list_.top() ); i.ok(); i++ ) { int bars_i = (int)( i->mom() / bar_mom ); if ( bars_i > bar_i ) - mtor << '[' << bar_i << flush; + tor( NORMAL_ver ) << '[' << bar_i << flush; while ( i->midi_event_p_list_.size() ) - // shit, where has the T* PCursor::remove() gone?? - // i don-t want to get and delete, - // i want to (re)move! - // is it renamed: get vs add/insert ?? (put/remove :-) get_free_midi_voice_l( i->mom() )->add_event( i->midi_event_p_list_.top().remove_p() ); if ( bars_i > bar_i ) { - bar_i++; - mtor << ']' << flush; + bar_i = bars_i; + tor( NORMAL_ver ) << ']' << flush; } } - dtor << "ends: " << endl; + tor( DEBUG_ver ) << "ends: " << endl; int n = 0; for ( PCursor i( midi_voice_p_list_.top() ); i.ok(); i++ ) - vtor << "voice " << n++ << ": " << i->end_mom() << endl; - dtor << ":sdne" << endl; + tor( VERBOSE_ver ) << "voice " << n++ << ": " << i->end_mom() << endl; + tor( DEBUG_ver ) << ":sdne" << endl; } void Midi_track::output_mudela( Lily_stream& lily_stream_r ) { - lily_stream_r << name_str_ << " = music { $"; + lily_stream_r << name_str_ << " = \\melodic{"; lily_stream_r.indent(); lily_stream_r << "% midi copyright:" << copyright_str_; lily_stream_r.newline(); lily_stream_r << "% instrument:" << instrument_str_; lily_stream_r.newline(); - int bar_i = 1; + int bar_i = 0; Moment bar_mom = midi_time_p_->bar_mom(); PointerList open_voices; Moment now_mom = 0.0; Moment then_mom = 0.0; while ( now_mom < end_mom() ) { - int bars_i = (int)( now_mom / bar_mom ); + int bars_i = (int)( now_mom / bar_mom ) + 1; if ( bars_i > bar_i ) - mtor << '[' << bar_i << flush; + tor( NORMAL_ver ) << '[' << flush; + + if ( bars_i > bar_i ) { + Moment into_bar_mom = now_mom - ( bars_i - 1 ) * bar_mom; + if ( bars_i > 1 ) { + if ( !into_bar_mom ) + lily_stream_r << "|"; + lily_stream_r.newline(); + } + lily_stream_r << "% " << String_convert::i2dec_str( bars_i, 0, ' ' ); + if ( into_bar_mom ) + lily_stream_r << ":" << Duration_convert::dur2_str( Duration_convert::mom2_dur( into_bar_mom ) ); + lily_stream_r.newline(); + } + add_begin_at( open_voices, now_mom ); Moment begin_mom = next_begin_mom( now_mom ); + + if ( bars_i > bar_i ) + tor( NORMAL_ver ) << bars_i << flush; + Moment end_mom = next_end_mom( now_mom ); if ( ( begin_mom > now_mom ) && ( begin_mom < end_mom ) ) then_mom = begin_mom; else then_mom = end_mom; - dtor << "begin: " << begin_mom << " end: " << end_mom << endl; - dtor << "slice: " << now_mom << ", " << then_mom << endl; + tor( DEBUG_ver ) << "begin: " << begin_mom << " end: " << end_mom << endl; + tor( DEBUG_ver ) << "slice: " << now_mom << ", " << then_mom << endl; if ( open_voices.size() > 1 ) - lily_stream_r << "{ "; + lily_stream_r << "< "; for ( PCursor i( open_voices.top() ); i.ok(); i++ ) lily_stream_r << i->mudela_str( now_mom, then_mom, open_voices.size() - 1 ); if ( open_voices.size() > 1 ) - lily_stream_r << "} "; + lily_stream_r << "> "; now_mom = then_mom; remove_end_at( open_voices, now_mom ); if ( bars_i > bar_i ) { - bar_i++; - mtor << ']' << flush; + bar_i = bars_i; + tor( NORMAL_ver ) << ']' << flush; } } + bar_i++; + tor( NORMAL_ver ) << '[' << bar_i << ']' << flush; + lily_stream_r.tnedni(); - lily_stream_r << "$} % " << name_str_; + lily_stream_r << "} % " << name_str_; lily_stream_r.newline(); } @@ -182,8 +199,8 @@ Midi_track::remove_end_at( PointerList& open_voices_r, Moment mom ) for ( PCursor i( open_voices_r.top() ); i.ok(); i++ ) // if ( i->end_mom() == mom ) { if ( i->end_mom() <= mom ) { - dtor << "open_voices (" << open_voices_r.size() << "): -1\n"; - i.remove_p(); // remove? // no delete; only a copy + tor( DEBUG_ver ) << "open_voices (" << open_voices_r.size() << "): -1\n"; + i.remove_p(); if ( !i.ok() ) break; } diff --git a/mi2mu/midi-voice.cc b/mi2mu/midi-voice.cc index e963be2f1c..5d476ddcc5 100644 --- a/mi2mu/midi-voice.cc +++ b/mi2mu/midi-voice.cc @@ -26,12 +26,12 @@ Moment Midi_voice::end_mom() { Moment now_mom = begin_mom_; - dtor << now_mom << ", "; + tor( DEBUG_ver ) << now_mom << ", "; for ( PCursor i( midi_event_p_list_.top() ); i.ok(); i++ ) { - dtor << now_mom << ", "; + tor( DEBUG_ver ) << now_mom << ", "; now_mom += i->mom(); } - dtor << endl; + tor( DEBUG_ver ) << endl; return now_mom; } @@ -56,7 +56,7 @@ Midi_voice::mudela_str( Moment from_mom, Moment to_mom, bool multiple_bo ) } if ( str.length_i() && multiple_bo ) - str = "\\music{ " + str + "} "; + str = "{ " + str + "} "; return str; } diff --git a/mi2mu/my-midi-lexer.cc b/mi2mu/my-midi-lexer.cc index ba578d1dfc..8893005c76 100644 --- a/mi2mu/my-midi-lexer.cc +++ b/mi2mu/my-midi-lexer.cc @@ -15,21 +15,21 @@ My_midi_lexer* midi_lexer_l_g = 0; My_midi_lexer::My_midi_lexer( String &filename_str, Sources * sources ) { - source_file_p_ =sources->get_file_l(filename_str); - switch_streams( source_file_p_->istream_l() ); + source_file_l_ =sources->get_file_l(filename_str); + switch_streams( source_file_l_->istream_l() ); errorlevel_i_ = 0; char_count_ = 0; } My_midi_lexer::~My_midi_lexer() { - delete source_file_p_; +// delete source_file_p_; } void My_midi_lexer::error( char const* sz_l ) { - if ( !source_file_p_ ) { + if ( !source_file_l_ ) { cerr << "error at EOF" << sz_l << '\n'; } else { char const* ch_C = here_ch_C(); @@ -47,7 +47,7 @@ My_midi_lexer::error( char const* sz_l ) char const* My_midi_lexer::here_ch_C() { - return source_file_p_->ch_C() + char_count_ ; + return source_file_l_->ch_C() + char_count_ ; } int diff --git a/mi2mu/my-midi-parser.cc b/mi2mu/my-midi-parser.cc index 9a7ece723b..1530e36ac8 100644 --- a/mi2mu/my-midi-parser.cc +++ b/mi2mu/my-midi-parser.cc @@ -113,7 +113,7 @@ My_midi_parser::note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i ) // assert( start_i64 != -1 ); // did we start? Duration dur( 0 ); - if ( Duration_convert::be_blonde_b_s ) + if ( Duration_convert::no_quantify_b_s ) dur = Duration_convert::ticks2_dur( (I64)now_i64_ - start_i64 ); else dur = Duration_convert::ticks2standardised_dur( (I64)now_i64_ - start_i64 ); @@ -124,7 +124,7 @@ int My_midi_parser::output_mudela( String filename_str ) { assert( midi_score_p_ ); - mtor << "\nProcessing..." << endl; + tor( NORMAL_ver ) << "\nProcessing..." << endl; midi_score_p_->process(); return midi_score_p_->output_mudela( filename_str ); } @@ -132,7 +132,7 @@ My_midi_parser::output_mudela( String filename_str ) int My_midi_parser::parse() { - mtor << "\nParsing..." << flush; + tor( NORMAL_ver ) << "\nParsing..." << flush; return ::yyparse(); } -- 2.39.5