From b94f8946e80e19f22d1416d7241810f7697ed921 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 22:14:48 +0000 Subject: [PATCH] lilypond-1.1.54 --- Documentation/tex/lilypond-regtest.doc | 8 +- Documentation/tex/refman.yo | 30 ++--- NEWS | 60 +++++++++- TODO | 56 ++++----- VERSION | 2 +- aclocal.m4 | 2 + input/test/tup.ly | 2 +- lily/atom.cc | 92 --------------- lily/include/atom.hh | 32 ------ lily/include/lookup.hh | 9 +- lily/lookup.cc | 10 +- lily/multi-measure-rest.cc | 63 ++++------- lily/parser.yy | 151 +++++++++++++++---------- lily/tuplet-spanner.cc | 6 +- lily/volta-spanner.cc | 5 +- ly/params.ly | 11 ++ ps/lily.ps | 16 +-- scm/lily.scm | 28 ++--- scripts/ly2dvi.py | 17 ++- scripts/mudela-book.py | 5 +- stepmake/aclocal.m4 | 2 + tex/lilyponddefs.tex | 11 -- 22 files changed, 283 insertions(+), 335 deletions(-) diff --git a/Documentation/tex/lilypond-regtest.doc b/Documentation/tex/lilypond-regtest.doc index 4ba4489be8..0dc04fde80 100644 --- a/Documentation/tex/lilypond-regtest.doc +++ b/Documentation/tex/lilypond-regtest.doc @@ -25,7 +25,9 @@ you must create a special context called Thread. \mudelafile{noteheadstyle.ly} Multiple measure rests do not collide with barlines and clefs. They -are not expanded when you set Score.SkipBars +are not expanded when you set \verb+Score.SkipBars+. Although the +multi-measure-rest is a Spanner, minimum distances are set to keep it +colliding from barlines. \mudelafile{multi-measure-rest.ly} @@ -124,7 +126,9 @@ middle voices are horizontally shifted in a limited number of cases. \mudelafile{collisions.ly} The number of stafflines of a staff can be set with the property -numberOfStaffLines. Ledger lines both on note heads and rests are adjusted. +numberOfStaffLines. Ledger lines both on note heads and rests are +adjusted. Barlines also are adjusted. + \mudelafile{number-staff-lines.fly} diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index 8f0285e287..6328f112b1 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -231,7 +231,7 @@ to an identifier whose name is the same as the name of a keyword. The following words are keywords: verb(accepts duration midi relative textscript alternative font mm remove time -bar grouping musicalpitch repeat times +bar musicalpitch repeat times cadenza header name scm translator chordmodifiers in notenames scmfile transpose chords include notes score type @@ -883,6 +883,21 @@ mudela(verbatim)(\score{ foo1 __ bar2. __ _4 baz1 __ } > }) +If you want to have hyphens centred between syllables (rather than attached +to the end of the first syllable) you can use the special code(--) lyric as +separate word between syllables. This will result in a hyphen whose length +varies depending on the space between syllables, and centred between the +syllables. For example: +mudela(verbatim)(\score{ + < \notes \transpose c'' {c d e c | c d e c | e f g'2 | + e'4 f g'2 \bar "|."; } + \context Lyrics \lyrics { + DOEXPAND(Fr\)`e4 -- re Ja -- que DOEXPAND(Fr\)`e -- re Ja -- que + Dor -- mez vous?2 Dor4 -- mez vous?2 } + > +}) + + sect(Time) @@ -909,14 +924,6 @@ In order to help with error checking, you can insert bar markers in your music by typing code(|). Whenever LilyPond encounters a code(|) that doesn't fall at a measure boundary, she prints a warning message. -Rhythmic grouping is a concept closely associated with this. -A default grouping is selected for the chosen time signature. -The default consists of combinations of 2 and 3 beats with as many -groups of 3 as possible, and the groups of 3 coming first. For -example, 4/4 is divided into 2+2 and 8/8 is divided into 3+3+2. This -default grouping can be changed using the \grouping keyword which -takes a list of durations to specify the grouping. - COMMENT( sect(Composition: forming bigger structures) @@ -1140,11 +1147,6 @@ var(dotcount). dit(code(\font) var(string)) Internal keyword. Used within code(\paper) to specify the font. -dit(code(\grouping) var(durationseq)code(;)) Sets the metric structure of -the measure. Each argument specifies the duration of one metric unit. -For example, code(\duration 16*5;) specifies a grouping of five beats -together in 5/16 time. The default grouping is to have as many groups -of 3 as possible followed by groups of two. dit(code(\header) code({) var(key1) = var(val1); var(key2) = var(val2); ... code(})) Specifies information about the music. A header should appear at the diff --git a/NEWS b/NEWS index 25c143f79d..b17aa62697 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,52 @@ - +pl 53.jbr1 + - scripts/ly2dvi.py: A fix for the multitude of file systems supported + by windows. As long as the paths that the cygwin apps use are + UNC style and the paths that the native windows apps use are DOS + style everybody is happy. I add quick and dirty unc2dos function + to facilitate this approach. + +pl 53.hwn1 + - bf mudela-book. + - better min distance for multi measure rests. + - junk ATOM_SMOB + - control tuplet gap size from paper. + - bf: output header as PS strings for PS out. + - bf: cached-fontname + - control volta height from paper block. + +pl 53.jcn5 + - \rhythm-ified and text bfs: standchen.ly + - walk rhythm through *_iterator::next_music_l () + +pl 53.jcn4 + - more abc2ly hacking, including lyrics and \rhythm + - bfs: \rhythm + - \rhythm-ified input/twinkle.ly + +pl 53.jcn3 + - put rhythm A on pitches/lyrics B: \rhythm MUSICA MUSICB + input/test/rhythm-melody.fly + input/test/rhythm-lyrics.fly + - syntax changes: +o * dot-only duration dropped: use c4 c4. iso now invalid: c4 c. + * chords: optional_dot now mandatory: + \chords { c-1.2.3 } iso now invalid: \chords { c-1 2 3 } + * @c@ (notemode_chords) syntax dropped. rather use: + \notes { c d \chords { e f } } + +pl 53.jcn2 + - \property graceFraction: part of next note taken-up by grace(s). + - Note_performer: add moments for delayed notes, + fine for single grace notes: hear gnossienne-4.ly + +pl 53.jcn1 + - grace performance + - fixed tie-performance + - bf: abe + +pl 53.gp1 + - added Hyphen-engraver, Hyphen-spanner +************ pl 52.jcn3 - bf: mi2mu: midi without key - try at grace-performer-group; breaks MIDI output even when no \grace @@ -20,7 +68,8 @@ pl 52.hwn2 * beam over barlines * non-fitting stems handled gracefully (eg. [c8 c4 c8] ) - junked rhythmic grouping, \grouping and all associated bits. - - bf: do try_visibility_lambda for nonbreakable items as well (fixes \nobreak on barline) + - bf: do try_visibility_lambda for nonbreakable items as well + (fixes \nobreak on barline) - bf: Cons_list::truncate() pl 52.hwn1 @@ -35,7 +84,6 @@ pl 52.mb3 - Added barSize property. Junked barsize variable. ************ -i pl 51.uu2 - grace note flags, move Lookup::flag into Stem - faq updates: doc++, Matt's page @@ -576,7 +624,7 @@ pl 31.hwn3 - Span_bar bugfix (there you go, Mats). - bf: Score copy ctor (-> bf declaring score) - new Tie behavior: only tie identical pitches, switchable with -oldTieBehavior + oldTieBehavior - junked cautionary_b_ from Musical_pitch pl 32.jcn1 @@ -1299,7 +1347,7 @@ pl5.jcn4 pl5.jcn3 - website fixes -opl5.jcn2 +pl5.jcn2 - extender-*, see input/test/extender.ly - bf: half-beam length (urg) - fixes: standchen, star @@ -1529,7 +1577,7 @@ pl 17.jcn3 - tex output support - all output through scheme - option: f, output-format=X -o - geile placebox + - geile placebox - mf/mfplain.ini pl 17.jcn2 diff --git a/TODO b/TODO index 776239db00..569bfdb5b8 100644 --- a/TODO +++ b/TODO @@ -12,11 +12,9 @@ Grep for TODO and ugh/ugr/urg. . * indent = 0.0 with linewidth=-1.0 . * music ending in grace notes. . * PostScript -. * header for PS enteredby = "bla " . * ps/lily.ps see comments. . * didot / big point. . * fix singleStaffBracket -. * declare performers in \midi . * check EGCS version . * input/test/stem-spacing.ly: 12/4 touches first note . * \shape 1st dim skipped? @@ -24,14 +22,8 @@ Grep for TODO and ugh/ugr/urg. . * We need feta-din*.mf files for more sizes than 10. . * fix dynamics decently, ie. use kerning & ligatures. . * dots & rest collisions? -. * mudela-book.py -. * fix \mudelafile{} to have decent functionality -. * P.P.S. It can be cool in mudela-book to distinguish in -pre,postMudelaExample, whether MudelaExample is epsed or not: ( if -this fragment is floating eps, than 1, otherwise 2). say -preMudelaExample[eps]{}, and change it in document body sometimes. -. * use less RE's -. * junk _ in lyric mode for " " +. * behavior of "that the obvious solution +\lyrics { foo1*4 __ _ }" is unintuitive. . * Lyrics and scripts collide. . * a note with a circle after it, meaning: @@ -72,25 +64,7 @@ preMudelaExample[eps]{}, and change it in document body sometimes. . * Remove non-free software links. . * Remove meta article LilyPond. . * break priority setting from SCM. -. * Gade score -. * remove [] in favour of auto-beamer . * hangOnClef with non-breakable clefs. -. * Aha, the problem is the new TeX code generation for changing fonts. -> (The explanation below is mostly intended for Han-Wen and Jan) -> Before, the font was changed with macros declared separately for -> pure TeX and LaTeX, but now all the fonts are declared directly in -> the generated code using the low-level TeX commands. This circumvents -> the fontencoding mechanism of LaTeX and is a potential source of -> problems also for us users of the Latin-1 character set. -> I think it still works since the inputencoding latin1 is -> declared by ly2dvi, but it still means that e.g. an o with -> umlaut is typeset as a combination of the two symbols 'o' and -> 'umlaut' instead of as a single character, as would be the case -> if fontencoding OT1 had been used. This shouldn't give any -> difference in layout, though. One of the main argument for using -> fontencoding OT1 is for the hyphenation mechanism to work, an -> argument that's clearly irrelevant in our application. Yet we -> see the problem for August. . * Abstraction for engravers: . * make "in-between" engraver (Tie, Extender) . * make wide_spanner_engraver (line_group_spanner, staff_symbol) @@ -316,11 +290,23 @@ touching it. . * PS output . * optimal pagebreaking. -. * Unicode support? -> man 7 unicode -. * 16 bit Strings -. * -u switch -. * detect of 16/8 bit files -. * examples to go with it. +. * internationalisation for input. +. * Unicode support? -> man 7 unicode +. * (The explanation below is mostly intended for Han-Wen and Jan) +> Before, the font was changed with macros declared separately for +> pure TeX and LaTeX, but now all the fonts are declared directly in +> the generated code using the low-level TeX commands. This circumvents +> the fontencoding mechanism of LaTeX and is a potential source of +> problems also for us users of the Latin-1 character set. +> I think it still works since the inputencoding latin1 is +> declared by ly2dvi, but it still means that e.g. an o with +> umlaut is typeset as a combination of the two symbols 'o' and +> 'umlaut' instead of as a single character, as would be the case +> if fontencoding OT1 had been used. This shouldn't give any +> difference in layout, though. One of the main argument for using +> fontencoding OT1 is for the hyphenation mechanism to work, an +> argument that's clearly irrelevant in our application. Yet we +> see the problem for August. . * \header . * output header info to MIDI too. @@ -352,7 +338,6 @@ languages: . * SMDL? . * add to MIDI output: -. * tied notes for MIDI . * sharp / flat on trills (in MIDI ??) . * tempo change . * ornaments (and trills?) @@ -456,7 +441,6 @@ hesitate to ask. . * specify number of lines .* INPUTLANGUAGE -. * \rhythms 4 16 16 16 16; c c c c c -> c4 c16 etc. . * convention for slurs vs. phrasing marks. . * Language: . * \translator -> ? @@ -486,8 +470,6 @@ hesitate to ask. . * fix confusing naming in Engraver vs Engraver_group_engraver (context) -. * progress when creating MIDI elts. - . * A range for context errors (eg. mark both { and }. ) . * lyric in staff (sharpsharp in staff, text below) diff --git a/VERSION b/VERSION index d06e719920..ceae9e6172 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=53 +PATCH_LEVEL=54 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/aclocal.m4 b/aclocal.m4 index d579266f49..602d77213a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,7 @@ dnl WARNING WARNING WARNING WARNING dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4 +dnl WARNING WARNING WARNING WARNING +dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in diff --git a/input/test/tup.ly b/input/test/tup.ly index 6a0e13cb09..e532ed3030 100644 --- a/input/test/tup.ly +++ b/input/test/tup.ly @@ -1,5 +1,5 @@ \score{ - \notes \context Voice { + \notes \context Voice \relative c'' { \times 2/3 { \times 2/3 { a8 b c} c } \times 3/4 { c4 c4 c4 c4 } \time 6/8; diff --git a/lily/atom.cc b/lily/atom.cc index 61a1b3e32f..b6bbb7e598 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -20,95 +20,3 @@ Atom::Atom(SCM s) { func_ = s; } - - -#ifdef ATOM_SMOB -int -Atom::smob_display (SCM smob, SCM port, scm_print_state*) -{ - Atom* a =(Atom*) SCM_CDR(smob); - String i (a->off_.str ()); - - scm_puts ("#func_); - scm_puts (">", port); - - /* non-zero means success */ - return 1; -} - - -scm_sizet -Atom::smob_free (SCM smob) -{ - Atom * a= (Atom*) SCM_CDR(smob); - delete a; - return sizeof (Atom); -} - -SCM -Atom::smob_mark (SCM smob) -{ - Atom * a= (Atom*) SCM_CDR(smob); - scm_gc_mark (a->func_); - return a->font_; -} - -long Atom::smob_tag_; - -void -Atom::init_smob () -{ - static scm_smobfuns type_rec; - - type_rec.mark = smob_mark; - type_rec.free = smob_free; - type_rec.print = smob_display; - type_rec.equalp = 0; - - smob_tag_ = scm_newsmob (&type_rec); -} - - -SCM -Atom::make_smob () const -{ - SCM smob; - SCM_NEWCELL (smob); - SCM_SETCAR (smob, smob_tag_); - SCM_SETCDR (smob, this); - return smob; -} - -SCM -Atom::make_atom (SCM outputfunc) -{ - Atom * a= new Atom(outputfunc); - return a->make_smob (); -} - -SCM -Atom::copy_self () const -{ - return (new Atom (*this))->make_smob (); -} - -bool -Atom::Atom_b (SCM obj) -{ - return(SCM_NIMP(obj) && SCM_CAR(obj) == smob_tag_); -} - -Atom* -Atom::atom_l (SCM a) -{ - assert (Atom_b (a)); - return (Atom*) SCM_CDR(a); -} - - -ADD_GLOBAL_CTOR_WITHNAME(atomsmob, Atom::init_smob); -#endif - - diff --git a/lily/include/atom.hh b/lily/include/atom.hh index 15fc068f5e..3c23232be7 100644 --- a/lily/include/atom.hh +++ b/lily/include/atom.hh @@ -15,37 +15,6 @@ #include "lily-proto.hh" #include "lily-guile.hh" -//#define ATOM_SMOB - -#ifdef ATOM_SMOB - -/// a symbol which can be translated, and freely copied -class Atom { - static long smob_tag_; - - static SCM smob_mark (SCM); - static scm_sizet smob_free (SCM); - static int smob_display (SCM, SCM, scm_print_state*); -public: - SCM make_smob () const; - - Offset off_; - Atom (SCM s); - - static SCM make_atom (SCM outputfunc); - SCM copy_self () const; - static Atom *atom_l (SCM); - - /// Is #obj# a Foo? - static bool Atom_b(SCM obj); - static void init_smob (); - - SCM func_; - SCM font_; -}; - -#else - class Atom { public: Atom (SCM s); @@ -57,6 +26,5 @@ representing a musical notation symbol. */ Protected_scm font_; }; -#endif #endif diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 58a7e34ccb..1d1d96c369 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -16,8 +16,9 @@ #include "direction.hh" #include "box.hh" -/** handy interface to symbol table - TODO: move this into GUILE? +/** + handy interface to symbol table + TODO: move this into GUILE? */ class Lookup { @@ -38,14 +39,14 @@ public: Molecule fill (Box b) const; Molecule filledbox (Box b) const; Molecule hairpin (Real width, Real height, bool decresc, bool continued) const; - Molecule tuplet_bracket (Real dy, Real dx, Real thick,Real interline, Direction dir) const; + Molecule tuplet_bracket (Real dy, Real dx, Real gap, Real thick,Real interline, Direction dir) const; Molecule rest (int, bool outside, String) const; Molecule accordion (SCM arg, Real interline_f) const; Molecule slur (Array controls) const; Molecule text (String style, String text, Paper_def*) const; Molecule staff_brace (Real dy) const; Molecule staff_bracket (Real dy) const; - Molecule volta (Real w, Real h, Real il, bool last_b) const; + Molecule volta (Real h, Real w, Real thick, bool last_b) const; Molecule special_time_signature (String, int,int, Paper_def*) const; Molecule time_signature (int n,int d, Paper_def*) const; diff --git a/lily/lookup.cc b/lily/lookup.cc index 0aedf8c219..961a4b37c8 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -517,12 +517,13 @@ Lookup::hairpin (Real width, Real height, bool decresc, bool continued) const } Molecule -Lookup::tuplet_bracket (Real dy , Real dx, Real thick, Real interline_f, Direction dir) const +Lookup::tuplet_bracket (Real dy , Real dx, Real thick, Real gap, Real interline_f, Direction dir) const { Molecule m; Atom at (gh_list(tuplet_scm_sym, - gh_double2scm (interline_f), + gh_double2scm (interline_f), + gh_double2scm (gap), gh_double2scm (dx), gh_double2scm (dy), gh_double2scm (thick), @@ -575,17 +576,18 @@ Lookup::staff_bracket (Real y) const } Molecule -Lookup::volta (Real w, Real thick, Real interline_f, bool last_b) const +Lookup::volta (Real h, Real w, Real thick, bool last_b) const { Molecule m; Atom at (gh_list (volta_scm_sym, + gh_double2scm (h), gh_double2scm (w), gh_double2scm (thick), gh_int2scm (last_b), SCM_UNDEFINED)); - m.dim_[Y_AXIS] = Interval (-interline_f, interline_f); + m.dim_[Y_AXIS] = Interval (- h/2, h/2); m.dim_[X_AXIS] = Interval (0, w); m.add_atom (&at); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 5c604e3176..41d8018b05 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--1999, 1999 Jan Nieuwenhuizen + (c) 1998--1999 Jan Nieuwenhuizen */ @@ -59,7 +59,7 @@ Multi_measure_rest::do_brew_molecule_p () const Real x_off = 0.0; - Dimension_cache * col_ref = spanned_drul_[LEFT]->column_l ()->dim_cache_[X_AXIS]; + // Dimension_cache * col_ref = spanned_drul_[LEFT]->column_l ()->dim_cache_[X_AXIS]; Real rx = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS); /* @@ -150,48 +150,35 @@ Multi_measure_rest::get_rods () const if (!(spanned_drul_[LEFT] && spanned_drul_[RIGHT])) { programming_error ("Multi_measure_rest::get_rods (): I am not spanned!"); - return a; + return a; } - Rod r; - r.item_l_drul_ = spanned_drul_; - r.distance_f_ = paper_l ()->get_var ("mmrest_x_minimum"); - a.push (r); + Item * l = spanned_drul_[LEFT]->column_l (); + Item * r = spanned_drul_[RIGHT]->column_l (); + Item * lb = l->find_prebroken_piece (RIGHT); + Item * rb = r->find_prebroken_piece (LEFT); - /* - also set distances in case the left or right ending of the rest is - a broken column. This is very common: it happens if the rest is in - the beginning of the line, or at the end. - - TODO: merge this code with other discretionary handling code. - - TODO: calc mmrest_x_minimum (see brew_molecule_p ()) - */ - - Drul_array discretionaries; - Direction d = LEFT; - do + Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; + for (int i=0; i < 4; i++) { - Item *i = r.item_l_drul_[d]->find_prebroken_piece (-d); - discretionaries[d] = i; - if (i) - { - Rod k (r); - - k.item_l_drul_[d] = i; - a.push (k); - } - } - while ((flip (&d))!= LEFT); - - if (discretionaries[LEFT] && discretionaries[RIGHT]) - { - Rod k(r); - k.item_l_drul_ = discretionaries; - a.push (k); - } + Item * l = combinations[i][0]; + Item *r = combinations[i][1]; + if (!l || !r) + continue; + Rod rod; + rod.item_l_drul_[LEFT] = l; + rod.item_l_drul_[RIGHT] = r; + /* + should do something more advanced. + */ + rod.distance_f_ = l->extent (X_AXIS)[BIGGER] - r->extent (X_AXIS)[SMALLER] + + paper_l ()->get_var ("mmrest_x_minimum"); + + a.push (rod); + } + return a; } diff --git a/lily/parser.yy b/lily/parser.yy index cb4f0a942b..7973a73d6b 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -49,6 +49,7 @@ #include "mudela-version.hh" #include "scope.hh" #include "relative-music.hh" +#include "re-rhythmed-music.hh" #include "transposed-music.hh" #include "time-scaled-music.hh" #include "new-repeated-music.hh" @@ -143,6 +144,7 @@ yylex (YYSTYPE *s, void * v_l) %token CADENZA %token CHORDMODIFIERS %token CHORDS +%token HYPHEN %token CLEF %token CM_T %token CONSISTS @@ -173,6 +175,7 @@ yylex (YYSTYPE *s, void * v_l) %token REMOVE %token REPEAT %token REPETITIONS +%token RHYTHM %token SCM_T %token SCMFILE %token SCORE @@ -192,7 +195,7 @@ yylex (YYSTYPE *s, void * v_l) /* escaped */ %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR -%type dots exclamations questions +%type exclamations questions %token DIGIT %token NOTENAME_PITCH %token TONICNAME_PITCH @@ -227,7 +230,7 @@ yylex (YYSTYPE *s, void * v_l) %type script_dir %type optional_modality %type identifier_init -%type steno_duration notemode_duration +%type steno_duration optional_notemode_duration %type entered_notemode_duration explicit_duration %type int_list %type pre_requests post_requests @@ -236,14 +239,15 @@ yylex (YYSTYPE *s, void * v_l) %type steno_tonic_pitch %type pitch_list -%type chord notemode_chord +%type chord %type chord_additions chord_subtractions chord_notes -%type chord_addsub chord_note chord_inversion notemode_chord_inversion +%type chord_addsub chord_note chord_inversion %type midi_block midi_body %type duration_length %type scalar -%type Music relative_music Sequential_music Simultaneous_music Music_sequence +%type Music Sequential_music Simultaneous_music Music_sequence +%type relative_music re_rhythmed_music %type property_def translator_change %type Music_list %type paper_block paper_def_body @@ -252,6 +256,7 @@ yylex (YYSTYPE *s, void * v_l) %type post_request %type command_req verbose_command_req %type extender_req +%type hyphen_req %type string %type score_block score_body %type shape_array @@ -263,7 +268,6 @@ yylex (YYSTYPE *s, void * v_l) - %left '-' '+' %left '*' '/' %left UNARY_MINUS @@ -554,11 +558,6 @@ paper_block: ; -optional_dot: - /* empty */ - | '.' - ; - paper_def_body: /* empty */ { Paper_def *p = THIS->default_paper_p (); @@ -663,6 +662,9 @@ midi_body: /* empty */ { } | MIDI_IDENTIFIER { $$ = $1-> access_content_Midi_def (true); + } + | midi_body assignment semicolon { + } | midi_body translator_spec_block { $$-> assign_translator ($2); @@ -826,6 +828,7 @@ Composite_music: THIS->lexer_p_->pop_state (); } | relative_music { $$ = $1; } + | re_rhythmed_music { $$ = $1; } ; relative_music: @@ -835,6 +838,12 @@ relative_music: } ; +re_rhythmed_music: + RHYTHM Music Music { + $$ = new Re_rhythmed_music ($3, $2); + } + ; + translator_change: TRANSLATOR STRING '=' STRING { Change_translator * t = new Change_translator; @@ -849,7 +858,7 @@ translator_change: ; property_def: - PROPERTY STRING '.' STRING '=' scalar { + PROPERTY STRING '.' STRING '=' scalar { Translation_property *t = new Translation_property; t-> var_str_ = *$4; @@ -904,6 +913,9 @@ abbrev_command_req: extender_req { $$ = $1; } + | hyphen_req { + $$ = $1; + } | '|' { $$ = new Barcheck_req; } @@ -1133,8 +1145,14 @@ explicit_musical_pitch: ; musical_pitch: - steno_musical_pitch - | explicit_musical_pitch + steno_musical_pitch { + $$ = $1; + THIS->set_last_pitch ($1); + } + | explicit_musical_pitch { + $$ = $1; + THIS->set_last_pitch ($1); + } ; explicit_duration: @@ -1158,6 +1176,14 @@ extender_req: } ; +hyphen_req: + HYPHEN { + if (!THIS->lexer_p_->lyric_state_b ()) + THIS->parser_error (_ ("have to be in Lyric mode for lyrics")); + $$ = new Hyphen_req; + } + ; + close_request: close_request_parens { $$ = $1; @@ -1276,18 +1302,16 @@ duration_length: ; entered_notemode_duration: - dots { - $$ = new Duration (THIS->default_duration_); - if ($1) - $$->dots_i_ = $1; - } - | steno_duration { + steno_duration { THIS->set_last_duration ($1); } ; -notemode_duration: - entered_notemode_duration { +optional_notemode_duration: + { + $$ = new Duration (THIS->default_duration_); + } + | entered_notemode_duration { $$ = $1; } ; @@ -1325,7 +1349,7 @@ abbrev_type: simple_element: - musical_pitch exclamations questions notemode_duration { + musical_pitch exclamations questions optional_notemode_duration { if (!THIS->lexer_p_->note_state_b ()) THIS->parser_error (_ ("have to be in Note mode for notes")); @@ -1347,11 +1371,42 @@ simple_element: $$ = v; } - | RESTNAME notemode_duration { + /* + This rhythm option introduces a lot of shift/reduce conflicts; + ie, for every optional_notemode_duration. + However, we always want the default behaviour, which is to shift: + if an optional_notemode_duration is allowed, a following duration + is to be taken as this default duration. Thus + + c4 c 8 4 + + are three notes, ie: c4 c8 c4. + Parsing whitespace is a snaky thing to do. + * / + | entered_notemode_duration { + if (!THIS->lexer_p_->note_state_b ()) + THIS->parser_error (_ ("have to be in Note mode for notes")); + + Note_req *n = new Note_req; + + n->pitch_ = THIS->default_pitch_; + n->duration_ = *$1; + delete $1; + + Simultaneous_music*v = new Request_chord; + v->set_spot (THIS->here_input ()); + n->set_spot (THIS->here_input ()); + + v->add_music (n); + + $$ = v; + } +*/ + | RESTNAME optional_notemode_duration { $$ = THIS->get_rest_element (*$1, $2); delete $1; // delete notename } - | MEASURES notemode_duration { + | MEASURES optional_notemode_duration { Multi_measure_rest_req* m = new Multi_measure_rest_req; m->duration_ = *$2; delete $2; @@ -1361,7 +1416,7 @@ simple_element: velt_p->add_music (m); $$ = velt_p; } - | REPETITIONS notemode_duration { + | REPETITIONS optional_notemode_duration { Repetitions_req* r = new Repetitions_req; r->duration_ = *$2; delete $2; @@ -1371,7 +1426,7 @@ simple_element: velt_p->add_music (r); $$ = velt_p; } - | STRING notemode_duration { + | STRING optional_notemode_duration { if (!THIS->lexer_p_->lyric_state_b ()) THIS->parser_error (_ ("have to be in Lyric mode for lyrics")); $$ = THIS->get_word_element (*$1, $2); @@ -1382,24 +1437,13 @@ simple_element: THIS->parser_error (_ ("have to be in Chord mode for chords")); $$ = $1; } - | '@' notemode_chord '@' { - if (!THIS->lexer_p_->note_state_b ()) - THIS->parser_error (_ ("have to be in Note mode for @chords")); - $$ = $2; - } ; chord: - steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion { - $$ = THIS->get_chord (*$1, $3, $4, $5, *$2); - }; - -notemode_chord: - steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion { + steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion { $$ = THIS->get_chord (*$1, $3, $4, $5, *$2); }; - chord_additions: { $$ = new Array; @@ -1410,12 +1454,13 @@ chord_additions: ; chord_notes: - { + chord_addsub { $$ = new Array; + $$->push (*$1); } - | chord_notes chord_addsub { + | chord_notes '.' chord_addsub { $$ = $1; - $$->push (*$2); + $$->push (*$3); } ; @@ -1435,8 +1480,8 @@ chord_subtractions: chord_addsub: - chord_note optional_dot - | CHORDMODIFIER_PITCH optional_dot + chord_note + | CHORDMODIFIER_PITCH ; chord_inversion: @@ -1448,15 +1493,6 @@ chord_inversion: } ; -notemode_chord_inversion: - { - $$ = 0; - } - | '/' steno_musical_pitch { - $$ = $2 - } - ; - chord_note: unsigned { $$ = new Musical_pitch; @@ -1535,15 +1571,6 @@ string: ; - - -dots: - { $$ = 0; } - | dots '.' { $$ ++; } - ; - - - exclamations: { $$ = 0; } | exclamations '!' { $$ ++; } diff --git a/lily/tuplet-spanner.cc b/lily/tuplet-spanner.cc index 3f76d659e1..aa17ba7972 100644 --- a/lily/tuplet-spanner.cc +++ b/lily/tuplet-spanner.cc @@ -25,7 +25,7 @@ Tuplet_spanner::Tuplet_spanner () } /* - TODO. We should control the gap for lookup from here. + TODO. */ Molecule* Tuplet_spanner::do_brew_molecule_p () const @@ -69,7 +69,9 @@ Tuplet_spanner::do_brew_molecule_p () const Real thick = paper_l ()->get_realvar (tuplet_thick_scm_sym); if (bracket_visibility) { - mol_p->add_molecule (lookup_l ()->tuplet_bracket (dy, w, thick, interline, dir_)); + Real gap = paper_l () -> get_var ("tuplet_spanner_gap"); + + mol_p->add_molecule (lookup_l ()->tuplet_bracket (dy, w, thick, gap, interline, dir_)); } if (number_visibility) diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index 2cf391856c..860a87c94c 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -39,8 +39,9 @@ Volta_spanner::do_brew_molecule_p () const Real dx = internote_f; Real w = extent (X_AXIS).length () - dx; - Molecule volta (lookup_l ()->volta (w, t, interline_f, last_b_)); - Real h = volta.dim_.y ().length (); + Real h = paper_l()->get_var ("volta_spanner_height"); + Molecule volta (lookup_l ()->volta (h, w, t, last_b_)); + Molecule num (lookup_l ()->text ("volta", number_str_, paper_l ())); Real dy = bar_arr_.top ()->extent (Y_AXIS) [UP] > diff --git a/ly/params.ly b/ly/params.ly index a41d3c2c1a..c224318fba 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -143,8 +143,10 @@ barthick_thick = 6.0* \staffline; barthick_thin = 1.6*\staffline; barthick_score = 1.6*\staffline; +tuplet_spanner_gap = 2.0 * \interline; tuplet_thick = 1.0*\staffline; volta_thick = 1.6*\staffline; +volta_spanner_height = 2.0 *\interline; % relative thickness of thin lines 1.6 : 1 : 0.8 stemthickness = 0.8*\staffline; @@ -153,6 +155,10 @@ rulethickness = \staffline; extender_height = 0.8*\staffline; +hyphen_thickness = 0.05*\font_normal; +hyphen_height = 0.2*\font_normal; +hyphen_minimum_length = 0.25*\font_normal; + % Multi-measure rests mmrest_x_minimum = 2.0*\staffheight; @@ -167,8 +173,13 @@ restcollision_minimum_beamdist = 1.5; % deprecated! postBreakPadding = 0.0; +% optical correction amount. stemSpacingCorrection = 0.5*\interline; + + + + \include "engraver.ly"; diff --git a/ps/lily.ps b/ps/lily.ps index 662ac2ec53..75991aa5f0 100644 --- a/ps/lily.ps +++ b/ps/lily.ps @@ -4,14 +4,6 @@ % round cappings 1 setlinecap -% URG -% staffheight 4 div /interline exch def -% interline 3 div /bracket_b exch def -% interline 2 mul /bracket_w exch def -% stafflinethickness 2 mul /bracket_t exch def -% interline 1.5 mul /bracket_v exch def -% bracket_v /bracket_u exch def -% 50 /bracket_alpha exch def /draw_beam % width slope thick { @@ -61,7 +53,7 @@ 1 copy mul exch 1 copy mul add sqrt } bind def -/draw_tuplet % height dx dy thick dir +/draw_tuplet % height gap dx dy thick dir { % urg: the only Level-2 PS, check effect in print % true setstrokeadjust @@ -71,8 +63,8 @@ 1 setlinejoin /tuplet_dy exch def /tuplet_dx exch def + /tuplet_gapx exch def /tuplet_h exch def - staffheight 2 div /tuplet_gapx exch def tuplet_dy tuplet_dx div tuplet_gapx mul /tuplet_gapy exch def @@ -87,12 +79,12 @@ stroke } bind def -/draw_volta % w thick last +/draw_volta % h w thick last { /last exch def setlinewidth /volta_w exch def - staffheight 2 div /volta_h exch def + /volta_h exch def % urg: the only Level-2 PS, check effect in print % true setstrokeadjust 1 setlinecap diff --git a/scm/lily.scm b/scm/lily.scm index 268a383d62..dbc8381e43 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -49,8 +49,7 @@ (string-append (number->string (cadr c)) " "))) -(define - (font i) +(define (font i) (string-append "font" (make-string 1 (integer->char (+ (char->integer #\A) i))) @@ -316,11 +315,11 @@ (define (text s) (string-append "\\hbox{" (output-tex-string s) "}")) - (define (tuplet ht dx dy thick dir) - (embedded-ps ((ps-scm 'tuplet) ht dx dy thick dir))) + (define (tuplet ht gapx dx dy thick dir) + (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir))) - (define (volta w thick last) - (embedded-ps ((ps-scm 'volta) w thick last))) + (define (volta h w thick last) + (embedded-ps ((ps-scm 'volta) h w thick last))) ;; TeX ;; The procedures listed below form the public interface of TeX-scm. @@ -401,7 +400,7 @@ (define (cached-fontname i) (string-append - " lilyfont" + "lilyfont" (make-string 1 (integer->char (+ 65 i))))) (define (select-font font-name) @@ -477,9 +476,12 @@ (define (header-end) "") (define (lily-def key val) - (string-append - "/" key " {" val "} bind def\n")) + (if (string=? (substring key 0 (string-length "mudelapaper") ) "mudelapaper") + (string-append "/" key " {" val "} bind def\n") + (string-append "/" key " (" val ") def\n") + ) + ) (define (header creator generate) (string-append "%!PS-Adobe-3.0\n" @@ -527,14 +529,14 @@ (string-append "(" s ") show ")) - (define (volta w thick last) + (define (volta h w thick last) (string-append - (numbers->string (list w thick (inexact->exact last))) + (numbers->string (list h w thick (inexact->exact last))) " draw_volta")) - (define (tuplet ht dx dy thick dir) + (define (tuplet ht gap dx dy thick dir) (string-append - (numbers->string (list ht dx dy thick (inexact->exact dir))) + (numbers->string (list ht gap dx dy thick (inexact->exact dir))) " draw_tuplet")) diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index deb297b599..25da9f8fce 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -14,7 +14,7 @@ Output: DVI file """ name = 'ly2dvi' -version = '0.0.11' +version = '0.0.12' errorlog = '' import sys @@ -854,7 +854,11 @@ class Properties: """ os.environ['LILYPONDPREFIX'] = path + if os.name == 'nt' or os.name == 'dos': + path = unc2dos(path); + this.__set('root',path,requester) + # # printProps @@ -912,6 +916,17 @@ def getTeXFile(contents): else: return texfiles +def unc2dos(path): + """ + Convert a path of format ///this/that/the/other to + :\this\that\the\other + """ + m=re.match('^//([A-Za-z])(/.*)$',path) + if m: + return m.group(1) + ':' + os.path.normpath(m.group(2)) + + + def program_id (): return name + ' ' + version; diff --git a/scripts/mudela-book.py b/scripts/mudela-book.py index 46b6a61778..eafc978c0e 100644 --- a/scripts/mudela-book.py +++ b/scripts/mudela-book.py @@ -63,7 +63,7 @@ # - bf: Default fragments have linewidth=-1.0 # - Added 'singleline' and 'multiline' options. # 0.5.6: -# - \mudelafile{} set linewith correct, -1 for .sly and texlinewidth for .fly +# - \mudelafile{} set linewidth correct, -1 for .sly and texlinewidth for .fly # - changes to Mudela_output # - changed RE to search for pre/postMudelaExample to make it possible to # comment out a definition. @@ -85,6 +85,8 @@ fontsize_i2a = {11:'eleven', 13:'thirteen', 16:'sixteen', 20:'twenty', 26:'twentysix'} fontsize_pt2i = {'11pt':11, '13pt':13, '16pt':16, '20pt':20, '26pt':26} +# perhaps we can do without this? + begin_mudela_re = re.compile ('^ *\\\\begin{mudela}') begin_verbatim_re = re.compile ('^ *\\\\begin{verbatim}') end_verbatim_re = re.compile ('^ *\\\\end{verbatim}') @@ -600,6 +602,7 @@ class Main_tex_input(Tex_input): f = open (full_path, 'r') lines =f.readlines () + self.mudela.write ('%% This is a copy of file %s\n' % full_path) for x in lines: self.mudela.write (x) r = file_ext_re.search(fn) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index c92667b586..d579266f49 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -1,3 +1,5 @@ +dnl WARNING WARNING WARNING WARNING +dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index 5dc69f9e60..5ef348b4dd 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -46,17 +46,11 @@ %% set up dimensions % mudela-book don't like this: %\parindent=0pt -\newdimen\smallspace \newdimen\interlinedist -\newdimen\stemthickness \newcount\n %duh. meaningful identifiers. \newdimen\staffheight -\newdimen\notewidth -\newdimen\noteheight \newdimen\stafflinethickness -\newdimen\interstaffline -\newdimen\dist %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set fonts and primary dimensions @@ -121,13 +115,8 @@ % this has to be synced with the font definition \def\musixcalc{ - \notewidth=\mudelapapernotewidth pt - \smallspace=.3\interlinedist - \interstaffline=\staffheight - \divide\interstaffline by 4 \stafflinethickness=\mudelapaperrulethickness pt - \stemthickness=\stafflinethickness } -- 2.39.5