From: Jan Nieuwenhuizen Date: Mon, 29 Dec 1997 10:13:08 +0000 (+0100) Subject: patch::: 0.1.38.jcn1: biem pats X-Git-Tag: release/0.1.39~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9b8bf81285ea1b86a214708c4bdb6fd00128bc67;p=lilypond.git patch::: 0.1.38.jcn1: biem pats pl 38.jcn2 - added to beams.ly - open-up beam spacing for mult > 3 - fixed hang/sit to overlap iso aligne with staffline - fixed inter beam spacing, paper*.ly - scsii-menuetto.ly fixes - init/property.ly - property settings for beam quantiseing and damping pl 38.jcn1 - provisionary multiple-beam fix --- diff --git a/NEWS b/NEWS index 650f5ba4db..a25644017f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +pl 38.jcn2 + - added to beams.ly + - open-up beam spacing for mult > 3 + - fixed hang/sit to overlap iso aligne with staffline + - fixed inter beam spacing, paper*.ly + - scsii-menuetto.ly fixes + - init/property.ly + - property settings for beam quantiseing and damping + +pl 38.jcn1 + - provisionary multiple-beam fix + pl 38 - bf: \> \! \ff (crescendo overlap) - misc feta-fixes, flageolet sign. diff --git a/VERSION b/VERSION index 72f3a04587..5432edf03e 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 1 TOPLEVEL_PATCH_LEVEL = 38 -TOPLEVEL_MY_PATCH_LEVEL = jcn1 +TOPLEVEL_MY_PATCH_LEVEL = jcn2 # use the above to send patches, always empty for released version: # please don't move these comments up; the patch should fail if diff --git a/init/feta16.ly b/init/feta16.ly index bd6b9a8cd5..ca8ce0a267 100644 --- a/init/feta16.ly +++ b/init/feta16.ly @@ -1,5 +1,5 @@ % Creator: mf-to-table.py version 0.4 -% Automatically generated on Wed Dec 24 16:30:21 1997 +% Automatically generated on Mon Dec 29 10:52:00 1997 % Do not edit % input from out/feta16.log % name=\symboltables { diff --git a/init/feta20.ly b/init/feta20.ly index a54e367be9..7c855c23d3 100644 --- a/init/feta20.ly +++ b/init/feta20.ly @@ -1,5 +1,5 @@ % Creator: mf-to-table.py version 0.4 -% Automatically generated on Wed Dec 24 16:30:29 1997 +% Automatically generated on Mon Dec 29 10:52:03 1997 % Do not edit % input from out/feta20.log % name=\symboltables { diff --git a/init/lily-init.ly b/init/lily-init.ly index c1753b3263..b47910ac69 100644 --- a/init/lily-init.ly +++ b/init/lily-init.ly @@ -16,7 +16,6 @@ Wordwrap = 0.0 \include "paper16.ly" \include "paper20.ly" - default_paper = \paper{ \paper_sixteen } @@ -29,21 +28,8 @@ left = -1 right = 1 up = 1 down = -1 +% zillie spellink? center=0 - -stemup = { - \skip 1*0; - % Stupid hack to make < { \stemup } > work - \property Voice.ydirection = \up - } -stemboth= { - \skip 1*0; - \property Voice.ydirection = \center -} -stemdown = { - \skip 1*0; - \property Voice.ydirection = \down -} - +\include "property.ly" diff --git a/init/paper16.ly b/init/paper16.ly index 854324b424..98ee62688d 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -26,8 +26,13 @@ paper_sixteen = \paper { arithmetic_basicspace = 2.; arithmetic_multiplier = 4.8\pt; - % - interbeam = 2.667\pt; + % three beams span two interlines, including stafflines: + % 2 interbeam + beam_thickness = 2 interline - staffline_thickness + % ( beam_thickness = 0.48 interline for now...) + % interbeam = interline - (beam_thickness + staffline_thickness) / 2 + % interbeam = 2.84; + % ugh: interline *in fact* is rule_thickness + "interline"? + interbeam = 3.14; gourlay_energybound = 100000.; gourlay_maxmeasures = 14.; diff --git a/init/paper20.ly b/init/paper20.ly index fdfee8404b..e4bd6bfb00 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -19,7 +19,14 @@ paper_twenty = \paper { arithmetic_multiplier = 6.\pt; % - interbeam = 3.333\pt; + % three beams span two interlines, including stafflines: + % 2 interbeam + beam_thickness = 2 interline - staffline_thickness + % ( beam_thickness = 0.48 interline for now...) + % interbeam = interline - (beam_thickness + staffline_thickness) / 2 + % interbeam = 3.6; + % ugh: interline *in fact* is rule_thickness + "interline"? + interbeam = 3.9; + gourlay_energybound = 100000.; gourlay_maxmeasures = 12.; diff --git a/init/property.ly b/init/property.ly new file mode 100644 index 0000000000..4faeb4c6b5 --- /dev/null +++ b/init/property.ly @@ -0,0 +1,94 @@ +% property.ly +% list of properties that lily recognises +% and some shorthands (ugh) + +%{ + +PROPERTIES + +name value effect shorthand + +[Voice] +ydirection -1 force stem down \stemdown +ydirection 0 stem direction free \stemboth +ydirection 1 force stem up \stemup + +[Score?] +beamslopedamping 0 no damping \beamslopeproportional +beamslopedamping 1 damping1) \beamslopedamped +beamslopedamping 100000 zero slope \beamslopezero + +[Score?] +beamquantisation 0 no quantisations \beamposfree +beamquantisation 1 quantise pos and slope \beamposnormal +beamquantisation 2 quantise avoide wedge2) \beampostraditional + + +[Staff?] +instrument ascii midi instrument table lookup + + +1) after beam slope damping table suggested in [Wanske] +2) [Wanske] as well as [Ross] suggests that beams sloped upward must not + start sitting on a staffline, and beams sloped downward must not hang + from a staffline (similar for beam-ends). This would create a wedge + that is traditionally being avoided because it could easily be filled-up + with ink. + However, avoiding these wedges restricts the freedom of beams quite a lot + while they don't seem to be a problem in modern printing. + In no piece of sheetmusic engraved after 1953 (Baerenreiter) i've seen + these wedges being avoided. + +%} + +%hmm, (these) abbrevs suck, imo +% i guess they're meant as some form of doco +% that's what i use them for... +% should compile a list with recognised properties! +stemup = { + \skip 1*0; + % Stupid hack to make < { \stemup } > work + \property Voice.ydirection = \up + } +stemboth= { + \skip 1*0; + \property Voice.ydirection = \center +} +stemdown = { + \skip 1*0; + \property Voice.ydirection = \down +} + +% ugh, cluttering global namespace... +none=0 +free=0 +normal=1 +traditional=2 +infinity=10000 + +beamslopeproportional = { + \property Score.beamslopedamping = \none +} + +beamslopedamped = { + \property Score.beamslopedamping = \normal +} + +beamslopezero = { + \property Score.beamslopedamping = \infinity +} + +% this sucks, you'd want to pass an array, at least +% (or embedded code: you still can't dictate the slope / stemlength) +beamposfree = { + \property Score.beamquantisation = \none +} + +beamposnormal = { + \property Score.beamquantisation = \normal +} + +beampostraditional = { + \property Score.beamquantisation = \traditional +} + diff --git a/input/beams.ly b/input/beams.ly index 6e897a8475..9453f0da6f 100644 --- a/input/beams.ly +++ b/input/beams.ly @@ -10,7 +10,7 @@ TestedFeatures = "beams and beamflags"; \version "0.1.7"; \score{ - \melodic \multi 3 < + \melodic { \multi 3 < { \octave c'; \meter 8/4; \duration8; @@ -23,6 +23,7 @@ TestedFeatures = "beams and beamflags"; \stemup [c c'' a' f'] \duration128; \stemup [c c'' a' f'] + r32 \duration 8; \stemup ['g 'g 'g 'g] @@ -34,6 +35,7 @@ TestedFeatures = "beams and beamflags"; \stemup ['g 'g 'g 'g] \duration 128; \stemup ['g 'g 'g 'g] + r32 } { \octave c'; @@ -48,6 +50,7 @@ TestedFeatures = "beams and beamflags"; \stemdown [a' 'a c e] \duration128; \stemdown [a' 'a c e] + r32 \octave c; \duration 8; @@ -60,7 +63,27 @@ TestedFeatures = "beams and beamflags"; \stemdown [d'' d'' d'' d''] \duration 128; \stemdown [d'' d'' d'' d''] + r32 + } > + { + % ugh, "duration mode" + \duration 8; + [g8 g] [a a] [b b] [c' c'] + \duration 16; + [g16 g g g] [a a a a] [b b b b] [c' c' c' c'] + \meter 4/4; + \duration 32; + [g32 g g g g g g g] [a a a a a a a a] + [b b b b b b b b] [c' c' c' c' c' c' c' c'] + \duration 64; + \meter 2/4; + [g64 g g g g g g g g g g g g g g g] + [c' c' c' c' c' c' c' c' c' c' c' c' c' c' c' c'] } - >} + } + \paper{ + gourlay_maxmeasures = 1.; + } +} diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 889c56e124..febd0720e6 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -28,6 +28,7 @@ copyright = "public domain"; % % because piece is set very tightly IImenuetto = \melodic{ + \property Voice.beamslopedamping = \infinity \clef"alto"; \property Staff.instrument = cello \meter 3/4; @@ -39,13 +40,15 @@ IImenuetto = \melodic{ %%2 \textstyle "finger"; % ugh. - < [ bes8^"1" e8 c8_"2"_"4" > - a8 bes8-. g8-. ] a4-.^"4" | + < [ bes8^"1"( e8 c8_"2"_"4" > + )a8 bes8-. g8-. ] a4-.^"4" | %%3 + \property Voice.beamslopedamping = \normal < d4 'bes4-. > g4-. [ f8-. e8-. ] | + \property Voice.beamslopedamping = \infinity %%4 - < [ f8 'a > e8 d8 cis8-. 'b8-. 'a8-. ] + < [ f8( 'a > e8 )d8 cis8-. 'b8-. 'a8-. ] %%5 < a2 f2 d2 > bes!4-. | %%6 @@ -61,16 +64,21 @@ IImenuetto = \melodic{ %%9 \clef "violin"; < e'2 a2 \f > + \property Voice.beamslopedamping = \normal [ d'8( e'16 )f'16 ] | + \property Voice.beamslopedamping = \infinity %%10 - < [ e'8 g8 > d' cis'_"2" e' a () g8 ] | + < [ e'8( g8 > d' cis'_"2" )e' a () g8 ] | %%11 \multi 2 < {\stemup a4() d'4 cis'4-. } { \stemdown f2 e4 } > | \stemboth %%12 - < [ g'8^"4" d8 > f' e' f' d'^"3"() c' ] | + % oeps: slur gets attached at d8 iso g'8! +% < [ g'8^"4"( d8 > f' e' )f' d'^"3"() c' ] | + % wrong still... + < { [ g'8^"4"( f' e' )f' d'^"3"() c' ] } { [ d8 ] } > | %%13 \clef "alto"; \multi 2 < @@ -85,9 +93,9 @@ IImenuetto = \melodic{ %%16 [ f( e8 )f a8-. g8-. bes8-. ] | %%17 - < a2^"0" fis2_"3" > bes4 | + < a2^"0"^\trill fis2_"3" > bes4 | %%18 - < { [ c'8 () bes8 c' a8 ] } es8 > fis4 | + < { [ c'8 () bes8 c' a8 ] } es8 > fis4^\trill | %%19 < d'4-\downbow g4 'bes4 > < c'4-\upbow g4 c4 > < [ bes8 d8 > a8 ] | %%20 @@ -101,7 +109,9 @@ IImenuetto = \melodic{ %%22 < { [ g8 () f8 g8 e8 ] } cis8 > < f4 d4 > | %%23 - [ 'g8 g8 ] < e4. 'a4. > d8-\upbow | + \property Voice.beamslopedamping = \normal + [ 'g8 g8 ] < e4.^\trill 'a4. > d8-\upbow | + \property Voice.beamslopedamping = \infinity %%24 \textstyle "roman"; % ugh < d2.^"fine" 'a2. 'd2._"3 mins."> diff --git a/lily/beam-grav.cc b/lily/beam-grav.cc index c86597b17e..ffa1cda9e2 100644 --- a/lily/beam-grav.cc +++ b/lily/beam-grav.cc @@ -68,6 +68,19 @@ Beam_engraver::do_process_requests() plet_spanner_p_->spec_p_ = defp; announce_element (Score_elem_info(plet_spanner_p_,0)); } + + Scalar prop = get_property ("beamslopedamping"); + if (prop.isnum_b ()) + { + beam_p_->damping_i_ = prop; + } + + prop = get_property ("beamquantisaton"); + if (prop.isnum_b ()) + { + beam_p_->quantisation_ = (Beam::Quantise)(int)prop; + } + announce_element (Score_elem_info (beam_p_, span_reqs_drul_[LEFT])); } } diff --git a/lily/beam.cc b/lily/beam.cc index 0f9a981720..aba565e760 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -34,6 +34,7 @@ IMPLEMENT_IS_TYPE_B1 (Beam, Spanner); +// ugh, hardcoded const int MINIMUM_STEMLEN[6] = { 0, // just in case 5, @@ -47,6 +48,9 @@ Beam::Beam () { slope_f = 0; left_y = 0.0; + damping_i_ = 1; + quantisation_ = NORMAL; + multiple_i_ = 0; } void @@ -232,7 +236,8 @@ Beam::solve_slope () This neat trick is by Werner Lemberg, damped = tanh (slope_f) corresponds with some tables in [Wanske] */ - slope_f = 0.6 * tanh (slope_f); + if (damping_i_) + slope_f = 0.6 * tanh (slope_f) / damping_i_; quantise_yspan (); @@ -255,6 +260,10 @@ Beam::quantise_yspan () - beam_thickness + staffline_thickness + n * interline */ + + if (!quantisation_) + return; + Real interline_f = paper ()->interline_f (); Real internote_f = interline_f / 2; Real staffline_thickness = paper ()->rule_thickness (); @@ -299,6 +308,9 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) if extend then stems must not get shorter */ + if (!quantisation_) + return; + Real interline_f = paper ()->interline_f (); Real internote_f = interline_f / 2; Real staffline_thickness = paper ()->rule_thickness (); @@ -306,11 +318,11 @@ Beam::quantise_left_y (Beam::Pos pos, bool extend_b) const int QUANTS = 6; Real qy[QUANTS] = { - -staffline_thickness, + 0, beam_thickness / 2, - beam_thickness + staffline_thickness / 2, + beam_thickness, interline_f / 2 + beam_thickness / 2 + staffline_thickness / 2, - interline_f - staffline_thickness, + interline_f, interline_f + beam_thickness / 2, }; /* @@ -385,6 +397,8 @@ Beam::set_stemlens () Real staffline_thickness = paper ()->rule_thickness (); Real beam_thickness = 0.48 * (interline_f - staffline_thickness); Real interbeam_f = paper ()->interbeam_f (); + if (multiple_i_ > 3) + interbeam_f += 2.0 * staffline_thickness / 4; Real xspan_f = stems.top ()->hpos_f () - stems[0]->hpos_f (); /* ugh, y values are in "internote" dimension @@ -394,7 +408,7 @@ Beam::set_stemlens () Pos left_pos = NONE; - if (yspan_f < staffline_thickness / 2) + if ((yspan_f < staffline_thickness / 2) || (quantisation_ == NORMAL)) left_pos = (Pos)(STRADDLE | SIT | HANG); else left_pos = (Pos) (sign (slope_f) > 0 ? STRADDLE | HANG @@ -467,6 +481,7 @@ Beam::set_grouping (Rhythmic_grouping def, Rhythmic_grouping cur) Stem *s = stems[j]; s->beams_left_i_ = b[i]; s->beams_right_i_ = b[i+1]; + multiple_i_ = multiple_i_ >? (b[i] >? b[i+1]); } } @@ -478,9 +493,12 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const { assert (!next || next->hpos_f () > here->hpos_f ()); assert (!prev || prev->hpos_f () < here->hpos_f ()); - // Real dy=paper ()->internote_f ()*2; - Real dy = paper ()->interbeam_f (); - Real stemdx = paper ()->rule_thickness (); + Real staffline_thickness = paper ()->rule_thickness (); + Real interbeam_f = paper ()->interbeam_f (); + if (multiple_i_ > 3) + interbeam_f += 2.0 * staffline_thickness / 4; + Real dy = interbeam_f; + Real stemdx = staffline_thickness; Real sl = slope_f*paper ()->internote_f (); paper ()->lookup_l ()->beam (sl, 20 PT); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 130df73d5d..7106cbf0d5 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -16,6 +16,8 @@ class Beam: public Directional_spanner { public: enum Pos { NONE, SIT = 1, STRADDLE = 2, HANG = 4, INTER = 8 }; + // ugh, silly C++ + enum Quantise { NUN, NORMAL, TRADITIONAL }; Link_array stems; /// the slope of the beam in posns / point (dimension) @@ -23,7 +25,12 @@ public: /// position of leftmost end of beam Real left_y; - + /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams + int damping_i_; + /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional + Quantise quantisation_; + /// maximum number of beams (for opening-up of beam-spacing) + int multiple_i_; /* *************** */ DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/mi2mu/TODO b/mi2mu/TODO index e522176955..2f0b77f11e 100644 --- a/mi2mu/TODO +++ b/mi2mu/TODO @@ -6,6 +6,8 @@ grep for TODO and ugh/ugr IMPORTANT + * if multiple channels per track: output each to separate voice + * get rid of (last few?) midi-specifics in mudela-* * find / remove trend (tempo) of mudela columns diff --git a/tex/feta16.tex b/tex/feta16.tex index 5f416ef4b2..f7a8acd462 100644 --- a/tex/feta16.tex +++ b/tex/feta16.tex @@ -1,5 +1,5 @@ % Creator: mf-to-table.py version 0.4 -% Automatically generated on Wed Dec 24 16:30:21 1997 +% Automatically generated on Mon Dec 29 10:52:00 1997 % Do not edit % input from out/feta16.log % name diff --git a/tex/feta20.tex b/tex/feta20.tex index e97dbdeccc..21be64fb9d 100644 --- a/tex/feta20.tex +++ b/tex/feta20.tex @@ -1,5 +1,5 @@ % Creator: mf-to-table.py version 0.4 -% Automatically generated on Wed Dec 24 16:30:29 1997 +% Automatically generated on Mon Dec 29 10:52:03 1997 % Do not edit % input from out/feta20.log % name