From: Han-Wen Nienhuys Date: Thu, 18 Oct 2001 15:44:36 +0000 (+0200) Subject: release: 1.5.18 X-Git-Tag: release/1.5.18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c77c48ae854512f724aa3733886c346dae30b90d;p=lilypond.git release: 1.5.18 =========== * Some more hacking at midi2ly.py: - options and stuff: moved to library for ly2dvi, midi2ly, mup2ly, update-lily - handle keys and note names - simple quantising - handle tuplets and silly durations - guess clef - don't include empty staffs in score - print relative pitches by default - don't repeat duration by default - bugfix: allow 8th notes too - include new version of input/test/midi-scales.ly - added barchecks + fix - bugfix for relative mode * Shorter MIDI creation texts. * Bugfix: Key_change_req::transpose: don't deliver reversed list. * Bugfix: Key_performer::create_audio_elements: transpose list to `do', before determining tonality. 1.4.8.m --- diff --git a/CHANGES b/CHANGES index e10993120d..032bb58916 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,21 @@ * Bugfix: Key_performer::create_audio_elements: transpose list to `do', before determining tonality. +1.4.8.moh1 +========== + +* new property "end-alignment" to control non-centered lyric alignment + +1.5.17.hwn1 +=========== + +* Be quicker in Grob::handle_broken_dependencies(). + +* --strict option for abc2ly, exit if an error is found. + +* GUILE 1.3.4 fix. + + 1.5.17 ====== diff --git a/VERSION b/VERSION index b8f2d2a038..af64987802 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 -PATCH_LEVEL=17 -MY_PATCH_LEVEL=jcn6 +PATCH_LEVEL=18 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilylib.py.in b/buildscripts/lilylib.py.in index fea6ffda23..10ee45aa9c 100644 --- a/buildscripts/lilylib.py.in +++ b/buildscripts/lilylib.py.in @@ -177,21 +177,6 @@ def cleanup_temp (): shutil.rmtree (temp_dir) -#what a name. -def set_setting (dict, key, val): - try: - val = string.atof (val) - except ValueError: - #warning (_ ("invalid value: %s") % `val`) - pass - - try: - dict[key].append (val) - except KeyError: - warning (_ ("no such setting: %s") % `key`) - dict[key] = [val] - - def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: diff --git a/input/paddy.abc b/input/paddy.abc index 0aadebc63c..1492ea2089 100644 --- a/input/paddy.abc +++ b/input/paddy.abc @@ -1,16 +1,47 @@ -% -% This is NOT a lilypond input file. It is an ABC file, see -% http://www.gre.ac.uk/~c.walshaw/abc/ -% -% LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX -% -X:1 -T:Paddy O'Rafferty -C:Trad. -M:6/8 -K:D -dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB|| -~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA|| -fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:| +\header { + composer = "Trad." + crossRefNumber = "1" + footnotes = "" + tagline = "Lily was here (unknown version) -- automatically converted from ABC" + title = "Paddy O'Rafferty" +} +voicedefault = \notes { +\property Score.defaultBarType="empty" +% This is NOT a lilypond input file. It is an ABC file, see + % http://www.gre.ac.uk/~c.walshaw/abc/ + % + % LilyPond includes import tools for Finale, Musedata, ABC, MIDI and PMX + \time 6/8 \key d \major d''8 fis''8 fis''8 cis''8 e''8 e''8 +\bar "|" d''8 e''8 fis''8 g''8 fis''8 e''8 \bar "|" d''8 +fis''8 fis''8 cis''8 e''8 e''8 \bar "|" d''8 fis''8 e''8 + d''8 b'8 a'8 \bar "|" d''8 fis''8 fis''8 cis''8 e''8 +e''8 \bar "|" d''8 e''8 fis''8 g''8 fis''8 e''8 \bar "|" +fis''8 a''8 fis''8 g''8 fis''8 e''8 \bar "|" d''8 fis''8 + e''8 d''8 b'8 a'8 \bar ":|" d''8 fis''8 e''8 d''8 +cis''8 b'8 \bar "||" a'4. ^"~" b'4. \bar "|" g''8 fis''8 +e''8 fis''8 d''8 b'8 \bar "|" a'8 fis'8 a'8 b'4 cis''8 +\bar "|" d''8 fis''8 e''8 d''8 cis''8 b'8 \bar "|" a'4. +^"~" b'4. ^"~" \bar "|" e''8 fis''8 e''8 e''8 fis''8 g''8 +\bar "|" fis''8 a''8 fis''8 g''8 fis''8 e''8 \bar "|" d''8 + fis''8 e''8 d''8 cis''8 b'8 \bar ":|" d''8 fis''8 e''8 + d''8 b'8 a'8 \bar "||" fis''8 a'8 a'8 e''8 a'8 a'8 +\bar "|" d''8 e''8 fis''8 g''8 fis''8 e''8 \bar "|" fis''8 + a'8 a'8 e''8 a'8 a'8 \bar "|" d''8 fis''8 e''8 d''8 + b'8 a'8 \bar "|" fis''8 a'8 a'8 e''8 a'8 a'8 \bar "|" +d''8 e''8 fis''8 g''8 fis''8 e''8 \bar "|" fis''8 a''8 +fis''8 g''8 fis''8 e''8 \bar "|" d''8 fis''8 e''8 d''8 +b'8 a'8 \bar ":|" +}\score{ + \notes < + \context Staff="default" + { + \voicedefault + } + + > + \paper { + } + \midi {} +} diff --git a/input/regression/lyric-phrasing.ly b/input/regression/lyric-phrasing.ly index 6a4da6320e..f1f45fa8c8 100644 --- a/input/regression/lyric-phrasing.ly +++ b/input/regression/lyric-phrasing.ly @@ -36,7 +36,7 @@ } \context LyricsVoice = "v-2" \lyrics { \property LyricsVoice . stanza = "2:" - x x x __ x + x x x __ x. } > } diff --git a/input/test/GNUmakefile b/input/test/GNUmakefile index 9791939930..bb53247dda 100644 --- a/input/test/GNUmakefile +++ b/input/test/GNUmakefile @@ -1,8 +1,8 @@ # input/test/Makefile depth = ../.. -examples= font20 -LOCALSTEPMAKE_TEMPLATES=ly mutopia +examples= font20 ancient-font +LOCALSTEPMAKE_TEMPLATES=ly mutopia EXTRA_DISTFILES=features.abc diff --git a/lily/grob.cc b/lily/grob.cc index f55ee2f8e2..bd716106db 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -354,7 +354,9 @@ Grob::add_dependency (Grob*e) CRITERION is either a SMOB pointer to the desired line, or a number representing the break direction. Do not modify SRC. - It is rather tightly coded, since it takes a lot of time. + It is rather tightly coded, since it takes a lot of time; it is + one of the top functions in the profile. + */ SCM Grob::handle_broken_grobs (SCM src, SCM criterion) @@ -363,7 +365,7 @@ Grob::handle_broken_grobs (SCM src, SCM criterion) Grob *sc = unsmob_grob (src); if (sc) { - if (gh_number_p (criterion)) + if (SCM_INUMP (criterion)) { Item * i = dynamic_cast (sc); Direction d = to_dir (criterion); @@ -388,22 +390,23 @@ Grob::handle_broken_grobs (SCM src, SCM criterion) return SCM_UNDEFINED; /* now: sc && sc->line_l () == line */ - if (!line + if (!line) + return sc->self_scm(); /* This was introduced in 1.3.49 as a measure to prevent programming errors. It looks expensive (?). TODO: benchmark , document when (what kind of programming errors) this happens. */ - || (sc->common_refpoint (line, X_AXIS) - && sc->common_refpoint (line, Y_AXIS))) + if (sc->common_refpoint (line, X_AXIS) + && sc->common_refpoint (line, Y_AXIS)) { return sc->self_scm (); } return SCM_UNDEFINED; } } - else if (gh_pair_p (src)) + else if (SCM_CONSP (src)) { SCM oldcar =ly_car (src); /* @@ -427,7 +430,7 @@ Grob::handle_broken_grobs (SCM src, SCM criterion) } SCM newcdr = handle_broken_grobs (oldcdr, criterion); - return gh_cons (newcar, newcdr); + return scm_cons (newcar, newcdr); } else return src; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 7cc9232bf2..54c9decd29 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -23,6 +23,15 @@ /* Guile 1.3.4 compatibility */ #if GUILE_MINOR_VERSION < 4 + +#ifndef SCM_CELL_TYPE +#define SCM_CELL_TYPE(X) SCM_CAR (X) +#endif + +#ifndef SCM_CELL_WORD_1 +#define SCM_CELL_WORD_1(X) SCM_CDR (X) +#endif + #define scm_bits_t SCM #define fix_guile_1_3_4_scm_puts(scm_data, port) scm_puts ((char*)scm_data, port) diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index 3106026868..1dfbad8d98 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -131,7 +131,7 @@ Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead_l) /** determine the distance to translate lyrics to get correct alignment Rules: If alignment is centre, translate = 0 Otherwise, - If (length of longest lyric) < 2 * (length of shortest lyric), + If (length of longest lyric) < property("end-alignment") * (length of shortest lyric), - centre longest lyric on notehead Otherwise - move so shortest lyric just reaches notehead centre @@ -142,7 +142,7 @@ Syllable_group::amount_to_translate () Real translate = 0.0; if (alignment_i_ != CENTER) { // FIXME: do we really know the lyric extent here? Some font sizing comes later? - Real l1 = longest_lyric_l_->extent (longest_lyric_l_, X_AXIS).length () / 2; + Real l1 = longest_lyric_l_->extent (longest_lyric_l_, X_AXIS).length () / gh_scm2double (longest_lyric_l_->get_grob_property("end-alignment")); Real l2 = shortest_lyric_l_->extent (shortest_lyric_l_, X_AXIS).length (); translate = l1 real. Default v (grob-property-description 'visibility-lambda procedure? "a function that takes the break direction and returns a cons of booleans containing (TRANSPARENT . EMPTY).") (grob-property-description 'when moment? "when does this column happen?.") (grob-property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics).") +(grob-property-description 'end-alignment number? "proportion of lyric length to align with note-head for non-centered lyrics.") (grob-property-description 'x-gap number? "horizontal gap between notehead and tie.") (grob-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems.") (grob-property-description 'y-offset number? "extra vertical offset for ties away from the center line.") diff --git a/scm/interface-description.scm b/scm/interface-description.scm index 60b76f8d79..e0de47c3f8 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -532,7 +532,8 @@ that helps show the length of a melissima (tied/slurred note)." 'lyric-syllable-interface "a single piece of lyrics" '( - word-space + word-space + end-alignment )) diff --git a/scripts/GNUmakefile b/scripts/GNUmakefile index a61a9b1d58..1df3d26a3b 100644 --- a/scripts/GNUmakefile +++ b/scripts/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SEXECUTABLES=convert-ly lilypond-book ly2dvi abc2ly as2text etf2ly musedata2ly pmx2ly mup2ly +SEXECUTABLES=convert-ly lilypond-book ly2dvi abc2ly as2text etf2ly musedata2ly pmx2ly mup2ly midi2ly STEPMAKE_TEMPLATES=script help2man po HELP2MAN_EXECS = $(SEXECUTABLES) diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index b4295e933f..6428e0f105 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -67,6 +67,7 @@ import os UNDEF = 255 state = UNDEF +strict = 0 voice_idx_dict = {} header = {} header['footnotes'] = '' @@ -88,6 +89,13 @@ DIGITS='0123456789' alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" HSPACE=' \t' midi_specs = '' + + +def error (msg): + sys.stderr.write (msg) + if strict: + sys.exit (1) + def check_clef(s): if not s: @@ -457,6 +465,7 @@ def compute_key (k): key_count = flat_key_seq.index (keytup) accseq = map (lambda x: (3*x + 3 ) % 7, range (1, key_count + 1)) else: + error ("Huh?") raise "Huh" key_table = [0] * 7 @@ -1226,8 +1235,7 @@ def parse_file (fn): ln = junk_space (ln) if ln: - msg = "%s: %d: Huh? Don't understand\n" % (fn, lineno) - sys.stderr.write (msg) + error ("%s: %d: Huh? Don't understand\n" % (fn, lineno)) left = orig_ln[0:-len (ln)] sys.stderr.write (left + '\n') sys.stderr.write (' ' * len (left) + ln + '\n') @@ -1246,7 +1254,8 @@ Options: -h, --help this help -o, --output=FILE set output filename to FILE -v, --version version information - + -s, --strict be strict about succes. + This program converts ABC music files (see http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt) To LilyPond input. """ @@ -1256,7 +1265,7 @@ def print_version (): -(options, files) = getopt.getopt (sys.argv[1:], 'vo:h', ['help','version', 'output=']) +(options, files) = getopt.getopt (sys.argv[1:], 'vo:hs', ['help','version', 'output=', 'strict']) out_filename = '' for opt in options: @@ -1265,11 +1274,12 @@ for opt in options: if o== '--help' or o == '-h': help () sys.exit (0) - if o == '--version' or o == '-v': + elif o == '--version' or o == '-v': print_version () sys.exit(0) - - if o == '--output' or o == '-o': + elif o == '--strict' or o == '-s': + strict = 1 + elif o == '--output' or o == '-o': out_filename = a else: print o diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index f7f734b8f2..fd5386915b 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -188,7 +188,9 @@ class LatexPaper: elif name[-5:] == 'paper': self.m_papersize = name else: - self._set_dimen('m_geo_'+name, value) + pass + # what is _set_dimen ?? /MB + #self._set_dimen('m_geo_'+name, value) def __setattr__(self, name, value): if type(value) == type("") and \ dimension_conversion_dict.has_key (value[-2:]): diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 77ebe9808c..eaceb590af 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -67,9 +67,19 @@ import operator import tempfile import traceback -datadir = '@datadir@' -sys.path.append ('@datadir@/python') -sys.path.append ('@datadir@/buildscripts/out') +datadir = '' + +if '@datadir@' == ('@' + 'datadir' + '@'): + datadir = os.environ['LILYPONDPREFIX'] +else: + datadir = '@datadir@' + +while datadir[-1] == os.sep: + datadir = datadir[:-1] + + +sys.path.append (os.path.join (datadir, 'python')) +sys.path.append (os.path.join (datadir, 'buildscripts/out')) try: import gettext @@ -112,6 +122,7 @@ option_definitions = [ from lilylib import * +# verbose_p = 1 # arg! layout_fields = ['dedication', 'title', 'subtitle', 'subsubtitle', 'footer', 'head', 'composer', 'arranger', 'instrument', @@ -170,6 +181,7 @@ environment = { 'GS_LIB' : datadir + '/ps', } + def setup_environment (): for key in environment.keys (): val = environment[key] @@ -177,6 +189,25 @@ def setup_environment (): val = os.environ[key] + os.pathsep + val os.environ[key] = val +#what a name. +def set_setting (dict, key, val): + try: + val = string.atof (val) + except ValueError: + #warning (_ ("invalid value: %s") % `val`) + pass + + try: + dict[key].append (val) + except KeyError: + warning (_ ("no such setting: %s") % `key`) + dict[key] = [val] + + +def print_environment (): + for (k,v) in os.environ.items (): + sys.stderr.write ("%s=\"%s\"\n" % (k,v)) + def run_lilypond (files, outbase, dep_prefix): opts = '' # opts = opts + '--output=%s.tex' % outbase @@ -196,11 +227,14 @@ def run_lilypond (files, outbase, dep_prefix): fs = string.join (files) if not verbose_p: - progress ( _("Running %s...") % 'LilyPond') # cmd = cmd + ' 1> /dev/null 2> /dev/null' + progress ( _("Running %s...") % 'LilyPond') else: opts = opts + ' --verbose' - + + # for better debugging! + print_environment () + print opts, fs system ('lilypond %s %s ' % (opts, fs)) def analyse_lilypond_output (filename, extra):