From 8309cbcd6660ea1f0b35abacbb424ddc4158e448 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 24 Mar 1997 00:44:41 +0100 Subject: [PATCH] release: 0.0.44 --- .dstreamrc | 6 +- .version | 3 +- Documentation/CodingStyle.pod | 6 + Documentation/INSTALL.pod | 5 +- Documentation/lilyinput-pre-0.1.pod | 8 - Documentation/{lilyinput.pod => mudela.pod} | 111 ++++++- INSTALL.text | 18 +- NEWS | 15 +- README | 4 + TODO | 17 +- flower/.version | 2 +- flower/NEWS | 4 + flower/flower-debug.cc | 18 + flower/include/flower-debug.hh | 25 ++ flower/include/path.hh | 10 +- flower/include/string-data.hh | 12 +- flower/include/string-data.inl | 22 +- flower/include/string-handle.hh | 10 +- flower/include/string-handle.inl | 18 +- flower/include/string.hh | 10 +- flower/include/vector.hh | 1 - flower/{matdebug.cc => matrix-debug.cc} | 19 +- flower/path.cc | 14 +- flower/scalar.cc | 2 +- flower/string-convert.cc | 16 +- flower/string.cc | 32 +- init/dutch.ini | 140 ++++---- input/cadenza.ly | 12 +- input/coriolan-alto.ly | 4 +- input/error.ly | 18 +- input/fugue1.midi.ly | 80 ++--- input/kortjakje.ly | 12 +- input/maartje.ly | 8 +- input/midi.ly | 2 +- input/mlalt.ly | 108 +++--- input/mlcello.ly | 102 +++--- input/mlvio1.ly | 10 +- input/mlvio2.ly | 38 +-- input/pre1.midi.ly | 120 +++---- input/scales.ly | 18 +- input/scsii-menuetto.ly | 22 +- input/standchen.ly | 164 +++++----- input/twinkle.ly | 4 +- input/wohltemperirt.ly | 25 +- lib/binary-source-file.cc | 6 +- lib/duration-convert.cc | 287 ++++++++++++++++ lib/duration.cc | 334 ++----------------- lib/includable-lexer.cc | 77 +++++ lib/include/binary-source-file.hh | 2 + lib/include/duration-convert.hh | 103 ++++++ lib/include/duration.hh | 151 +++------ lib/include/includable-lexer.hh | 39 +++ lib/include/input-file.hh | 28 -- lib/include/proto.hh | 2 +- lib/include/source-file.hh | 10 +- lib/include/source.hh | 20 +- lib/input-file.cc | 47 --- lib/source-file.cc | 128 +++----- lib/source.cc | 54 ++- lib/template.cc | 6 + lily/.version | 2 +- lily/Makefile | 2 +- lily/bar-reg.cc | 2 +- lily/clef-reg.cc | 4 +- lily/debug.cc | 7 +- lily/headreg.cc | 5 +- lily/include/input-score.hh | 2 +- lily/include/input-staff.hh | 2 +- lily/include/lily-proto.hh | 2 + lily/include/local-key-reg.hh | 2 +- lily/include/main.hh | 3 +- lily/include/musical-request.hh | 10 +- lily/include/my-lily-lexer.hh | 41 +-- lily/include/my-lily-parser.hh | 65 ++++ lily/include/parseconstruct.hh | 19 +- lily/include/request.hh | 2 +- lily/include/rest.hh | 6 +- lily/include/score.hh | 2 +- lily/include/staff-elem-info.hh | 4 +- lily/include/text-def.hh | 2 +- lily/include/voice-element.hh | 2 +- lily/input-music.cc | 2 +- lily/input-score.cc | 6 +- lily/input-staff.cc | 6 +- lily/key-reg.cc | 2 +- lily/lexer.l | 57 ++-- lily/local-key-reg.cc | 16 +- lily/lyric-item.cc | 3 +- lily/main.cc | 34 +- lily/midi-item.cc | 8 +- lily/midi-output.cc | 57 +--- lily/midi-stream.cc | 4 +- lily/musical-request.cc | 33 +- lily/my-lily-lexer.cc | 85 ++--- lily/my-lily-parser.cc | 232 +++++++++++++ lily/note.cc | 183 +---------- lily/notehead.cc | 4 +- lily/parser.y | 345 +++++++++----------- lily/rest.cc | 18 +- lily/score.cc | 6 +- lily/scores.cc | 2 +- lily/slur-reg.cc | 4 +- lily/staff-walker.cc | 2 +- lily/stem-beam-reg.cc | 18 +- lily/template3.cc | 3 - lily/tex-stream.cc | 3 +- lily/text-def.cc | 2 +- lily/voice-elt.cc | 13 +- lily/walk-regs.cc | 6 +- lily/warn.cc | 25 +- make/Rules.make | 20 +- make/Targets.make | 33 +- make/Variables.make | 7 +- make/lilypond.spec.in | 2 +- mi2mu/include/mi2mu.hh | 2 +- mi2mu/include/midi-global.hh | 8 +- mi2mu/include/my-midi-lexer.hh | 12 +- mi2mu/include/my-midi-parser.hh | 79 ++--- mi2mu/lily-stream.cc | 162 ++++----- mi2mu/main.cc | 42 ++- mi2mu/mi2mu-version.cc | 2 +- mi2mu/midi-event.cc | 12 +- mi2mu/midi-lexer.l | 6 +- mi2mu/my-midi-lexer.cc | 61 ++-- mi2mu/my-midi-parser.cc | 12 +- mi2mu/template.cc | 1 - mi2mu/version.cc | 2 +- 127 files changed, 2354 insertions(+), 2063 deletions(-) rename Documentation/{lilyinput.pod => mudela.pod} (75%) create mode 100644 flower/flower-debug.cc create mode 100644 flower/include/flower-debug.hh rename flower/{matdebug.cc => matrix-debug.cc} (68%) create mode 100644 lib/duration-convert.cc create mode 100644 lib/includable-lexer.cc create mode 100644 lib/include/duration-convert.hh create mode 100644 lib/include/includable-lexer.hh delete mode 100644 lib/include/input-file.hh delete mode 100644 lib/input-file.cc create mode 100644 lib/template.cc create mode 100644 lily/include/lily-proto.hh create mode 100644 lily/include/my-lily-parser.hh create mode 100644 lily/my-lily-parser.cc diff --git a/.dstreamrc b/.dstreamrc index dd50d37872..63a0a94456 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -1,7 +1,7 @@ # class name silence? Dstream 1 -My_lily_lexer 0 +My_lily_lexer 1 PCol 1 Score_column 1 Ineq_constrained_qp 1 @@ -13,9 +13,9 @@ Idealspacing 1 # yydebug InitParser 1 -Parser 0 +Parser 1 InitDeclarations 1 -Declarations 0 +Declarations 1 # FlexLexer debug InitLexer 1 Lexer 1 diff --git a/.version b/.version index f3fe58849a..18dcdc6982 100644 --- a/.version +++ b/.version @@ -1,8 +1,7 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 43 +TOPLEVEL_PATCH_LEVEL = 44 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf TOPLEVEL_MY_PATCH_LEVEL = -# diff --git a/Documentation/CodingStyle.pod b/Documentation/CodingStyle.pod index 66ee04705f..2f65fb775e 100644 --- a/Documentation/CodingStyle.pod +++ b/Documentation/CodingStyle.pod @@ -311,6 +311,12 @@ user built array. const. Note that the proper order C i.s.o. C +=item C + +A const pointer. This would be equivalent to C<_c_l>, but since any +"const" pointer has to be a link (you can't delete a const pointer), +it is superfluous. + =item C temporary pointer to object (link) diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 4a389171dd..4615b850f2 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -85,7 +85,10 @@ have the gnu development tools, and your make is gnu make. If this is not the case, you can adjust your environment variables to your taste: - CXXFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" configure + export CPPFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" + configure + +C are the preprocessor flags. the configure script is Cygnus configure, and it will accept B<--help>. If you are not root, you will probably have to make it with diff --git a/Documentation/lilyinput-pre-0.1.pod b/Documentation/lilyinput-pre-0.1.pod index 58a4378d4b..885b303306 100644 --- a/Documentation/lilyinput-pre-0.1.pod +++ b/Documentation/lilyinput-pre-0.1.pod @@ -69,11 +69,3 @@ 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. diff --git a/Documentation/lilyinput.pod b/Documentation/mudela.pod similarity index 75% rename from Documentation/lilyinput.pod rename to Documentation/mudela.pod index 6fdedd2148..02f06aeffb 100644 --- a/Documentation/lilyinput.pod +++ b/Documentation/mudela.pod @@ -1,14 +1,12 @@ =head1 NAME -LilyInput - LilyPond input format -- Mudela 0.1 - -B this doc describes the I input format, S. +Mudela - LilyPond input format 0.1 =head1 DESCRIPTION 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, @@ -100,7 +98,7 @@ short excerpts to be used in musicological publications. =head1 Overview -The Musical Definition Language (Mudela) S, +The Musical Definition Language (Mudela) S, has a logical structure, making use of typing and naming (using identifiers), that allows for flexible input, and definition reuse. @@ -210,6 +208,11 @@ In Lyrics mode, a word is looked up in the following order: In Lyric mode every sequence of non-digit and non-white characters starting with an alphabetic character is considered a word. + a&@&@&TSI|{[ % a word + 1THtrhortho % not a "word" + Leise Fl\"u\ss{}teren meine Sapfe % 4 words + + =back These modes are of a lexical nature. Normal and Note mode largely @@ -223,18 +226,18 @@ enter. a'4 % dutch names -is a A-1 pitched quaver. The ' as well as the ` signify an octave change. +is a A-1 pitched quaver. The ' as well as the ' signify an octave change. A-1 is 440 Hz concert-pitch. C is also known as the central c. More examples: - `a % 110 + 'a % 110 a % 220 a' % 440 a'' % 880 another example: - `as4.*2/3 + 'as4.*2/3 This is an A flat, (just below 110 Hz concert-pitch). The C<*2/3> signifies that this note is part of a triplet (3 in stead of 2). The @@ -256,7 +259,7 @@ The default language for notenames is defined to be dutch, The standard notenames also have uppercase versions, which octavate down: - a % 220 + a % 220 concert-pitch A % 110 'A % 55 A' % 220 @@ -266,7 +269,7 @@ The rest is named r -These notenames along with duration is enough material to construct +These notenames along with duration are enough material to construct simple melodies: c4 c4 g4 g4 a4 a4 g2 @@ -312,6 +315,44 @@ The general form of a note is: Notenames are just identifiers, and can be declared for any language appropriate (see F). +=head2 Defaults + +If omit the duration of a, a default value is substituted. For this +default value, there are two modes: + +=over 4 + +=item 1 + +Use the last duration explicitly entered + +=item 2 + +Use the explicitly set "default duration" + +=back + +Thus the following inputs are equivalent + + c4 c4 c16 c16 c16 s16 c4 c16 + + \duration { "last" } + c4 c c16 c c c c4 c16 + + \duration { 4 } + c c c16 c16 c16 c16 c c16 + + \duration { 16 } + c4 c4 c c c c c4 + +If you are typing music which does not lie in the "small" and "large" +octave, you can prevent having to type C<'> all the time by using the +C<\octave> command: These two notes have the same pitch. + + c'' \octave{2} c + +By default the setting of C<\octave> is 0. + =head2 Lyrics Lyrics in Mudela resemble Simple mudela a lot, with notes substituted @@ -326,7 +367,34 @@ duration entry are bound together using an underscore He_could4 not4 +=head2 Music direction + +Mudela reads left to right, but LilyPond can stack voices and +Voice_elements which are produced in two directions: horizontal +(voice like) and vertical (chord like) + +You can start horizontal music by enclosing a sequence of notes with { and } + + { c c g g a a g2 } % twinkle twinkle + +You can start vertical music (a "chord") by enclosing a sequence of +notes with < and >. Example: + + % a-major chord + +You can also put vertical music inside horizontal music: + + { c < c e > } % 4 increasing chords + +And vice versa + < \multivoice + {c c g g a a g2} + {r2 r2 c c g g a a g2} > % a canon + +The duration of a chord equals the union of the durations of each of +its elements. The C<\multivoice> is a construct which is explained +below. =head2 Rhythms @@ -356,7 +424,30 @@ Examples are included with the LilyPond distribution. For the sake of maintenance no long examples are included in this document. +=head2 Requests + +=head2 Voice + +=head2 Voice_element + +=head2 Voice groups + =head2 Other LilyPond first reads F, which contains declarations crucial to proper operation of LilyPond (symbol tables, note names). + +=head1 HISTORY + + +This language has a number of roots. First and foremost, LilyPond's +predecessor mpp was the inspiration of simple Mudela. Secondly, the +hierarchical structure looks a lot like Rayce's (Rayce is a raytracer +that I've written as a hobby project. ), which in turn owes a lot to +POVRay. + +Now, we know, musictypesetting and raytracing do not necessarily +require the same input format, and we know that a lot more ways exist +to convert music to ASCII, but we did give this language some +thoughts. As always suggestions are appreciated. + diff --git a/INSTALL.text b/INSTALL.text index fa4c437bca..a42ca956da 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -14/Mar/97 LilyPond 0.0.42 1 +24/Mar/97 LilyPond 0.0.44 1 @@ -82,7 +82,10 @@ INSTALL(1) LilyPond documentation INSTALL(1) your make is gnu make. If this is not the case, you can adjust your environment variables to your taste: - CXXFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" configure + export CPPFLAGS="-I /home/me/my_include -DWEIRD_FOOBAR" + configure + + CPPFLAGS are the preprocessor flags. the configure script is Cygnus configure, and it will accept --------hhhheeeellllpppp. If you are not root, you will probably have @@ -122,12 +125,9 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG compile. It's lot slower than most MusiXTeX preprocessors) - +o TeX - - -14/Mar/97 LilyPond 0.0.42 2 +24/Mar/97 LilyPond 0.0.44 2 @@ -136,6 +136,8 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG INSTALL(1) LilyPond documentation INSTALL(1) + +o TeX + +o The MusixTeX fonts. (I use those found in MusixTeX T.59) Please refer to the man page for more information. @@ -191,8 +193,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS - - -14/Mar/97 LilyPond 0.0.42 3 +24/Mar/97 LilyPond 0.0.44 3 diff --git a/NEWS b/NEWS index cb41bce2b2..7b7354de36 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +****** +pl 44 + - pure parser, My_lily_parser + - ''a iso ``a + - Includable_lexer + - junk Input_file + - Duration in parser, Duration restructuring + - grandiose lexer hax. Flex should be fixed, really. + Lexer much faster now. + - opps. mi2mu broken + ****** pl 43 - transposition. @@ -9,14 +20,14 @@ pl 43 pl 42.hwn3 - const naming change (T const <-> const T) - - Mudela 0.1 + - Mudela 0.1 (roughly the same as below..) pl 42.3 - moving towards Mudela 0.1: * (almost) all keywords must be preceded by backslash '\' * explicit lexer switches '$' and '@' dropped * keyword "music" dropped for horizontal music - * keywords "\lyric" "\melodic" "\rhythmic" introduced, e.g.: + * keywords "\lyric" " introduced, e.g.: melody = \melodic { c c | g g } * staff initialisable with music identifier: \staff{ melody } diff --git a/README b/README index 9042e4f255..229d052b1e 100644 --- a/README +++ b/README @@ -1,3 +1,7 @@ + +warning: the --enable-optimise compile seems to broken!! + +=================== IMPORTANT: if you have downloaded a diff --git a/TODO b/TODO index e074ce5aa6..5e14b414d8 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,6 @@ before 0.1 + + * fix -O2 -NDEBUG compile * remove spurious/outdated comments in .ly, debug .ly @@ -8,13 +10,15 @@ before 0.1 * decent TeX page layout + * per-pstaff item-widths + * remove unnecessary or confusing constructs from .ly This is an assorted collection of stuff that will be done, might be done, or is an idea that I want to think about PARSER - * Duration + * Duration-> Musical_duration, typedef Rational Duration? MAKE-STUFF @@ -89,9 +93,8 @@ SMALLISH PROJECTS * parshape - * a pure parser? - - * read from mmap directly: study yy_scan_buffer + * read from mmap directly: bugreport to flex developers-> + yy_scan_buffer in C++.. * binsearch/hash for identifiers @@ -140,6 +143,10 @@ DOC FUTURE + * slur parts as a script + + * multiple scripst. + * mixed fontsizes * put scripts on bars @@ -174,8 +181,6 @@ IDEAS * move MIDI io to a ANSI C libmidi library. - * fold indentifiers and notenames? - * itemcolumns: Use dummy items. * use an embedded language: scheme, lisp, S-lang, Perl, GUILE, ? diff --git a/flower/.version b/flower/.version index c4828f0767..ea70f79da1 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 8 +PATCH_LEVEL = 9 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/NEWS b/flower/NEWS index 4dd5330743..3ee8480d71 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,3 +1,7 @@ +pl 1.1.9 + - _C iso _c_l + - flower debug. + pl 1.1.8 diff --git a/flower/flower-debug.cc b/flower/flower-debug.cc new file mode 100644 index 0000000000..7617faaa24 --- /dev/null +++ b/flower/flower-debug.cc @@ -0,0 +1,18 @@ +#include +#include "flower-debug.hh" +#include "dstream.hh" + +bool flower_check_debug=false; +ofstream null_device ( "/dev/null"); +Dstream default_flower_stream(&null_device ,"/dev/null"); +Dstream *flower_dstream = &default_flower_stream; + +/** + Set the debugging output. Will not delete/swallow argument. + */ +void set_flower_debug(Dstream&ds, bool b) +{ + flower_check_debug = b; + flower_dstream = &ds; +} + diff --git a/flower/include/flower-debug.hh b/flower/include/flower-debug.hh new file mode 100644 index 0000000000..1fe12e09e1 --- /dev/null +++ b/flower/include/flower-debug.hh @@ -0,0 +1,25 @@ +/* + flower-debug.hh -- declare + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef FLOWER_DEBUG_HH +#define FLOWER_DEBUG_HH + +#include "dstream.hh" + +extern Dstream *flower_dstream; +extern bool flower_check_debug; +#ifdef NPRINT +#define fdebug if ( 0 ) *flower_dstream +#else +#define fdebug if (flower_check_debug) \ + flower_dstream->identify_as(__PRETTY_FUNCTION__) +#endif +void set_flower_debug(Dstream&ds, bool); + +#endif // FLOWER_DEBUG_HH diff --git a/flower/include/path.hh b/flower/include/path.hh index bc4d9f3776..0bed543538 100644 --- a/flower/include/path.hh +++ b/flower/include/path.hh @@ -17,7 +17,7 @@ class File_path : private Array { public: /// locate a file in the search path - String find(String nm); + String find(String nm)const; /// construct using prefix. Normally argv[0]. File_path(String); @@ -26,7 +26,13 @@ public: Array::push; void add(String str) { push(str); } }; -/// split path into its components +/** split a path into its components. + + @params path + + @return + String & drive, String &dirs, String &filebase, String &extension + */ void split_path(String path, String &drive, String &dirs, String &filebase, String &extension); #endif diff --git a/flower/include/string-data.hh b/flower/include/string-data.hh index ecd7159074..318f422f16 100644 --- a/flower/include/string-data.hh +++ b/flower/include/string-data.hh @@ -54,20 +54,20 @@ friend class String_handle; void tighten(); // assignment. - void set( Byte const* byte_c_l, int length_i ); + void set( Byte const* byte_C, int length_i ); - void set( char const* ch_c_l ); + void set( char const* ch_C ); /// concatenation. - void append( Byte const* byte_c_l, int length_i ); + void append( Byte const* byte_C, int length_i ); - void operator += ( char const* ch_c_l ); + void operator += ( char const* ch_C ); - char const* ch_c_l() const; + char const* ch_C() const; char* ch_l(); - Byte const* byte_c_l() const; + Byte const* byte_C() const; // idem, non const Byte* byte_l(); diff --git a/flower/include/string-data.inl b/flower/include/string-data.inl index d2b925d0ce..5a3bb390ef 100644 --- a/flower/include/string-data.inl +++ b/flower/include/string-data.inl @@ -105,29 +105,29 @@ String_data::tighten() } // assignment. INLINE void -String_data::set( Byte const* byte_c_l, int length_i ) +String_data::set( Byte const* byte_C, int length_i ) { OKW(); - assert( byte_c_l && byte_c_l != data_byte_p_); + assert( byte_C && byte_C != data_byte_p_); length_i_ = length_i; remax( length_i_ ); // copies too - memcpy( data_byte_p_, byte_c_l, length_i_ ); + memcpy( data_byte_p_, byte_C, length_i_ ); data_byte_p_[ length_i_ ] = 0; } INLINE void -String_data::set( char const* ch_c_l ) +String_data::set( char const* ch_C ) { - set( (Byte const*)ch_c_l, strlen( ch_c_l ) ); + set( (Byte const*)ch_C, strlen( ch_C ) ); } /// concatenation. INLINE void -String_data::append( Byte const* byte_c_l, int length_i ) +String_data::append( Byte const* byte_C, int length_i ) { OK(); OKW(); @@ -135,22 +135,22 @@ String_data::append( Byte const* byte_c_l, int length_i ) length_i_ += length_i; remax( length_i_ ); - memcpy( data_byte_p_ + old_i, byte_c_l, length_i ); + memcpy( data_byte_p_ + old_i, byte_C, length_i ); data_byte_p_[ length_i_ ] = 0; } INLINE void -String_data::operator += ( char const* ch_c_l ) +String_data::operator += ( char const* ch_C ) { - append( (Byte const*)ch_c_l, strlen( ch_c_l ) ); + append( (Byte const*)ch_C, strlen( ch_C ) ); } INLINE char const* -String_data::ch_c_l() const +String_data::ch_C() const { return (char const*)data_byte_p_; } @@ -161,7 +161,7 @@ String_data::ch_l() } INLINE Byte const* -String_data::byte_c_l() const +String_data::byte_C() const { return data_byte_p_; } diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh index 5b7a12f648..3f42e860e6 100644 --- a/flower/include/string-handle.hh +++ b/flower/include/string-handle.hh @@ -38,8 +38,8 @@ public: ~String_handle(); String_handle(String_handle const & src); - Byte const* byte_c_l() const; - char const* ch_c_l() const; + Byte const* byte_C() const; + char const* ch_C() const; Byte* byte_l(); char* ch_l(); bool is_binary_bo()const; @@ -48,11 +48,11 @@ public: Byte operator[](int j) const; /** Access elements. WARNING: NOT SAFE - don't use this for loops. Use byte_c_l() + don't use this for loops. Use byte_C() */ Byte &operator[](int j); - void append( Byte const* byte_c_l, int length_i ); - void set( Byte const* byte_c_l, int length_i ); + void append( Byte const* byte_C, int length_i ); + void set( Byte const* byte_C, int length_i ); void operator = (char const *p); void trunc(int j); int length_i() const; diff --git a/flower/include/string-handle.inl b/flower/include/string-handle.inl index 1f1d44ab13..63b2ab379d 100644 --- a/flower/include/string-handle.inl +++ b/flower/include/string-handle.inl @@ -72,15 +72,15 @@ String_handle::ch_l() } INLINE Byte -const* String_handle::byte_c_l() const +const* String_handle::byte_C() const { - return data->byte_c_l(); + return data->byte_C(); } INLINE char const* -String_handle::ch_c_l() const +String_handle::ch_C() const { - return (char const*)data->byte_c_l(); + return (char const*)data->byte_C(); } INLINE void @@ -107,7 +107,7 @@ String_handle::operator[](int j) const } // !NOT SAFE! -// don't use this for loops. Use byte_c_l() +// don't use this for loops. Use byte_C() INLINE Byte & String_handle::operator[](int j) { @@ -116,17 +116,17 @@ String_handle::operator[](int j) } INLINE void -String_handle::append( Byte const* byte_c_l, int length_i ) +String_handle::append( Byte const* byte_C, int length_i ) { copy(); - data->append( byte_c_l, length_i ); + data->append( byte_C, length_i ); } INLINE void -String_handle::set( Byte const* byte_c_l, int length_i ) +String_handle::set( Byte const* byte_C, int length_i ) { copy(); - data->set( byte_c_l, length_i ); + data->set( byte_C, length_i ); } INLINE void diff --git a/flower/include/string.hh b/flower/include/string.hh index 8270e01e08..0e0b9fb4dd 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -66,7 +66,7 @@ public: /// String s = "abc"; String( char const* source ); - String( Byte const* byte_c_l, int length_i ); + String( Byte const* byte_C, int length_i ); /// "ccccc" String( char c, int n = 1 ); @@ -79,13 +79,13 @@ public: /// return a "new"-ed copy of contents Byte* copy_byte_p() const; // return a "new"-ed copy of contents - char const* ch_c_l() const; - Byte const* byte_c_l() const; + char const* ch_C() const; + Byte const* byte_C() const; char* ch_l(); Byte* byte_l(); - /// deprecated; use ch_c_l() - operator char const* () const { return ch_c_l(); } + /// deprecated; use ch_C() + operator char const* () const { return ch_C(); } String &operator =( String const & source ); diff --git a/flower/include/vector.hh b/flower/include/vector.hh index 323d03db88..fdeab97f13 100644 --- a/flower/include/vector.hh +++ b/flower/include/vector.hh @@ -7,7 +7,6 @@ class Dstream; class String; -void set_matrix_debug(Dstream&ds); /** a row of numbers. a vector. Storage is handled in Array, Vector only does the mathematics. diff --git a/flower/matdebug.cc b/flower/matrix-debug.cc similarity index 68% rename from flower/matdebug.cc rename to flower/matrix-debug.cc index bcc2843bca..47a66896a5 100644 --- a/flower/matdebug.cc +++ b/flower/matrix-debug.cc @@ -1,15 +1,6 @@ -#include "dstream.hh" +#include "flower-debug.hh" #include "matrix.hh" -static Dstream *dout = 0; - -/** - Set the debugging output. Will not delete/swallow argument. - */ -void set_matrix_debug(Dstream&ds) -{ - dout = &ds; -} Matrix::operator String() const { @@ -32,9 +23,7 @@ void Matrix::print() const { #ifndef NPRINT - if (!dout) - return; - *dout << *this; + fdebug << *this; #endif } @@ -56,8 +45,6 @@ void Vector::print() const { #ifndef NDEBUG - if (!dout) - return; - *dout << *this<<'\n'; + fdebug << *this<<'\n'; #endif } diff --git a/flower/path.cc b/flower/path.cc index c79962f00f..a0bbaca44f 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -3,6 +3,7 @@ */ #include #include "path.hh" +#include "flower-debug.hh" #ifndef PATHSEP #define PATHSEP '/' @@ -60,18 +61,23 @@ File_path::File_path(String pref) in any other added path, in this order. */ String -File_path::find(String nm) +File_path::find(String nm)const + { - for (int i=0; i < size(); i++) { + fdebug << "looking for " << nm ; + for (int i=0; i < size(); i++) { + String path = (*this)[i]; path+= "/"+nm; - + fdebug << path << "? "; FILE *f = fopen(path, "r"); // ugh! if (f) { + fdebug << "found\n"; fclose(f); return path; } } - return ""; + fdebug << "\n"; + return ""; } diff --git a/flower/scalar.cc b/flower/scalar.cc index 5edd9e997f..da86835063 100644 --- a/flower/scalar.cc +++ b/flower/scalar.cc @@ -26,7 +26,7 @@ Scalar::isnum() int conv = false; if (len()) { long l =0; - conv = sscanf(strh_.ch_c_l(), "%ld", &l); + conv = sscanf(strh_.ch_C(), "%ld", &l); } return len() && conv; } diff --git a/flower/string-convert.cc b/flower/string-convert.cc index 31e7a332b8..565c332228 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -27,10 +27,10 @@ String String_convert::bin2hex_str( String bin_str ) { String str; - Byte const* byte_c_l = bin_str.byte_c_l(); + Byte const* byte_C = bin_str.byte_C(); for ( int i = 0; i < bin_str.length_i(); i++ ) { - str += (char)nibble2hex_byte( *byte_c_l >> 4 ); - str += (char)nibble2hex_byte( *byte_c_l++ ); + str += (char)nibble2hex_byte( *byte_C >> 4 ); + str += (char)nibble2hex_byte( *byte_C++ ); } return str; } @@ -56,7 +56,7 @@ String_convert::dec2_i( String dec_str ) return 0; long l = 0; - int conv = sscanf( dec_str.ch_c_l(), "%ld", &l ); + int conv = sscanf( dec_str.ch_C(), "%ld", &l ); assert( conv ); return (int)l; @@ -78,7 +78,7 @@ String_convert::dec2_f( String dec_str ) if ( !dec_str.length_i() ) return 0; double d = 0; - int conv = sscanf( dec_str.ch_c_l(), "%lf", &d ); + int conv = sscanf( dec_str.ch_C(), "%lf", &d ); assert( conv ); return d; } @@ -90,11 +90,11 @@ String_convert::hex2bin_i( String hex_str, String& bin_str_r ) hex_str = "0" + hex_str; bin_str_r = ""; - Byte const* byte_c_l= hex_str.byte_c_l(); + Byte const* byte_C= hex_str.byte_C(); int i = 0; while ( i < hex_str.length_i() ) { - int high_i = hex2nibble_i( *byte_c_l++ ); - int low_i = hex2nibble_i( *byte_c_l++ ); + int high_i = hex2nibble_i( *byte_C++ ); + int low_i = hex2nibble_i( *byte_C++ ); if ( high_i < 0 || low_i < 0 ) return 1; // illegal char bin_str_r += String( (char)( high_i << 4 | low_i ), 1 ); diff --git a/flower/string.cc b/flower/string.cc index 3eaa5c1b09..d66951c931 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -25,7 +25,7 @@ void* mymemmove( void* dest, void const* src, size_t n ); Byte* String::copy_byte_p() const { - Byte const* src = strh_.byte_c_l(); + Byte const* src = strh_.byte_C(); Byte* dest = new Byte[strh_.length_i() + 1]; memcpy( dest, src, strh_.length_i() + 1 ); return dest; @@ -34,7 +34,7 @@ void String::print_on(ostream& os) const { if (!strh_.is_binary_bo()) - os << ch_c_l(); + os << ch_C(); else for ( int i = 0; i < length_i(); i++ ) os << (Byte)(*this)[ i ]; @@ -94,7 +94,7 @@ String::String( Byte const* byte_l, int length_i ) void String::append(String s) { - strh_.append( s.byte_c_l(), s.length_i() ); + strh_.append( s.byte_C(), s.length_i() ); } void String::operator +=(String s) @@ -116,15 +116,15 @@ String::length_i() const } Byte const* -String::byte_c_l() const +String::byte_C() const { - return strh_.byte_c_l(); + return strh_.byte_C(); } char const* -String::ch_c_l() const +String::ch_C() const { - return strh_.ch_c_l(); + return strh_.ch_C(); } Byte* @@ -145,8 +145,8 @@ String::ch_l() int String::compare_i(String const& s1, String const& s2 ) { - Byte const* p1 = s1.byte_c_l(); - Byte const* p2 = s2.byte_c_l(); + Byte const* p1 = s1.byte_C(); + Byte const* p2 = s2.byte_C(); if ( p1 == p2 ) return 0; @@ -164,7 +164,7 @@ String::index_last_i( char const c ) const if ( !length_i() ) return -1; - char const* me = strh_.ch_c_l(); + char const* me = strh_.ch_C(); char const* p = memrchr(me, length_i(), c ); if ( p ) return p - me; @@ -202,7 +202,7 @@ String::index_last_i( char const* string ) const // UGK! int String::index_i(char c ) const { - char const* me = strh_.ch_c_l(); + char const* me = strh_.ch_C(); char const* p = (char const *) memchr( me,c, length_i()); if ( p ) return p - me; @@ -218,9 +218,9 @@ String::index_i(char c ) const int String::index_i( String searchfor ) const { - char const* me = strh_.ch_c_l(); + char const* me = strh_.ch_C(); char const* p = (char const *) memmem( - me, length_i(), searchfor.ch_c_l(), searchfor.length_i()); + me, length_i(), searchfor.ch_C(), searchfor.length_i()); if ( p ) return p - me; @@ -240,7 +240,7 @@ String::index_any_i( String set ) const if ( !n ) return -1; - void const * me_l = (void const *) strh_.ch_c_l(); + void const * me_l = (void const *) strh_.ch_C(); for (int i=0; i < set.length_i(); i++) { char * found=(char*) memchr(me_l, set[i], n ); if (found) { @@ -274,7 +274,7 @@ String::right_str( int n ) const if ( n < 1) return ""; - return String( strh_.byte_c_l() + length_i() - n, n ); + return String( strh_.byte_C() + length_i() - n, n ); } @@ -310,7 +310,7 @@ String::mid_str( int index_i, int n ) const if ( ( n > length_i() ) || ( index_i + n > length_i() ) ) n = length_i() - index_i; - return String( byte_c_l() + index_i, n ); + return String( byte_C() + index_i, n ); } String diff --git a/init/dutch.ini b/init/dutch.ini index a44eaca96b..8aed19fa95 100644 --- a/init/dutch.ini +++ b/init/dutch.ini @@ -2,41 +2,41 @@ % common dutch names for notes. "es" means flat, "is" means sharp % -ceses = \melodic { 0 0 -2 } -ces = \melodic { 0 0 -1 } -c = \melodic { 0 0 0 } -cis = \melodic { 0 0 1 } -cisis = \melodic { 0 0 2 } -deses = \melodic { 0 1 -2 } -des = \melodic { 0 1 -1 } -d = \melodic { 0 1 0 } -dis = \melodic { 0 1 1 } -disis = \melodic { 0 1 2 } -eses = \melodic { 0 2 -2 } -es = \melodic { 0 2 -1 } -e = \melodic { 0 2 0 } -eis = \melodic { 0 2 1 } -eisis = \melodic { 0 2 2 } -feses = \melodic { 0 3 -2 } -fes = \melodic { 0 3 -1 } -f = \melodic { 0 3 0 } -fis = \melodic { 0 3 1 } -fisis = \melodic { 0 3 2 } -geses = \melodic { 0 4 -2 } -ges = \melodic { 0 4 -1 } -g = \melodic { 0 4 0 } -gis = \melodic { 0 4 1 } -gisis = \melodic { 0 4 2 } -ases = \melodic { 0 5 -2 } -as = \melodic { 0 5 -1 } -a = \melodic { 0 5 0 } -ais = \melodic { 0 5 1 } -aisis = \melodic { 0 5 2 } -beses = \melodic { 0 6 -2 } -bes = \melodic { 0 6 -1 } -b = \melodic { 0 6 0 } -bis = \melodic { 0 6 1 } -bisis = \melodic { 0 6 2 } +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 } % @@ -44,40 +44,40 @@ bisis = \melodic { 0 6 2 } % -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 } +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 } diff --git a/input/cadenza.ly b/input/cadenza.ly index ebef5ed7a1..8e8b5e8c73 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -24,25 +24,25 @@ cad = \music { \bar \empty r8 [c d] [e f g gis] \duration{4} - a-> `f()`e g - f-> `d()`cis e + a-> 'f()'e g + f-> 'd()'cis e \duration{8} d4^\fermata \bar \empty - r8 `a [`b cis] + r8 'a ['b cis] \duration{16} [d cis d e] f4()[f e d c] - `b4 + 'b4 \octave{} [d'8 c'8 a8]2/3 g2 \bar \empty [g c e g] [c' e g c']\octave{'} - [e `g c e] g4^\fermata %()% BUG! + [e 'g c e] g4^\fermata %()% BUG! \bar \empty [g8.(_"a \tempo" e g8. )e] a4. g8 [f8 e8 d8 c8] - `g2 d2^"tr" + 'g2 d2^"tr" c4 } diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index ad468d0573..eed877bb8c 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -34,7 +34,7 @@ alto = \music { } %30:2 { - \octave{ ` } + \octave{ -1 } \textstyle "italic" % this should be a \dynamic, rather than text [ c c_"cresc. \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ @@ -61,7 +61,7 @@ alto = \music { < \multivoice { \stem{ 1 }[ c16^"div." c16 c16 c16 ] c4 c2 } { - \octave{ ` } + \octave{ -1 } \textstyle "italic" \stem{ -1 } [ as16_"\ff" as16 as16 as16 ] as4_"simile" as2 \textstyle "roman" diff --git a/input/error.ly b/input/error.ly index 570300af98..9a432233b0 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,7 +1,7 @@ include "this-is-hopefully-a-nonexisting-file" mwa = \music { - + \meter{3/4} [ a8 a8 a8 a8 a8 ] % [ a8 ] % % segfault @@ -13,33 +13,27 @@ mwa = \music { a b c ||| % abc % ok; print error, no \output - \bla % no warning-> this STRING, reduced to lyric_elt. + \bla % STRING, reduced to lyric_elt. a [ b % warning, still \output - { a( b } % warning, still \output + < a( b > % warning, still \output a b ,c a b c-* a b c& - { a-. b-. } + < a-. b-. > } -bla = \music { - @ +bla = \lyrics { These Gates will open just like windows. % ok; warning - @ } include "this-is-hopefully-a-nonexisting-file" - -score { +\score { \staff { lyric \music { bla } } \staff { \melodic \music { mwa } } - \co\mmands { - \meter {3/4} - } } diff --git a/input/fugue1.midi.ly b/input/fugue1.midi.ly index 630b94a4ba..7ebb6970f4 100644 --- a/input/fugue1.midi.ly +++ b/input/fugue1.midi.ly @@ -54,7 +54,7 @@ track2 = \music { % 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{ + 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 } @@ -83,52 +83,52 @@ track2 = \music { track3 = \music { % \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{ + '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 + \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 } % track3 track4 = \music { % \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 + '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 } % track4 score { diff --git a/input/kortjakje.ly b/input/kortjakje.ly index d26a7431bf..36cfbb1246 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -38,17 +38,17 @@ begeleiding = % you to precede \keyword by a backslash: \ \music { \clef "bass" - \octave { ` } % default \octave: 1 below the first \octave. + \octave { ' } % 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 { ` } - e `g d `g c `g `b `g e `g d `g c `g `b `g + c e c f c e c d 'b c 'a 'f 'g 'c2 + \octave { ' } + e 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g %%%% var 1 r8 e8() c r8 e8() c r8 f8()c r8 e8()c - r8 d8()`b r8 c8()`a r8 `a8()`f r8 `e8()`c + r8 d8()'b r8 c8()'a r8 'a8()'f r8 'e8()'c } diff --git a/input/maartje.ly b/input/maartje.ly index ce3425fbb3..64fa7166ec 100644 --- a/input/maartje.ly +++ b/input/maartje.ly @@ -44,7 +44,7 @@ melody= \duration {4} < - { c () `bes [c8 c8] } + { c () 'bes [c8 c8] } { fis' ()gisis' fis8 fis8 } { d () d dis8 dis8 } { a () bes eis8 eis8 } @@ -55,11 +55,11 @@ melody= [d8 e8 f'8 g8] d8 e8 f8 g8 |fis''2 - | a8 b8 c'8 d'8 |c''8 ```c8 c4 |c4 c4 |c4 - \duration{ 16 } `b `a `g `f \duration{ 4} + | a8 b8 c'8 d'8 |c''8 '''c8 c4 |c4 c4 |c4 + \duration{ 16 } 'b 'a 'g 'f \duration{ 4} \clef\bass - |c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c + |c 'b 'a 'g 'f 'e 'd 'c ''b ''a ''g ''f ''e ''d ''c } } diff --git a/input/midi.ly b/input/midi.ly index 4382ed3bf2..08c6ce4755 100644 --- a/input/midi.ly +++ b/input/midi.ly @@ -11,7 +11,7 @@ melodie = \music { begeleiding = \music { \clef \bass - \octave{`} + \octave{-1} c c' | e' c' | f' c' | e' c' d' b | c' a | f g | c2 | diff --git a/input/mlalt.ly b/input/mlalt.ly index 50563fef84..3e0e419e4a 100644 --- a/input/mlalt.ly +++ b/input/mlalt.ly @@ -18,63 +18,63 @@ alto = \music { \octave{} \key{fis} %1 - [ `b8. `a ] [ `g8 `b c ] | + [ 'b8. 'a ] [ 'g8 'b c ] | %2 [ d8 g8 ] d4 | %3 [ e fis g a ] d4 | %4 - [ c `b `a `b ] `b4 | + [ c 'b 'a 'b ] 'b4 | %5=1 - [ `b8. `a ] [ `g8 `b c ] | + [ 'b8. 'a ] [ 'g8 'b c ] | %6=2 [ d8 g8 ] d4 | %7 - [ c `b `a `g ] [ `fis `e `d `c ] | + [ c 'b 'a 'g ] [ 'fis 'e 'd 'c ] | %8 - [ `d8. `e ] [ `d `fis `a c ] | + [ 'd8. 'e ] [ 'd 'fis 'a c ] | %9=1 - [ `b8. `a ] [ `g8 `b c ] | + [ 'b8. 'a ] [ 'g8 'b c ] | %10 - [ d8 `d8 ] d4 | + [ d8 'd8 ] d4 | %11=4 - [ c `b `a `b ] `b4 | + [ c 'b 'a 'b ] 'b4 | %12 - [ `a8 d8 ] `b4 | + [ 'a8 d8 ] 'b4 | %13 - [ d8. c ] [ `b8 `a `g ] | + [ d8. c ] [ 'b8 'a 'g ] | %14=10 - [ d8 `d8 ] d4 | + [ d8 'd8 ] d4 | %15 [ e8 fis8 ] [ g8 d8 ] | %16 \textstyle "italic" - [ c `a `fis `d ] `g4_"fine" | + [ c 'a 'fis 'd ] 'g4_"fine" | \textstyle "roman" % \scoreverb{\mulooseness=-1} % \newline %17 %=1 - [ `b8. `a ] [ `g8 `b c ] | + [ 'b8. 'a ] [ 'g8 'b c ] | %18=2 [ d8 g8 ] d4 | %19=3 [ e fis g a ] d4 | %20=4 - [ c `b `a `b ] `b4 | + [ c 'b 'a 'b ] 'b4 | %21=5=1 - [ `b8. `a ] [ `g8 `b c ] | + [ 'b8. 'a ] [ 'g8 'b c ] | %22=6=2 [ d8 g8 ] d4 | %23=20=4 - [ c `b `a `b ] `b4 | + [ c 'b 'a 'b ] 'b4 | %24 - [ `a8. `g ] [ `a cis e g ] | + [ 'a8. 'g ] [ 'a cis e g ] | %first modulation %25 [ fis8. e ] [ d8 fis g ] | %26 - [ a8 `a8 ] a4 | + [ a8 'a8 ] a4 | %27 [ g fis e fis ] fis4 | %28 @@ -82,44 +82,44 @@ alto = \music { %29 [ a8. g ] [ fis8 e d ] | %30 - [ a8 `a8 ] a4 | + [ a8 'a8 ] a4 | %31 [ b8 cis'8 ] [ d'8 a8 ] | %32 - [ g e cis `a ] d4 | + [ g e cis 'a ] d4 | %variant a %33 - [ `b8 `g `g ] [ `g8 `b c ] | + [ 'b8 'g 'g ] [ 'g8 'b c ] | %34 - [ d8 `g `g ] `g4 | + [ d8 'g 'g ] 'g4 | %35 - [ e8 `g `g ] [ `g8 e fis ] | + [ e8 'g 'g ] [ 'g8 e fis ] | %36 [ g8. fis32 e32 ] d4 | %37 - [ e8 c c ] [ c8 `b `a ] | + [ e8 c c ] [ c8 'b 'a ] | %38 - [ d8 `b `b ] [ `b8 `a `g ] | + [ d8 'b 'b ] [ 'b8 'a 'g ] | %39 - [ c8 `a `a ] [ `a8 `b `a ] | + [ c8 'a 'a ] [ 'a8 'b 'a ] | %40 - `a4 `g4 | + 'a4 'g4 | %41 - [ `g8 `a `g ] [ d8 e d ] | + [ 'g8 'a 'g ] [ d8 e d ] | %42 - [ `g8 `a `g ] [ g8 e8 ] | + [ 'g8 'a 'g ] [ g8 e8 ] | %43 - [ d8 e d ] [ d8 c `b ] | + [ d8 e d ] [ d8 c 'b ] | %44 - [ `b8. c32 `b32 ] `a4 | + [ 'b8. c32 'b32 ] 'a4 | %45 - [ `g `a `g `a `g `a ]4/6 [ `g `b c d e fis ]4/6 | + [ 'g 'a 'g 'a 'g 'a ]4/6 [ 'g 'b c d e fis ]4/6 | %46 - [ g fis e d `b `g ]4/6 [ `a8 `g8 ] | + [ g fis e d 'b 'g ]4/6 [ 'a8 'g8 ] | %47 - [ g fis e d c `b ]4/6 [ e d c `b `a `g ]4/6 | + [ g fis e d c 'b ]4/6 [ e d c 'b 'a 'g ]4/6 | %48 - [ d e d d `b `g ]4/6 [ `a8 `g8 ] | + [ d e d d 'b 'g ]4/6 [ 'a8 'g8 ] | %theme 2 \duration{8} %49 @@ -127,7 +127,7 @@ alto = \music { %50 [ e d c ]2/3 e4 | %51 - [ d g `g ]2/3 [ `g `a `b ]2/3 | + [ d g 'g ]2/3 [ 'g 'a 'b ]2/3 | %52 d4 e4 | %53 @@ -135,31 +135,31 @@ alto = \music { %54 [ e d c ]2/3 e4 | %55 - [ d g `g ]2/3 [ `g `a `b ]2/3 | + [ d g 'g ]2/3 [ 'g 'a 'b ]2/3 | %56 - `b4 c4 \key{bes es as} | % || \key\Es + 'b4 c4 \key{bes es as} | % || \key\Es %57 - [ `b d ] [ `g `b ] | + [ 'b d ] [ 'g 'b ] | %58 - [ c es ] [ `g c ] | + [ c es ] [ 'g c ] | %59 - [ d f ] [ `g f ] | + [ d f ] [ 'g f ] | %60 [ es16 d16 es16 f16 ] g4 | %61 [ as f ] [ d as ] | %62 - [ g es ] [ c `as ] | + [ g es ] [ c 'as ] | %63 - [ `g `b ] [ es d ] | + [ 'g 'b ] [ es d ] | %64 - [ c8. `g32 `es32 ] `c4 | % || \meter{6/8} + [ c8. 'g32 'es32 ] 'c4 | % || \meter{6/8} %65 es4.( [ )es d c ] | %66 es2. | %67 - d4.( [ )d c `b ] | + d4.( [ )d c 'b ] | %68 d2. | %69 @@ -174,21 +174,21 @@ alto = \music { c r4 r4. | % || \meter{2/4} %73 \duration{8} - [ `b d ] [ `g `b ] | + [ 'b d ] [ 'g 'b ] | %74 - [ c es ] [ `g c ] | + [ c es ] [ 'g c ] | %75 - [ d f ] [ `g f ] | + [ d f ] [ 'g f ] | %76 [ es16 d16 es16 f16 ] g4 | %77 [ as f ] [ d as ] | %78 - [ g es ] [ c `as ] | + [ g es ] [ c 'as ] | %79 - [ `g `b ] [ es d ] | + [ 'g 'b ] [ es d ] | %80 - [ c8. `g32 `es32 ] `c4 | + [ c8. 'g32 'es32 ] 'c4 | %81 g4 [ as g ] | %82 @@ -199,11 +199,11 @@ alto = \music { %84 [ as g f g ] as4 | %85 - f4 [ f des c `bes ] | + f4 [ f des c 'bes ] | %86 - `a2 | + 'a2 | %87 - `b2 | + 'b2 | %88 \textstyle "italic" c2_"dacapo" \key{fis} | diff --git a/input/mlcello.ly b/input/mlcello.ly index c513a366ea..76d9519123 100644 --- a/input/mlcello.ly +++ b/input/mlcello.ly @@ -13,13 +13,13 @@ % cello = \music { -\clef"bass" \octave{`} +\clef"bass" \octave{'} \duration{4} \key{fis} %%1 - g `g | + g 'g | %%2 - [ `g8. `a16 ] ``b | + [ 'g8. 'a16 ] ''b | %%3 c d | %%4 @@ -27,15 +27,15 @@ cello = \music { %%5=1 e2 | %%6=2 - [ `g8. `a16 ] ``b | + [ 'g8. 'a16 ] ''b | %%7 c d | %%8 - `g d | + 'g d | %%9=1 - `g2 | + 'g2 | %%10 - `g ``b | + 'g ''b | %%11=4 e [ g16 fis16 e16 d16( ] | %%12 @@ -45,16 +45,16 @@ cello = \music { %%14=10 [ d8 d'8 ] g | %%15 - [ c8 e8 ] [ g8 `g8 ] | + [ c8 e8 ] [ g8 'g8 ] | %%16 \textstyle "italic" [ d8 c'8 ] b_"fine" \textstyle "roman" | % \newline %%17=1 - g `g | + g 'g | %%18=2 - [ `g8. `a16 ] ``b | + [ 'g8. 'a16 ] ''b | %%19=3 c d | %%20=4 @@ -62,73 +62,73 @@ cello = \music { %%21=5=1 e2 | %%22=6=2 - [ `g8. `a16 ] ``b | + [ 'g8. 'a16 ] ''b | %%23=4 c g | %%24 - a `a | + a 'a | %%25 d2 | %%first modulation %%26 - d `fis | + d 'fis | %%27 - ``b [ dis16 c16 ``b16 `a16( ] | + ''b [ dis16 c16 ''b16 'a16( ] | %%28 - ) `a d | + ) 'a d | %%29 \duration{8} - [ `a a ] d4 | + [ 'a a ] d4 | %%30 - [ `a a ] d4 | + [ 'a a ] d4 | %%31 - [ `g ``b ] [ d `d ] | + [ 'g ''b ] [ d 'd ] | %%32 - [ `a a ] d4 | + [ 'a a ] d4 | %%variant a %%33 \duration{16} - [ `g8 `g `g ] [ `g8 `g `g ] | + [ 'g8 'g 'g ] [ 'g8 'g 'g ] | %%34 - [ `g8 `g `g ] g4 | + [ 'g8 'g 'g ] g4 | %%35 [ c8 c c ] [ c8 c' c' ] | %%36 g4 b4 | %%37 - [ a8 a a ] [ `a8 `a `a ] | + [ a8 a a ] [ 'a8 'a 'a ] | %%38 - [ ``b8 ``b ``b ] [ ``b8 ``b ``b ] | + [ ''b8 ''b ''b ] [ ''b8 ''b ''b ] | %%39 - [ `a8 `a `a ] [ `a8 `a `a ] | + [ 'a8 'a 'a ] [ 'a8 'a 'a ] | %%40 - `d4 `g4 | + 'd4 'g4 | %%41 \duration{8} \textstyle "italic" r_"pizz" \textstyle "roman" - g r `g | + g r 'g | %%42 r g e4 | %%43 - r b r ``b | + r b r ''b | %%44 r e a4 | %%45 r e r e | %%46 - r ``b [ d g ] | + r ''b [ d g ] | %%47 - r e r `a | + r e r 'a | %%48 - r ``b - [ `d `g ] | + r ''b + [ 'd 'g ] | %%theme 2 %%49 \textstyle "italic" r4_"arco" - [ `g `g `g ]2/3 | + [ 'g 'g 'g ]2/3 | \textstyle "roman" %%50 r4 [ c c c ]2/3 | @@ -137,37 +137,37 @@ cello = \music { %%52 c2 | %%53 - r4 [ `g `g `g ]2/3 | + r4 [ 'g 'g 'g ]2/3 | %%54 r4 [ c c c ]2/3 | %%55 g2 | %%56 - `g4 `c4 \key{bes es as}| -% \key\`es || + 'g4 'c4 \key{bes es as}| +% \key\'es || %%57 g r g r | %%58 c r c r | %%59 - `g r `g r | + 'g r 'g r | %%60 c r c r | %%61 - d4. ``b | + d4. ''b | %%62 c2 | %%63 - g4 `g4 | + g4 'g4 | %%64 - c4 `c4 | + c4 'c4 | % \meter{6/8} || %%65 [ c c c ] c4. | %%66 - [ `c `c `c ] `c4. | + [ 'c 'c 'c ] 'c4. | %%67 - [ `g `g `g ] `g4. | + [ 'g 'g 'g ] 'g4. | % \newline %%68 [ g g g ] g4. | @@ -185,28 +185,28 @@ cello = \music { %%74 c r c r | %%75 - `g r `g r | + 'g r 'g r | %%76 c r c4 | %%77 - d4. ``b | + d4. ''b | %%78 c2 | %%79 - g4 `g4 | + g4 'g4 | %%80 - c4 `c4 | + c4 'c4 | %%81 \duration{2} - `c | + 'c | %%82 - `c | + 'c | %%83 - `e | + 'e | %%84 - `f | + 'f | %%85 - `as | + 'as | %%86 c | %%87 @@ -215,6 +215,6 @@ cello = \music { \textstyle "italic" d_"dacapo" \key{fis} | \textstyle "roman" -% \key\`g || +% \key\'g || } diff --git a/input/mlvio1.ly b/input/mlvio1.ly index 9b3bf05604..0ef0d07821 100644 --- a/input/mlvio1.ly +++ b/input/mlvio1.ly @@ -65,7 +65,7 @@ violinI = \music { %22=6 g2 | %23=4 - e [ d16 c16 `b16 c16 ] | + e [ d16 c16 'b16 c16 ] | %24 cis cis' | %25 @@ -151,9 +151,9 @@ violinI = \music { c' r c'4 | %61 \duration{16} - [ as f d f as d' ]4/6 [ as f d `as d f ]4/6 | + [ as f d f as d' ]4/6 [ as f d 'as d f ]4/6 | %62 - [ g es c `g c es ]4/6 [ g c' es' c' g es ]4/6 | + [ g es c 'g c es ]4/6 [ g c' es' c' g es ]4/6 | %63 [ g d g bes d' g' ]4/6 [ f' d' bes g f d ]4/6 | %64 @@ -187,9 +187,9 @@ violinI = \music { c' r c'4 | %77 \duration{16} - [ as f d f as d' ]4/6 [ as f d `as d f ]4/6 | + [ as f d f as d' ]4/6 [ as f d 'as d f ]4/6 | %78 - [ g es c `g c es ]4/6 [ f c' es' c' g es ]4/6 | + [ g es c 'g c es ]4/6 [ f c' es' c' g es ]4/6 | %79 [ g d f b d' g' ]4/6 [ f' d' b g f d ]4/6 | %80 diff --git a/input/mlvio2.ly b/input/mlvio2.ly index 74940775cb..9f87985537 100644 --- a/input/mlvio2.ly +++ b/input/mlvio2.ly @@ -19,7 +19,7 @@ violinII = \music { %1 d2 | %2 - [ `b8. `a16 ] `g4 | + [ 'b8. 'a16 ] 'g4 | %3 [ g8 e8 ] fis | %4 @@ -27,17 +27,17 @@ violinII = \music { %5=1 e2 | %6=2 - [ `b8. `a16 ] `g4 | + [ 'b8. 'a16 ] 'g4 | %7 - `g `a | + 'g 'a | %8 - `b `a | + 'b 'a | %9=1 d2 | %10 - `b `g | + 'b 'g | %11=4 - `g2 | + 'g2 | %12 [ d8 e16 fis16 ] g | %13 @@ -54,7 +54,7 @@ violinII = \music { %17=1 d2 | %18=2 - [ `b8. `a16 ] `g4 | + [ 'b8. 'a16 ] 'g4 | %19=3 [ g8 e8 ] fis | %20=4 @@ -62,9 +62,9 @@ violinII = \music { %21=5=1 e2 | %22=6=2 - [ `b8. `a16 ] `g4 | + [ 'b8. 'a16 ] 'g4 | %23=4 - `g2 | + 'g2 | %24 cis e | %25 @@ -107,9 +107,9 @@ violinII = \music { \textstyle "italic" r_"pizz" \textstyle "roman" - `b r `b | + 'b r 'b | %42 - r `b `g4 | + r 'b 'g4 | %43 r fis r fis | %44 @@ -144,9 +144,9 @@ violinII = \music { f4 e4 \key{bes es as}| % \key\Es || %57 - d r `b r | + d r 'b r | %58 - `g r es r | + 'g r es r | %59 g r g r | %60 @@ -156,7 +156,7 @@ violinII = \music { %62 es2 | %63 - `b d4. | + 'b d4. | %64 es2 | % \meter{6/8} || @@ -164,9 +164,9 @@ violinII = \music { \duration{8} [ c c c ] c4. | %66 - [ `g `g `g ] `g4. | + [ 'g 'g 'g ] 'g4. | %67 - [ `b8 `b `b ] `b4. | + [ 'b8 'b 'b ] 'b4. | %68 [ g g g ] g4. | %69 @@ -179,9 +179,9 @@ violinII = \music { es r4 r4. | %73 % \meter{2/4} || - d r `b r | + d r 'b r | %74 - `g r es r | + 'g r es r | %75 g r g r | %76 @@ -192,7 +192,7 @@ violinII = \music { %78 es | %79 - `b8 d4. | + 'b8 d4. | %80 es | %81 diff --git a/input/pre1.midi.ly b/input/pre1.midi.ly index 3945d68be8..132410ba9a 100644 --- a/input/pre1.midi.ly +++ b/input/pre1.midi.ly @@ -37,36 +37,36 @@ track1 = \music { 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 + '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 } } @@ -82,36 +82,36 @@ track2 = \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 } } + } { \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. score { diff --git a/input/scales.ly b/input/scales.ly index ee267b8ce6..d31118d0bd 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -7,20 +7,20 @@ blah = \duration { 8 } \octave{ } |[ a a a a a a a a a ]6/9 - \octave{ ' } + \octave{ 1 } |[ a a a a a a a a a ]6/9 - \octave { ` } - [ `c `g d a e' b' f'' c''' g''' ]6/9 - [ g''' c''' f'' b' e' a d `g `c ]6/9 - \octave{ ' } - [ `c `g d a e' b' f'' c''' g''' ]6/9 - [ g''' c''' f'' b' e' a d `g `c ]6/9 + \octave { ' } + [ 'c 'g d a e' b' f'' c''' g''' ]6/9 + [ g''' c''' f'' b' e' a d 'g 'c ]6/9 + \octave{ 1 } + [ 'c 'g d a e' b' f'' c''' g''' ]6/9 + [ g''' c''' f'' b' e' a d 'g 'c ]6/9 \octave { } [ c g d' ]2/3 [ d' g c ]2/3 [ f c' g' ]2/3 [ g' c' f ]2/3 - \octave{ ' } + \octave{ 1 } [ c g d' ]2/3 [ d' g c ]2/3 [ f c' g' ]2/3 @@ -42,7 +42,7 @@ c1 [c d e f][g a b c'] % 10 |[c' b a g][f e d c] - } + } } \score { diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index b9f848715b..f53ff15fef 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -30,16 +30,16 @@ ii_menuetto = \music { \clef"alto"\meter{3/4} \key {bes} - \octave{} + \octave{1} \duration{8} < a2 f2 d2 df > bes4-. | %%2 < [ bes^"1" e c_"2"_"4" > a bes-. g-. ] a4-.^"4" | %%3 - < d4 `bes4-. > g4-. [ f-. e-. ] | + < d4 'bes4-. > g4-. [ f-. e-. ] | %%4 - < [ f `a > e d cis-. `b-. `a-. ] + < [ f 'a > e d cis-. 'b-. 'a-. ] %%5 < a2 f2 d2 > bes4-. | % @bes4-. | %%6 @@ -47,10 +47,10 @@ ii_menuetto = \music { c'4-. | % =c'4-. | %%7 < a4-. f4> - < d'4-.-upbow f4 `bes4 > - < e'4-.-downbow g4 `g4 > | + < d'4-.-upbow f4 'bes4 > + < e'4-.-downbow g4 'g4 > | %%8 - < cis'2.-upbow e2. `a2. > \bar ":|:"%%!! sorry! + < cis'2.-upbow e2. 'a2. > \bar ":|:"%%!! sorry! %%9 \clef "violin" < e'2 a2 df > @@ -70,9 +70,9 @@ ii_menuetto = \music { { \stem{-1} g4(\stem{-1}) f4 e4 }% ugh > | %%14 - < [ a f > g a f ] < d'4-upbow e4 `bes4 > | + < [ a f > g a f ] < d'4-upbow e4 'bes4 > | %%15 - < c'4-\downbow f4 `a4 > [ bes( )a g a ] | + < c'4-\downbow f4 'a4 > [ bes( )a g a ] | %%16 [ f( e )f a-. g-. bes-. ] | %%17 @@ -80,7 +80,7 @@ ii_menuetto = \music { %%18 < { [ c'( )bes c' a ] } { [ es ] } > fis4 | %%19 - < d'4-downbow g4 `bes4 > < c'4-upbow g4 c4 > < [ bes d > a ] | + < d'4-downbow g4 'bes4 > < c'4-upbow g4 c4 > < [ bes d > a ] | %%20 < { [ c'( bes a )bes g( )bes ] } { [ d ] } { [ g ] } > | %%21 @@ -88,9 +88,9 @@ ii_menuetto = \music { %%22 < { [ g( )f g e ] } { [ cis ] } > < f4 d4 > | %%23 - [ `g g ] < e4. `a4. > d-upbow | + [ 'g g ] < e4. 'a4. > d-upbow | %%24 - < d2.^"fine" `a2. `d2._"3 mins."> \bar ":|" % \bar ":||" + < d2.^"fine" 'a2. 'd2._"3 mins."> \bar ":|" % \bar ":||" %% \tighten % use one line less } diff --git a/input/standchen.ly b/input/standchen.ly index 7673bb95c1..0fae878df9 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -13,18 +13,18 @@ % (except for grace notes) are printed % %%1 -melodie = \music { \clef\violin +melodie = \music { \clef\violin\octave{1} \key{bes} \meter{3/4}\duration{ 8 } - r pp < [ d `a-| > f-| < d `a-| > f-| < d `a-| ] > | + r pp < [ d 'a-| > f-| < d 'a-| > f-| < d 'a-| ] > | %%2 - r < [ d `bes-| > f-| < d `bes-| > f-| < d `bes-| ] > | + r < [ d 'bes-| > f-| < d 'bes-| > f-| < d 'bes-| ] > | %%3 \textstyle "italic" - r_"simile" < [ d `bes > e < d `bes > e < d `bes ] > + r_"simile" < [ d 'bes > e < d 'bes > e < d 'bes ] > \textstyle "roman" | %%4 - r < [ `a cis > e < `a cis > e < `a cis ] > | + r < [ 'a cis > e < 'a cis > e < 'a cis ] > | %#%:| %%5 [ a()bes a ]2/3 d'4. a | @@ -167,146 +167,146 @@ begeleiding = \music { \key{bes}\meter{3/4} \clef\bass \duration{2} - `d r4 | + 'd r4 | %%2 - ``bes r4 | + ''bes r4 | %%3 - ``g r4 | + ''g r4 | %%4 - ``a r4 | + ''a r4 | %#%:| %%5 \duration{ 8 } - < \multivoice { \stem{ 1 } [ `f `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'f 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%6 - < \multivoice { \stem{ 1 } [ `d `e `g `e `g `e ] } - { \stem{ -1 } ``bes2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'e 'g 'e 'g 'e ] } + { \stem{ -1 } ''bes2 r4 } > | %%7 - < \multivoice { \stem{ 1 } [ `cis `e `g `e `g e ] } - { \stem{ -1 } ``a2 r4 } > | + < \multivoice { \stem{ 1 } [ 'cis 'e 'g 'e 'g e ] } + { \stem{ -1 } ''a2 r4 } > | %%8 - < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%9 - [ `a e g e g e ] | + [ 'a e g e g e ] | %%10 - [ `d `a d `a d `a ] | + [ 'd 'a d 'a d 'a ] | %%11 - < \multivoice { \stem{ 1 } [ `f `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'f 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%12 == 6 - < \multivoice { \stem{ 1 } [ `d `e `g `e `g `e ] } - { \stem{ -1 } ``bes2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'e 'g 'e 'g 'e ] } + { \stem{ -1 } ''bes2 r4 } > | %13 - < \multivoice { [ `e `g `bes `g `bes `g ] } - { \stem{ -1 } `c2 r4 } > | + < \multivoice { [ 'e 'g 'bes 'g 'bes 'g ] } + { \stem{ -1 } 'c2 r4 } > | %%14 - < \multivoice { \stem{ 1 } [ `a c f c f c ] } - { \stem{ -1 } `f2 r4 } > | + < \multivoice { \stem{ 1 } [ 'a c f c f c ] } + { \stem{ -1 } 'f2 r4 } > | %%15 - [ `c `g `bes `g `bes `g ] | + [ 'c 'g 'bes 'g 'bes 'g ] | %%16 - [ ``f `c `f `c `f `c ] | + [ ''f 'c 'f 'c 'f 'c ] | %%17 - < \multivoice { \stem{ 1 } [ ``a `e `g `e `g `e ] } - { \stem{ -1 } ``a2 r4 } > | + < \multivoice { \stem{ 1 } [ ''a 'e 'g 'e 'g 'e ] } + { \stem{ -1 } ''a2 r4 } > | %%18 - < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%19 - < \multivoice { \stem{ 1 } [ ``bes `f `bes `f `bes `f ] } - { \stem{ -1 } ``bes2 r4 } > | + < \multivoice { \stem{ 1 } [ ''bes 'f 'bes 'f 'bes 'f ] } + { \stem{ -1 } ''bes2 r4 } > | %%20 - < \multivoice { \stem{ 1 } [ ``f `c `f `c `f `c ] } - { \stem{ -1 } ``f2 r4 } > | + < \multivoice { \stem{ 1 } [ ''f 'c 'f 'c 'f 'c ] } + { \stem{ -1 } ''f2 r4 } > | %%21 - < [ `e `c > `g c `g c `g ] | + < [ 'e 'c > 'g c 'g c 'g ] | %%22 - [ `f `a c `a `f `c ] | + [ 'f 'a c 'a 'f 'c ] | %%23 - < \multivoice { \stem{ 1 } [ ``a `e `g `e `g `e ] } - { \stem{ -1 } ``a2 r4 } > | + < \multivoice { \stem{ 1 } [ ''a 'e 'g 'e 'g 'e ] } + { \stem{ -1 } ''a2 r4 } > | %%24 - < \multivoice { \stem{ 1 } [ `d `fis `a `fis `a `fis ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'fis 'a 'fis 'a 'fis ] } + { \stem{ -1 } 'd2 r4 } > | %%25 - < \multivoice { \stem{ 1 } [ ``g `d `b `d `b `d ] } - { \stem{ -1 } ``g2 r4 } > | + < \multivoice { \stem{ 1 } [ ''g 'd 'b 'd 'b 'd ] } + { \stem{ -1 } ''g2 r4 } > | %%26 - < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%27 - < [ `cis ``a > `e `a `e `a `e ] | + < [ 'cis ''a > 'e 'a 'e 'a 'e ] | %%28 - [ `d `a d `a d `a ] | + [ 'd 'a d 'a d 'a ] | %%29 - [ `d `g `bes `g `bes `g ] | + [ 'd 'g 'bes 'g 'bes 'g ] | %#%\volta1 %%30 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %%31 - [ ``a `e `a `e `a `e ] | + [ ''a 'e 'a 'e 'a 'e ] | %%32 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %%33 - [ `d `g `b `g `b `g ] | + [ 'd 'g 'b 'g 'b 'g ] | %%34 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %%35 - [ ``a `e `a `e `a `e ] | + [ ''a 'e 'a 'e 'a 'e ] | %%36 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %#%\volta2 %#%:| %%37 - [ ``a `e `g `e ``bes^> `e ] | + [ ''a 'e 'g 'e ''bes^> 'e ] | %%38 - [ ``a < e cis `a > < e cis `a > < e cis `a > < e cis `a > < e cis `a ] > | + [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > | %%39 - [ ``a `e `g `e ``bes^> `e ] | + [ ''a 'e 'g 'e ''bes^> 'e ] | %%40 - [ ``a < e cis `a > < e cis `a > < e cis `a > < e cis `a > < e cis `a ] > | + [ ''a < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a > < e cis 'a ] > | %%41 - [ ``ais `e `fis `e `fis `e ] | + [ ''ais 'e 'fis 'e 'fis 'e ] | %%42 - < [ `d ``b > `fis `b `fis `b `fis ] | + < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] | %%43 - < [ `e ``b > `g `b `g `b `g ] | + < [ 'e ''b > 'g 'b 'g 'b 'g ] | %%44 - < [ `d ``b > `fis `b `fis `b `fis ] | + < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] | %%45 - < \multivoice { \stem{ 1 } [ ``g `d `b `d `b `d ] } - { \stem{ -1 } ``g2 r4 } > | + < \multivoice { \stem{ 1 } [ ''g 'd 'b 'd 'b 'd ] } + { \stem{ -1 } ''g2 r4 } > | %%46 - < \multivoice { \stem{ 1 } [ `d `a d `a d `a ] } - { \stem{ -1 } `d2 r4 } > | + < \multivoice { \stem{ 1 } [ 'd 'a d 'a d 'a ] } + { \stem{ -1 } 'd2 r4 } > | %%47 - < [ `cis ``a > `e `a `e `a `e ] | + < [ 'cis ''a > 'e 'a 'e 'a 'e ] | %%48 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %%49 - [ `d `a d `a d `a ] | + [ 'd 'a d 'a d 'a ] | %%50 - [ ``g `e `g `e `g `e ] | + [ ''g 'e 'g 'e 'g 'e ] | %%51 - [ ``a `e `g `e `g `e ] | + [ ''a 'e 'g 'e 'g 'e ] | %%52 - [ ``d `d `fis `d `fis `d ] | + [ ''d 'd 'fis 'd 'fis 'd ] | %%53 - [ `d `g `bes `g `bes `g ] | + [ 'd 'g 'bes 'g 'bes 'g ] | %%54 - [ `d `fis `a `fis `a `fis ] | + [ 'd 'fis 'a 'fis 'a 'fis ] | %%55 - [ ``a `e `g `e `g `e ] | + [ ''a 'e 'g 'e 'g 'e ] | %%56 - [ ``d ``a `d ``a `d ``a ] | + [ ''d ''a 'd ''a 'd ''a ] | %%57 - [ ``d ``a `d ``a `d ``a ] + [ ''d ''a 'd ''a 'd ''a ] %%58 - < `d2.^\fermata ``d2. > | + < 'd2.^\fermata ''d2. > | } @@ -447,7 +447,7 @@ tekstII= \lyrics { \music { tekstI } \music { tekstII } } -% Setting up music ...lilypond: ../flower/include/cursor.inl:98: class Cursor Cursor::operator ++(int): Assertion `pointer_' failed. +% 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 { diff --git a/input/twinkle.ly b/input/twinkle.ly index 14f6030cc7..6a2bf0dd9d 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -6,7 +6,7 @@ melodie = \music { \clef\violin - c c | g g | a a | g g | + c4 c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 | % :| g g | f f | e e | d d | @@ -20,7 +20,7 @@ melodie = \music { begeleiding = \music { \clef \bass - \octave{`} + \octave{-1} c c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 | diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 921cdbb983..9e3389a370 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -6,13 +6,15 @@ % global=\music{\meter {4/4} \grouping {2*2} - \key {bes es as}} + \key {bes es as} + +} dux = \music { - \clef \violin + \clef \violin\octave{1} \duration { \last } - - r8-"dux" \stem{-1} + \stem{-1} + r8-"dux" [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] | [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] | [es c' b a] [ g f es d] [c8 es' d' c'] | @@ -24,22 +26,21 @@ dux = \music { } comes = \music { - \octave {'} - r1 \stem{1} - | + \octave {2}\stem{1} + r1 | r1 | r8-"comes" [g16 fis] [g8 c] [es g16 f] [g8 a]| [d8 g16 fis] [g8 a] [c16 d] es4 [d16 c] | - [`bes8 es16 d] [es8 `g8] [`as f16 es] [f8 `a] - [`bes8 g16 f] [g8 `b] [c8 d16 es] f4( | - [) f8 es16 d] [c16 `bes `as `g] [`f8 as g f] - [es d es f] [`b c d `b] | + ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] + ['bes8 g16 f] [g8 'b] [c8 d16 es] f4( | + [) f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] + [es d es f] ['b c d 'b] | } bassdux = \music { \clef \bass - \octave { } + \octave {1} r1 | r | r | diff --git a/lib/binary-source-file.cc b/lib/binary-source-file.cc index 34f6645de6..f080c2dab2 100644 --- a/lib/binary-source-file.cc +++ b/lib/binary-source-file.cc @@ -34,8 +34,8 @@ Binary_source_file::error_str( char const* pos_ch_c_l ) if ( !in_b( pos_ch_c_l ) ) return ""; - char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_c_l(); - char const* end_ch_c_l = pos_ch_c_l + 7 ? ch_C(); + char const* end_ch_c_l = pos_ch_c_l + 7 +*/ +#include +#include "duration-convert.hh" +#include "debug.hh" + +// statics Duration_convert +bool Duration_convert::be_blonde_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; + +String +Duration_convert::dur2_str( Duration dur ) +{ + if ( dur.ticks_i_ ) + return String( "[" ) + String( dur.ticks_i_ ) + "]"; + + String str( dur.type_i_ ); + str += String( '.', dur.dots_i_ ); + if ( dur.plet_b()) + str += String( "*" ) + String( dur.plet_.iso_i_ ) + + String( "/" ) + String( dur.plet_.type_i_ ); + return str; +} + +#if 0 +int +Duration_convert::dur2_i( Duration dur, int division_1_i ) +{ + return dur2_mom( dur ) * Moment( division_1_i ); +} +#endif + +int +Duration_convert::dur2ticks_i( Duration dur ) +{ + if ( dur.ticks_i_ ) + return dur.ticks_i_; + return dur2_mom( dur ) * Moment( Duration::division_1_i_s ); +} + +Moment +Duration_convert::dur2_mom( Duration dur ) +{ + if ( dur.ticks_i_ ) + return Moment( dur.ticks_i_, Duration::division_1_i_s ); + + // or simply assert? + if ( !dur.type_i_ ) + return Moment( 0 ); + + Moment mom = Moment( 1 , dur.type_i_ ); + + Moment delta = mom; + while ( dur.dots_i_-- ) { + delta /= 2.0; + mom += delta; + } + + return mom * plet_factor_mom( dur ); +} + +#if 0 +Moment +Duration_convert::i2_mom( int time_i, int division_1_i ) +{ + if ( !time_i ) + return Moment( 0 ); + + if ( division_1_i > 0 ) + return Moment( time_i, division_1_i ); + else + return Moment( -division_1_i, time_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 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; + } + return Duration( 0 ); +} +#endif + +Moment +Duration_convert::plet_factor_mom( Duration dur ) +{ + return dur.plet_.mom(); +} + +Real +Duration_convert::sync_f( Duration dur, Moment mom ) +{ + return mom / dur2_mom( dur ); +} + +Duration +Duration_convert::ticks2_dur( int ticks_i ) +{ + /* this is cute, + but filling an array using Duration_iterator + might speed things up, a little + */ + Moment mom( ticks_i, Duration::division_1_i_s ); + Duration_iterator iter_dur; + assert( iter_dur ); + while ( iter_dur ) { + Duration dur = iter_dur++; + if ( mom == dur2_mom( dur ) ) + return dur; + } + Duration dur( 0 ); + dur.set_ticks( ticks_i ); + return dur; +} + +Duration +Duration_convert::ticks2standardised_dur( int ticks_i ) +{ + /* this is cute, + but filling an array using Duration_iterator + might speed things up, a little + */ + Moment mom( ticks_i, Duration::division_1_i_s ); + Duration_iterator iter_dur; + assert( iter_dur ); + while ( iter_dur ) { + Duration lower_dur = iter_dur++; +// Duration upper_dur( 0 ); + Duration upper_dur( 1, 1 ); + 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 == 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; + } + return iter_dur(); +} + +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? +} + +Duration +Duration_iterator::operator ++(int) +{ + return forward_dur(); +} + +Duration +Duration_iterator::operator ()() +{ + return dur(); +} + +Duration_iterator::operator bool() +{ + return ok(); +} + +Duration +Duration_iterator::dur() +{ + return cursor_dur_; +} + +Duration +Duration_iterator::forward_dur() +{ + /* should do smart table? guessing: + duration wholes + 16 0.0625 + 32.. 0.0703 + 8:2/3 0.0833 + 16. 0.0938 + 8 0.1250 + 16.. 0.1406 + 4:2/3 0.1667 + 8. 0.1875 + + */ + assert( ok() ); + + Duration dur = cursor_dur_; + + if ( !cursor_dur_.dots_i_ && !cursor_dur_.plet_b() ) { + cursor_dur_.type_i_ *= 2; + cursor_dur_.dots_i_ = 2; + } + else if ( cursor_dur_.dots_i_ == 2 ) { + assert( !cursor_dur_.plet_b() ); + cursor_dur_.dots_i_ = 0; + cursor_dur_.type_i_ /= 4; + 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_.type_i_ *= 2; + cursor_dur_.dots_i_ = 1; + } + else if ( cursor_dur_.dots_i_ == 1 ) { + assert( !cursor_dur_.plet_b() ); + cursor_dur_.dots_i_ = 0; + cursor_dur_.type_i_ /= 2; + } + + if ( Duration_convert::no_triplets_b_s + && cursor_dur_.plet_b() && ok() ) + forward_dur(); + if ( Duration_convert::no_double_dots_b_s + && ( cursor_dur_.dots_i_ == 2 ) && ok() ) + forward_dur(); + if ( Duration_convert::no_smaller_than_i_s + && ( cursor_dur_.type_i_ > Duration_convert::no_smaller_than_i_s ) && ok() ) + forward_dur(); + if ( Duration_convert::no_smaller_than_i_s + && cursor_dur_.dots_i_ + && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s ) + && ok() ) + forward_dur(); + if ( Duration_convert::no_smaller_than_i_s + && ( cursor_dur_.dots_i_ == 2 ) + && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s / 2 ) + && ok() ) + forward_dur(); + + return dur; +} + +bool +Duration_iterator::ok() +{ + return ( cursor_dur_.type_i_ + && !( ( cursor_dur_.type_i_ == 1 ) && ( cursor_dur_.dots_i_ > 2 ) ) ); +} diff --git a/lib/duration.cc b/lib/duration.cc index 5504ed6e35..e341d75831 100644 --- a/lib/duration.cc +++ b/lib/duration.cc @@ -1,7 +1,12 @@ -// -// duration.cc -- implement Duration, Plet, Duration_convert, Duration_iterator -// -// copyright 1997 Jan Nieuwenhuizen +/* + duration.cc -- implement Duration, Plet, + + source file of the LilyPond music typesetter + + copyright 1997 Jan Nieuwenhuizen + + (c) 1997 Han-Wen Nienhuys +*/ // split into 4? @@ -13,337 +18,64 @@ #include "moment.hh" #include "duration.hh" #include "debug.hh" //ugh +#include "duration-convert.hh" // statics Duration int Duration::division_1_i_s = 384 * 4; -Duration::Duration( int type_i, int dots_i = 0, Plet* plet_l ) +Duration::Duration( int type_i, int dots_i = 0) { type_i_ = type_i; dots_i_ = dots_i; - plet_p_ = 0; - ticks_i_ = 0; - set_plet( plet_l ); -} - -Duration::Duration( Duration const& dur_c_r ) -{ - type_i_ = 0; - dots_i_ = 0; - plet_p_ = 0; ticks_i_ = 0; - *this = dur_c_r; -} - -Duration::~Duration() -{ - delete plet_p_; } - -Duration const& -Duration::operator =( Duration const& dur_c_r ) +void +Duration::set_plet(int i, int t) { - if ( &dur_c_r == this ) - return *this; - - type_i_ = dur_c_r.type_i_; - dots_i_ = dur_c_r.dots_i_; - ticks_i_ = dur_c_r.ticks_i_; - set_plet( dur_c_r.plet_p_ ); - - return *this; + plet_.iso_i_ = i; + plet_.type_i_ = t; } -void -Duration::set_plet( Plet* plet_l ) +Moment +Duration::length() const { - delete plet_p_; - plet_p_ = 0; - if ( plet_l ) - plet_p_ = new Plet( *plet_l ); + return Duration_convert::dur2_mom(*this); } - void Duration::set_ticks( int ticks_i ) { assert( !type_i_ ); assert( !dots_i_ ); - assert( !plet_p_ ); ticks_i_ = ticks_i; } - +String +Duration::str()const +{ + return Duration_convert::dur2_str(*this); +} Plet::Plet( int iso_i, int type_i ) { iso_i_ = iso_i; type_i_ = type_i; } - - -// statics Duration_convert -bool Duration_convert::be_blonde_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; - -String -Duration_convert::dur2_str( Duration dur ) -{ - if ( dur.ticks_i_ ) - return String( "[" ) + String( dur.ticks_i_ ) + "]"; - - String str( dur.type_i_ ); - str += String( '.', dur.dots_i_ ); - if ( dur.plet_p_ ) - str += String( "*" ) + String( dur.plet_p_->iso_i_ ) - + String( "/" ) + String( dur.plet_p_->type_i_ ); - return str; -} - -#if 0 -int -Duration_convert::dur2_i( Duration dur, int division_1_i ) -{ - return dur2_mom( dur ) * Moment( division_1_i ); -} -#endif - -int -Duration_convert::dur2ticks_i( Duration dur ) -{ - if ( dur.ticks_i_ ) - return dur.ticks_i_; - return dur2_mom( dur ) * Moment( Duration::division_1_i_s ); -} - -Moment -Duration_convert::dur2_mom( Duration dur ) -{ - if ( dur.ticks_i_ ) - return Moment( dur.ticks_i_, Duration::division_1_i_s ); - - // or simply assert? - if ( !dur.type_i_ ) - return Moment( 0 ); - - Moment mom = Moment( 1 , dur.type_i_ ); - - Moment delta = mom; - while ( dur.dots_i_-- ) { - delta /= 2.0; - mom += delta; - } - - return mom * plet_factor_mom( dur ); -} - -#if 0 -Moment -Duration_convert::i2_mom( int time_i, int division_1_i ) -{ - if ( !time_i ) - return Moment( 0 ); - - if ( division_1_i > 0 ) - return Moment( time_i, division_1_i ); - else - return Moment( -division_1_i, time_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 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; - } - return Duration( 0 ); -} -#endif - Moment -Duration_convert::plet_factor_mom( Duration dur ) -{ - if ( !dur.plet_p_ ) - return 1; - return Moment( dur.plet_p_->iso_i_, dur.plet_p_->type_i_ ); -} - -Real -Duration_convert::sync_f( Duration dur, Moment mom ) -{ - return mom / dur2_mom( dur ); -} - -Duration -Duration_convert::ticks2_dur( int ticks_i ) -{ - /* this is cute, - but filling an array using Duration_iterator - might speed things up, a little - */ - Moment mom( ticks_i, Duration::division_1_i_s ); - Duration_iterator iter_dur; - assert( iter_dur ); - while ( iter_dur ) { - Duration dur = iter_dur++; - if ( mom == dur2_mom( dur ) ) - return dur; - } - Duration dur( 0 ); - dur.set_ticks( ticks_i ); - return dur; -} - -Duration -Duration_convert::ticks2standardised_dur( int ticks_i ) +Plet::mom()const { - /* this is cute, - but filling an array using Duration_iterator - might speed things up, a little - */ - Moment mom( ticks_i, Duration::division_1_i_s ); - Duration_iterator iter_dur; - assert( iter_dur ); - while ( iter_dur ) { - Duration lower_dur = iter_dur++; -// Duration upper_dur( 0 ); - Duration upper_dur( 1, 1 ); - 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 == 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; - } - return iter_dur(); + return Moment( iso_i_, type_i_ ); } -Duration_iterator::Duration_iterator() +Plet::Plet() { - 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 ); + type_i_ = 1; + iso_i_ = 1; } - -Duration -Duration_iterator::operator ++(int) -{ - return forward_dur(); -} - -Duration -Duration_iterator::operator ()() -{ - return dur(); -} - -Duration_iterator::operator bool() -{ - return ok(); -} - -Duration -Duration_iterator::dur() +bool +Plet::unit_b()const { - return cursor_dur_; + return type_i_ == 1 && iso_i_ == 1; } - -Duration -Duration_iterator::forward_dur() -{ - // should do smart table? guessing: - // duration wholes - // 16 0.0625 - // 32.. 0.0703 - // 8:2/3 0.0833 - // 16. 0.0938 - // 8 0.1250 - // 16.. 0.1406 - // 4:2/3 0.1667 - // 8. 0.1875 - - assert( ok() ); - - Duration dur = cursor_dur_; - - if ( !cursor_dur_.dots_i_ && !cursor_dur_.plet_p_ ) { - cursor_dur_.type_i_ *= 2; - cursor_dur_.dots_i_ = 2; - } - else if ( cursor_dur_.dots_i_ == 2 ) { - assert( !cursor_dur_.plet_p_ ); - cursor_dur_.dots_i_ = 0; - cursor_dur_.type_i_ /= 4; - cursor_dur_.set_plet( &Plet( 2, 3 ) ); - } - else if ( cursor_dur_.plet_p_ - && ( cursor_dur_.plet_p_->iso_i_ == 2 ) - && ( cursor_dur_.plet_p_->type_i_ == 3 ) ) { - assert( !cursor_dur_.dots_i_ ); - cursor_dur_.set_plet( 0 ); - cursor_dur_.type_i_ *= 2; - cursor_dur_.dots_i_ = 1; - } - else if ( cursor_dur_.dots_i_ == 1 ) { - assert( !cursor_dur_.plet_p_ ); - cursor_dur_.dots_i_ = 0; - cursor_dur_.type_i_ /= 2; - } - - if ( Duration_convert::no_triplets_b_s && cursor_dur_.plet_p_ && ok() ) - forward_dur(); - if ( Duration_convert::no_double_dots_b_s && ( cursor_dur_.dots_i_ == 2 ) && ok() ) - forward_dur(); - if ( Duration_convert::no_smaller_than_i_s && ( cursor_dur_.type_i_ > Duration_convert::no_smaller_than_i_s ) && ok() ) - forward_dur(); - if ( Duration_convert::no_smaller_than_i_s && cursor_dur_.dots_i_ && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s ) && ok() ) - forward_dur(); - if ( Duration_convert::no_smaller_than_i_s && ( cursor_dur_.dots_i_ == 2 ) && ( cursor_dur_.type_i_ >= Duration_convert::no_smaller_than_i_s / 2 ) && ok() ) - forward_dur(); - - return dur; -} - bool -Duration_iterator::ok() +Duration::plet_b() { - return ( cursor_dur_.type_i_ - && !( ( cursor_dur_.type_i_ == 1 ) && ( cursor_dur_.dots_i_ > 2 ) ) ); + return !plet_.unit_b(); } diff --git a/lib/includable-lexer.cc b/lib/includable-lexer.cc new file mode 100644 index 0000000000..f394907823 --- /dev/null +++ b/lib/includable-lexer.cc @@ -0,0 +1,77 @@ +/* + includable-lexer.cc -- implement Includable_lexer + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ +#include "includable-lexer.hh" +#include "source-file.hh" +#include "source.hh" + +Includable_lexer::Includable_lexer() +{ + yy_current_buffer = 0; +} + +/** set the new input to s, remember old file. +*/ +void +Includable_lexer::new_input(String s, Sources * global_sources) +{ + Source_file * sl = global_sources->get_file_l(s); + if (!sl) { + LexerError("can't find file"); + return; + } + char_count_stack_.push(0); + if (yy_current_buffer) + state_stack_.push(yy_current_buffer); + cout << "[" << s<istream_l(), sl->length_off() )); +} + +/** pop the inputstack. conceptually this is a destructor, but it + does not destruct the Source_file it creates. */ +bool +Includable_lexer::close_input() +{ + include_stack_.pop(); + char_count_stack_.pop(); + cout << "]"<ch_C() + char_count_stack_.top(); +} + +Includable_lexer::~Includable_lexer() +{ + while (!include_stack_.empty()) { + close_input(); + }; +} +/** + Since we don't create the buffer state from the bytes directly, we + don't know about the location of the lexer. Add this as a + YY_USER_ACTION */ +void +Includable_lexer::add_lexed_char(int count) +{ + char_count_stack_.top() += count; +} diff --git a/lib/include/binary-source-file.hh b/lib/include/binary-source-file.hh index 1af35631be..bc8279f6ab 100644 --- a/lib/include/binary-source-file.hh +++ b/lib/include/binary-source-file.hh @@ -6,6 +6,8 @@ #ifndef BINARY_SOURCE_FILE_HH #define BINARY_SOURCE_FILE_HH +#include "source-file.hh" + class Binary_source_file : public Source_file { public: Binary_source_file( String& filename_str ); diff --git a/lib/include/duration-convert.hh b/lib/include/duration-convert.hh new file mode 100644 index 0000000000..9c8b53d709 --- /dev/null +++ b/lib/include/duration-convert.hh @@ -0,0 +1,103 @@ + +/* + duration-convert.hh -- declare + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef DURATION_CONVERT_HH +#define DURATION_CONVERT_HH +#include "duration.hh" +#include "string.hh" + +/** + Duration_convert handles all conversions to -n fro Duration (dur). + That is including (integer + division) representation for MIDI, + and conversion from unexact time representation (best guess :-). + + A Moment (mom) is a Rational that holds the time fraction + compared to a whole note (before also called wholes). + + SUGGESTION: currently a moment in time is called moment too; + let-s typedef Rational When too, so that we get + When Staff_column::when(), Moment Voice_element::mom(). +*/ +struct Duration_convert { + + /* Urgh. statics. + */ + static bool be_blonde_b_s; // cute, but not informative. everythiing is blonde, right? HW + static bool no_double_dots_b_s; + static bool no_triplets_b_s; + static int no_smaller_than_i_s; + +// /// Most used division in MIDI, all fine with me. +// static int const division_1_c_i = 384; + +// /// Return (integer, division) representation. +// static int dur2_i( Duration dur, int division_1_i = division_1_c_i ); + + /// Return number of ticks in (ticks, division_1) representation + static int dur2ticks_i( Duration dur ); + + /// Return Moment representation (fraction of whole note). + static Moment dur2_mom( Duration dur ); + + /// Return Mudela string representation. + static String dur2_str( Duration dur ); + +// /// Return Moment from (integer, division) representation. +// static Moment i2_mom( int i, int division_1_i = division_1_c_i ); + +// /// Return Moment (fraction of whole) representation, best guess. +// static Duration mom2_dur( Moment mom ); + + /// Return plet factor (not a Moment: should use Rational?). + static Moment plet_factor_mom( Duration dur ); + + /** Return synchronisation factor for mom, so that + mom2_dur( mom / sync_f ) will return the duration dur. + */ + static Real sync_f( Duration dur, Moment mom ); + + /// Return exact duration, in midi-ticks if not-exact. + static Duration ticks2_dur( int ticks_i ); + + /// Return standardised duration, best guess if not exact. + static Duration ticks2standardised_dur( int ticks_i ); +}; + +/// (iter_dur) +struct Duration_iterator { + /// start at shortest: 128:2/3 + Duration_iterator(); + + // **** what about these three here ? + /// return forward_dur(); + Duration operator ++(int); + + /// return ok() + operator bool(); + + /// return dur() + Duration operator ()(); + // **** + + /// return current dur + Duration dur(); + + /// return dur(), step to next + Duration forward_dur(); + + /// durations left? + bool ok(); + +private: + Duration cursor_dur_; +}; + + +#endif // DURATION_CONVERT_HH diff --git a/lib/include/duration.hh b/lib/include/duration.hh index 5c56285954..de576e9884 100644 --- a/lib/include/duration.hh +++ b/lib/include/duration.hh @@ -1,128 +1,57 @@ -// -// duration.hh -- declare Duration, Plet, Duration_convert Duration_iterator -// -// copyright 1997 Jan Nieuwenhuizen +/* + duration.hh -- declare Duration Plet + + source file of the LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen + +*/ // split into 4? #ifndef DURATION_HH #define DURATION_HH +#include "fproto.hh" +#include "moment.hh" + // ugh, to get me in lily lib extern bool no_triplets_bo_g; -/// (dur) -struct Duration { - // actually i hate it when other people use default arguments, - // because it makes you easily loose track of what-s really - // happening; in the routine-s implementation you-re not aware - // of this defaultness (who sets this stupid value?). - Duration( int type_i = 1, int dots_i = 0, Plet* plet_p = 0 ); - Duration( Duration const& dur_c_r ); - ~Duration(); - - Duration const& operator =( Duration const& dur_c_r ); - - void set_plet( Plet* plet_l ); // handiger: newt zelf - void set_ticks( int ticks_i ); - - static int division_1_i_s; - int type_i_; - int dots_i_; - Plet* plet_p_; - int ticks_i_; -}; - -/// (plet) +/** (plet) + The type and replacement value of a plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3 + */ struct Plet { - Plet( int replace_i, int type_i ); - + Plet( int replace_i, int type_i ); + Plet(); + Moment mom()const; + bool unit_b()const; int iso_i_; // 2/3; 2 is not duration, maar of count! - int type_i_; + int type_i_; }; /** - Duration_convert handles all conversions to -n fro Duration (dur). - That is including (integer + division) representation for MIDI, - and conversion from unexact time representation (best guess :-). - - A Moment (mom) is a Rational that holds the time fraction - compared to a whole note (before also called wholes). - - SUGGESTION: currently a moment in time is called moment too; - let-s typedef Rational When too, so that we get - When Staff_column::when(), Moment Voice_element::mom(). -*/ -struct Duration_convert { - static bool be_blonde_b_s; - static bool no_double_dots_b_s; - static bool no_triplets_b_s; - static int no_smaller_than_i_s; - -// /// Most used division in MIDI, all fine with me. -// static int const division_1_c_i = 384; - -// /// Return (integer, division) representation. -// static int dur2_i( Duration dur, int division_1_i = division_1_c_i ); - - /// Return number of ticks in (ticks, division_1) representation - static int dur2ticks_i( Duration dur ); - - /// Return Moment representation (fraction of whole note). - static Moment dur2_mom( Duration dur ); - - /// Return Mudela string representation. - static String dur2_str( Duration dur ); - -// /// Return Moment from (integer, division) representation. -// static Moment i2_mom( int i, int division_1_i = division_1_c_i ); - -// /// Return Moment (fraction of whole) representation, best guess. -// static Duration mom2_dur( Moment mom ); - - /// Return plet factor (not a Moment: should use Rational?). - static Moment plet_factor_mom( Duration dur ); - - /** Return synchronisation factor for mom, so that - mom2_dur( mom / sync_f ) will return the duration dur. - */ - static Real sync_f( Duration dur, Moment mom ); - - /// Return exact duration, in midi-ticks if not-exact. - static Duration ticks2_dur( int ticks_i ); - - /// Return standardised duration, best guess if not exact. - static Duration ticks2standardised_dur( int ticks_i ); -}; - -/// (iter_dur) -struct Duration_iterator { - /// start at shortest: 128:2/3 - Duration_iterator(); - - // **** what about these three here ? - /// return forward_dur(); - Duration operator ++(int); - - /// return ok() - operator bool(); - - /// return dur() - Duration operator ()(); - // **** - - /// return current dur - Duration dur(); - - /// return dur(), step to next - Duration forward_dur(); - - /// durations left? - bool ok(); - -private: - Duration cursor_dur_; + Class to handle "musical" durations. This means: balltype 1,2,4,etc. and dots. + + (dur) + */ +struct Duration { + /* actually i hate it when other people use default arguments, + because it makes you easily loose track of what-s really + happening; in the routine-s implementation you-re not aware + of this defaultness (who sets this stupid value?).*/ + Duration( int type_i = 1, int dots_i = 0); + /// is the "plet factor" of this note != 1 ? + bool plet_b(); + String str()const; + void set_plet(int,int ); + void set_ticks( int ticks_i ); + Moment length() const ; // zo naai mij + static int division_1_i_s; + int type_i_; + int dots_i_; + Plet plet_; + int ticks_i_; }; - #endif // DURATION_HH diff --git a/lib/include/includable-lexer.hh b/lib/include/includable-lexer.hh new file mode 100644 index 0000000000..3a076181a4 --- /dev/null +++ b/lib/include/includable-lexer.hh @@ -0,0 +1,39 @@ +/* + includable-lexer.hh -- declare + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef INCLUDABLE_LEXER_HH +#define INCLUDABLE_LEXER_HH +#include "string.hh" +#include +#include "varray.hh" +#include "fproto.hh" +#include "proto.hh" + +// GIGA urg! +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +/** + an yyFlexLexer child with provisions for inclusion. + */ +class Includable_lexer : public yyFlexLexer { + Array state_stack_; +protected: + bool close_input(); + Array include_stack_; + Array char_count_stack_; +public: + void new_input(String s,Sources*); + Includable_lexer(); + ~Includable_lexer(); + void add_lexed_char(int); + char const * here_ch_C(); +}; + + +#endif // INCLUDABLE_LEXER_HH diff --git a/lib/include/input-file.hh b/lib/include/input-file.hh deleted file mode 100644 index a01ea75076..0000000000 --- a/lib/include/input-file.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - input-file.hh -- declare Input_file - - source file of the LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#ifndef INPUT_FILE_HH -#define INPUT_FILE_HH -#include -#include "proto.hh" -#include "fproto.hh" -#include "varray.hh" -#include "string.hh" - -struct Input_file { - istream* is; - char const* defined_ch_c_l_; - Source_file* sourcefile_l_; - int line; - String name; - - Input_file(String); - ~Input_file(); -}; - -#endif // INPUT_FILE_HH diff --git a/lib/include/proto.hh b/lib/include/proto.hh index a58e2969c1..32714730c7 100644 --- a/lib/include/proto.hh +++ b/lib/include/proto.hh @@ -131,7 +131,7 @@ struct Skip_req; struct Slur; struct Slur_register; struct Slur_req; -struct Source; +struct Sources; struct Source_file; struct Spacing_req ; struct Span_req; diff --git a/lib/include/source-file.hh b/lib/include/source-file.hh index 7f7168eb7e..6fdcc5d88a 100644 --- a/lib/include/source-file.hh +++ b/lib/include/source-file.hh @@ -5,19 +5,21 @@ #ifndef SOURCE_FILE_HH #define SOURCE_FILE_HH - +#include "fproto.hh" +#include "string.hh" +class istream; /// class for reading and mapping a file. class Source_file { public: /** Ugh! filename gets changed! The path to the opened file may change, since it might be searched in multiple directories. */ - Source_file( String& filename_str_r ); + Source_file( String filename_str_r ); virtual ~Source_file(); - char const* ch_c_l(); + char const* ch_C(); virtual String error_str( char const* pos_ch_c_l ); - istream* istream_l(); + istream * istream_l(); bool in_b( char const* pos_ch_c_l ); off_t length_off(); virtual int line_i( char const* pos_ch_c_l ); diff --git a/lib/include/source.hh b/lib/include/source.hh index 6c79b75a99..05890f1310 100644 --- a/lib/include/source.hh +++ b/lib/include/source.hh @@ -5,22 +5,24 @@ #ifndef SOURCE_HH #define SOURCE_HH - -class Source +#include "source-file.hh" +#include "plist.hh" +#include "path.hh" +class Sources { public: - Source(); - ~Source(); - - void add( Source_file* sourcefile_p ); + Source_file * get_file_l( String &filename ); Source_file* sourcefile_l( char const* ch_c_l ); - + void set_path(File_path*p_C); + Sources(); + void set_binary(bool); private: + const File_path * path_C_; + void add( Source_file* sourcefile_p ); IPointerList sourcefile_p_iplist_; + bool binary_b_ ; }; -// ugh -extern Source* source_l_g; #endif // SOURCE_HH // diff --git a/lib/input-file.cc b/lib/input-file.cc deleted file mode 100644 index a0f1018be6..0000000000 --- a/lib/input-file.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* - input-file.cc -- implement Input_file - - source file of the LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys Jan Nieuwenhuizen -*/ - -#include -#include -#include "proto.hh" -#include "plist.hh" -#include "input-file.hh" -#include "debug.hh" -#include "source-file.hh" -#include "binary-source-file.hh" -#include "source.hh" - -Input_file::Input_file(String s) -{ - name = s; - line = 1; - String pf(s); - if ( pf == "" ) { - is = &cin; - defined_ch_c_l_ = 0; - sourcefile_l_ = 0; - } - else { - Source_file* sourcefile_p = 0; - // ugh, very dirty, need to go away - if ( ( pf.right_str( 3 ).lower_str() == "mid" ) || ( pf.right_str( 4 ).lower_str() == "midi" ) ) - sourcefile_p = new Binary_source_file( pf ); - else - sourcefile_p = new Source_file( pf ); - source_l_g->add( sourcefile_p ); - sourcefile_l_ = sourcefile_p; - is = sourcefile_l_->istream_l(); - defined_ch_c_l_ = sourcefile_l_->ch_c_l(); - } - cout << "[" << pf << flush; -} - -Input_file::~Input_file() -{ - cout << "]" << flush; -} diff --git a/lib/source-file.cc b/lib/source-file.cc index a39a57cbfa..28ede975d6 100644 --- a/lib/source-file.cc +++ b/lib/source-file.cc @@ -18,20 +18,13 @@ #include "proto.hh" #include "plist.hh" -//#include "lexer.hh" #include "debug.hh" #include "windhoos-suck-suck-suck-thank-you-cygnus.hh" -// #include "parseconstruct.hh" // defined_ch_c_l -extern char const* defined_ch_c_l; - -// ugh -// #include "main.hh" // find_file -String find_file(String); #include "source-file.hh" -Source_file::Source_file( String &filename_str ) +Source_file::Source_file( String filename_str ) { data_caddr_ = 0; fildes_i_ = 0; @@ -41,8 +34,21 @@ Source_file::Source_file( String &filename_str ) open(); map(); - // ugh!?, should call name_str() ! - filename_str = name_str_; +} + +istream* +Source_file::istream_l() +{ + assert( fildes_i_ ); + if ( !istream_p_ ) { + if ( size_off_ ) // can-t this be done without such a hack? + istream_p_ = new istrstream( ch_C(), size_off_ ); + else { + istream_p_ = new istrstream( "", 0 ); + istream_p_->set(ios::eofbit); + } + } + return istream_p_; } Source_file::~Source_file() @@ -54,7 +60,7 @@ Source_file::~Source_file() } char const* -Source_file::ch_c_l() +Source_file::ch_C() { assert( this ); return (char const*)data_caddr_; @@ -70,73 +76,52 @@ Source_file::close() } String -Source_file::error_str( char const* pos_ch_c_l ) +Source_file::error_str( char const* pos_ch_C ) { - assert( this ); - if ( !in_b( pos_ch_c_l ) ) - return ""; - - char const* begin_ch_c_l = pos_ch_c_l; - char const* data_ch_c_l = ch_c_l(); - while ( begin_ch_c_l > data_ch_c_l ) - if ( *--begin_ch_c_l == '\n' ) { - begin_ch_c_l++; + char const* data_ch_C = ch_C(); + char const * eof_C_ = data_ch_C + size_off_; + if ( !in_b( pos_ch_C ) ) + return "(position unknown)"; + + + if ( pos_ch_C == eof_C_) + pos_ch_C --; + char const* begin_ch_C = pos_ch_C; + while ( begin_ch_C > data_ch_C ) + if ( *--begin_ch_C == '\n' ) { + begin_ch_C++; break; } - char const* end_ch_c_l = pos_ch_c_l; - while ( end_ch_c_l < data_ch_c_l + size_off_ ) - if ( *end_ch_c_l++ == '\n' ) { - break; + char const* end_ch_C = pos_ch_C; + while ( end_ch_C < eof_C_ ) + if ( *end_ch_C++ == '\n' ) { + end_ch_C--; + break; } - end_ch_c_l--; - -#if 1 -// String( char const* p, int length ) is missing!? - String line_str( (Byte const*)begin_ch_c_l, end_ch_c_l - begin_ch_c_l ); -#else - int length_i = end_ch_c_l - begin_ch_c_l; - char* ch_p = new char[ length_i + 1 ]; - strncpy( ch_p, begin_ch_c_l, length_i ); - ch_p[ length_i ] = 0; - String line_str( ch_p ); - delete ch_p; -#endif + + // String( char const* p, int length ) is missing!? + String line_str( (Byte const*)begin_ch_C, end_ch_C - begin_ch_C ); int error_col_i = 0; - char const* scan_ch_c_l = begin_ch_c_l; - while ( scan_ch_c_l < pos_ch_c_l ) - if ( *scan_ch_c_l++ == '\t' ) + char const* scan_ch_C = begin_ch_C; + while ( scan_ch_C < pos_ch_C ) + if ( *scan_ch_C++ == '\t' ) error_col_i = ( error_col_i / 8 + 1 ) * 8; else error_col_i++; - String str = line_str.left_str( pos_ch_c_l - begin_ch_c_l ) + String str = line_str.left_str( pos_ch_C - begin_ch_C ) + String( '\n' ) + String( ' ', error_col_i ) - + line_str.mid_str( pos_ch_c_l - begin_ch_c_l, INT_MAX ); // String::mid should take 0 arg.. + + line_str.mid_str( pos_ch_C - begin_ch_C, INT_MAX ); // String::mid should take 0 arg.. return str; } bool -Source_file::in_b( char const* pos_ch_c_l ) -{ - return ( pos_ch_c_l && ( pos_ch_c_l >= ch_c_l() ) && ( pos_ch_c_l < ch_c_l() + size_off_ ) ); -} - -istream* -Source_file::istream_l() +Source_file::in_b( char const* pos_ch_C ) { - assert( fildes_i_ ); - if ( !istream_p_ ) { - if ( size_off_ ) // can-t this be done without such a hack? - istream_p_ = new istrstream( ch_c_l(), size_off_ ); - else { - istream_p_ = new istrstream( "", 0 ); - istream_p_->set(ios::eofbit); - } - } - return istream_p_; + return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + size_off_ ) ); } off_t @@ -146,15 +131,15 @@ Source_file::length_off() } int -Source_file::line_i( char const* pos_ch_c_l ) +Source_file::line_i( char const* pos_ch_C ) { - if ( !in_b( pos_ch_c_l ) ) + if ( !in_b( pos_ch_C ) ) return 0; int i = 1; - char const* scan_ch_c_l = ch_c_l(); - while ( scan_ch_c_l < pos_ch_c_l ) - if ( *scan_ch_c_l++ == '\n' ) + char const* scan_ch_C = ch_C(); + while ( scan_ch_C < pos_ch_C ) + if ( *scan_ch_C++ == '\n' ) i++; return i; } @@ -168,8 +153,7 @@ Source_file::map() data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 ); if ( (int)data_caddr_ == -1 ) - // ugh: defined_ch_c_l... - warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ), defined_ch_c_l ); //lexer->here_ch_c_l() ); + warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno ), 0); } String @@ -181,14 +165,10 @@ Source_file::name_str() void Source_file::open() { - String name_str = find_file( name_str_ ); - if ( name_str != "" ) - name_str_ = name_str; - fildes_i_ = ::open( name_str_, O_RDONLY ); if ( fildes_i_ == -1 ) { - warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ), defined_ch_c_l ); // lexer->here_ch_c_l() ); + warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno ), 0 ); return; } @@ -207,8 +187,8 @@ Source_file::unmap() } } String -Source_file::file_line_no_str(char const *ch_c_l ) +Source_file::file_line_no_str(char const *ch_C ) { return name_str() + ": " - + String( line_i( ch_c_l ) ); + + String( line_i( ch_C ) ); } diff --git a/lib/source.cc b/lib/source.cc index 8a8c528835..3247c8d82c 100644 --- a/lib/source.cc +++ b/lib/source.cc @@ -1,36 +1,72 @@ -// -// source.cc -// +/* + source.cc -- implement Source + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #include +#include "binary-source-file.hh" #include "string.hh" #include "proto.hh" #include "plist.hh" - #include "source-file.hh" #include "source.hh" -Source::Source() +void +Sources::set_path(File_path *f_C) +{ + path_C_ = f_C; +} + +/** + open a file + + @param file_str the file to be opened, name might be changed if it + is found in a search path. + + @return 0 if no file found + */ +Source_file* +Sources::get_file_l(String &file_str ) { + if (path_C_){ + file_str = path_C_->find(file_str); + if (file_str== "") + return 0; + } + Source_file * f_p= (!binary_b_) ? + new Source_file(file_str) : new Binary_source_file(file_str); + add(f_p); + return f_p; } -Source::~Source() +Sources::Sources() { + path_C_= 0; + binary_b_ = false; } void -Source::add( Source_file* sourcefile_p ) +Sources::add( Source_file* sourcefile_p ) { sourcefile_p_iplist_.bottom().add( sourcefile_p ); } +/** + search the list for file whose map contains pointer #ch_C# + + @return 0 if not found. + */ Source_file* -Source::sourcefile_l( char const* ch_c_l ) +Sources::sourcefile_l( char const* ch_C ) { PCursor sourcefile_l_pcur( sourcefile_p_iplist_.top() ); for ( ; sourcefile_l_pcur.ok(); sourcefile_l_pcur++ ) - if ( sourcefile_l_pcur->in_b( ch_c_l ) ) + if ( sourcefile_l_pcur->in_b( ch_C ) ) return *sourcefile_l_pcur; return 0; } diff --git a/lib/template.cc b/lib/template.cc new file mode 100644 index 0000000000..2e3d527baf --- /dev/null +++ b/lib/template.cc @@ -0,0 +1,6 @@ +#include "source-file.hh" +#include "plist.tcc" +#include "pcursor.tcc" + + +IPL_instantiate(Source_file); diff --git a/lily/.version b/lily/.version index 0ae4d984d1..c74b79390b 100644 --- a/lily/.version +++ b/lily/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 43 +PATCH_LEVEL = 44 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/Makefile b/lily/Makefile index cb49063ad6..f052914063 100644 --- a/lily/Makefile +++ b/lily/Makefile @@ -69,7 +69,7 @@ include ./$(depth)/make/Rules.make # force these: Make can't know these have to be generated in advance my-lily-lexer.cc: $(outdir)/parser.hh -lexer.l: $(outdir)/parser.hh +$(outdir)/lexer.cc: $(outdir)/parser.hh # diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index c7c0d05e3d..c28443df62 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -35,7 +35,7 @@ Bar_register::process_requests() { if (bar_req_l_ ) { bar_p_ = new Bar(bar_req_l_->type_str_); - } else if (!get_staff_info().time_c_l_->whole_in_measure_) { + } else if (!get_staff_info().time_C_->whole_in_measure_) { bar_p_ = new Bar("|"); } diff --git a/lily/clef-reg.cc b/lily/clef-reg.cc index b4775721bb..2492703cdf 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -45,7 +45,7 @@ void Clef_register::read_req(Clef_change_req*c_l) { if (!set_type(c_l->clef_str_)) - error("unknown clef type ", c_l->defined_ch_c_l_); + error("unknown clef type ", c_l->defined_ch_C_); } bool @@ -65,7 +65,7 @@ Clef_register::try_request(Request * r_l) void Clef_register::process_requests() { - Time_description const *time_l = get_staff_info().time_c_l_; + Time_description const *time_l = get_staff_info().time_C_; if (!clef_req_l_ && (!time_l->whole_in_measure_|| !time_l->when_)) { clef_p_ = new Clef_item; clef_p_->change = false; diff --git a/lily/debug.cc b/lily/debug.cc index 01a35bd140..67bcd70681 100644 --- a/lily/debug.cc +++ b/lily/debug.cc @@ -4,11 +4,11 @@ #include #include "debug.hh" #include "dstream.hh" -#include "vector.hh" +#include "flower-debug.hh" Dstream *monitor=0; ostream * nulldev =0; - +// ugh struct _Dinit { _Dinit() { nulldev = new ofstream("/dev/null"); @@ -44,7 +44,8 @@ debug_init() #ifndef NDEBUG set_new_handler(&mynewhandler); #endif - set_matrix_debug(*monitor); + set_flower_debug(*monitor, check_debug); + signal(SIGFPE, float_handler); } diff --git a/lily/headreg.cc b/lily/headreg.cc index 7f1a9bbae8..93ea9b2d08 100644 --- a/lily/headreg.cc +++ b/lily/headreg.cc @@ -48,9 +48,8 @@ Notehead_register::process_requests() n_p->position = note_req_l_->note()->height() + *get_staff_info().c0_position_i_; } else { - note_p_ = new Rest ( note_req_l_->rhythmic()->balltype, - note_req_l_->rhythmic()->dots); - if (note_req_l_->rhythmic()->balltype <= 2) + note_p_ = new Rest ( note_req_l_->rhythmic()->duration_); + if (note_req_l_->rhythmic()->duration_.type_i_ <= 2) note_p_->translate( Offset(0, 6 * paper()->internote())); diff --git a/lily/include/input-score.hh b/lily/include/input-score.hh index a7468e03fa..36baf691c9 100644 --- a/lily/include/input-score.hh +++ b/lily/include/input-score.hh @@ -19,7 +19,7 @@ /// the total music def of one movement struct Input_score { /// defined where? - char const * defined_ch_c_l_; + char const * defined_ch_C_; int errorlevel_i_; /// paper_, staffs_ and commands_ form the problem definition. diff --git a/lily/include/input-staff.hh b/lily/include/input-staff.hh index 23495bd744..25e1431162 100644 --- a/lily/include/input-staff.hh +++ b/lily/include/input-staff.hh @@ -14,7 +14,7 @@ struct Input_staff { - char const * defined_ch_c_l_; + char const * defined_ch_C_; String type; IPointerList music_; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh new file mode 100644 index 0000000000..88b7adaa78 --- /dev/null +++ b/lily/include/lily-proto.hh @@ -0,0 +1,2 @@ +struct My_lily_lexer; +struct My_lily_parser; diff --git a/lily/include/local-key-reg.hh b/lily/include/local-key-reg.hh index 9611449383..628ccc7c42 100644 --- a/lily/include/local-key-reg.hh +++ b/lily/include/local-key-reg.hh @@ -13,7 +13,7 @@ struct Local_key_register : Request_register { Local_key local_key_; Local_key_item* key_item_p_; - Key const *key_c_l_; + Key const *key_C_; /* *************** */ virtual void process_requests(); virtual void acknowledge_element(Staff_elem_info); diff --git a/lily/include/main.hh b/lily/include/main.hh index 203eac71ae..10fc7c3f47 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -10,8 +10,7 @@ void set_default_output(String s); Input_score* current_iscore_l(); String find_file(String); String get_version_str(); -extern String infile_str_g; -extern Source* source_l_g; +extern Sources* source_l_g; extern bool only_midi; extern String default_out_fn; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 761efce6bd..d9a13deda9 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -11,6 +11,7 @@ #define MUSICALREQUESTS_HH #include "request.hh" +#include "duration.hh" /** @@ -38,14 +39,13 @@ struct Skip_req : Musical_req { This request is used only a base class. */ struct Rhythmic_req : virtual Musical_req { - int balltype; - int dots; - Moment plet_factor; + Duration duration_; + /* *************** */ + void set_duration(Duration); static int compare(const Rhythmic_req &, const Rhythmic_req &); virtual Moment duration() const; Rhythmic_req(); - Rhythmic_req(int,int); REQUESTMETHODS(Rhythmic_req, rhythmic); }; @@ -133,7 +133,7 @@ public: struct Stem_req : Rhythmic_req { /// preferred direction for the stem int dir_i_; - Stem_req(int s, int dots); + Stem_req(); REQUESTMETHODS(Stem_req,stem); }; diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index c3f2bfa388..8dbc42e861 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -8,46 +8,33 @@ #ifndef LEXER_HH #define LEXER_HH + #include + #include "proto.hh" #include "fproto.hh" #include "varray.hh" #include "string.hh" +#include "includable-lexer.hh" +#include "duration.hh" -int yylex(); -void yyerror(char const *s); bool busy_parsing(); void kill_lexer(); void set_lexer(); -struct Lexer_prefs { - int default_duration, default_dots, default_octave_i_; - int default_plet_type, default_plet_dur; - String textstyle_str_; - - bool last_duration_mode ; - - Lexer_prefs(); - Moment plet_mom(); - void set_default_duration(int *); - void set_last_duration(int n); - void set_duration_mode(String s); - void get_default_duration(int *); - void set_plet(int,int); -}; - -/// lexer with provisions for include files. -class My_lily_lexer : public yyFlexLexer { +/// lexer for Mudela +class My_lily_lexer : public Includable_lexer { int lookup_keyword(String); void lookup_notename(int &large, int &small, String s); int scan_bare_word(String); int scan_escaped_word(String); + bool post_quotes_b_; public: - Lexer_prefs prefs; + void * lexval_l; + - Array include_stack_; Assoc *identifier_assoc_p_; Keyword_table * keytable_p_; int errorlevel_i_; @@ -55,25 +42,19 @@ public: /* *************** */ Identifier*lookup_identifier(String s); - char const* here_ch_c_l(); void push_note_state(); void push_lyric_state(); void pop_state(); void LexerError(char const *); - String spot() const; My_lily_lexer(); void add_identifier(Identifier*i); ~My_lily_lexer(); - void new_input(String s); - bool close_input(); int yylex(); - void print_init_declarations() const; - void print_user_declarations() const; + void print_declarations(bool init_b) const; + bool note_state_b() const; bool lyric_state_b() const; }; -extern My_lily_lexer *lexer; - #endif diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh new file mode 100644 index 0000000000..679c381181 --- /dev/null +++ b/lily/include/my-lily-parser.hh @@ -0,0 +1,65 @@ +/* + my-lily-parser.hh -- declare + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef MY_LILY_PARSER_HH +#define MY_LILY_PARSER_HH +#include "proto.hh" +#include "duration.hh" +#include "string.hh" +#include "varray.hh" +#include "lily-proto.hh" +#include "proto.hh" +#include "duration.hh" +#include "string.hh" +#include "varray.hh" + +class My_lily_parser { +public: + friend int yyparse( void*); + + int default_octave_i_; + Duration default_duration_; + String textstyle_str_; + + bool last_duration_mode ; + + Array pre_reqs, post_reqs; + Array define_spot_array_; + char const* defined_ch_C_; + int fatal_error_i_; + Sources * source_l_; + int error_level_i_; + bool init_parse_b_; + My_lily_lexer * lexer_p_; + + Moment plet_mom(); + void add_requests( Voice_element*v); + + Voice_element * get_note_element(Note_req * ,Duration *); + Voice_element* get_rest_element(String,Duration *); + Voice_element* get_word_element(Text_def*, Duration*); + void set_last_duration(Duration const *); + void set_duration_mode(String s); + char const* here_ch_C()const; + void remember_spot(); + Paper_def*default_paper(); + void do_yyparse(); + void parser_error(String); + + Request* get_parens_request(char c); + + void set_debug(); + void set_yydebug(bool); + void print_declarations(); +public: + void parse_file ( String init_str, String file_str); + My_lily_parser(Sources * sources_l); +}; + +#endif // MY_LILY_PARSER_HH diff --git a/lily/include/parseconstruct.hh b/lily/include/parseconstruct.hh index 6a44167532..45b7c3f3c8 100644 --- a/lily/include/parseconstruct.hh +++ b/lily/include/parseconstruct.hh @@ -9,27 +9,12 @@ #include "proto.hh" -extern char const* defined_ch_c_l; -extern char const* req_defined_ch_c_l; - - - - -Voice_element * get_note_element(Note_req * ,int *); -Voice_element* get_rest_element(String,int *); -Voice_element* get_word_element(Text_def*, int*); -void add_requests( Voice_element*v, Array&req); -Request* get_request(char); -Script_def* get_scriptdef(char); -Text_def*get_text(String s); +String * get_scriptdef(char c); +Request* get_script_req(char); Request* get_plet_request( char c, int dur_i, int type_i ); Request*get_script_req(int d , Script_def*def); Request*get_text_req(int d , Text_def*def); Request* get_stemdir_req(int); - - - - Request*get_grouping_req(Array i_arr); #endif // PARSECONSTRUCT_HH diff --git a/lily/include/request.hh b/lily/include/request.hh index 6e9bfd4df2..66e62d4843 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -23,7 +23,7 @@ class Request { public: Voice_element*elt_l_; - char const* defined_ch_c_l_; + char const* defined_ch_C_; /* *************** */ Voice * voice_l(); diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 85c7266677..67ca259f54 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -12,11 +12,13 @@ struct Rest : Item { int dots; int balltype; - + + /// rests can be translated up and down. + int pos_i_; /* *************** */ - Rest(int dur,int dots); + Rest(Duration); void do_print()const; NAME_MEMBERS(Rest); Molecule* brew_molecule_p()const; diff --git a/lily/include/score.hh b/lily/include/score.hh index 4f10a7f95f..293801a98e 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -28,7 +28,7 @@ struct Score { IPointerList cols_; PScore *pscore_p_; - char const *defined_ch_c_l_; + char const *defined_ch_C_; int errorlevel_i_; /* *************************************************************** */ diff --git a/lily/include/staff-elem-info.hh b/lily/include/staff-elem-info.hh index 4e3392027d..2dcbc845a9 100644 --- a/lily/include/staff-elem-info.hh +++ b/lily/include/staff-elem-info.hh @@ -28,8 +28,8 @@ struct Staff_elem_info { struct Staff_info { int *c0_position_i_; Staff_walker *walk_l_; - Time_description const *time_c_l_; - Rhythmic_grouping const *rhythmic_c_l_; + Time_description const *time_C_; + Rhythmic_grouping const *rhythmic_C_; bool break_allowed_b_; }; diff --git a/lily/include/text-def.hh b/lily/include/text-def.hh index b59df7f532..50bb98105c 100644 --- a/lily/include/text-def.hh +++ b/lily/include/text-def.hh @@ -14,7 +14,7 @@ struct Text_def { int align_i_; String text_str_; String style_str_; - char const* defined_ch_c_l_; + char const* defined_ch_C_; /* *************** */ diff --git a/lily/include/voice-element.hh b/lily/include/voice-element.hh index cf398bc9b6..0b606f1301 100644 --- a/lily/include/voice-element.hh +++ b/lily/include/voice-element.hh @@ -18,7 +18,7 @@ *the requests, */ struct Voice_element { Moment duration; - char const* defined_ch_c_l_; + char const* defined_ch_C_; Voice const *voice_l_; IPointerList reqs; diff --git a/lily/input-music.cc b/lily/input-music.cc index 5c8aa72472..26377e7f53 100644 --- a/lily/input-music.cc +++ b/lily/input-music.cc @@ -11,7 +11,7 @@ Input_music::check_plet(Voice_element* velt_l) if ( i->plet() ) { Moment start_moment = 0; if ( !find_plet_start_bo( i->plet()->type_c_, start_moment ) ) { - error( "begin of plet not found", i->defined_ch_c_l_ ); + error( "begin of plet not found", i->defined_ch_C_ ); break; } Moment moment = 0; diff --git a/lily/input-score.cc b/lily/input-score.cc index d68dd10959..ed7d831eea 100644 --- a/lily/input-score.cc +++ b/lily/input-score.cc @@ -40,7 +40,7 @@ Input_score::Input_score(Input_score const&s) { paper_p_ = (s.paper_p_)? new Paper_def(*s.paper_p_) :0; midi_p_ = (s.midi_p_)? new Midi_def(*s.midi_p_) : 0; - defined_ch_c_l_ = s.defined_ch_c_l_; + defined_ch_C_ = s.defined_ch_C_; errorlevel_i_ = s.errorlevel_i_; } @@ -48,7 +48,7 @@ Score* Input_score::parse() { Score *s_p = new Score; - s_p->defined_ch_c_l_= defined_ch_c_l_; + s_p->defined_ch_C_= defined_ch_C_; s_p->errorlevel_i_ = errorlevel_i_; if (midi_p_) s_p->set(new Midi_def(*midi_p_)); @@ -72,7 +72,7 @@ Input_score::~Input_score() Input_score::Input_score() { - defined_ch_c_l_=0; + defined_ch_C_=0; paper_p_= 0; midi_p_ = 0; errorlevel_i_ = 0; diff --git a/lily/input-staff.cc b/lily/input-staff.cc index 2d42e2a1ba..9262851f3c 100644 --- a/lily/input-staff.cc +++ b/lily/input-staff.cc @@ -20,7 +20,7 @@ Input_staff::Input_staff(String s) { type= s; - defined_ch_c_l_ = 0; + defined_ch_C_ = 0; } void @@ -38,7 +38,7 @@ Input_staff::parse(Score*score_l) else if (type == "lyric") p = new Lyric_staff; else { - error( "Unknown staff-type `" + type +"\'", defined_ch_c_l_ ); + error( "Unknown staff-type `" + type +"\'", defined_ch_C_ ); exit( 1 ); } @@ -55,7 +55,7 @@ Input_staff::Input_staff(Input_staff const&s) { for (iter_top(s.music_,i); i.ok(); i++) add(i->clone()); - defined_ch_c_l_ = s.defined_ch_c_l_; + defined_ch_C_ = s.defined_ch_C_; type = s.type; } diff --git a/lily/key-reg.cc b/lily/key-reg.cc index 865eea264e..8b8b2373b3 100644 --- a/lily/key-reg.cc +++ b/lily/key-reg.cc @@ -49,7 +49,7 @@ Key_register::acknowledge_element(Staff_elem_info info) void Key_register::process_requests() { - Time_description const *time_l = get_staff_info().time_c_l_; + Time_description const *time_l = get_staff_info().time_C_; if (!keyreq_l_ && (!time_l->whole_in_measure_|| !time_l->when_)) { diff --git a/lily/lexer.l b/lily/lexer.l index 549a957efd..21ce7aa06b 100644 --- a/lily/lexer.l +++ b/lily/lexer.l @@ -17,16 +17,19 @@ yy_push_state(quote);\ yylval.string = new String +#define yylval (*(YYSTYPE*)lexval_l) +#define YY_USER_ACTION add_lexed_char(YYLeng()); %} %option c++ %option noyywrap %option nodefault -%option yylineno %option debug %option yyclass="My_lily_lexer" %option stack +%option never-interactive +%option warn %x incl %x lyrics @@ -64,16 +67,17 @@ COMMENT %.*\n -^include { +include { yy_push_state(incl); } {WHITE}* { /* eat the whitespace */ } \"[^"]*\" { /* got the include file name */ - String s (YYText()+1); - s = s.left_str(s.length_i()-1); - defined_ch_c_l = here_ch_c_l() - String( YYText() ).length_i() - 1; - new_input(s); - yy_pop_state(); + String s (YYText()+1); + s = s.left_str(s.length_i()-1); + mtor << "#include `" << s << "\'\n"; +// defined_ch_C = here_ch_C() - String( YYText() ).length_i() - 1; + new_input(s,source_l_g); + yy_pop_state(); } {RESTNAME} { @@ -92,6 +96,18 @@ COMMENT %.*\n s=s.left_str(s.length_i() - 1); return scan_bare_word(s); } +{ALPHAWORD}/\' { + post_quotes_b_ = true; + return scan_bare_word(YYText()); +} +\'+ { + yylval.i = YYLeng(); + if (post_quotes_b_) { + post_quotes_b_ = false; + return POST_QUOTES; + } else + return PRE_QUOTES; +} {ALPHAWORD} { return scan_bare_word(YYText()); @@ -109,23 +125,21 @@ COMMENT %.*\n yylval.i = String_convert::dec2_i( String( YYText() ) ); return INT; } -[ \t\n]+ { -} \+\+ { return CONCAT; } \" { start_quote(); } -. { - return yylval.c = YYText()[0]; -} \" { start_quote(); } +\\\\ { + *yylval.string += '\\'; +} \\\" { *yylval.string +='\"'; } @@ -176,14 +190,13 @@ COMMENT %.*\n [()\[\]|/.^>_-] { return yylval.c = YYText()[0]; } -[ \t\n]+ { -} <> { - mtor << "<>"; + mtor << "<>"; - if (! close_input()) + if (! close_input()) { yyterminate(); // can't move this, since it actually rets a YY_NULL + } } {WORD} { return scan_bare_word(YYText()); @@ -210,15 +223,15 @@ COMMENT %.*\n mtor << "misc char" <{WHITE}+ { } - -{COMMENT} { - //ignore +. { + return yylval.c = YYText()[0]; } -. { - error( String( "illegal character: " ) + String( YYText()[0] ), here_ch_c_l() ); + +<*>. { + error( String( "illegal character: " ) + String( YYText()[0] ), here_ch_C() ); return YYText()[0]; } diff --git a/lily/local-key-reg.cc b/lily/local-key-reg.cc index bf7eb9c352..0ce36e955c 100644 --- a/lily/local-key-reg.cc +++ b/lily/local-key-reg.cc @@ -16,7 +16,7 @@ Local_key_register::Local_key_register() { key_item_p_ = 0; - key_c_l_ = 0; + key_C_ = 0; } void @@ -51,19 +51,19 @@ Local_key_register::acknowledge_element(Staff_elem_info info) } else if (info.elem_p_->name()==Key_item::static_name()) { Key_register * key_reg_l = (Key_register*)info.origin_reg_l_arr_[0]; - key_c_l_ = &key_reg_l->key_; - local_key_.reset(*key_c_l_); + key_C_ = &key_reg_l->key_; + local_key_.reset(*key_C_); } } void Local_key_register::process_requests() { - Time_description const * time_c_l_ = get_staff_info().time_c_l_; - if (! time_c_l_->whole_in_measure_){ - if (key_c_l_) - local_key_.reset(*key_c_l_); - else if( time_c_l_->when_ >Moment(0)) + Time_description const * time_C_ = get_staff_info().time_C_; + if (! time_C_->whole_in_measure_){ + if (key_C_) + local_key_.reset(*key_C_); + else if( time_C_->when_ >Moment(0)) warning ("Help me! can't figure current key", 0); } } diff --git a/lily/lyric-item.cc b/lily/lyric-item.cc index 6e3fdf02b8..1a54f12bca 100644 --- a/lily/lyric-item.cc +++ b/lily/lyric-item.cc @@ -8,7 +8,6 @@ #include "source-file.hh" #include "source.hh" #include "debug.hh" -#include "main.hh" Lyric_item::Lyric_item(Lyric_req* lreq_l, int voice_count_i) : Text_item(lreq_l,0) @@ -23,5 +22,5 @@ Lyric_item::do_pre_processing() // test context-error if ( tdef_l()->text_str_.index_i( "Gates" ) >=0)// :-) - warning( "foul word", tdef_l()->defined_ch_c_l_ ); + warning( "foul word", tdef_l()->defined_ch_C_ ); } diff --git a/lily/main.cc b/lily/main.cc index 43a44f3c52..85a6bd923b 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -1,3 +1,11 @@ +/* + main.cc -- implement main: entrypoints + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + #include #include #include "proto.hh" @@ -8,12 +16,10 @@ #include "main.hh" #include "path.hh" #include "config.hh" -#include "source-file.hh" #include "source.hh" +#include "my-lily-parser.hh" -Source source; -Source* source_l_g = &source; -String infile_str_g; +Sources* source_l_g = 0; bool only_midi = false; extern void parse_file(String,String); @@ -98,6 +104,18 @@ struct Main_init { } } main_init; +void +do_one_file(String init_str, String file_str) +{ + source_l_g = new Sources; + source_l_g->set_path(path); + My_lily_parser parser(source_l_g); + parser.parse_file(init_str, file_str); + do_scores(); + delete source_l_g; + source_l_g = 0; +} + int main (int argc, char **argv) { @@ -141,19 +159,15 @@ main (int argc, char **argv) while ( (arg= oparser.get_next_arg()) ) { String f(arg); destill_inname(f); - infile_str_g = f; - parse_file(init_str,f); - do_scores(); + do_one_file(init_str,f); p++; } if (!p) { - parse_file(init_str, ""); - do_scores(); + do_one_file(init_str, ""); } return 0; } - String find_file(String f) { diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 2bc00a3a0f..04e1286197 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -213,7 +213,7 @@ Midi_track::Midi_track( int number_i ) number_i_ = number_i; - char const* data_ch_c_l = "" + char const* data_ch_C = "" // "00" "ff58" "0404" "0218" "08" // "00" "ff51" "0307" "a120" // why a key at all, in midi? @@ -225,10 +225,10 @@ Midi_track::Midi_track( int number_i ) String data_str; // only for format 0 (currently using format 1)? - data_str += String_convert::hex2bin_str( data_ch_c_l ); + data_str += String_convert::hex2bin_str( data_ch_C ); - char const* footer_ch_c_l = "00" "ff2f" "00"; - String footer_str = String_convert::hex2bin_str( footer_ch_c_l ); + char const* footer_ch_C = "00" "ff2f" "00"; + String footer_str = String_convert::hex2bin_str( footer_ch_C ); set( "MTrk", data_str, footer_str ); } diff --git a/lily/midi-output.cc b/lily/midi-output.cc index 72f71de64e..73d0260c2b 100644 --- a/lily/midi-output.cc +++ b/lily/midi-output.cc @@ -8,7 +8,8 @@ // "" huh? #include "time.h" - +#include "main.hh" +#include "source.hh" #include "proto.hh" #include "plist.hh" #include "string.hh" @@ -48,36 +49,25 @@ Midi_output::do_staff(Staff*st_l,int track_i) // set track name Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( track_i, 0, '0' ) ); - midi_track.add( Moment( 0.0 ), &track_name ); + midi_track.add( Moment( 0 ), &track_name ); // set instrument :-) Midi_text instrument_name( Midi_text::INSTRUMENT_NAME, "piano" ); - midi_track.add( Moment( 0.0 ), &instrument_name ); + 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; -#ifdef UGR - // uph, sorry, wanna test this... - // menuetto in F - if ( ( infile_str_g.index_i( "scsii-menuetto" ) >= 0 ) - || ( infile_str_g.index_i( "standchen" ) >= 0 ) - || ( infile_str_g.left_str( 1 ) == String( "s" ) ) ) - accidentals_i = -1; - // standchen in d - if ( ( infile_str_g.index_i( "standchen" ) >= 0 ) ) - minor_i = 1; -#endif Midi_key midi_key( accidentals_i, minor_i ); - midi_track.add( Moment( 0.0 ), &midi_key ); + midi_track.add( Moment( 0 ), &midi_key ); Midi_tempo midi_tempo( midi_l_->get_tempo_i( Moment( 1, 4 ) ) ); - midi_track.add( Moment( 0.0 ), &midi_tempo ); + 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.0 ), &midi_time ); + midi_track.add( Moment( 0 ), &midi_time ); for (Midi_walker w (st_l, &midi_track); w.ok(); w++) w.process_requests(); @@ -96,41 +86,26 @@ Midi_output::header() String str = String( "Creator: " ) + get_version_str() + "\n"; Midi_text creator( Midi_text::TEXT, str ); - midi_track.add( Moment( 0.0 ), &creator ); + midi_track.add( Moment( 0 ), &creator ); str = "Generated, at "; str += ctime( &t ); str = str.left_str( str.length_i() - 1 ); str += ",\n"; Midi_text generate( Midi_text::TEXT, str ); - midi_track.add( Moment( 0.0 ), &generate ); + midi_track.add( Moment( 0 ), &generate ); + Source_file* sourcefile_l = source_l_g->sourcefile_l( score_l_->defined_ch_C_ ); + if ( sourcefile_l ) { + str = "from musical definition: " + + sourcefile_l->file_line_no_str(score_l_->defined_ch_C_); - str = "from musical definition: " + infile_str_g + "\n"; + } Midi_text from( Midi_text::TEXT, str ); - midi_track.add( Moment( 0.0 ), &from ); + midi_track.add( Moment( 0 ), &from ); // set track name Midi_text track_name( Midi_text::TRACK_NAME, "Track " + String_convert::i2dec_str( 0, 0, '0' ) ); - midi_track.add( Moment( 0.0 ), &track_name ); - -#if 0 - /* - shouldn't impose copyright on output. - */ - struct tm* tm_l = gmtime( &t ); - String year_str = String_convert::i2dec_str( 1900 + tm_l->tm_year, 4, '0' ); - - // your copyleft here - str = " Copyleft (o) " + year_str + "by\n"; - Midi_text copyleft( Midi_text::COPYRIGHT, str ); - midi_track.add( Moment( 0.0 ), ©left ); - - str = " Han-Wen Nienhuys ," - " Jan Nieuwenhuizen \n"; - - Midi_text authors( Midi_text::COPYRIGHT, str ); - midi_track.add( Moment( 0.0 ), &authors ); -#endif + midi_track.add( Moment( 0 ), &track_name ); *midi_stream_l_ << midi_track; } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index 88e5eb2dc6..e6a2e35b3c 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -73,8 +73,8 @@ Midi_stream::header() // 00 01 one track // 00 60 96 per quarter-note -// char const ch_c_l = "0000" "0006" "0001" "0001" "0060"; -// str += String_convert::hex2bin_str( ch_c_l ); +// char const ch_C = "0000" "0006" "0001" "0001" "0060"; +// str += String_convert::hex2bin_str( ch_C ); // *os_p_ << str; // *this << Midi_header( 1, 1, tempo_i_ ); diff --git a/lily/musical-request.cc b/lily/musical-request.cc index 597a60ac76..e90be35ba3 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -17,12 +17,13 @@ void Stem_req::do_print() const { +#ifndef NPRINT Rhythmic_req::do_print(); mtor << "dir : " << dir_i_; +#endif } -Stem_req::Stem_req(int s, int d) - : Rhythmic_req(s,d) +Stem_req::Stem_req() { dir_i_ = 0; } @@ -56,12 +57,12 @@ Span_req::do_print() const Request::Request() { elt_l_ = 0; - defined_ch_c_l_ = 0; + defined_ch_C_ = 0; } Request::Request(Request const&src) { elt_l_ = 0; - defined_ch_c_l_ = src.defined_ch_c_l_; + defined_ch_C_ = src.defined_ch_C_; } /* *************** */ Spacing_req::Spacing_req() @@ -103,7 +104,7 @@ Melodic_req::transpose(Melodic_req const & delta) accidental_i_ += delta.accidental_i_; if (abs(accidental_i_) > 2) { warning("transposition makes accidental larger than 2", - delta.defined_ch_c_l_); + delta.defined_ch_C_); } } @@ -153,37 +154,29 @@ Rhythmic_req::compare(Rhythmic_req const &r1, Rhythmic_req const &r2) { return sign(r1.duration() - r2.duration()); } -Rhythmic_req::Rhythmic_req(int b, int d) + +void +Rhythmic_req::set_duration(Duration d) { - plet_factor = 1; - balltype = b; - dots = d; + duration_ = d; } Rhythmic_req::Rhythmic_req() { - plet_factor = 1; - balltype = 1; - dots = 0; } void Rhythmic_req::do_print() const { #ifndef NPRINT - mtor << "ball: " << balltype ; - int d =dots; - while (d--) - mtor << '.'; - - mtor<<", plet factor"< +*/ + #include +#include #include "interval.hh" #include "identifier.hh" #include "assoc-iter.hh" -#include "input-file.hh" #include "out/parser.hh" #include "keyword.hh" #include "assoc.hh" @@ -58,6 +66,8 @@ My_lily_lexer::My_lily_lexer() keytable_p_ = new Keyword_table(the_key_tab); identifier_assoc_p_ = new Assoc; errorlevel_i_ = 0; + post_quotes_b_ = false; + } int @@ -75,11 +85,6 @@ My_lily_lexer::lookup_identifier(String s) return (*identifier_assoc_p_)[s]; } -char const* -My_lily_lexer::here_ch_c_l() -{ - return include_stack_.top()->sourcefile_l_->ch_c_l() + yyin->tellg(); -} void My_lily_lexer::add_identifier(Identifier*i) @@ -104,78 +109,30 @@ My_lily_lexer::~My_lily_lexer() delete identifier_assoc_p_; } void -My_lily_lexer::print_init_declarations()const +My_lily_lexer::print_declarations(bool init_b)const { for (Assoc_iter ai(*identifier_assoc_p_); ai.ok(); ai++) { - if (ai.val()->init_b_) - ai.val()->print(); - } -} -void -My_lily_lexer::print_user_declarations()const -{ - for (Assoc_iter ai(*identifier_assoc_p_); ai.ok(); ai++) { - if (!ai.val()->init_b_) + if (ai.val()->init_b_ == init_b) ai.val()->print(); } } -String -My_lily_lexer::spot()const -{ - return include_stack_.top()->name + ": " + String( lineno() ); -} - void My_lily_lexer::LexerError(char const *s) { - if (lexer->include_stack_.empty()) { + if (include_stack_.empty()) { *mlog << "error at EOF" << s << '\n'; } else { - char const* ch_c_l = here_ch_c_l(); - if ( ch_c_l ) { - ch_c_l--; - while ( ( *ch_c_l == ' ' ) || ( *ch_c_l == '\t' ) || ( *ch_c_l == '\n' ) ) - ch_c_l--; - ch_c_l++; + char const* ch_C = here_ch_C(); + if ( ch_C ) { + ch_C--; + while (isspace(*ch_C == ' ' )) + ch_C--; + ch_C++; } errorlevel_i_ |= 1; - error( s, ch_c_l ); + error( s, ch_C ); } } -// set the new input to s, remember old file. -void -My_lily_lexer::new_input(String s) -{ - if (!include_stack_.empty()) { - include_stack_.top()->line = lineno(); - // should this be saved at all? - include_stack_.top()->defined_ch_c_l_ = defined_ch_c_l; - } - - Input_file *newin = new Input_file(s); - include_stack_.push(newin); - switch_streams(newin->is); - - yylineno = 1; -} - -// pop the inputstack. -bool -My_lily_lexer::close_input() -{ - Input_file *old = include_stack_.pop(); - bool ok = true; - if (include_stack_.empty()) { - ok = false; - } else { - Input_file *i = include_stack_.top(); - switch_streams(i->is); - yylineno = i->line; - defined_ch_c_l = i->defined_ch_c_l_; - } - delete old; - return ok; -} diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc new file mode 100644 index 0000000000..6340a918b8 --- /dev/null +++ b/lily/my-lily-parser.cc @@ -0,0 +1,232 @@ +/* + my-lily-parser.cc -- implement + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "my-lily-parser.hh" +#include "my-lily-lexer.hh" +#include "debug.hh" +#include "main.hh" +#include "voice-element.hh" +#include "musical-request.hh" +#include "command-request.hh" + +void +My_lily_parser::set_debug() +{ +#ifndef NPRINT + String s = ""; + if (init_parse_b_) + s = "Init"; + set_yydebug( !monitor->silence(s+"Parser") && check_debug); + lexer_p_->set_debug( !monitor->silence(s+"Lexer") && check_debug); +#endif +} +void +My_lily_parser::print_declarations() +{ +#ifndef NPRINT + String s = ""; + if (init_parse_b_) + s = "Init"; + if (!monitor->silence(s+"Declarations") && check_debug) { + lexer_p_->print_declarations(init_parse_b_); + } +#endif +} + +void +My_lily_parser::parse_file(String init, String s) +{ + *mlog << "Parsing ... "; + lexer_p_ = new My_lily_lexer; + + set_debug(); + + lexer_p_->new_input(init, source_l_); + do_yyparse(); + print_declarations(); + + init_parse_b_ = false; + lexer_p_->new_input(s, source_l_); + do_yyparse(); + + + if(!define_spot_array_.empty()) + warning("Braces don't match.",0); +} + +My_lily_parser::~My_lily_parser() +{ + delete lexer_p_; +} + +void +My_lily_parser::remember_spot() +{ + define_spot_array_.push(here_ch_C()); +} + +char const * +My_lily_parser::here_ch_C()const +{ + return lexer_p_->here_ch_C(); +} + +void +My_lily_parser::parser_error(String s) +{ + lexer_p_->LexerError(s); + + if ( fatal_error_i_ ) + exit( fatal_error_i_ ); + error_level_i_ = 1; +} + +void +My_lily_parser::set_duration_mode(String s) +{ + s = s.upper_str(); + last_duration_mode = (s== "LAST"); +} + +void +My_lily_parser::set_last_duration(Duration const *d) +{ + if (last_duration_mode) + default_duration_ = *d; +} + + +Voice_element* +My_lily_parser::get_word_element(Text_def* tdef_p, Duration * duration_p) +{ + Voice_element* velt_p = new Voice_element; + + Lyric_req* lreq_p = new Lyric_req(tdef_p); + + lreq_p->duration_ = *duration_p; + lreq_p->print(); + lreq_p->defined_ch_C_ = here_ch_C(); + + velt_p->add(lreq_p); + + delete duration_p; + return velt_p; +} + +Voice_element * +My_lily_parser::get_rest_element(String, Duration * duration_p ) +{ + Voice_element* velt_p = new Voice_element; + velt_p->defined_ch_C_ = lexer_p_->here_ch_C(); + + 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(); + + velt_p->add(rest_req_p); + delete duration_p; + return velt_p; +} + +Voice_element * +My_lily_parser::get_note_element(Note_req *rq, Duration * duration_p ) +{ + Voice_element*v = new Voice_element; + v->defined_ch_C_ = here_ch_C(); + + if (duration_p->type_i_ >= 2) { + Stem_req * stem_req_p = new Stem_req(); + stem_req_p->duration_ = *duration_p; + + stem_req_p->defined_ch_C_ = here_ch_C(); + v->add(stem_req_p); + } + + rq->set_duration(*duration_p); + rq->defined_ch_C_ = here_ch_C(); + + + v->add(rq); + delete duration_p ; + return v; +} + +Request* +My_lily_parser::get_parens_request(char c) +{ + Request* req_p=0; + switch (c) { + case '|': + req_p = new Barcheck_req; + break; + + case '[': + case ']': + { + Beam_req*b = new Beam_req; + int p_i=default_duration_.plet_.type_i_ ; // ugh . Should junk? + if (p_i!= 1) + b->nplet = p_i; + req_p = b; + } + break; + + + case ')': + case '(': + req_p = new Slur_req; + break; + default: + assert(false); + break; + } + + switch (c) { + case '(': + case '[': + req_p->span()->spantype = Span_req::START; + break; + case ')': + case ']': + req_p->span()->spantype = Span_req::STOP; + break; + + default: + break; + } + + req_p->defined_ch_C_ = here_ch_C(); + return req_p; +} + +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; + textstyle_str_="roman"; // in lexer? + error_level_i_ = 0; + last_duration_mode = false; + defined_ch_C_ = 0; + fatal_error_i_ = 0; +} + +void +My_lily_parser::add_requests(Voice_element*v) +{ + for (int i = 0; i < pre_reqs.size(); i++) { + v->add(pre_reqs[i]); + } + pre_reqs.set_size(0); + for (int i = 0; i add(post_reqs[i]); + } + post_reqs.set_size(0); +} diff --git a/lily/note.cc b/lily/note.cc index 9c26c57f08..0d43d53234 100644 --- a/lily/note.cc +++ b/lily/note.cc @@ -16,138 +16,7 @@ #include "parseconstruct.hh" #include "input-music.hh" #include "voice-element.hh" -Moment -Lexer_prefs::plet_mom() -{ - return Moment(default_plet_dur, default_plet_type); -} -Lexer_prefs::Lexer_prefs() -{ - default_duration = 4, default_dots=0, default_octave_i_=0; - default_plet_type = 1, default_plet_dur = 1; - textstyle_str_="roman"; // in lexer? - - last_duration_mode = false; -} - -void -Lexer_prefs::set_duration_mode(String s) -{ - s = s.upper_str(); - last_duration_mode = (s== "LAST"); -} - -void -Lexer_prefs::set_last_duration(int n) -{ - if (last_duration_mode) - default_duration = n; -} - -/* triplet is '2/3' */ -void -Lexer_prefs::set_plet(int num,int den) -{ - assert(num >0&& den>0); - default_plet_dur = num; - default_plet_type = den; -} - -Text_def* -get_text(String s) return t; -{ - t= new Text_def; - t->text_str_= s; - t->style_str_ = lexer->prefs.textstyle_str_; - t->defined_ch_c_l_ = defined_ch_c_l; - return t; -} -Voice_element * -get_note_element(Note_req *rq, int * duration ) -{ - Voice_element*v = new Voice_element; - v->defined_ch_c_l_ = defined_ch_c_l; - - int dur = duration[0]; - int dots = duration[1]; - - if (dur >= 2) { - Stem_req * stem_req_p = new Stem_req(dur,dots); - stem_req_p->plet_factor = lexer->prefs.plet_mom(); - - stem_req_p->defined_ch_c_l_ = defined_ch_c_l; - v->add(stem_req_p); - } - - if ( !defined_ch_c_l ) - defined_ch_c_l = lexer->here_ch_c_l(); - - rq->balltype = dur; - rq->dots = dots; - rq->plet_factor = lexer->prefs.plet_mom(); - - rq->defined_ch_c_l_ = defined_ch_c_l; - - v->add(rq); - - return v; -} - -Voice_element* -get_word_element(Text_def* tdef_p, int* duration) -{ - Voice_element* velt_p = new Voice_element; - velt_p->defined_ch_c_l_ = defined_ch_c_l; - - int dur = duration[0]; - int dots=duration[1]; - - tdef_p->defined_ch_c_l_ = defined_ch_c_l; - - Lyric_req* lreq_p = new Lyric_req(tdef_p); - - lreq_p->balltype = dur; - lreq_p->dots = dots; - lreq_p->plet_factor = lexer->prefs.plet_mom(); - lreq_p->print(); - lreq_p->defined_ch_c_l_ = defined_ch_c_l; - - velt_p->add(lreq_p); - - return velt_p; -} -Voice_element * -get_rest_element(String, int * duration ) -{ - Voice_element* velt_p = new Voice_element; - velt_p->defined_ch_c_l_ = defined_ch_c_l; - - Rest_req * rest_req_p = new Rest_req; - rest_req_p->plet_factor = lexer->prefs.plet_mom(); - rest_req_p->balltype = duration[0]; - rest_req_p->dots = duration[1]; - rest_req_p->print(); - rest_req_p->defined_ch_c_l_ = defined_ch_c_l; - - velt_p->add(rest_req_p); - - return velt_p; -} - -void -Lexer_prefs::get_default_duration(int *p) -{ - *p++ = default_duration; - *p = default_dots; -} - -void -Lexer_prefs::set_default_duration(int *p) -{ - default_duration = *p++; - default_dots = *p++; -} Request* get_plet_request( char c, int dur_i, int type_i ) @@ -159,53 +28,6 @@ get_plet_request( char c, int dur_i, int type_i ) return plet_req_p; } -Request* -get_request(char c) -{ - Request* req_p=0; - switch (c) { - case '|': - req_p = new Barcheck_req; - break; - - case '[': - case ']': - { - Beam_req*b = new Beam_req; - int p_i=lexer->prefs.default_plet_type ; - if (p_i!= 1) - b->nplet = p_i; - req_p = b; - } - break; - - - case ')': - case '(': - req_p = new Slur_req; - break; - default: - assert(false); - break; - } - - switch (c) { - case '(': - case '[': - req_p->span()->spantype = Span_req::START; - break; - case ')': - case ']': - req_p->span()->spantype = Span_req::STOP; - break; - - default: - break; - } - - req_p->defined_ch_c_l_ = req_defined_ch_c_l; - return req_p; -} void add_requests(Voice_element *v, Array &req) @@ -215,8 +37,7 @@ add_requests(Voice_element *v, Array &req) } req.set_size(0); } - -Script_def* +String * get_scriptdef(char c) { String s; @@ -238,7 +59,7 @@ get_scriptdef(char c) case '.' : s = "staccato"; break; } - return lexer->lookup_identifier(s)->script(1); + return new String(s); } Request* diff --git a/lily/notehead.cc b/lily/notehead.cc index fb0c1166c1..b1f660ef17 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -22,8 +22,8 @@ Notehead::Notehead(int ss) void Notehead::set_rhythmic(Rhythmic_req*r_req_l) { - balltype = r_req_l->balltype; - dots = r_req_l->dots; + balltype = r_req_l->duration_.type_i_; + dots = r_req_l->duration_.dots_i_; } void diff --git a/lily/parser.y b/lily/parser.y index d5d53de1d1..c379ade770 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -1,5 +1,7 @@ %{ // -*-Fundamental-*- #include + + #include "script-def.hh" #include "symtable.hh" #include "lookup.hh" @@ -19,26 +21,30 @@ #include "command-request.hh" #include "musical-request.hh" #include "voice-element.hh" +#include "my-lily-parser.hh" +#include "text-def.hh" #ifndef NDEBUG #define YYDEBUG 1 #endif -Array pre_reqs, post_reqs; -Array define_spots; -Paper_def*default_paper(); -char const* defined_ch_c_l; -char const* req_defined_ch_c_l; -int fatal_error_i = 0; -bool init_parse_b; +#define YYERROR_VERBOSE 1 + +#define YYPARSE_PARAM my_lily_parser_l +#define YYLEX_PARAM my_lily_parser_l +#define THIS ((My_lily_parser *) my_lily_parser_l) + +#define yyerror THIS->parser_error + %} %union { - Array *melreqvec; + Array *melreqvec;/* should clean up naming */ Array * strvec; Array *intvec; Box *box; + Duration *duration; Identifier *id; Input_music *music; Input_score *score; @@ -67,12 +73,28 @@ bool init_parse_b; int i; int ii[10]; } +%{ + +int +yylex(YYSTYPE *s, void * v_l) +{ + My_lily_parser *pars_l = (My_lily_parser*) v_l; + My_lily_lexer * lex_l = pars_l->lexer_p_; + lex_l->lexval_l = (void*) s; + return lex_l->yylex(); +} + + +%} +%pure_parser + +/* tokens which are not keywords */ +%token CONCAT %token BAR %token CADENZA %token CLEF %token CM_T -%token CONCAT %token DURATIONCOMMAND %token DYNAMIC %token END @@ -124,17 +146,18 @@ bool init_parse_b; %token REAL %token DURATION RESTNAME %token STRING +%token POST_QUOTES +%token PRE_QUOTES + %type box %type open_request_parens close_request_parens close_plet_parens %type music_chord music_chord_body init_music_chord %type voice_elt full_element lyrics_elt command_elt %type int -%type octave_quotes octave_quote %type script_dir %type declaration -%type default_duration explicit_duration notemode_duration -%type mudela_duration +%type explicit_duration notemode_duration %type dinterval %type intastint_list %type symtables symtables_body @@ -155,6 +178,8 @@ bool init_parse_b; %type