From 4833f2f6ad0a2db018e4cf9ef4cf77e6ee28ac4b Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:28:42 +0000 Subject: [PATCH] lilypond-1.1.2 --- Documentation/tex/feta.tex | 18 ++- Documentation/tex/refman.yo | 33 ++++-- Documentation/tex/tutorial.yo | 10 +- TODO | 5 +- dstreamrc | 5 +- init/GNUmakefile | 3 +- init/declarations.ly | 3 + init/paper16.ly | 2 + init/paper20.ly | 3 +- input/test/accid.fly | 6 + input/test/keys.ly | 4 +- input/test/time.fly | 192 ++++++++++++++++---------------- lily/command-request.cc | 4 +- lily/include/command-request.hh | 3 +- lily/include/lily-guile.hh | 1 + lily/include/lookup.hh | 9 +- lily/include/musical-pitch.hh | 2 + lily/include/musical-request.hh | 2 + lily/include/time-signature.hh | 2 +- lily/key-engraver.cc | 3 +- lily/key-item.cc | 10 +- lily/lily-guile.cc | 17 +++ lily/local-key-engraver.cc | 5 + lily/local-key-item.cc | 6 +- lily/midi-walker.cc | 2 +- lily/musical-pitch.cc | 1 + lily/musical-request.cc | 7 +- lily/paper-def.cc | 3 + lily/paper-outputter.cc | 29 ++++- lily/parser.yy | 17 ++- lily/time-signature-engraver.cc | 2 +- lily/time-signature.cc | 2 +- mf/feta-toevallig.mf | 33 +++++- mutopia/gallina.ly | 63 +++++++---- tex/lilyponddefs.tex | 2 +- 35 files changed, 330 insertions(+), 179 deletions(-) create mode 100644 input/test/accid.fly diff --git a/Documentation/tex/feta.tex b/Documentation/tex/feta.tex index cf2f881c94..032c1dcf69 100644 --- a/Documentation/tex/feta.tex +++ b/Documentation/tex/feta.tex @@ -11,8 +11,11 @@ \font\fetanumber = feta-nummer12 \font\fetafinger = feta-nummer5 \font\fetadyn = feta-din10 scaled \magstep 2 +\font\title = cmbx12 scaled \magstep 4 +\font\subtitle = cmr9 -\def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}}} +\def\lilyfooter{Lily was here, 1.1.0} +\def\setchar#1#2{\hbox to\charwidth{\hss{#1\char#2}\hss}} \def\charsperline{6} \def\charheight{55pt} @@ -25,12 +28,19 @@ \loop\ifnum\n<#3 \advance\n by\charsperline \i=0 - \vbox to\charheight{\vss\hbox{ + {\vbox to\charheight{\vss\centerline{ {\loop\ifnum\i<\charsperline \advance\i by1 \advance\n by1 {\setchar{#1}{\number\n}} - \repeat}}}\repeat} + \repeat}}}}\repeat} + + +\centerline{\title FETA} + +\centerline{\subtitle (definately not an abbreviation for Font-En-Tja)} + +\vskip5mm \listfont{\fetatwenty}{0}{78} % urg @@ -43,4 +53,6 @@ \listfont{\fetadyn}{0}{6} \vskip-\charheight +\lilyfooter + \bye diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index ae08ad2d24..7a2e4ec17a 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -347,7 +347,7 @@ label(notedesc) subsect(Basic Note Specification) A note specification has the form -var(pitch)[var(octavespec)][code(!)][var(duration)]. +var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]. The pitch of the note is specified by the note's name. LilyPond has predefined note names for various languages. The default @@ -395,9 +395,11 @@ will determine what accidentals to typeset depending on the key and context. A reminder accidental can be forced by using the optional exclamation mark `code(!)' -on a pitch. +on the pitch. +A cautionary accidental, i.e., an accidental within paranthesis +can be obtained using the optional question mark `code(?)' on the pitch. mudela(fragment,verbatim,center)( -cis' d' e' cis' c'! d' e' c' +cis' d' e' cis' c'? d' e' c'! ) @@ -951,8 +953,14 @@ argument var(file) is a string. The full filename including the file(.ly) extension must be given, and the filename must be quoted. (An unquoted string will not work here.) -dit(code(\key) var(pitch)code(;)) Change key signature to that of -var(pitch)-major. +dit(code(\key) var(pitch) var(type) code(;)) Change the key signature. +var(type) should be code(\major) or code(\minor) to get +var(pitch)-major or var(pitch)-minor, respectively. The second +argument is optional, the default is major keys. +The var(\type) argument can also be given as an integer, which tells +the number of semitones that should be added to the pitch given in the +subsequent code(\key) commands to get the corresponding major key, +e.g. code(\minor) is defined as 3. dit(code(\keysignature) var(pitchseq)code(;)) Specify an arbitrary key signature. The pitches from var(pitch) will @@ -1295,9 +1303,6 @@ dit(code(barAlways)) If set to 1 a bar line is drawn after each note. dit(code(defaultBarType)) Sets the default type of bar line. See code(\bar) keyword. - - - dit(code(keyoctaviation)) If set to 1, then keys are the same in all octaves. If set to 0 then the key signature for different octaves can be different and is specified independently: code(\keysignature bes @@ -1323,16 +1328,16 @@ default) if you do not want key signatures printed. dit(code(timeSignatureStyle)) Changes the default two-digit layout for time signatures. The following values are recognized: description( - dit(code(C)): 4/4 and 2/2 are typeset as C and struck C, + dit(code(C)) 4/4 and 2/2 are typeset as C and struck C, respectively. All other time signatures are written with two digits. - dit(code(old)): 2/2, 3/2, 3/4, 4/4, 6/4 and 9/4 are typeset with + dit(code(old)) 2/2, 3/2, 3/4, 4/4, 6/4 and 9/4 are typeset with old-style mensuration marks. All other time signatures are written with two digits. - dit(code(1)): All time signatures are typeset with a single + dit(code(1)) All time signatures are typeset with a single digit, e.g. 3/2 is written as 3. dit(code(C2/2), code(C4/4), code(old2/2), code(old3/2), code(old3/4), code(old4/4), code(old6/4) or - code(old9/4)): Tells Lilypond to use a specific symbol as time + code(old9/4)) Tells Lilypond to use a specific symbol as time signature. ) The different time signature characters are shown below with @@ -1439,6 +1444,10 @@ code(castingalgorithm). Is equal to 1.0. dit(code(\infinity)) Used for setting the Score.beamslopedamping property. Is actually equal to 10000. dit(code(\left)) Used for setting textalignment property. Is equal to -1. +dit(code(\major)) Used as the second argument of the code(\key) +command to get a major key. +dit(code(\minor)) Used as the second argument of the code(\key) +command to get a minor key. dit(code(\mf)) Print mezzoforte symbol on preceeding note. dit(code(\mp)) Print mezzopiano symbol on preceeding note. dit(code(\nobreak)) Prevent a line break in music by using a large diff --git a/Documentation/tex/tutorial.yo b/Documentation/tex/tutorial.yo index 02bdaaf9a3..cf2e0e5349 100644 --- a/Documentation/tex/tutorial.yo +++ b/Documentation/tex/tutorial.yo @@ -696,10 +696,12 @@ dit(code(\clef) var(clefname)) This command sets the current clef for notation, \clef "treble"; c'4 \clef "alto"; c'4 ) -dit(code(\key) var(pitch)) This command changes the current key signature. The - key signature is printed at the start of every line. The argument - is the name of the corresponding major key. The key of C-minor can - thus be specified as `code(\key es)'. +dit(code(\key) var(pitch) var(type)) This command changes the current + key signature. The key signature is printed at the start of every + line. The var(type) argument is set to code(\major) or code(\minor) + to get major or minor keys, respectively. Omitting the second + argument gives major keys. The key of C-minor can thus be specified + as `code(\key es)' or `code(\key \c minor)'. dit(code(\keysignature) var(pitchlist)) diff --git a/TODO b/TODO index b22fe9a244..b6ac7d37bc 100644 --- a/TODO +++ b/TODO @@ -9,7 +9,7 @@ grep for TODO and ugh/ugr/urg BUGS: - * disallow backslashes + * --safe: disallow backslashes, disallow \include. * \breathmark TeX macro @@ -269,8 +269,6 @@ ydirection and hshift preset * integrate midi-elts from mi2mu and lily? - * cautionary accidental - * score-bar-scripts FMR: Free memory read: * This is occurring while in: @@ -487,7 +485,6 @@ PROJECTS * Keys: - merge key{item} & localkey{item}? - - Major/Minor - spacing, national styles? * Support for TAB diff --git a/dstreamrc b/dstreamrc index 2d4ef5938b..330a276b84 100644 --- a/dstreamrc +++ b/dstreamrc @@ -41,9 +41,8 @@ Clef_item 1 Clef_change_req 1 Col_configuration 1 Col_hpositions 1 -Colinfo 1 -Colinfo 1 Collision 1 +Column_info 1 Column_rod 1 Duration_identifier 1 Engraver 0 @@ -92,7 +91,7 @@ Rhythmic_req 1 Scope 1 Score 0 Score_column 0 -Score_elem 0 +Score_element 0 Score_engraver 0 Score_performer 1 Script_column 1 diff --git a/init/GNUmakefile b/init/GNUmakefile index 7b213816c7..105ca5fc69 100644 --- a/init/GNUmakefile +++ b/init/GNUmakefile @@ -3,7 +3,8 @@ depth = .. INI_FILES = $(FLY_FILES) $(LY_FILES) -# DIST_FILES = Makefile $(INI_FILES) +SCM_FILES = $(wildcard *.scm) +EXTRA_DIST_FILES = $(SCM_FILES) INSTALLATION_DIR=$(datadir)/ly/ INSTALLATION_FILES=$(INI_FILES) diff --git a/init/declarations.ly b/init/declarations.ly index c1bc0fd333..352dc96a89 100644 --- a/init/declarations.ly +++ b/init/declarations.ly @@ -33,6 +33,9 @@ center=0 break = { \penalty = 10000; } nobreak = { \penalty = -10000; } +major = 0 +minor = 3 + \include "property.ly" \include "scm.ly" diff --git a/init/paper16.ly b/init/paper16.ly index 11aa7a8fd2..53ab49363d 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -20,6 +20,8 @@ paper_sixteen = \paper { arithmetic_multiplier = 4.8\pt; texsetting = "\\input lilyponddefs \\musixsixteendefs "; pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + scmsetting = "(display \"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\");\n"; + scmsetting = "(display \"\\\\input lilyponddefs \\\\musixsixteendefs\");\n"; 0 = \symboltables { \table_sixteen } -1 = \symboltables { \table_thirteen } diff --git a/init/paper20.ly b/init/paper20.ly index 226cfb6a74..e799f529bc 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -20,7 +20,8 @@ paper_twenty = \paper { texsetting = "\\input lilyponddefs \\musixtwentydefs "; pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; % urg, debugging only - scmsetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + scmsetting = "(display \"(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\");\n"; + scmsetting = "(display \"\\\\input lilyponddefs \\\\musixtwentydefs\");\n"; -2 = \symboltables { \table_thirteen } -1 = \symboltables { \table_sixteen } diff --git a/input/test/accid.fly b/input/test/accid.fly new file mode 100644 index 0000000000..d7a7775c42 --- /dev/null +++ b/input/test/accid.fly @@ -0,0 +1,6 @@ +\time 3/4; +cisis'' cisis! cisis? | +cis cis! cis? | +c c! c? | +ces ces! ces? | +ceses ceses! ceses? | diff --git a/input/test/keys.ly b/input/test/keys.ly index 211c7c1e20..aa12b97e65 100644 --- a/input/test/keys.ly +++ b/input/test/keys.ly @@ -6,8 +6,8 @@ test key itemv breaking \score { \notes { - \key bes; c1 \key c; c1 + \key bes; c1 \key c \minor; c1 \break - \key bes; c1 \key d;\break c1 + \key bes \major; c1 \key d;\break c1 } } diff --git a/input/test/time.fly b/input/test/time.fly index 3908c4cf64..a7fd1d68b3 100644 --- a/input/test/time.fly +++ b/input/test/time.fly @@ -1,111 +1,113 @@ \property Staff.timeSignatureStyle = "C" \time 1/1; -c''1^"timeSignatureStyle = \"C\"" | -\time 2/2; -c1 | -\time 3/4; -c2. | -\time 4/4; -c1 | -\time 5/4; -c2. c2 | -\time 6/4; -c1. | -\time 3/2; -c1. | -\time 7/4; -c1 c2. | -\time 8/4; -c\breve | -\time 9/4; -c2. c2. c2. | +c''1^"timeSignatureStyle = \"C\"" +\time 2/2; +c1 +\time 3/4; +c2. +\time 4/4; +c1 +\time 5/4; +c2. c2 +\time 6/4; +c1. +\time 3/2; +c1. +\time 7/4; +c1 c2. +\time 8/4; +c\breve +\time 9/4; +c2. c2. c2. \break \property Staff.timeSignatureStyle = "old" -\time 1/1; -c1^"timeSignatureStyle = \"old\"" | -\time 2/2; -c1 | -\time 3/4; -c2. | -\time 4/4; -c1 | -\time 5/4; -c2. c2 | -\time 6/4; -c1. | -\time 3/2; -c1. | -\time 7/4; -c1 c2. | -\time 8/4; -c\breve | -\time 9/4; -c2. c2. c2. | +\time 1/1; +c1^"timeSignatureStyle = \"old\"" +\time 2/2; +c1 +\time 3/4; +c2. +\time 4/4; +c1 +\time 5/4; +c2. c2 +\time 6/4; +c1. +\time 3/2; +c1. +\time 7/4; +c1 c2. +\time 8/4; +c\breve +\time 9/4; +c2. c2. c2. \break \property Staff.timeSignatureStyle = "" -\time 1/1; -c1^"timeSignatureStyle = \"\"" | -\time 2/2; -c1 | -\time 3/4; -c2. | -\time 4/4; -c1 | -\time 5/4; -c2. c2 | -\time 6/4; -c1. | -\time 3/2; -c1. | -\time 7/4; -c1 c2. | -\time 8/4; -c\breve | -\time 9/4; -c2. c2. c2. | +\time 1/1; +c1^"timeSignatureStyle = \"\"" +\time 2/2; +c1 +\time 3/4; +c2. +\time 4/4; +c1 +\time 5/4; +c2. c2 +\time 6/4; +c1. +\time 3/2; +c1. +\time 7/4; +c1 c2. +\time 8/4; +c\breve +\time 9/4; +c2. c2. c2. \break \property Staff.timeSignatureStyle = "1" -\time 1/1; -c1^"timeSignatureStyle = \"1\"" | -\time 2/2; -c1 | -\time 3/4; -c2. | -\time 4/4; -c1 | -\time 5/4; -c2. c2 | -\time 6/4; -c1. | -\time 3/2; -c1. | -\time 7/4; -c1 c2. | -\time 8/4; -c\breve | -\time 9/4; -c2. c2. c2. | +\time 1/1; +c1^"timeSignatureStyle = \"1\"" +\time 2/2; +c1 +\time 3/4; +c2. +%{ % Error if these lines are uncommented: + % Line ... [0guile: Wrong type to apply: # +\time 4/4; +c1 +%} +\time 5/4; +c2. c2 +\time 6/4; +c1. +\time 3/2; +c1. +\time 7/4; +c1 c2. +\time 8/4; +c\breve +\time 9/4; +c2. c2. c2. \break \property Staff.timeSignatureStyle = "old9/4" \property Staff.textalignment = \center -\time 1/1; -c1^"old9/4" | -\property Staff.timeSignatureStyle = "old6/4" -\time 2/2; -c1^"old6/4" | +\time 1/1; +c1^"old9/4" +\property Staff.timeSignatureStyle = "old6/4" +\time 2/2; +c1^"old6/4" \property Staff.timeSignatureStyle = "old3/2" -\time 3/4; -c2.^"old3/2" | +\time 3/4; +c2.^"old3/2" \property Staff.timeSignatureStyle = "old4/4" -\time 4/4; -c1^"old4/4" | +\time 4/4; +c1^"old4/4" \property Staff.timeSignatureStyle = "old2/2" -\time 5/4; -c2.^"old2/2" c2 | +\time 5/4; +c2.^"old2/2" c2 \property Staff.timeSignatureStyle = "C4/4" -\time 6/4; -c1.^"C4/4" | +\time 6/4; +c1.^"C4/4" \property Staff.timeSignatureStyle = "C2/2" -\time 3/2; -c1.^"C2/2" | - +\time 3/2; +c1.^"C2/2" diff --git a/lily/command-request.cc b/lily/command-request.cc index 5a67560e45..9255f63cfb 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -322,7 +322,7 @@ Key_change_req::do_print() const Key_change_req::Key_change_req() { - minor_b_ = false; + modality_i_ = 0; ordinary_key_b_= false; } @@ -366,7 +366,7 @@ Key_change_req::flats_i() bool Key_change_req::minor_b() const { - return minor_b_; + return modality_i_ == 3; } int diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 96c010322b..c03ff6eb54 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -132,7 +132,7 @@ public: class Key_change_req : public Command_req { public: Array pitch_arr_; - bool minor_b_; + int modality_i_; bool ordinary_key_b_; Key_change_req(); @@ -147,7 +147,6 @@ public: int sharps_i(); void transpose (Musical_pitch d); - /// is minor key? bool minor_b() const; }; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index c4479cb567..f4c468c65e 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -37,6 +37,7 @@ SCM ly_quote (); #include "array.hh" #include "scalar.hh" +SCM lambda_scm (String str, Array args_arr); SCM lambda_scm (String str, Array args_arr); SCM lambda_scm (String str, Array args_arr); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 1781679920..9b00615622 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -11,6 +11,7 @@ #define LOOKUP_HH #include "atom.hh" +#include "molecule.hh" #include "fproto.hh" #include "scalar.hh" #include "direction.hh" @@ -29,9 +30,9 @@ public: Lookup (Symtables const&); ~Lookup (); - Atom accidental (int) const; + Molecule accidental (int, bool cautionary) const; void add (String, Symtable*); - Atom afm_find (String) const; + Atom afm_find (String, bool warn=true) const; Atom ball (int) const; Atom bar (String, Real height) const; Atom beam (Real, Real, Real) const; @@ -53,8 +54,8 @@ public: Atom text (String style, String text) const; Atom vbrace (Real &dy) const; Atom vbracket (Real &dy) const; - Atom special_time_signature (String, Array) const; - Atom time_signature (Array) const; + Atom special_time_signature (String, Array) const; + Atom time_signature (Array) const; Paper_def * paper_l_; Symtables *symtables_p_; diff --git a/lily/include/musical-pitch.hh b/lily/include/musical-pitch.hh index 2c4f1a55de..a46471fd61 100644 --- a/lily/include/musical-pitch.hh +++ b/lily/include/musical-pitch.hh @@ -29,6 +29,8 @@ struct Musical_pitch : public Input int octave_i_; /// 0 natural, 1 sharp, etc int accidental_i_; + /// Used for cautionary accidentals + bool cautionary_b_; void init () ; Musical_pitch to_relative_octave (Musical_pitch); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index d280d158ac..3f79b0b45b 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -110,6 +110,8 @@ public: /// force/supress printing of accidental. bool forceacc_b_; + /// Cautionary, i.e. parenthesized accidental. + bool cautionary_b_; Note_req(); bool do_equal_b (Request*) const; REQUESTMETHODS(Note_req); diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 55c8133d38..a2d09022b5 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -26,7 +26,7 @@ protected: virtual Molecule*brew_molecule_p() const; public: Time_signature () ; - Array args_; + Array args_; String time_sig_type_str_; DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 77a29425f5..e2152e2245 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -114,8 +114,7 @@ Key_engraver::read_req (Key_change_req const * r) else { p = r->pitch_arr_[0].semitone_pitch (); - if (r->minor_b ()) - p += 3; + p += r->modality_i_; } /* Solve the equation 7*no_of_acc mod 12 = p, -6 <= no_of_acc <= 5 */ int no_of_acc = (7*p) % 12; diff --git a/lily/key-item.cc b/lily/key-item.cc index 80e470f10f..7d519d3b97 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -133,9 +133,8 @@ Key_item::brew_molecule_p() const || (old_pitch_arr_[i] == pitch_arr_[j] && old_acc_arr_[i] != acc_arr_[j])) { - Atom a =lookup_l ()->accidental (0); - a.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); - Molecule m (a); + Molecule m =lookup_l ()->accidental (0,false); + m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS); output->add_at_edge (X_AXIS, RIGHT, m); } } @@ -153,9 +152,8 @@ Key_item::brew_molecule_p() const for (int i =0; i < pitch_arr_.size(); i++) { - Atom a =lookup_l ()->accidental (acc_arr_[i]); - a.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); - Molecule m (a); + Molecule m =lookup_l ()->accidental (acc_arr_[i],false); + m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS); output->add_at_edge (X_AXIS, RIGHT, m); } if (pitch_arr_.size()) diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 375ff46359..e4be912288 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -63,6 +63,23 @@ ly_func_o (char const* name) } #endif +SCM +lambda_scm (String str, Array args_arr) +{ + if (str.empty_b ()) + { + str = "empty"; + args_arr.clear (); + } + SCM args_scm = SCM_EOL; + for (int i = args_arr.size () - 1; i >= 0; i--) + args_scm = gh_cons (gh_int2scm (args_arr[i]), args_scm); + SCM scm = + ly_append (ly_lambda_o (), + ly_list1 (ly_append (ly_func_o (str.ch_l ()), args_scm))); + return scm; +} + SCM lambda_scm (String str, Array args_arr) { diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 9b0658b647..4edb8b8746 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -67,6 +67,11 @@ Local_key_engraver::process_acknowledged () key_item_p_ = new Local_key_item; announce_element (Score_element_info (key_item_p_, 0)); } + if (note_l->cautionary_b_) + { + note_l->pitch_.cautionary_b_ = true; + } + key_item_p_->add (note_l->pitch_); key_item_p_->add_support (support_l); local_key_.set (note_l->pitch_); diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index a0dc2907a6..a78ec7a371 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -70,10 +70,10 @@ Local_key_item::brew_molecule_p() const Real dy = (c0_position_i_ + accidental_pitch_arr_[i].notename_i_) * paper()->internote_f (); - Atom a (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_)); + Molecule m (lookup_l ()->accidental (accidental_pitch_arr_[i].accidental_i_, + accidental_pitch_arr_[i].cautionary_b_)); - a.translate_axis (dy, Y_AXIS); - Molecule m(a); + m.translate_axis (dy, Y_AXIS); octave_mol_p->add_at_edge (X_AXIS, RIGHT, m); } diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 90477a3009..1af44cd1fb 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -111,7 +111,7 @@ Midi_walker::process() return; p->channel_i_ = track_l_->number_i_; - if (Midi_item *mi = dynamic_cast(p)) + if (Midi_note *mi = dynamic_cast(p)) do_start_note (mi); else output_event (ptr()->audio_column_l_->at_mom (), p); diff --git a/lily/musical-pitch.cc b/lily/musical-pitch.cc index e7ffbd7014..9603e025d9 100644 --- a/lily/musical-pitch.cc +++ b/lily/musical-pitch.cc @@ -21,6 +21,7 @@ Musical_pitch::init () notename_i_ = 0; octave_i_ = 0; accidental_i_ = 0; + cautionary_b_ = false; } void diff --git a/lily/musical-request.cc b/lily/musical-request.cc index c12cd16c29..4538a1d3b2 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -185,6 +185,7 @@ Note_req::do_equal_b (Request*r) const Note_req::Note_req () { + cautionary_b_ = false; forceacc_b_ = false; } @@ -195,7 +196,11 @@ Note_req::do_print () const { #ifndef NPRINT Melodic_req::do_print (); - if (forceacc_b_) + if (cautionary_b_) + { + DOUT << " force cautionary accidental\n"; + } + else if (forceacc_b_) { DOUT << " force accidental\n"; } diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 85abdd931b..c94fe3e8d9 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -269,8 +269,11 @@ Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origi Paper_outputter* p = new Paper_outputter (os_p); output_header (p, header_global_p); +#if 0 + // for now; breaks -fscm output p->output_comment (_ ("outputting Score, defined at: ")); p->output_comment (origin_str); +#endif output_header (p, header_l); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 033fbf3f06..487b3d2b9a 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -8,6 +8,7 @@ */ #include +#include #include "paper-outputter.hh" #include "paper-stream.hh" #include "molecule.hh" @@ -94,6 +95,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) #ifndef NPRINT if (check_debug && !monitor->silent_b ("Guile")) { + DOUT << i->str_ << "\n"; gh_display (i->lambda_); gh_newline (); } #endif @@ -139,10 +141,29 @@ Paper_outputter::output_scheme (SCM scm) // urg; temporary hack to debug scheme error #unknown if (String (output_global_ch) == "scm") { -// char* c = gh_scm2newstr (scm, NULL); -// *outstream_l_ << c << "\n"; -// free (c); - gh_display (scm); gh_newline (); + static SCM port = 0; + // urg + if (!port) + { + int fd = 1; + ofstream * of = dynamic_cast (outstream_l_->os); + if (of) + fd = of->rdbuf()->fd(); + FILE *file = fdopen (fd, "a"); + port = scm_standard_stream_to_port (file, "a", ""); + scm_display (gh_str02scm ("(load 'lily.scm)\n"), port); + } +#if 0 + *outstream_l_ << "(display ((eval "; + scm_write (scm, port); + *outstream_l_ << ") 'tex))\n"; +#else + scm_display (gh_str02scm ("(display ((eval "), port); + scm_write (scm, port); + scm_display (gh_str02scm (") 'tex))\n"), port); + scm_newline (port); + scm_fflush (port); +#endif return; } SCM str_scm = gh_call1 (ly_eval (scm), gh_eval_str (o.ch_l ())); diff --git a/lily/parser.yy b/lily/parser.yy index bc0680a301..72e14708f5 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -248,6 +248,7 @@ yylex (YYSTYPE *s, void * v_l) %type abbrev_type %type int unsigned %type script_dir +%type optional_modality %type identifier_init simple_identifier_init block_identifier %type steno_duration notemode_duration %type entered_notemode_duration explicit_duration @@ -910,10 +911,11 @@ verbose_command_req: $$ = new Clef_change_req (*$2); delete $2; } - | KEY NOTENAME_PITCH { + | KEY NOTENAME_PITCH optional_modality { Key_change_req *key_p= new Key_change_req; key_p->pitch_arr_.push(*$2); key_p->ordinary_key_b_ = true; + key_p->modality_i_ = $3; $$ = key_p; delete $2; } @@ -970,6 +972,15 @@ post_request: } ; +optional_modality: + /* empty */ { + $$ = 0; + } + | int { + $$ = $1; + } + ; + sup_quotes: '\'' { $$ = 1; @@ -1028,6 +1039,10 @@ steno_notepitch: | steno_notepitch '!' { $$->forceacc_b_ = ! $$->forceacc_b_; } + | steno_notepitch '?' { + $$->forceacc_b_ = ! $$->forceacc_b_; + $$->cautionary_b_ = ! $$->cautionary_b_; + } ; diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 35743ad24f..a5ff8b4595 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -35,7 +35,7 @@ Time_signature_engraver::do_process_requests() Time_signature_change_req *req = timing_grav_l->time_signature_req_l(); if (req) { - Array args; + Array args; args.push (req->beats_i_); args.push (req->one_beat_i_); diff --git a/lily/time-signature.cc b/lily/time-signature.cc index edee3d9fbe..a1330d55a4 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -26,7 +26,7 @@ Time_signature::brew_molecule_p () const { if (time_sig_type_str_[0]=='1') { - Array tmparr = args_; + Array tmparr = args_; tmparr[1]= 0; s = lookup_l ()->time_signature (tmparr); } diff --git a/mf/feta-toevallig.mf b/mf/feta-toevallig.mf index b9c9a0ebbe..d4f94c5362 100644 --- a/mf/feta-toevallig.mf +++ b/mf/feta-toevallig.mf @@ -247,7 +247,38 @@ fet_beginchar("Double sharp", "2", "sharpsharp") currentpicture := currentpicture shifted (w/2,0); - fet_endchar; + +fet_endchar; + + +def draw_paren = + save leftindent; + leftindent# := .2 interline#; + define_pixels(leftindent); + set_char_box(0, .5 interline#+stafflinethickness#, + interline#, interline#); + z1 = (leftindent,h); + z2 = (w-stafflinethickness,0); + z3 = (leftindent,-d); + + penpos1(stafflinethickness, 35); + penpos2(2 stafflinethickness, 0); + penpos3(stafflinethickness, -35); + + penlabels(1,2,3); + fill z2l{down} .. simple_serif(z3l, z3r, 90) .. z2r{up} + .. simple_serif(z1r, z1l, 90) .. z2l{down} -- cycle; +enddef; + +fet_beginchar("Right paranthesis", ")", "rightparen") + draw_paren; +fet_endchar; + +fet_beginchar("Left paranthesis", "(", "leftparen") + draw_paren; + currentpicture := currentpicture xscaled -1; + set_char_box(charwd, charbp, chardp, charht); +fet_endchar; fet_endgroup("accidentals"); diff --git a/mutopia/gallina.ly b/mutopia/gallina.ly index b693616337..ffaa8941cd 100644 --- a/mutopia/gallina.ly +++ b/mutopia/gallina.ly @@ -29,8 +29,8 @@ either. /Mats - -Tested Features: Note placement, multipart score, figured base, \breve +Tested Features: Note placement, multipart score, figured base, \breve, + time signature styles %} %{ @@ -47,8 +47,28 @@ definition below. --MB \version "1.0.7"; -vi1=\notes \relative c'' { +global = \notes { + \property StaffGroup.timeSignatureStyle = "old" + \time 4/4; + \tempo 4=80; + \skip 1*31; + \property StaffGroup.timeSignatureStyle = "1" + \time 3/2; + \bar ":|:"; + \tempo 2=140; + \skip 1.*15; + \property StaffGroup.timeSignatureStyle = "old" \time 4/4; + \tempo 4=80; + \skip 1; + \bar ":|:"; + \skip 1*13; + \bar "|."; +} + +vi1=\type Staff = vi1 < +\global +\notes \relative c'' { [d8 d d d] d4 [a16 b c a] | [b8 g ][ g g16 a][ b8 g ][ g g16 a] | @@ -80,9 +100,8 @@ vi1=\notes \relative c'' { [c8 g ][ g g16 f] e4 d | r8 g [g g16 f] e4 d | r8 [d16 a ][ b8 b16 c] a2 | - b1 | - \time 3/2; - \tempo 2=140; + b1 | + r4 d d d d d | e1. | r4 c c c c c | @@ -98,8 +117,7 @@ vi1=\notes \relative c'' { a4 [c8 b] a4 [b8 c] f,4 [g8 a] | d,4 g g g g g | a [d,8 c] b4 [c8 d] a2 | - \time 4/4; - \tempo 4=80; + b1 | [d8 d d d] d4 [a16 b c a] | [b8 g ][ g g16 a] [b8 g ][ g g16 a] | @@ -114,11 +132,11 @@ vi1=\notes \relative c'' { fis4 g2 fis!4 | \cadenza 1; g\breve - \bar "|."; -} +}> -vi2=\notes \relative c'' { - \time 4/4; +vi2=\type Staff = vi2 < +\global +\notes \relative c'' { r1 | r | r | [d8 d d d] d4 [a16 b c a] | @@ -149,7 +167,7 @@ vi2=\notes \relative c'' { e4 d r8 [c16 g ][ b8 b16 c] | a4 g2 fis4 | g1 | - \time 3/2; + r1. | r4 [g'8 f] e4 [f8 g] c,4 [d8 e] | a,1. | @@ -165,7 +183,7 @@ vi2=\notes \relative c'' { c,4 a a a a a | b [d8 c] b4 [c8 d] d,4 e | fis2 g fis! | - \time 4/4; + g1 | r1 | r1 | [g'8 g g g] g4 [d16 e f d] | @@ -179,13 +197,13 @@ vi2=\notes \relative c'' { [a d c b ][ a g fis e] d4 d' | \cadenza 1; b\breve - \bar "|."; -} +}> -bc=\notes\transpose c'{ +bc=\type Staff = bc < +\global +\notes\transpose c'{ \clef "bass"; - \time 4/4; G2 d^"4 3" | G1 | g2 c4 G | d1^"3 4 3" | @@ -203,7 +221,7 @@ bc=\notes\transpose c'{ G1^"3 4 3" | c4 B c g | c B c G | d1^"3 4 3" | G1 | - \time 3/2; + g1. | c | f | d^"\\textsharp" | g | c | @@ -212,8 +230,9 @@ bc=\notes\transpose c'{ d^"\\textsharp" | e | f | g1 B2 | d1.^"3 4 3" | - \time 4/4; + G1 | + \bar ":|:"; g2 fis | g G | g1^"3 4 3" | c | G^"3 4 3" | c2 G | @@ -222,12 +241,10 @@ bc=\notes\transpose c'{ ) d^"3 4 3" | \cadenza 1; G\breve - \bar "|."; -} +}> \score{ \type StaffGroup < - \property StaffGroup.timeSignatureStyle = "old" \vi1 \vi2 \bc diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 38ea9553e8..4312a117a8 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -165,7 +165,7 @@ %compatibility %urg -\fetdef\repeatcolon{18} +\fetdef\repeatcolon{20} \def\repeatbar{\repeatstopbar} \def\startrepeat{\repeatstartbar} \def\repeatbarstartrepeat{\repeatstopstart} -- 2.39.5