From: Han-Wen Nienhuys Date: Wed, 27 Oct 1999 23:26:49 +0000 (+0200) Subject: release: 1.3.1 X-Git-Tag: release/1.3.1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=685452c8675e89a84692420fb9891756d318e771;p=lilypond.git release: 1.3.1 --- diff --git a/CHANGES b/CHANGES index b7c75936c8..b7f048a100 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,19 @@ +pl 3.hwn2,1 + - Generic properties and Property_engraver. Moved most of the +properties. + +0.lu1 + - resurrected midi2ly + 0.jcn1 - bf: lyrics lexer - reverted mup2ly revert +pl 3.uu1: + - frontport of 1.2.17 patches. + +********** + 1.3.0: pl 15.hwn2 diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index b3fda3a821..dd49ab04a3 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -9,7 +9,7 @@ EXTRA_DIST_FILES = include $(depth)/make/stepmake.make -default: do-doc +default: local-doc local-WWW: copy-for-me diff --git a/Documentation/misc/GNUmakefile b/Documentation/misc/GNUmakefile index d9b79c0e6e..003590955b 100644 --- a/Documentation/misc/GNUmakefile +++ b/Documentation/misc/GNUmakefile @@ -9,7 +9,7 @@ EXTRA_DIST_FILES = $(TEXTS) include $(depth)/make/stepmake.make -default: do-doc +default: local-doc local-WWW: $(addprefix $(outdir)/, $(addsuffix .txt, $(TEXTS))) diff --git a/Documentation/ntweb/GNUmakefile b/Documentation/ntweb/GNUmakefile index 2fbe79809f..c6d91915f5 100644 --- a/Documentation/ntweb/GNUmakefile +++ b/Documentation/ntweb/GNUmakefile @@ -9,7 +9,7 @@ EXTRA_DIST_FILES = $(PLAIN_FILES) include $(depth)/make/stepmake.make -default: do-doc dist-plain +default: local-doc dist-plain $(outdir)/%.texi: %.texi m4 -DTOPLEVEL_VERSION=$(TOPLEVEL_VERSION) < $< > $@ diff --git a/Documentation/programmer/1086342053.tex b/Documentation/programmer/1086342053.tex deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Documentation/programmer/hacking.texi b/Documentation/programmer/hacking.texi index 233c800216..da36f2f0ef 100644 --- a/Documentation/programmer/hacking.texi +++ b/Documentation/programmer/hacking.texi @@ -59,13 +59,18 @@ are only three translations so far. @unnumberedsubsec Hackers - There are lots of possibilities of improving the program itself. There are both small projects and big ones. Most of them are listed in the TODO file. A interesting and very big project is writing a GUI frontend to LilyPond. +@unnumberedsubsec Website designers + +The current website for LilyPond is neat and simple, but it is not very +pretty. We would like to have a website with pretty pictures, one that +looks appealing to new users. + @chapter LilyPond internals diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 440404cb13..1e40606d89 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -126,7 +126,8 @@ documentation on-line documentation. It is made by entering @example make website @end example -This does require a fully functioning +This does require a functioning LilyPond. The binary doesn't have to +be installed. If you want to auto-generate Lily's website, you'll need some additional conversion tools. diff --git a/Documentation/topdocs/README.texi b/Documentation/topdocs/README.texi index 8f76f1f673..f31af066a1 100644 --- a/Documentation/topdocs/README.texi +++ b/Documentation/topdocs/README.texi @@ -60,7 +60,7 @@ using @example @section Comments LilyPond is a long way from finished and polished. We do appreciate -criticism, comments, bugreports, patches, etc. +criticism, comments, bugreports, patches, etc., but please, @example Please send your e-mail to one of the MAILING LISTS diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index 6078fa1349..e0044f3284 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -6,7 +6,7 @@ @top -@unnumbered LilyPond -- The @uref{http://www.fsf.org/gnu/gnu-history.html,GNU Project} Music Typesetter +@unnumbered LilyPond -- The GNU Project Music Typesetter @html @@ -22,17 +22,16 @@ using a high level description file as input. LilyPond is part of the GNU Project. -@c @center + +@unnumberedsec Sheet music + + + @quotation @mudela[fragment] \relative c'' { \key es; r8 [c16 b] [c8 g] [as c16 b] [c8 d] | g,4 } @end mudela @end quotation -@c @end center - - -@unnumberedsec Sheet music - @itemize @bullet diff --git a/INSTALL.txt b/INSTALL.txt index 2a431f3a5c..5021801990 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -119,7 +119,8 @@ Website documentation on-line documentation. It is made by entering make website - This does require a fully functioning + This does require a functioning LilyPond. The binary doesn't have +to be installed. If you want to auto-generate Lily's website, you'll need some additional conversion tools. diff --git a/README.txt b/README.txt index c22267cdb8..957e88819c 100644 --- a/README.txt +++ b/README.txt @@ -55,7 +55,7 @@ Comments ======== LilyPond is a long way from finished and polished. We do appreciate -criticism, comments, bugreports, patches, etc. +criticism, comments, bugreports, patches, etc., but please, Please send your e-mail to one of the MAILING LISTS diff --git a/TODO b/TODO index 68c356c704..771ea60f80 100644 --- a/TODO +++ b/TODO @@ -11,6 +11,13 @@ Grep -i for TODO, FIXME and ugh/ugr/urg. .* TODO . * make this file understandable for 3rd parties. . * use Rhythmic_head::position_i () for all Staff_referenced +. * eradicate all VIRTUAL_COPY_CONS () macros ; use indexed creation, + eg. + + ctor_dict["Score_element"]->clone_func (orig); + ctor_dict["Score_element"]->create_func (); + + . * note head on stem err msg in dutch. . * why need to run -C mf twice? . * fix interstaff stuff @@ -21,8 +28,7 @@ everything works and matches up; when either is set just a bit above the default 5.0 (5.4 is what I was hoping to use), stems miss note heads. So it's some sort of a numerical (truncation/roundoff) problem. John -. * metre -> meter -. * Fixed size staff heights; +. * Fixed size staff/system heights; . * ly2dvi : don't repeat opus if same. . * breaks before mmrests are favored. . * hara kiri _8 clef. @@ -55,7 +61,6 @@ from which comes tons of confusion). It is usually notated as (again, using C as the root) Cdim7 or Co7. . * Mondrup: - - I would like the possibility of forcing clef- and key- changes to be printed _after_ the new bar line diff --git a/VERSION b/VERSION index 0e766f405c..26233811a9 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=0 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=1 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/genheader.py b/buildscripts/genheader.py index 2f57d1a958..bfe64c9be6 100755 --- a/buildscripts/genheader.py +++ b/buildscripts/genheader.py @@ -15,134 +15,159 @@ import getopt import time class My_options: - def __init__(self): - self.commentify = None - self.add_hdr_def = 0 - self.classname = '' + def __init__(self): + self.commentify = None + self.add_hdr_def = 0 + self.classname = '' my_options = My_options() def name(): - return os.environ['USERNAME'] + return os.environ['USERNAME'] # field 4 of passwd is also used for finger info (phone no., office etc) # return pwd.getpwuid(os.getuid())[4] def c_commentify(str): - return '/* ' + re.sub('^',' ', str) + '\n */'; + return '/* ' + re.sub('^',' ', str) + '\n */'; def sh_commentify(str): - return re.sub('^', '# ', str) + return re.sub('^', '# ', str) def tex_commentify(str): - return re.sub('^', '% ', str) + return re.sub('^', '% ', str) def project_str(): - cwd = os.getcwd() - if re.search('flower', cwd): - PROJECT = "the Flower Library" - elif re.search('mf$', cwd): - PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font" - else: - PROJECT = "the GNU LilyPond music typesetter" - return PROJECT + cwd = os.getcwd() + if re.search('flower', cwd): + PROJECT = "the Flower Library" + elif re.search('mf$', cwd): + PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font" + else: + PROJECT = "the GNU LilyPond music typesetter" + return PROJECT def head_str(filename): - if my_options.add_hdr_def: - what = "declare " - else: - what=" implement " - - - mailaddres = '' - try: - mailaddres = '<%s>' % os.environ['MAILADDRESS'] - except KeyError: - pass - headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \ - %(filename, what, project_str(), - time.localtime (time.time ())[0], name(), mailaddres) - return headstr + if my_options.add_hdr_def: + what = "declare " + else: + what=" implement " + + + mailaddres = '' + try: + mailaddres = '<%s>' % os.environ['MAILADDRESS'] + except KeyError: + pass + headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) %d %s %s\n' \ + %(filename, what, project_str(), + time.localtime (time.time ())[0], name(), mailaddres) + return headstr def c_include(filename): - startdef= filename; - trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__') - startdef = string.translate(filename, trans) + startdef= filename; + trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__') + startdef = string.translate(filename, trans) + + + headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef) + terminatestr = "#endif /* %s */\n" % (startdef); + + return headstr+ '\n\n'+ terminatestr; + + +def icc_include (filename): + startdef= filename; + trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__') + startdef = string.translate(filename, trans) - headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef) - terminatestr = "#endif /* %s */\n" % (startdef); + headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef) + headstr = headstr + r""" +#ifndef INLINE +#define INLINE inline +#define LOCAL_INLINE_DEF +#endif +""" + terminatestr = "#endif /* %s */\n" % (startdef); + + terminatestr = r""" +#ifdef LOCAL_INLINE_DEF +#undef LOCAL_INLINE_DEF +#undef INLINE +#endif +""" + terminatestr + return headstr+ '\n\n'+ terminatestr; - return headstr+ '\n\n'+ terminatestr; def help (): - sys.stdout.write ("Usage: genheader [options] FILENAME\n" - + "Generate file with header FILENAME\n\n" - + "Options:\n" - + " -h, --header generate header\n" - + " --help print this help\n" - + " -p, --package=DIR specify package\n" - ) - - sys.exit (0) + sys.stdout.write ("Usage: genheader [options] FILENAME\n" + + "Generate file with header FILENAME\n\n" + + "Options:\n" + + " -h, --header generate header\n" + + " --help print this help\n" + + " -p, --package=DIR specify package\n" + ) + + sys.exit (0) (options, files) = getopt.getopt(sys.argv[1:], 'tcshp:', ['class', 'package=', 'help']) for opt in options: - o = opt[0] - a = opt[1] - if o == '-c': - my_options.commentify = c_commentify - elif o == '-t': - my_options.commentify = tex_commentify - elif o == '-s': - my_options.commentify = sh_commentify - elif o == '-h' or o == '--header': - my_options.add_hdr_def = 1 - elif o == '--class': - my_options.classname = a - elif o == '--help': - help () + o = opt[0] + a = opt[1] + if o == '-c': + my_options.commentify = c_commentify + elif o == '-t': + my_options.commentify = tex_commentify + elif o == '-s': + my_options.commentify = sh_commentify + elif o == '-h' or o == '--header': + my_options.add_hdr_def = 1 + elif o == '--class': + my_options.classname = a + elif o == '--help': + help () # FIXME: should create xxx.cc and include/xxx.hh, with implement/declare Xxx # in one run if my_options.classname: - pass - + pass + def do_file(nm): - s = my_options.commentify(head_str(nm)) - if my_options.add_hdr_def: - s = s + c_include(nm) - return s + s = my_options.commentify(head_str(nm)) + if my_options.add_hdr_def: + s = s + c_include(nm) + return s def extension(ext,nm): - ext = '\\.' + ext - return re.search(ext, nm) <> None + ext = '\\.' + ext + return re.search(ext, nm) <> None def c_extension(nm): - return extension('hh',nm) or extension('cc',nm) \ - or extension('icc', nm) or extension('tcc',nm) + return extension('hh',nm) or extension('cc',nm) \ + or extension('icc', nm) or extension('tcc',nm) def select_commentification(nm): - if c_extension (nm): - return c_commentify - elif extension('py',nm) or extension('pl',nm) or extension('sh',nm): - return sh_commentify - elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm): - return tex_commentify - else: - sys.stderr.write ('unknown extension for file %s\n' % nm) - raise 'help' + if c_extension (nm): + return c_commentify + elif extension('py',nm) or extension('pl',nm) or extension('sh',nm): + return sh_commentify + elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm): + return tex_commentify + else: + sys.stderr.write ('unknown extension for file %s\n' % nm) + raise 'help' for nm in files: - if extension('hh', nm) or extension('icc', nm) or extension('tcc', nm): - my_options.add_hdr_def = 1 - if my_options.commentify == None: - my_options.commentify = select_commentification(nm) - print do_file(nm) + if extension('hh', nm) or extension('icc', nm) or extension('tcc', nm): + my_options.add_hdr_def = 1 + if my_options.commentify == None: + my_options.commentify = select_commentification(nm) + print do_file(nm) diff --git a/buildscripts/set-lily.sh b/buildscripts/set-lily.sh index f809aba7d3..a4c77ff0cd 100755 --- a/buildscripts/set-lily.sh +++ b/buildscripts/set-lily.sh @@ -34,7 +34,11 @@ testvar () fi } -. ./stepmake/bin/package-zet.sh + +# . ./stepmake/bin/package-zet.sh +sourcetree=`basename \`pwd\`` +(cd .. ; rm lilypond-devel ; showln -s $sourcetree lilypond-devel) + echo You should add the following to your profile script echo @@ -52,8 +56,8 @@ showln -sf $LILYPOND_SOURCEDIR/midi2ly/out/midi2ly $prefix/bin/midi2ly showln -sf $LILYPOND_SOURCEDIR/scripts/out/ly2dvi $prefix/bin/ly2dvi showln -sf $LILYPOND_SOURCEDIR/scripts/out/mudela-book $prefix/bin/mudela-book showln -sf $LILYPOND_SOURCEDIR/buildscripts/out/genheader $prefix/bin/genheader -chmod 755 $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh -showln -sf $LILYPOND_SOURCEDIR/buildscripts/ps-to-gifs.sh $prefix/bin/ps-to-gifs + + testmkdir $prefix/share rm -rf $prefix/share/lilypond diff --git a/flower/include/rational.hh b/flower/include/rational.hh index b1187ec692..e0ca9834d1 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -91,4 +91,6 @@ class ostream; ostream & operator << (ostream &, Rational); +const Rational infinity_rat = INT_MAX; + #endif // RATIONAL_HH diff --git a/flower/include/scalar.hh b/flower/include/scalar.hh index 1960e53d56..88905d62c9 100644 --- a/flower/include/scalar.hh +++ b/flower/include/scalar.hh @@ -12,6 +12,7 @@ #include "string.hh" #include "real.hh" +#include "protected-scm.hh" #error /// Perl -like scalar type. diff --git a/input/test/staff-line-leading.ly b/input/test/staff-line-leading.ly new file mode 100644 index 0000000000..03a5daf1d5 --- /dev/null +++ b/input/test/staff-line-leading.ly @@ -0,0 +1,8 @@ +\score { + \notes \relative c'' \context GrandStaff < + \context Staff = up { c4 c4 } + \context Staff = down { \property Staff. staffLineLeading = #5.5 c4 + + } +> +} diff --git a/input/test/stem-length.fly b/input/test/stem-length.fly new file mode 100644 index 0000000000..00718bc104 --- /dev/null +++ b/input/test/stem-length.fly @@ -0,0 +1,2 @@ + +g''4 \property Voice.stemLength = #14 g4 \property Voice.stemLength = #3 g4 g,,4 diff --git a/input/test/stem-length.ly b/input/test/stem-length.ly new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/input/test/stem-length.ly @@ -0,0 +1 @@ + diff --git a/lily/align-note-column-engraver.cc b/lily/align-note-column-engraver.cc index c28320f301..74967e7b66 100644 --- a/lily/align-note-column-engraver.cc +++ b/lily/align-note-column-engraver.cc @@ -86,7 +86,7 @@ Align_note_column_engraver::process_acknowledged () */ SCM grsp = get_property ("graceAccidentalSpace", 0); - if (SCM_NUMBERP(grsp)) + if (gh_number_p(grsp)) { /* ugh. diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 7caf691c79..c2d30f6d50 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -66,6 +66,13 @@ Auto_beam_engraver::consider_end_and_begin (Moment test_mom) if (test_mom.den () != 1) type_str = type_str + "_" + to_str (test_mom.den ()); + /* + URG + + FIXME: SHOULD USE ALIST + + */ + /* Determine end moment for auto beaming (and begin, mostly 0==anywhere) In order of increasing priority: @@ -203,24 +210,7 @@ Auto_beam_engraver::create_beam_p () beam_p->add_stem ((*stem_l_arr_p_)[i]); } - /* urg, copied from Beam_engraver */ - SCM prop = get_property ("beamslopedamping", 0); - if (SCM_NUMBERP(prop)) - beam_p->set_elt_property (damping_scm_sym, prop); - - prop = get_property ("autoKneeGap", 0); - if (SCM_NUMBERP(prop)) - beam_p->set_elt_property (auto_knee_gap_scm_sym, prop); - - prop = get_property ("autoInterstaffKneeGap", 0); - if (SCM_NUMBERP(prop)) - beam_p->set_elt_property (auto_interstaff_knee_gap_scm_sym, prop); - - prop = get_property ("beamquantisation", 0); - if (SCM_NUMBERP(prop)) - beam_p->quantisation_ = (Beam::Quantisation)(int)prop; - - announce_element (Score_element_info (beam_p, 0)); + return beam_p; } diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index 5811e6dc86..92378ccbd8 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -49,11 +49,6 @@ Bar_engraver::create_bar () { bar_p_->set_elt_property (at_line_start_scm_sym, SCM_BOOL_T); } - prop = get_property ("barSize", 0); - if (SCM_NUMBERP(prop)) - { - bar_p_->set_elt_property (bar_size_scm_sym, prop); - } announce_element (Score_element_info (bar_p_, 0)); } } diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 9db68461fb..2db31f2b91 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -33,7 +33,6 @@ Bar_number_engraver::do_process_requests () create_items (0); text_p_->text_str_ = to_str (time->bars_i_); - text_p_->style_str_ = "roman"; } } diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index 12e94befc1..cf73f36500 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -45,7 +45,7 @@ Bar_script_engraver::do_creation_processing () */ void -Bar_script_engraver::do_acknowledge_element (Item *i) +Bar_script_engraver::attach_script_to_item (Item *i) { Axis other_axis = Axis((axis_ + 1)%2); if (staff_side_p_ && !staff_side_p_->parent_l(other_axis)) @@ -106,7 +106,7 @@ Bar_script_engraver::acknowledge_element (Score_element_info inf) if (inf.origin_trans_l_arr_.size () != 1) return; - do_acknowledge_element (i); + attach_script_to_item (i); } } @@ -154,7 +154,7 @@ Bar_script_engraver::create_items (Request *rq) staff_side_p_->set_victim(text_p_); SCM padding = get_property (type_ + "ScriptPadding", 0); - if (SCM_NUMBERP(padding)) + if (gh_number_p(padding)) { staff_side_p_->set_elt_property (padding_scm_sym, padding); } diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 6022a0a578..99a7c00d28 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -99,21 +99,6 @@ Beam_engraver::do_process_requests () /* urg, must copy to Auto_beam_engraver too */ - SCM prop = get_property ("beamslopedamping", 0); - if (SCM_NUMBERP(prop)) - beam_p_->set_elt_property (damping_scm_sym, prop); - - prop = get_property ("autoKneeGap", 0); - if (SCM_NUMBERP(prop)) - beam_p_->set_elt_property (auto_knee_gap_scm_sym, prop); - - prop = get_property ("autoInterstaffKneeGap", 0); - if (SCM_NUMBERP(prop)) - beam_p_->set_elt_property (auto_interstaff_knee_gap_scm_sym, prop); - - prop = get_property ("beamquantisation", 0); - if (SCM_NUMBERP(prop)) - beam_p_->quantisation_ = (Beam::Quantisation)gh_scm2int(prop); announce_element (Score_element_info (beam_p_, reqs_drul_[START])); } diff --git a/lily/beam.cc b/lily/beam.cc index 83d83260ae..69de929231 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -41,7 +41,6 @@ Beam::Beam () { slope_f_ = 0; left_y_ = 0; - quantisation_ = NORMAL; multiple_i_ = 0; } @@ -283,34 +282,32 @@ Beam::get_default_dir () const Direction beam_dir; Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction"); - Dir_algorithm a = (Dir_algorithm)rint(paper_l ()->get_var ("beam_dir_algorithm")); - switch (a) + SCM a = get_elt_property (gh_symbol2scm ("beam_dir_algorithm")); + a= gh_cdr (a); + + if (a == gh_symbol2scm ("majority")) // should get default from paper. + beam_dir = (count[UP] == count[DOWN]) ? neutral_dir + : (count[UP] > count[DOWN]) ? UP : DOWN; + else if (a == gh_symbol2scm ("mean")) + // mean center distance + beam_dir = (total[UP] == total[DOWN]) ? neutral_dir + : (total[UP] > total[DOWN]) ? UP : DOWN; + else if (a == gh_symbol2scm ("median")) { - case MAJORITY: - beam_dir = (count[UP] == count[DOWN]) ? neutral_dir - : (count[UP] > count[DOWN]) ? UP : DOWN; - break; - case MEAN: - // mean center distance - beam_dir = (total[UP] == total[DOWN]) ? neutral_dir - : (total[UP] > total[DOWN]) ? UP : DOWN; - break; - default: - case MEDIAN: // median center distance - if (!count[DOWN] || !count[UP]) - { - beam_dir = (count[UP] == count[DOWN]) ? neutral_dir - : (count[UP] > count[DOWN]) ? UP : DOWN; - } - else - { + if (count[DOWN] && count[UP]) + { beam_dir = (total[UP] / count[UP] == total[DOWN] / count[DOWN]) ? neutral_dir - : (total[UP] / count[UP] > total[DOWN] / count[DOWN]) ? UP : DOWN; + : (total[UP] / count[UP] > total[DOWN] / count[DOWN]) ? UP : DOWN; + } + else + { + beam_dir = (count[UP] == count[DOWN]) ? neutral_dir + : (count[UP] > count[DOWN]) ? UP : DOWN; } - break; } + return beam_dir; } @@ -517,7 +514,10 @@ Beam::quantise_dy () + n * interline */ - if (quantisation_ <= NONE) + SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation")); + q = gh_cdr (q); + + if (q == gh_symbol2scm ("none")) return; Real interline_f = stems_[0]->staff_line_leading_f (); @@ -532,7 +532,6 @@ Beam::quantise_dy () Real quanty_f = 0.0; - /* UGR. ICE in 2.8.1; bugreport filed. */ Array allowed_fraction (3); allowed_fraction[0] = 0; allowed_fraction[1] = (beam_f / 2 + staffline_f / 2); @@ -560,9 +559,8 @@ Beam::quantise_left_y (bool extend_b) we only need to quantise the start of the beam as dy is quantised too if extend_b then stems must *not* get shorter */ - - if (quantisation_ == NONE) - return; + SCM q = get_elt_property (gh_symbol2scm ("slope_quantisation")); + q = gh_cdr (q); /* ---------------------------------------------------------- @@ -607,7 +605,7 @@ Beam::quantise_left_y (bool extend_b) Real beamdy_f = beamdx_f * slope_f_ * internote_f; Array allowed_position; - if (quantisation_ <= NORMAL) + if (q == gh_symbol2scm ("normal")) { if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) allowed_position.push (straddle); @@ -615,9 +613,9 @@ Beam::quantise_left_y (bool extend_b) allowed_position.push (sit); allowed_position.push (hang); } - else - // TODO: check and fix TRADITIONAL + else if (q == gh_symbol2scm ("traditional")) { + // TODO: check and fix TRADITIONAL if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2)) allowed_position.push (straddle); if ((multiple_i_ <= 1) && (beamdy_f <= staffline_f / 2)) diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 0fff51106f..923eeeab1e 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -23,7 +23,6 @@ Breathing_sign::Breathing_sign () { dir_ = UP; set_elt_property (breakable_scm_sym, SCM_BOOL_T); - set_elt_property (break_priority_scm_sym, gh_int2scm (-4)); set_elt_property (visibility_lambda_scm_sym, ly_ch_C_eval_scm ("non_postbreak_visibility")); } diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index d0005c8983..08d397b6f3 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -83,10 +83,6 @@ Chord_name_engraver::do_process_requests () item_p->text_str_ = chord.banter_str (inversion); - SCM style = get_property ("textStyle", 0); - if (gh_string_p (style)) - item_p->style_str_ = ly_scm2string (style); - text_p_arr_.push (item_p); announce_element (Score_element_info (item_p, 0)); } diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 68d96cef59..335ff0a62f 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -190,11 +190,6 @@ Clef_engraver::create_clef() if (!clef_p_) { Clef_item *c= new Clef_item; - c->set_elt_property (break_priority_scm_sym, gh_int2scm (-2)); // ugh - SCM clefstyle = get_property ("clefStyle", 0); - if (gh_string_p(clefstyle)) - c->set_elt_property (style_scm_sym, clefstyle); - announce_element (Score_element_info (c, clef_req_l_)); clef_p_ = c; } diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 2919255e71..f203d39bae 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -60,7 +60,7 @@ Clef_item::do_add_processing () pscore_l_->typeset_element (g); g->text_str_ = "8"; - g->style_str_ = "italic"; + g->set_elt_property (style_scm_sym, gh_str02scm ("italic")); g->set_parent (this, Y_AXIS); g->set_parent (this, X_AXIS); diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 2933131c8d..93dc2e7d5a 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -131,7 +131,7 @@ Dynamic_engraver::do_process_requests() } prop = get_property ("dynamicDirection", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { staff_side_p_->dir_ = to_dir (prop); } @@ -141,7 +141,7 @@ Dynamic_engraver::do_process_requests() } prop = get_property ("dynamicPadding", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { staff_side_p_->set_elt_property (padding_scm_sym, prop); } @@ -180,7 +180,7 @@ Dynamic_engraver::do_process_requests() to_end_ss_span_p_->dir_ = to_dir (prop); } prop = get_property ("dynamicPadding", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { to_end_ss_span_p_->set_elt_property (padding_scm_sym,prop); } diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index b8d91ae55c..4f706b34bf 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -13,7 +13,7 @@ Font_size_engraver::Font_size_engraver () { - size_i_ = 0; + size_ = SCM_EOL; } void @@ -21,20 +21,25 @@ Font_size_engraver::do_process_requests () { SCM s (get_property ("fontSize", 0)); - if (SCM_NUMBERP(s)) + if (gh_number_p(s)) { - size_i_ = gh_scm2int (s); + size_ = gh_scm2int (s); + } + else + { + size_ = SCM_EOL; } } void Font_size_engraver::acknowledge_element (Score_element_info e) { - if (size_i_ && e.elem_l_->get_elt_property (fontsize_scm_sym) == SCM_BOOL_F) + if (size_ != SCM_EOL + && e.elem_l_->get_elt_property (fontsize_scm_sym) == SCM_BOOL_F) { - e.elem_l_->set_elt_property (fontsize_scm_sym, - gh_int2scm (size_i_)); + e.elem_l_->set_elt_property (fontsize_scm_sym, size_); } } + ADD_THIS_TRANSLATOR (Font_size_engraver); diff --git a/lily/include/bar-script-engraver.hh b/lily/include/bar-script-engraver.hh index dec3c05ef6..a3642a29a6 100644 --- a/lily/include/bar-script-engraver.hh +++ b/lily/include/bar-script-engraver.hh @@ -31,7 +31,7 @@ protected: /** Put the script on #it# */ - void do_acknowledge_element (Item *it); + void attach_script_to_item (Item *it); /** Return non-nil if we want to hang something on this. */ diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 9e1cbb8346..de68f6f99c 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -23,6 +23,7 @@ damping: amount of beam slope damping. (int) should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams +slope_quantisation: 'none, 'normal or 'traditional */ class Beam : public Directional_spanner { @@ -44,11 +45,7 @@ public: /// position of leftmost end of beam Real left_y_; - /** should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional - JUNKME. - */ - Quantisation quantisation_; - + /// maximum number of beams (for opening-up of beam-spacing) int multiple_i_; diff --git a/lily/include/font-size-engraver.hh b/lily/include/font-size-engraver.hh index 0edef5be86..d36ee64683 100644 --- a/lily/include/font-size-engraver.hh +++ b/lily/include/font-size-engraver.hh @@ -11,7 +11,7 @@ #define FONT_SIZE_GRAV_HH #include "engraver.hh" - +#include "protected-scm.hh" /** Set font size on elements that do not have a fontsize set yet. @@ -20,7 +20,7 @@ Writes element property fontsize */ class Font_size_engraver : public Engraver { - int size_i_; + Protected_scm size_; protected: virtual void acknowledge_element (Score_element_info); virtual void do_process_requests (); diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index 45644294ee..ee91b59f8a 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -14,6 +14,7 @@ #include "lily-proto.hh" #include "virtual-methods.hh" #include "dictionary.hh" +#include "scm-hash.hh" /** Definition of how to output mudela. @@ -25,6 +26,7 @@ public: Scope *scope_p_; Array filename_str_arr_; + Scheme_hash_table default_properties_; Music_output_def (Music_output_def const&); Music_output_def (); diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 8615d9cf86..f939347094 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -57,7 +57,6 @@ public: Real get_realvar (SCM symbol) const; Real get_var (String id) const; - SCM get_scm_var (SCM sym) const; void reinit (); Paper_def (); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index a038db298e..5c44644c2e 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -33,6 +33,7 @@ static scm_sizet free_smob (SCM s); \ static int print_smob (SCM s, SCM p, scm_print_state*); \ static long smob_tag_; \ + static SCM equal_p (SCM a, SCM b);\ static void init_smobs(); \ void unsmobify_self ();\ void do_smobify_self();\ diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 8b73e999bb..4e628f2787 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -19,9 +19,7 @@ class Text_item : public Item { public: String text_str_; - String style_str_; - Text_item (); VIRTUAL_COPY_CONS (Score_element); protected: virtual void do_print () const; diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 771ff759af..39401cb208 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -27,8 +27,6 @@ protected: public: Time_signature () ; Array args_; - String time_sig_type_str_; - VIRTUAL_COPY_CONS(Score_element); }; diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 00da2cd391..e1d91d1aea 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -38,8 +38,9 @@ class Translator_group : public virtual Translator { Cons_list trans_p_list_; public: - SCM get_property (String type_str, Translator_group **where_found_l) const; + SCM get_property (SCM name_sym, Translator_group **where_found_l) const; void set_property (String var_name, SCM value); + String id_str_; diff --git a/lily/include/translator.hh b/lily/include/translator.hh index ec0feb943f..598544b142 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -59,7 +59,10 @@ public: ask daddy for a feature */ Music_output_def *output_def_l () const; + SCM get_property (String, Translator_group **) const; + SCM get_property (SCM symbol, Translator_group **) const; + virtual Moment now_mom () const; protected: diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 51b56ca726..b42b34592e 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -109,7 +109,7 @@ ly_quote_scm (SCM s) SCM ly_symbol (String name) { - return gh_car (scm_intern ((char*)name.ch_C(), name.length_i())); + return gh_symbol2scm ((char*)name.ch_C()); } String diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 080546f2f5..f6b61316fa 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -44,10 +44,6 @@ Lyric_engraver::do_process_requests() text_p_->text_str_ = req_l_->text_str_; text_p_->text_str_ += " "; // ugh. - SCM style = get_property ("textStyle", 0); - if (gh_string_p(style)) - text_p_->style_str_ = ly_scm2string (style); - text_p_->set_elt_property (non_rhythmic_scm_sym, SCM_BOOL_T); announce_element (Score_element_info (text_p_, req_l_)); diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 1c4b966a4f..444bd2ffeb 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -46,7 +46,8 @@ Mark_engraver::do_process_requests () { create_items (mark_req_l_); text_p_->text_str_ = mark_req_l_->str_; - text_p_->style_str_ = text_p_->text_str_.index_any_i ("0123456789") >= 0 - ? "mark" : "Large"; + SCM st = gh_str02scm ((text_p_->text_str_.index_any_i ("0123456789") >= 0 ) + ? "mark" : "large"); + text_p_->set_elt_property (style_scm_sym, st); } } diff --git a/lily/moment.cc b/lily/moment.cc index 7b76747d73..94d65eab45 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -67,3 +67,12 @@ init_moments () } ADD_SCM_INIT_FUNC(moms,init_moments); + +SCM +Moment::equal_p (SCM a, SCM b) +{ + Moment *m1 = SMOB_TO_TYPE(Moment, a); + Moment *m2 = SMOB_TO_TYPE(Moment, b); + + return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F; +} diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 99477e09d7..92c4b7ef98 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -73,12 +73,13 @@ Note_heads_engraver::do_process_requests() } note_p->position_i_ = note_req_l->pitch_.steps (); + /* + TODO: transparent note heads. + */ + if (gh_string_p (noteheadstyle)) { - if (ly_scm2string (noteheadstyle) == "transparent") - note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T); - else - note_p->set_elt_property (style_scm_sym, noteheadstyle); + note_p->set_elt_property (style_scm_sym, noteheadstyle); } Score_element_info itinf (note_p,note_req_l); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index f455204067..25a49c2f85 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -38,7 +38,7 @@ Note_performer::do_process_requests () int transposing_i = 0; //urg SCM prop = get_property ("transposing", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) transposing_i = gh_scm2int (prop); while (note_req_l_arr_.size ()) diff --git a/lily/paper-def.cc b/lily/paper-def.cc index c5a9146f81..ead9c06ae5 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -54,33 +54,6 @@ Paper_def::Paper_def (Paper_def const&s) } } -SCM -Paper_def::get_scm_var (SCM s) const -{ - if (!scope_p_->elem_b (s)) - return SCM_BOOL_F; - - Identifier * id = scope_p_->elem (s); - - SCM z; - SCM_NEWCELL (z); - SCM_SETCAR(z, s); - - SCM val; - - if (dynamic_cast (id)) - { - Real r = *id->access_content_Real (false); - val = gh_double2scm (r); - } - else - { - return SCM_BOOL_F; - } - - SCM_SETCDR(z,val); - return z; -} Real Paper_def::get_var (String s) const diff --git a/lily/parser.yy b/lily/parser.yy index c5b3927e59..fb8e92a65e 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -550,7 +550,13 @@ paper_def_body: $$->set_lookup ($2, l); } | paper_def_body assignment semicolon { - + + } + | paper_def_body SCM_T '=' SCM_T { + if (!gh_symbol_p ($2)) + THIS->parser_error ("expect a symbol as lvalue"); + else + $$->default_properties_[$2] = $4; } | paper_def_body translator_spec_block { $$->assign_translator ($2); diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc new file mode 100644 index 0000000000..1ff12820ff --- /dev/null +++ b/lily/property-engraver.cc @@ -0,0 +1,74 @@ +/* + property-engraver.cc -- implement Property engraver + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#include "lily-guile.hh" +#include "engraver.hh" +#include "protected-scm.hh" +#include "dictionary.hh" +#include "score-element.hh" + +class Property_engraver : public Engraver +{ + Dictionary prop_dict_; + void apply_properties (SCM, Score_element*); + +protected: + virtual void acknowledge_element (Score_element_info ei); + virtual void do_creation_processing (); + + VIRTUAL_COPY_CONS(Translator); +}; + +void +Property_engraver::do_creation_processing () +{ + SCM plist = get_property ("Generic_property_list", 0); + for (; SCM_NIMP (plist); plist = gh_cdr (plist)) + { + SCM elt_props = gh_car (plist); + prop_dict_[ly_scm2string (gh_car (elt_props))] = gh_cdr (elt_props); + } +} + +void +Property_engraver::acknowledge_element (Score_element_info i) +{ + if (prop_dict_.elem_b (i.elem_l_->name())) + { + SCM p = prop_dict_[i.elem_l_->name()]; + apply_properties (p,i.elem_l_); + } + if (prop_dict_.elem_b ("all")) + { + apply_properties (prop_dict_["all"], i.elem_l_); + } +} + +void +Property_engraver::apply_properties (SCM p, Score_element *e) +{ + for (; SCM_NIMP (p); p = gh_cdr (p)) + { + SCM entry = gh_car (p); + SCM prop_sym = gh_car (entry); + SCM type_p = gh_cadr (entry); + SCM elt_prop_name = gh_caddr (entry); + + if (e->get_elt_property (elt_prop_name) != SCM_BOOL_F) + continue; + + SCM val = get_property (prop_sym, 0); + if (val != SCM_UNDEFINED + && gh_apply (type_p, scm_listify (val, SCM_UNDEFINED)) + == SCM_BOOL_T) + e->set_elt_property (elt_prop_name, val); + } +} + +ADD_THIS_TRANSLATOR(Property_engraver); diff --git a/lily/property-inspect.cc b/lily/property-inspect.cc index 5e29f4160b..57093f8bce 100644 --- a/lily/property-inspect.cc +++ b/lily/property-inspect.cc @@ -12,7 +12,7 @@ bool isdir_b (SCM s) { - if (SCM_NUMBERP (s)) + if (gh_number_p (s)) { int i = gh_int2scm (s); return i>= -1 && i <= 1; diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 939baa2161..dde03daa1c 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -56,12 +56,7 @@ Rest_engraver::do_process_requests () dot_p_->dots_i_ = rest_req_l_->duration_.dots_i_; announce_element (Score_element_info (dot_p_,0)); } - if (rest_p_->balltype_i_ >= 2) - { - SCM reststyle = get_property ("restStyle", 0); - if (gh_string_p (reststyle)) - rest_p_->set_elt_property (style_scm_sym,reststyle); - } + announce_element (Score_element_info (rest_p_, rest_req_l_)); } } diff --git a/lily/rest.cc b/lily/rest.cc index daa9ceb5dd..14e10a3537 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -52,7 +52,7 @@ Rest::do_brew_molecule_p () const String style; SCM style_sym =get_elt_property (style_scm_sym); - if (style_sym != SCM_BOOL_F) + if (balltype_i_ >= 2 && style_sym != SCM_BOOL_F) { style = ly_scm2string (SCM_CDR(style_sym)); } diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 914a2c2ecf..5862e6f790 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -107,18 +107,6 @@ Rhythmic_column_engraver::do_pre_move_processing() { if (ncol_p_) { - SCM sh = get_property ("horizontalNoteShift", 0); - if (SCM_NUMBERP(sh)) - { - ncol_p_->set_elt_property (horizontal_shift_scm_sym, sh); - } - - sh = get_property ("forceHorizontalShift" ,0); - if (SCM_NUMBERP(sh)) - { - ncol_p_->set_elt_property (force_hshift_scm_sym, sh); - } - typeset_element (ncol_p_); ncol_p_ =0; } diff --git a/lily/score-element.cc b/lily/score-element.cc index a8a82a8a87..487a6c0d56 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -93,10 +93,17 @@ Score_element::get_elt_property (SCM sym) const SCM s = scm_assq(sym, element_property_alist_); // is this a good idea? - if (s == SCM_BOOL_F && pscore_l_ && pscore_l_->paper_l_) - s = pscore_l_->paper_l_->get_scm_var (sym); + if (s != SCM_BOOL_F) + return s; - return s; + if (pscore_l_) + { + // should probably check for Type::sym as well. + if (pscore_l_->paper_l_->default_properties_.elem_b (sym)) + return pscore_l_->paper_l_->default_properties_[sym]; + } + + return SCM_BOOL_F; } SCM @@ -464,3 +471,9 @@ Score_element::do_smobify_self () } #include "ly-smobs.icc" IMPLEMENT_SMOBS(Score_element); + +SCM +Score_element::equal_p (SCM a, SCM b) +{ + return SCM_CDR(a) == SCM_CDR(b) ? SCM_BOOL_T : SCM_BOOL_F; +} diff --git a/lily/score-priority-engraver.cc b/lily/score-priority-engraver.cc index 3530c26a25..c72a60d01f 100644 --- a/lily/score-priority-engraver.cc +++ b/lily/score-priority-engraver.cc @@ -44,8 +44,8 @@ Score_priority_engraver::acknowledge_element (Score_element_info inf) if (item_l->empty_b (X_AXIS) || item_l->parent_l (X_AXIS)) return; - bool breakable - = (item_l->remove_elt_property (breakable_scm_sym) != SCM_BOOL_F); + SCM bp=item_l->remove_elt_property (breakable_scm_sym); + bool breakable = (bp != SCM_BOOL_F); if (!breakable) return ; diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index ae2dfa312e..f7657e676f 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -71,14 +71,14 @@ Script_engraver::do_process_requests() ss->dir_ = (Direction)force_dir; SCM dir_prop (get_property ("articulationScriptVerticalDirection", 0)); - if (SCM_NUMBERP(dir_prop)) + if (gh_number_p(dir_prop)) ss->dir_ = to_dir (dir_prop); if (l->dir_) ss->dir_ = l->dir_; SCM paddingprop = get_property ("articulationScriptPadding", 0); - if (SCM_NUMBERP(paddingprop)) + if (gh_number_p(paddingprop)) { ss->set_elt_property (padding_scm_sym, paddingprop); } @@ -92,7 +92,7 @@ Script_engraver::do_process_requests() p->set_staff_side (ss); ss->set_elt_property (script_priority_scm_sym, priority); - if (SCM_NUMBERP (paddingprop)) + if (gh_number_p (paddingprop)) ss->set_elt_property (padding_scm_sym, paddingprop); diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index 35e24dab23..41be6e3180 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -32,7 +32,7 @@ void Separating_line_group_engraver::do_removal_processing () { SCM sz (get_property ("postBreakPadding", 0)); - if (SCM_NUMBERP(sz)) + if (gh_number_p(sz)) { sep_span_p_->padding_f_ = Real(sz); } diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 0ac32e8d34..045373378d 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -91,10 +91,6 @@ Slur_engraver::do_process_requests() // push a new slur onto stack. //(use temp. array to wait for all slur STOPs) Slur * s_p =new Slur; - SCM prop = get_property ("slurDash", 0); - if (SCM_NUMBERP(prop)) - s_p->set_elt_property (dashed_scm_sym, prop); - requests_arr_.push (slur_req_l); start_slur_l_arr_.push (s_p); @@ -112,7 +108,7 @@ Slur_engraver::do_pre_move_processing() SCM dir2 (get_property ("verticalDirection", 0)); Direction slurdir = CENTER; - if (SCM_NUMBERP(dir)) + if (gh_number_p(dir)) slurdir = to_dir (dir); else if (gh_number_p (dir2)) slurdir = to_dir (dir2); diff --git a/lily/slur.cc b/lily/slur.cc index 9e3b16d827..8f04b9fa76 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -280,9 +280,6 @@ Slur::do_post_processing () Now we've got a fine slur Catch and correct some ugly cases */ - - - String infix = interstaff_b ? "interstaff_" : ""; Real height_damp_f = paper_l ()->get_var ("slur_"+infix +"height_damping"); Real slope_damp_f = paper_l ()->get_var ("slur_"+infix +"slope_damping"); diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc index bddeeb9543..7fdba6a601 100644 --- a/lily/staff-margin-engraver.cc +++ b/lily/staff-margin-engraver.cc @@ -48,18 +48,17 @@ Staff_margin_engraver::acknowledge_element (Score_element_info inf) long_name = short_name; if (gh_string_p (long_name)) - return; - - create_items (0); - text_p_->text_str_ = ly_scm2string (long_name); - staff_side_p_->dir_ = LEFT; - Bar_script_engraver::do_acknowledge_element (i); + { + create_items (0); + text_p_->text_str_ = ly_scm2string (long_name); + staff_side_p_->dir_ = LEFT; + Bar_script_engraver::attach_script_to_item (i); - /* + /* UGH. ignores font size settings. */ - Interval iv(text_p_->extent (Y_AXIS)); - text_p_->translate_axis (- iv.center (), Y_AXIS); + Interval iv(text_p_->extent (Y_AXIS)); + text_p_->translate_axis (- iv.center (), Y_AXIS); + } } - diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 853af03f63..1ec7d19054 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -96,10 +96,10 @@ String Staff_performer::new_instrument_str () { // mustn't ask Score for instrument: it will return piano! - SCM minstr = get_property ("midiInstrument", 0); + SCM minstr = get_property (gh_symbol2scm ("midiInstrument"), 0); if (!gh_string_p(minstr)) - minstr = get_property ("instrument", 0); + minstr = get_property (gh_symbol2scm ("instrument"), 0); if (ly_scm2string (minstr) == instrument_str_) return ""; diff --git a/lily/staff-sym-engraver.cc b/lily/staff-sym-engraver.cc index 93e41b28ab..a326789009 100644 --- a/lily/staff-sym-engraver.cc +++ b/lily/staff-sym-engraver.cc @@ -35,13 +35,13 @@ void Staff_symbol_engraver::do_removal_processing() { SCM l (get_property ("numberOfStaffLines", 0)); - if (SCM_NUMBERP(l)) + if (gh_number_p(l)) { span_p_->no_lines_i_ = gh_scm2int (l); } SCM sz (get_property ("staffLineLeading", 0)); - if (SCM_NUMBERP(sz)) + if (gh_number_p(sz)) { span_p_->staff_line_leading_f_ = gh_scm2double (sz); } diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index d48fa3925f..edd978df5e 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -29,7 +29,7 @@ void Stem_engraver::do_creation_processing () { SCM prop = get_property ("abbrev", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { default_abbrev_i_ = gh_scm2int (prop); } @@ -97,7 +97,7 @@ Stem_engraver::do_pre_move_processing() if (stem_p_) { SCM prop = get_property ("verticalDirection", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { stem_p_->dir_ = to_dir (prop); stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T); @@ -105,36 +105,17 @@ Stem_engraver::do_pre_move_processing() Translator_group* which; prop = get_property ("stemLeftBeamCount", &which); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { stem_p_->beams_i_drul_[LEFT] = gh_scm2int (prop); ((Translator_group*)which)->set_property ("stemLeftBeamCount", SCM_UNDEFINED); } prop = get_property ("stemRightBeamCount", &which); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) { stem_p_->beams_i_drul_[RIGHT] = gh_scm2int (prop); ((Translator_group*)which)->set_property ("stemRightBeamCount", SCM_UNDEFINED); } - - prop = get_property ("stemLength", 0); - if (SCM_NUMBERP(prop)) - { - stem_p_->set_elt_property (length_scm_sym, prop); - } - - prop = get_property ("stemStyle", 0); - if (gh_string_p (prop)) - { - stem_p_->set_elt_property (style_scm_sym, prop); - } - - prop = get_property ("noStemExtend", 0); - if (gh_boolean_p (prop) && gh_scm2bool (prop)) - { - stem_p_->set_elt_property (no_stem_extend_scm_sym, prop); - } - typeset_element(stem_p_); stem_p_ = 0; } diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 9ecc46f434..a2bd014612 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -98,21 +98,9 @@ Text_engraver::do_process_requests () text->text_str_ = r->text_str_; - if (r->style_str_.empty_b ()) - { - SCM p (get_property ("textStyle", 0)); - if (gh_string_p (p)) - text->style_str_ = ly_scm2string(p); - } - else - text->style_str_ = r->style_str_; + if (r->style_str_.length_i ()) + text->set_elt_property (style_scm_sym, ly_ch_C_to_scm (r->style_str_.ch_C())); - SCM padding = get_property ("textScriptPadding", 0); - if (SCM_NUMBERP(padding)) - { - ss->set_elt_property (padding_scm_sym, padding); - } - SCM empty = get_property ("textEmptyDimension", 0); if (gh_boolean_p (empty) && gh_scm2bool (empty)) { diff --git a/lily/text-item.cc b/lily/text-item.cc index 6cc6437297..eeaf40c30a 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -16,16 +16,14 @@ Molecule* Text_item::do_brew_molecule_p () const { - Molecule a= paper_l ()->lookup_l(0)->text (style_str_,text_str_, paper_l ()); + SCM style = get_elt_property (style_scm_sym); + String st = (style == SCM_BOOL_F) ? "" : ly_scm2string (gh_cdr (style)); + + Molecule a= paper_l ()->lookup_l(0)->text (st, text_str_, paper_l ()); return new Molecule (a); } -Text_item::Text_item () -{ - style_str_ = "roman"; -} - void Text_item::do_print () const { diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc index 946f8e9367..a3ba0358ca 100644 --- a/lily/tie-engraver.cc +++ b/lily/tie-engraver.cc @@ -140,7 +140,7 @@ Tie_engraver::do_pre_move_processing () SCM dir2 (get_property ("verticalDirection", 0)); Direction tie_dir = CENTER; - if (SCM_NUMBERP(dir)) + if (gh_number_p(dir)) tie_dir = to_dir (dir); else if (isdir_b (dir2)) tie_dir = to_dir (dir2); diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index d9051d59ae..f680885064 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -54,11 +54,6 @@ Time_signature_engraver::do_pre_move_processing() { if (time_signature_p_) { - SCM sigstyle = get_property ("timeSignatureStyle", 0); - if (gh_string_p (sigstyle)) - { - time_signature_p_->time_sig_type_str_ = ly_scm2string (sigstyle); - } typeset_element (time_signature_p_); time_signature_p_ =0; diff --git a/lily/time-signature.cc b/lily/time-signature.cc index a4960abc7b..1f6234cd9c 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -21,16 +21,19 @@ Time_signature::Time_signature () Molecule* Time_signature::do_brew_molecule_p () const { - if (time_sig_type_str_.length_i ()) + SCM st = get_elt_property (style_scm_sym); + + if (st != SCM_BOOL_F) { - if (time_sig_type_str_[0]=='1') + String style (ly_scm2string (gh_cdr (st))); + if (style[0]=='1') { Array tmparr = args_; return new Molecule( lookup_l ()->time_signature (args_[0], 0, paper_l ())); } else { - return new Molecule( lookup_l ()-> special_time_signature (time_sig_type_str_ ,args_[0], args_[1], paper_l ())); + return new Molecule( lookup_l ()-> special_time_signature (style, args_[0], args_[1], paper_l ())); } } else diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 82ab9dc0be..03479ed5b8 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -95,7 +95,7 @@ Timing_translator::do_process_requests() Translator_group * tr=0; SCM barn = get_property ("currentBarNumber", &tr); - if (SCM_NUMBERP(barn)) + if (gh_number_p(barn)) { time_.bars_i_ = gh_scm2int (barn); tr->set_property ("currentBarNumber", SCM_UNDEFINED); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index cffdaf8905..f74aef58d4 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -448,10 +448,8 @@ Translator_group::do_add_processing () } SCM -Translator_group::get_property (String id, - Translator_group **where_l) const +Translator_group::get_property (SCM sym, Translator_group **where_l) const { - SCM sym = ly_symbol (id); if (properties_dict_.elem_b (sym)) { if (where_l) @@ -460,7 +458,7 @@ Translator_group::get_property (String id, } if (daddy_trans_l_) - return daddy_trans_l_->get_property (id, where_l); + return daddy_trans_l_->get_property (sym, where_l); if (where_l) *where_l = 0; diff --git a/lily/translator.cc b/lily/translator.cc index 218a8c1423..c70b629ce8 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -166,7 +166,14 @@ Translator::output_def_l () const SCM Translator::get_property (String id, Translator_group **where_l) const { - return daddy_trans_l_->get_property (id, where_l); + return daddy_trans_l_->get_property (ly_symbol (id), where_l); +} + +SCM +Translator::get_property (SCM sym, + Translator_group **where_l) const +{ + return daddy_trans_l_->get_property (sym, where_l); } diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index ce9c2cd2de..b9e3cf16dc 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -40,7 +40,7 @@ Tuplet_engraver::do_process_requests () dir = to_dir (prop); int visibility = 3; prop = get_property ("tupletVisibility", 0); - if (SCM_NUMBERP(prop)) + if (gh_number_p(prop)) visibility = gh_scm2int (prop); // bool ? for (int i= started_span_p_arr_.size (); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 2497fd4f59..48935c674c 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -33,13 +33,13 @@ void Vertical_align_engraver::do_removal_processing() { SCM dist (get_property ("maxVerticalAlign", 0)); - if (SCM_NUMBERP(dist)) + if (gh_number_p(dist)) { valign_p_->threshold_interval_[BIGGER] = gh_scm2double (dist); } dist = get_property ("minVerticalAlign", 0); - if (SCM_NUMBERP(dist)) + if (gh_number_p(dist)) { valign_p_->threshold_interval_[SMALLER] = gh_scm2double (dist); } diff --git a/ly/declarations.ly b/ly/declarations.ly index 5643839893..e7b6eac287 100644 --- a/ly/declarations.ly +++ b/ly/declarations.ly @@ -3,6 +3,8 @@ breve = \duration { -1 0 } longa = \duration { -2 0 } +#(eval-string (ly-gulp-file "generic-property.scm")) + \include "nederlands.ly" % dutch \include "chord-modifiers.ly" \include "script.ly" diff --git a/ly/engraver.ly b/ly/engraver.ly index b323524d32..c1687a847d 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -5,9 +5,12 @@ StaffContext=\translator { \type "Engraver_group_engraver"; \name Staff ; + barAuto = ##t voltaVisibility = ##t - + Generic_property_list = #generic-staff-properties + \consists "Property_engraver"; + \consists "Multi_measure_rest_engraver"; \consists "Bar_engraver"; % Bar_engraver must be first so default bars aren't overwritten @@ -66,6 +69,9 @@ StaffContext=\translator { RhythmicStaffContext=\translator{ \type "Engraver_group_engraver"; numberOfStaffLines = #1 + \consists "Property_engraver"; + + Generic_property_list = #generic-staff-properties barSize = \staffheight; \consists "Pitch_squash_engraver"; @@ -81,12 +87,16 @@ RhythmicStaffContext=\translator{ }; \translator{\RhythmicStaffContext} VoiceContext = \translator { + \type "Engraver_group_engraver"; dynamicPadding = #5.0 + Generic_property_list = #generic-voice-properties + + \consists "Dynamic_engraver"; % must come before text_engraver. \name Voice ; - -% \consists "Tie_engraver"; + \consists "Property_engraver"; + \consists "Breathing_sign_engraver"; \consists "Rest_engraver"; \consists "Dot_column_engraver"; @@ -95,9 +105,7 @@ VoiceContext = \translator { \consists "Auto_beam_engraver"; \include "auto-beam-settings.ly"; \consists "Chord_tremolo_engraver"; -% \consists "Multi_measure_rest_engraver"; - % ugh. Order matters here. \consists "Melisma_engraver"; textScriptPadding = #3.0 \consists "Text_engraver"; @@ -117,6 +125,9 @@ VoiceContext = \translator { GraceContext=\translator { \type "Grace_engraver_group"; \name "Grace"; + + Generic_property_list = #generic-grace-properties + \consists "Note_heads_engraver"; \consists "Local_key_engraver"; \consists "Stem_engraver"; @@ -126,13 +137,16 @@ GraceContext=\translator { \consists "Auto_beam_engraver"; \include "auto-beam-settings.ly"; \consists "Align_note_column_engraver"; - \consists "Font_size_engraver"; + \consists "Rhythmic_column_engraver"; \consists "Dynamic_engraver"; + \consists "Property_engraver"; + stemStyle = #"grace" weAreGraceContext = ##t fontSize = #-1 + stemLength = #6.0 verticalDirection = \up ; graceAccidentalSpace= 1.5 * \interline; @@ -143,7 +157,9 @@ GraceContext=\translator { ThreadContext = \translator{ \type Engraver_group_engraver; - \consists "Note_heads_engraver" ; + \consists "Note_heads_engraver" ; + Generic_property_list = #generic-thread-properties + \consists "Property_engraver"; \name Thread; }; @@ -289,6 +305,9 @@ ScoreContext = \translator { \accepts "GrandStaff"; \accepts "ChoirStaff"; \accepts "PianoStaff"; + + clefBreakPriority = #-2 + breathingSignBreakPriority = #-4 }; \translator { \ScoreContext } diff --git a/ly/params.ly b/ly/params.ly index a3e0eba66c..beb538c9b4 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -97,6 +97,10 @@ MAJORITY = 2.0; MEAN = 3.0; MEDIAN = 4.0; +#'beam_dir_algorithm = #'majority +#'slope_quantisation = #'normal + + %{ dit(code(beam_dir_algorithm)) Specify algorithm for determining whether beams go up or down. It is real valued. If set to 2.0 then diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index cbb9b6fba6..07d322a822 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.0 -Entered-date: 26OCT99 +Version: 1.3.1 +Entered-date: 28OCT99 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.0.tar.gz + 1000k lilypond-1.3.1.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.0.tar.gz + 1000k lilypond-1.3.1.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index 3e62d1f6d1..f1cdc34164 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.0 +Version: 1.3.1 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.0.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.1.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys diff --git a/midi2ly/include/midi-parser.hh b/midi2ly/include/midi-parser.hh index 529fdf268d..25fb357f64 100644 --- a/midi2ly/include/midi-parser.hh +++ b/midi2ly/include/midi-parser.hh @@ -36,7 +36,7 @@ #endif #include "proto.hh" -#include "moment.hh" +#include "rational.hh" #include "midi2ly-proto.hh" struct Midi_parser_info @@ -50,7 +50,7 @@ struct Midi_parser_info Byte const* end_byte_L_; Source_file* source_l_; Mudela_score* score_l_; - Moment bar_mom_; + Rational bar_mom_; }; #include "string.hh" diff --git a/midi2ly/include/midi-track-parser.hh b/midi2ly/include/midi-track-parser.hh index 27eb83d224..4dd95fe82d 100644 --- a/midi2ly/include/midi-track-parser.hh +++ b/midi2ly/include/midi-track-parser.hh @@ -12,7 +12,7 @@ #include "proto.hh" #include "cons.hh" -#include "moment.hh" +#include "rational.hh" #include "midi2ly-proto.hh" #include "midi-parser.hh" @@ -23,7 +23,7 @@ public: Midi_track_parser (Midi_parser_info* info_l, int i); ~Midi_track_parser (); - Moment at_mom (); + Rational at_mom (); Mudela_staff* parse (Mudela_column* col_l); private: @@ -34,7 +34,7 @@ private: Mudela_item* parse_event (Mudela_column* col_l); void parse_header (); - Moment at_mom_; + Rational at_mom_; Byte running_byte_; Cons_list open_note_l_list_; Mudela_staff* mudela_staff_p_; diff --git a/midi2ly/include/mudela-column.hh b/midi2ly/include/mudela-column.hh index cd549a1b37..6c348afbc4 100644 --- a/midi2ly/include/mudela-column.hh +++ b/midi2ly/include/mudela-column.hh @@ -8,20 +8,20 @@ #include "proto.hh" #include "midi2ly-proto.hh" -#include "moment.hh" +#include "rational.hh" #include "cons.hh" /// (mudela_column) class Mudela_column { public: - Mudela_column (Mudela_score* mudela_score_l, Moment mom); + Mudela_column (Mudela_score* mudela_score_l, Rational mom); void add_item (Mudela_item* mudela_item_l); - Moment at_mom (); + Rational at_mom (); Cons_list mudela_item_l_list_; - Moment at_mom_; + Rational at_mom_; Mudela_score* mudela_score_l_; }; diff --git a/midi2ly/include/mudela-item.hh b/midi2ly/include/mudela-item.hh index e6150e4a04..02c726b317 100644 --- a/midi2ly/include/mudela-item.hh +++ b/midi2ly/include/mudela-item.hh @@ -8,7 +8,7 @@ #include "midi2ly-proto.hh" #include "string.hh" -#include "moment.hh" +#include "rational.hh" #include "duration.hh" // should these: @@ -24,8 +24,8 @@ public: Mudela_item (Mudela_column* mudela_column_l); virtual ~Mudela_item (); - virtual Moment at_mom (); - virtual Moment duration_mom (); + virtual Rational at_mom (); + virtual Rational duration_mom (); void output (Mudela_stream& mudela_stream_r); virtual String str () = 0; @@ -55,7 +55,7 @@ public: int den_i (); int num_i (); virtual String str (); - Moment bar_mom (); + Rational bar_mom (); private: Real sync_f_; @@ -71,7 +71,7 @@ public: Mudela_note (Mudela_column* mudela_column_l, int channel_i, int pitch_i, int dyn_i); Duration duration (); - virtual Moment duration_mom (); + virtual Rational duration_mom (); virtual String str (); // int const c0_pitch_i_c_ = 60; // huh? @@ -86,14 +86,14 @@ public: class Mudela_skip : public Mudela_item { public: - Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom); + Mudela_skip (Mudela_column* mudela_column_l, Rational skip_mom); Duration duration (); - virtual Moment duration_mom (); + virtual Rational duration_mom (); virtual String str (); private: - Moment mom_; + Rational mom_; }; @@ -102,13 +102,13 @@ class Mudela_tempo : public Mudela_item public: Mudela_tempo (int useconds_per_4_i); - int get_tempo_i (Moment moment); + int get_tempo_i (Rational rational); virtual String str (); int useconds_per_4_i (); private: int useconds_per_4_i_; - Moment seconds_per_1_mom_; + Rational seconds_per_1_mom_; }; class Mudela_text : public Mudela_item diff --git a/midi2ly/include/mudela-score.hh b/midi2ly/include/mudela-score.hh index b5fa1db972..2a8006a5cd 100644 --- a/midi2ly/include/mudela-score.hh +++ b/midi2ly/include/mudela-score.hh @@ -20,8 +20,8 @@ public: void add_item (Mudela_item* mudela_item_p); void add_staff (Mudela_staff* mudela_staff_p); - Mudela_column* find_column_l (Moment mom); - Mudela_column* get_column_l (Moment mom); + Mudela_column* find_column_l (Rational mom); + Mudela_column* get_column_l (Rational mom); void output (String filename_str); void process (); diff --git a/midi2ly/include/mudela-staff.hh b/midi2ly/include/mudela-staff.hh index 2367fec701..6f51077d57 100644 --- a/midi2ly/include/mudela-staff.hh +++ b/midi2ly/include/mudela-staff.hh @@ -33,7 +33,7 @@ public: int number_i_; private: - void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i); + void output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Rational now_mom, int bar_i); Cons_list mudela_voice_p_list_; Cons_list mudela_item_p_list_; diff --git a/midi2ly/include/mudela-stream.hh b/midi2ly/include/mudela-stream.hh index 0ba47e8173..04ddbd86e9 100644 --- a/midi2ly/include/mudela-stream.hh +++ b/midi2ly/include/mudela-stream.hh @@ -10,7 +10,7 @@ #include "midi2ly-proto.hh" #include "string.hh" -#include "scalar.hh" +//#include "scalar.hh" /// Lily output class Mudela_stream { @@ -18,7 +18,8 @@ public: Mudela_stream (String filename_str); ~Mudela_stream(); - Mudela_stream& operator << (Scalar s); + Mudela_stream& operator << (char c); + Mudela_stream& operator << (String s); Mudela_stream& operator << (Mudela_item& mudela_item_r); private: diff --git a/midi2ly/midi-score-parser.cc b/midi2ly/midi-score-parser.cc index 33fb76b4b3..3370edcd15 100644 --- a/midi2ly/midi-score-parser.cc +++ b/midi2ly/midi-score-parser.cc @@ -6,7 +6,7 @@ (c) 1997--1998 Jan Nieuwenhuizen */ -#include "moment.hh" +#include "rational.hh" #include "source-file.hh" #include "source.hh" #include "midi2ly-global.hh" @@ -65,7 +65,7 @@ int Midi_score_parser::find_earliest_i (Link_array& tracks) { int earliest_i = 0; - Moment earliest_mom = infinity_mom; + Rational earliest_mom = infinity_rat; for (int i = 0; i < tracks.size(); i++) { if ( tracks [i]->at_mom () < earliest_mom ) @@ -82,7 +82,7 @@ Midi_score_parser::parse_score () { int current_bar_i = 0; Mudela_time_signature m4 (4, 2, 24, 8); - Moment bar4_mom = m4.bar_mom (); + Rational bar4_mom = m4.bar_mom (); Mudela_score* score_p = new Mudela_score( 1, 1, 1 ); info_l_->score_l_ = score_p; @@ -96,7 +96,7 @@ Midi_score_parser::parse_score () while (tracks.size ()) { int i = find_earliest_i (tracks); - Moment at_mom = tracks [i]->at_mom (); + Rational at_mom = tracks [i]->at_mom (); Mudela_column* column_l = score_p->get_column_l (at_mom); Mudela_staff* staff_p = tracks [i]->parse (column_l); if ( staff_p ) diff --git a/midi2ly/midi-track-parser.cc b/midi2ly/midi-track-parser.cc index 21442a4ef3..69c7ed080e 100644 --- a/midi2ly/midi-track-parser.cc +++ b/midi2ly/midi-track-parser.cc @@ -31,7 +31,7 @@ Midi_track_parser::~Midi_track_parser () delete track_info_p_; } -Moment +Rational Midi_track_parser::at_mom () { return at_mom_; @@ -85,7 +85,7 @@ Midi_track_parser::note_end_all (Mudela_column* col_l) Mudela_staff* Midi_track_parser::parse (Mudela_column* col_l) { - Moment mom = at_mom (); + Rational mom = at_mom (); while (!eot () && (mom == at_mom ())) { Mudela_item* p = parse_event (col_l); @@ -110,7 +110,7 @@ Midi_track_parser::parse_delta_time () if (eot ()) return; int delta_i = get_var_i (); - at_mom_ += Moment (delta_i, info_l_->division_1_i_); + at_mom_ += Rational (delta_i, info_l_->division_1_i_); } Mudela_item* diff --git a/midi2ly/mudela-column.cc b/midi2ly/mudela-column.cc index 833b351f81..e45e985c0e 100644 --- a/midi2ly/mudela-column.cc +++ b/midi2ly/mudela-column.cc @@ -5,7 +5,7 @@ #include "mudela-column.hh" -Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Moment mom) +Mudela_column::Mudela_column (Mudela_score* mudela_score_l, Rational mom) { mudela_score_l_ = mudela_score_l; at_mom_ = mom; @@ -17,7 +17,7 @@ Mudela_column::add_item (Mudela_item* mudela_item_l) mudela_item_l_list_.append (new Cons (mudela_item_l, 0)); } -Moment +Rational Mudela_column::at_mom() { return at_mom_; diff --git a/midi2ly/mudela-item.cc b/midi2ly/mudela-item.cc index 1aa6105f09..7c427c9ff4 100644 --- a/midi2ly/mudela-item.cc +++ b/midi2ly/mudela-item.cc @@ -21,16 +21,16 @@ Mudela_item::~Mudela_item () { } -Moment +Rational Mudela_item::at_mom () { return mudela_column_l_->at_mom (); } -Moment +Rational Mudela_item::duration_mom () { - return Moment (0); + return Rational (0); } void @@ -163,12 +163,12 @@ Mudela_time_signature::Mudela_time_signature (int num_i, int den_i, int clocks_4 clocks_1_i_ = clocks_4_i * 4; } -Moment +Rational Mudela_time_signature::bar_mom () { Duration d; d.durlog_i_ = den_i_; - return Moment (num_i_) * Duration_convert::dur2_mom (d); + return Rational (num_i_) * Duration_convert::dur2_mom (d); } int @@ -227,11 +227,11 @@ Duration Mudela_note::duration () { assert (end_column_l_); - Moment mom = end_column_l_->at_mom () - at_mom (); + Rational mom = end_column_l_->at_mom () - at_mom (); return Duration_convert::mom2_dur (mom); } -Moment +Rational Mudela_note::duration_mom () { assert (end_column_l_); @@ -281,7 +281,7 @@ Mudela_note::str () return str + " "; } -Mudela_skip::Mudela_skip (Mudela_column* mudela_column_l, Moment skip_mom) +Mudela_skip::Mudela_skip (Mudela_column* mudela_column_l, Rational skip_mom) : Mudela_item (mudela_column_l) { mom_ = skip_mom; @@ -293,7 +293,7 @@ Mudela_skip::duration () return Duration_convert::mom2_dur (mom_); } -Moment +Rational Mudela_skip::duration_mom () { return Duration_convert::dur2_mom (duration ()); @@ -319,14 +319,14 @@ Mudela_tempo::Mudela_tempo (int useconds_per_4_i) : Mudela_item (0) { useconds_per_4_i_ = useconds_per_4_i; - seconds_per_1_mom_ = Moment(useconds_per_4_i_ *4, 1e6); + seconds_per_1_mom_ = Rational(useconds_per_4_i_ *4, 1e6); } String Mudela_tempo::str () { String str = "\\tempo 4="; - str += to_str (get_tempo_i (Moment (1, 4))); + str += to_str (get_tempo_i (Rational (1, 4))); str += ";\n"; return str; } @@ -338,10 +338,10 @@ Mudela_tempo::useconds_per_4_i () } int -Mudela_tempo::get_tempo_i (Moment moment) +Mudela_tempo::get_tempo_i (Rational rational) { - Moment m1 = Moment (60) / moment; - Moment m2 = seconds_per_1_mom_; + Rational m1 = Rational (60) / rational; + Rational m2 = seconds_per_1_mom_; return m1 / m2; } diff --git a/midi2ly/mudela-score.cc b/midi2ly/mudela-score.cc index 1d3d0f5ca4..8a142c8449 100644 --- a/midi2ly/mudela-score.cc +++ b/midi2ly/mudela-score.cc @@ -4,7 +4,7 @@ // copyright 1997 Jan Nieuwenhuizen #include -#include "moment.hh" +#include "rational.hh" #include "duration.hh" #include "duration-convert.hh" #include "midi2ly-global.hh" @@ -27,7 +27,7 @@ Mudela_score::Mudela_score (int format_i, int tracks_i, int tempo_i) format_i_ = format_i; tracks_i_ = tracks_i; tempo_i_ = tempo_i; - column_l_array_.push (new Mudela_column (this, Moment (0))); + column_l_array_.push (new Mudela_column (this, Rational (0))); // mudela_key_l_ = &key_c; mudela_key_l_ = 0; mudela_time_signature_l_ = &time_sig_4; @@ -52,14 +52,14 @@ Mudela_score::add_staff (Mudela_staff* mudela_staff_p) } Mudela_column* -Mudela_score::find_column_l (Moment mom) +Mudela_score::find_column_l (Rational mom) { int upper_i = max (0, column_l_array_.size () - 1); int lower_i = 0; int i = 0; //upper_i; while (1) { - Moment i_mom = column_l_array_ [i]->at_mom (); + Rational i_mom = column_l_array_ [i]->at_mom (); if (i_mom == mom) return column_l_array_ [i]; if (mom < i_mom) @@ -81,7 +81,7 @@ Mudela_score::find_column_l (Moment mom) } Mudela_column* -Mudela_score::get_column_l (Moment mom) +Mudela_score::get_column_l (Rational mom) { int i; Mudela_column *c=0; @@ -131,7 +131,7 @@ Mudela_score::output (String filename_str) && (i->car_ == mudela_staff_p_list_.head_->car_)) continue; mudela_stream << "\\context Staff = \"" << i->car_->id_str () << "\" "; - mudela_stream << String ("\\" + i->car_->id_str ()) << "\n"; + mudela_stream << String ("\\" + i->car_->id_str ()) << '\n'; } if (mudela_staff_p_list_.size_i () > 1) mudela_stream << ">\n"; @@ -190,15 +190,15 @@ Mudela_score::quantify_columns () LOGOUT (NORMAL_ver) << '\n' << _ ("Quantifying columns...") << endl; int current_bar_i = 0; - Moment bar_mom = mudela_time_signature_l_->bar_mom (); + Rational bar_mom = mudela_time_signature_l_->bar_mom (); int n = 5 >? Duration_convert::no_smaller_than_i_s; n = Duration_convert::type2_i (n); - Moment s = Moment (1, n); + Rational s = Rational (1, n); for (int i = 0; i < column_l_array_.size (); i++) { column_l_array_ [i]->at_mom_ = - s * Moment ( (int) ( (column_l_array_ [i]->at_mom ()) / s)); + s * Rational ( (int) ( (column_l_array_ [i]->at_mom ()) / s)); int bar_i = (int) (column_l_array_ [i]->at_mom () / bar_mom) + 1; if (bar_i > current_bar_i) @@ -226,12 +226,12 @@ Mudela_score::settle_columns () int start_i = 0; int end_i = 0; - Moment start_mom = 0; + Rational start_mom = 0; Duration smallest_dur; smallest_dur.durlog_i_ = 6; - Moment const noise_mom = Duration_convert::dur2_mom (smallest_dur) - / Moment (2); + Rational const noise_mom = Duration_convert::dur2_mom (smallest_dur) + / Rational (2); for (int i = 0; i < n; i++) { if (!start_i) diff --git a/midi2ly/mudela-staff.cc b/midi2ly/mudela-staff.cc index 6440d180b9..6f561cdb15 100644 --- a/midi2ly/mudela-staff.cc +++ b/midi2ly/mudela-staff.cc @@ -5,7 +5,7 @@ #include #include -#include "moment.hh" +#include "rational.hh" #include "duration-convert.hh" #include "string-convert.hh" #include "midi2ly-proto.hh" @@ -52,15 +52,15 @@ Mudela_staff::eat_voice (Cons_list& items) Mudela_voice* voice_p = new Mudela_voice (this); mudela_voice_p_list_.append (new Killing_cons (voice_p, 0)); - // Moment mom = items.top ()->at_mom (); - Moment mom = 0; + // Rational mom = items.top ()->at_mom (); + Rational mom = 0; for (Cons** pp = &items.head_; *pp;) { Cons* i = *pp; if (i->car_->at_mom () > mom) { - Moment dur = i->car_->at_mom () - mom; + Rational dur = i->car_->at_mom () - mom; // ugh, need score Mudela_column* start = mudela_score_l_g->find_column_l (mom); voice_p->add_item (new Mudela_skip (start, dur)); @@ -170,7 +170,7 @@ Mudela_staff::output (Mudela_stream& mudela_stream_r) trackbody += "\\" + voicename + "\n"; - mudela_stream_r << "\n"; + mudela_stream_r << '\n'; i->car_->output (mudela_stream_r); c++; } @@ -184,10 +184,10 @@ Mudela_staff::output (Mudela_stream& mudela_stream_r) } void -Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment now_mom, int bar_i) +Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Rational now_mom, int bar_i) { - Moment bar_mom = mudela_time_signature_l_->bar_mom (); - Moment into_bar_mom = now_mom - Moment (bar_i - 1) * bar_mom; + Rational bar_mom = mudela_time_signature_l_->bar_mom (); + Rational into_bar_mom = now_mom - Rational (bar_i - 1) * bar_mom; if (bar_i > 1) { if (!into_bar_mom) @@ -202,10 +202,10 @@ Mudela_staff::output_mudela_begin_bar (Mudela_stream& mudela_stream_r, Moment no #if 0 // not used for now void -Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_mom, Moment end_mom) +Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Rational begin_mom, Rational end_mom) { - Moment bar_mom = mudela_time_signature_l_->bar_mom (); - Moment now_mom = begin_mom; + Rational bar_mom = mudela_time_signature_l_->bar_mom (); + Rational now_mom = begin_mom; int begin_bar_i = (int) (now_mom / bar_mom) + 1; int end_bar_i = (int) (end_mom / bar_mom) + 1; @@ -220,15 +220,15 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m int bar_i = (int) (now_mom / bar_mom) + 1; //fill current bar - Moment begin_bar_mom = Moment (begin_bar_i - 1) * bar_mom; + Rational begin_bar_mom = Rational (begin_bar_i - 1) * bar_mom; if (now_mom > begin_bar_mom) { int next_bar_i = (int) (now_mom / bar_mom) + 2; - Moment next_bar_mom = Moment (next_bar_i - 1) * bar_mom; + Rational next_bar_mom = Rational (next_bar_i - 1) * bar_mom; assert (next_bar_mom <= end_mom); - Moment remain_mom = next_bar_mom - now_mom; - if (remain_mom > Moment (0)) + Rational remain_mom = next_bar_mom - now_mom; + if (remain_mom > Rational (0)) { output_mudela_rest_remain (mudela_stream_r, remain_mom); now_mom += remain_mom; @@ -259,8 +259,8 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m // bar_i = check_end_bar_i (now_mom, bar_i); - Moment remain_mom = end_mom - Moment (end_bar_i - 1) * bar_mom; - if (remain_mom > Moment (0)) + Rational remain_mom = end_mom - Rational (end_bar_i - 1) * bar_mom; + if (remain_mom > Rational (0)) { output_mudela_rest_remain (mudela_stream_r, remain_mom); now_mom += remain_mom; @@ -269,7 +269,7 @@ Mudela_staff::output_mudela_rest (Mudela_stream& mudela_stream_r, Moment begin_m } void -Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Moment mom) +Mudela_staff::output_mudela_rest_remain (Mudela_stream& mudela_stream_r, Rational mom) { if (Duration_convert::no_quantify_b_s) { diff --git a/midi2ly/mudela-stream.cc b/midi2ly/mudela-stream.cc index f5fbfd0f8c..1ec52fc4a1 100644 --- a/midi2ly/mudela-stream.cc +++ b/midi2ly/mudela-stream.cc @@ -30,7 +30,7 @@ Mudela_stream::Mudela_stream (String filename_str) header(); } -Mudela_stream::~Mudela_stream() +Mudela_stream::~Mudela_stream () { delete os_p_; if (indent_i_) @@ -38,7 +38,14 @@ Mudela_stream::~Mudela_stream() } Mudela_stream& -Mudela_stream::operator << (Scalar s) +Mudela_stream::operator << (char c) +{ + *this << to_str (c); + return *this; +} + +Mudela_stream& +Mudela_stream::operator << (String s) { static String word_sep_str = "{} \t\n"; while (s.length_i()) diff --git a/midi2ly/mudela-voice.cc b/midi2ly/mudela-voice.cc index 65691d073c..4d5ec74abe 100644 --- a/midi2ly/mudela-voice.cc +++ b/midi2ly/mudela-voice.cc @@ -67,17 +67,17 @@ Mudela_voice::output (Mudela_stream& mudela_stream_r) mudela_stream_r << get_clef () << '\n'; int current_bar_i = 0; - Moment bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom (); + Rational bar_mom = mudela_staff_l_->mudela_time_signature_l_->bar_mom (); for (Cons* i = mudela_item_l_list_.head_; i; i = i->next_) { - Moment at_mom = i->car_->mudela_column_l_->at_mom (); + Rational at_mom = i->car_->mudela_column_l_->at_mom (); int bar_i = (int) (at_mom / bar_mom) + 1; if (bar_i > current_bar_i) { if (current_bar_i) { - if (at_mom == Moment (bar_i - 1) * bar_mom) + if (at_mom == Rational (bar_i - 1) * bar_mom) mudela_stream_r << "|"; mudela_stream_r << "\n% "; mudela_stream_r << String_convert::i2dec_str (bar_i, 0, ' '); diff --git a/scm/generic-property.scm b/scm/generic-property.scm new file mode 100644 index 0000000000..a895d3ba13 --- /dev/null +++ b/scm/generic-property.scm @@ -0,0 +1,96 @@ + +(define generic-beam-properties + (cons "Beam" + (list + (list 'beamslopedamping number? 'damping) + (list 'autoKneeGap number? 'auto_knee_gap) + (list 'autoInterstaffKneeGap number? 'auto_interstaff_knee_gap) + (list 'beamQuantisation symbol? 'slope_quantisation) + (list 'beamDirAlgorithm symbol? 'beam_dir_algorithm) + ) + ) + ) + + +(define generic-stem-properties + (cons "Stem" + (list + (list 'stemLength number? 'length) + (list 'stemStyle string? 'style) + (list 'noStemExtend boolean? 'no_stem_extend) + )) + ) + +(define generic-text-properties + (cons "Text_item" (list + (list 'textStyle string? 'style) + (list 'textScriptPadding number? 'padding) + ) + )) + +(define generic-bar-properties + (cons "Staff_bar" (list + (list 'barSize number? 'bar_size)) + ) + ) +(define generic-breathing-sign-properties + (cons "Breathing_sign" + (list + (list 'breathingSignBreakPriority number? 'break_priority + )))) + +(define generic-clef-properties + (cons "Clef_item" + (list + (list 'clefBreakPriority number? 'break_priority) + (list 'clefStyle string? 'style)) + ) + ) + +(define generic-All-properties + (cons "all" (list (list 'fontSize number? 'fontsize)))) + +(define generic-rest-properties + (cons "Rest" (list (list 'restStyle string? 'reststyle)))) + +(define generic-note-column-properties + (cons "Note_column" + (list + (list 'horizontalNoteShift number? 'horizontal_shift) + (list 'forceHorizontalShift number? 'force_hshift) + ))) + +(define generic-slur-properties + (cons "Slur" + (list + (list 'slurDash number? 'dashed)))) + +(define generic-timesig-properties + (cons "Time_signature" + (list + (list 'timeSignatureStyle string? 'sigstyle)))) + +(define generic-voice-properties + (list + generic-stem-properties + generic-rest-properties + generic-slur-properties + generic-beam-properties + generic-text-properties + generic-note-column-properties + generic-All-properties + )) + +(define generic-grace-properties generic-voice-properties) +(define generic-staff-properties + (list + generic-bar-properties + generic-timesig-properties + generic-clef-properties + generic-All-properties + ) + ) + +(define generic-thread-properties + (list generic-All-properties)) + diff --git a/scripts/convert-mudela.py b/scripts/convert-mudela.py index 097642bf97..b23b0e6cdd 100644 --- a/scripts/convert-mudela.py +++ b/scripts/convert-mudela.py @@ -112,7 +112,7 @@ def show_rules (file): ############################ if 1: # need new a namespace - def conv (lines): + def conv (str): if re.search ('\\\\octave', str): sys.stderr.write ('\nNot smart enough to convert \\octave') raise FatalConversionError() @@ -124,10 +124,10 @@ if 1: # need new a namespace if 1: # need new a namespace - def conv (lines): - x = re.sub ('\\\\textstyle([^;]+);', + def conv (str): + str = re.sub ('\\\\textstyle([^;]+);', '\\\\property Lyrics . textstyle = \\1', str) - x = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str) + str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str) return str @@ -136,9 +136,9 @@ if 1: # need new a namespace if 1: - def conv (lines): - x = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str) - x = re.sub ('\\\\meter', '\\\\time',str) + def conv (str): + str = re.sub ('\\\\musical_pitch', '\\\\musicalpitch',str) + str = re.sub ('\\\\meter', '\\\\time',str) return str @@ -147,7 +147,7 @@ if 1: '\\meter -> \\time')) if 1: - def conv (lines): + def conv (str): return lines conversions.append ( @@ -155,10 +155,10 @@ if 1: if 1: - def conv (lines): - x = re.sub ('\\\\accidentals', '\\\\keysignature',str) - x = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str) - x = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str) + def conv (str): + str = re.sub ('\\\\accidentals', '\\\\keysignature',str) + str = re.sub ('specialaccidentals *= *1', 'keyoctaviation = 0',str) + str = re.sub ('specialaccidentals *= *0', 'keyoctaviation = 1',str) return str @@ -167,7 +167,7 @@ if 1: 'specialaccidentals -> keyoctaviation')) if 1: - def conv(lines): + def conv(str): if re.search ('\\\\header', lines): sys.stderr.write ('\nNot smart enough to convert to new \\header format') return lines @@ -175,33 +175,33 @@ if 1: conversions.append ((1,0,2), conv, '\\header { key = concat + with + operator }') if 1: - def conv(lines): - x = re.sub ('\\\\melodic', '\\\\notes',str) + def conv(str): + str = re.sub ('\\\\melodic', '\\\\notes',str) return str conversions.append ((1,0,3), conv, '\\melodic -> \\notes') if 1: - def conv(lines): - x = re.sub ('default_paper *=', '',str) - x = re.sub ('default_midi *=', '',x) + def conv(str): + str = re.sub ('default_paper *=', '',str) + str = re.sub ('default_midi *=', '',x) return str conversions.append ((1,0,4), conv, 'default_{paper,midi}') if 1: - def conv(lines): - x = re.sub ('ChoireStaff', 'ChoirStaff',str) - x = re.sub ('\\output', 'output = ',str) + def conv(str): + str = re.sub ('ChoireStaff', 'ChoirStaff',str) + str = re.sub ('\\output', 'output = ',str) return str conversions.append ((1,0,5), conv, 'ChoireStaff -> ChoirStaff') if 1: - def conv(lines): + def conv(str): if re.search ('[a-zA-Z]+ = *\\translator',str): sys.stderr.write ('\nNot smart enough to change \\translator syntax') raise FatalConversionError() @@ -211,46 +211,46 @@ if 1: if 1: - def conv(lines): - x = re.sub ('\\\\lyric', '\\\\lyrics',str) + def conv(str): + str = re.sub ('\\\\lyric', '\\\\lyrics',str) return str conversions.append ((1,0,7), conv, '\\lyric -> \\lyrics') if 1: - def conv(lines): - x = re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str) - x = re.sub ('\\[/3+', '\\\\times 2/3 { [',str) - x = re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str) - x = re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str) - x = re.sub ('\\\\\\]([0-9/]+)', '}', str) - x = re.sub ('\\\\\\]', '}',str) - x = re.sub ('\\]([0-9/]+)', '] }', str) + def conv(str): + str = re.sub ('\\\\\\[/3+', '\\\\times 2/3 { ',str) + str = re.sub ('\\[/3+', '\\\\times 2/3 { [',str) + str = re.sub ('\\\\\\[([0-9/]+)', '\\\\times \\1 {',str) + str = re.sub ('\\[([0-9/]+)', '\\\\times \\1 { [',str) + str = re.sub ('\\\\\\]([0-9/]+)', '}', str) + str = re.sub ('\\\\\\]', '}',str) + str = re.sub ('\\]([0-9/]+)', '] }', str) return str conversions.append ((1,0,10), conv, '[2/3 ]1/1 -> \\times 2/3 ') if 1: - def conv(lines): + def conv(str): return lines conversions.append ((1,0,12), conv, 'Chord syntax stuff') if 1: - def conv(lines): + def conv(str): - x = re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str) + str = re.sub ('<([^>~]+)~([^>]*)>','<\\1 \\2> ~', str) return str conversions.append ((1,0,13), conv, ' c -> ~ c') if 1: - def conv(lines): - x = re.sub ('<\\[','[<', str) - x = re.sub ('\\]>','>]', str) + def conv(str): + str = re.sub ('<\\[','[<', str) + str = re.sub ('\\]>','>]', str) return str @@ -258,9 +258,9 @@ if 1: if 1: - def conv(lines): - x = re.sub ('\\\\type','\\\\context', str) - x = re.sub ('textstyle','textStyle', str) + def conv(str): + str = re.sub ('\\\\type','\\\\context', str) + str = re.sub ('textstyle','textStyle', str) return str @@ -268,7 +268,7 @@ if 1: if 1: - def conv(lines): + def conv(str): if re.search ('\\\\repeat',str): sys.stderr.write ('\nNot smart enough to convert \\repeat') raise FatalConversionError() @@ -278,10 +278,10 @@ if 1: '\\repeat NUM Music Alternative -> \\repeat FOLDSTR Music Alternative') if 1: - def conv(lines): - x = re.sub ('SkipBars','skipBars', str) - x = re.sub ('fontsize','fontSize', str) - x = re.sub ('midi_instrument','midiInstrument', x) + def conv(str): + str = re.sub ('SkipBars','skipBars', str) + str = re.sub ('fontsize','fontSize', str) + str = re.sub ('midi_instrument','midiInstrument', x) return str @@ -290,10 +290,10 @@ if 1: if 1: - def conv(lines): - x = re.sub ('tieydirection','tieVerticalDirection', str) - x = re.sub ('slurydirection','slurVerticalDirection', str) - x = re.sub ('ydirection','verticalDirection', x) + def conv(str): + str = re.sub ('tieydirection','tieVerticalDirection', str) + str = re.sub ('slurydirection','slurVerticalDirection', str) + str = re.sub ('ydirection','verticalDirection', x) return str @@ -302,8 +302,8 @@ if 1: if 1: - def conv(lines): - x = re.sub ('hshift','horizontalNoteShift', str) + def conv(str): + str = re.sub ('hshift','horizontalNoteShift', str) return str @@ -312,8 +312,8 @@ if 1: if 1: - def conv(lines): - x = re.sub ('\\\\grouping[^;]*;','', str) + def conv(str): + str = re.sub ('\\\\grouping[^;]*;','', str) return str @@ -322,8 +322,8 @@ if 1: if 1: - def conv(lines): - x = re.sub ('\\\\wheel','\\\\coda', str) + def conv(str): + str = re.sub ('\\\\wheel','\\\\coda', str) return str @@ -331,9 +331,9 @@ if 1: '\\wheel -> \\coda') if 1: - def conv(lines): - x = re.sub ('keyoctaviation','keyOctaviation', str) - x = re.sub ('slurdash','slurDash', str) + def conv(str): + str = re.sub ('keyoctaviation','keyOctaviation', str) + str = re.sub ('slurdash','slurDash', str) return str @@ -341,8 +341,8 @@ if 1: 'slurdash -> slurDash, keyoctaviation -> keyOctaviation') if 1: - def conv(lines): - x = re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str) + def conv(str): + str = re.sub ('\\\\repeat *\"?semi\"?','\\\\repeat "volta"', str) return str @@ -351,8 +351,8 @@ if 1: if 1: - def conv(lines): - x = re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str) + def conv(str): + str = re.sub ('\"?beamAuto\"? *= *\"?0?\"?','noAutoBeaming = "1"', str) return str @@ -360,8 +360,8 @@ if 1: 'beamAuto -> noAutoBeaming') if 1: - def conv(lines): - x = re.sub ('automaticMelismas', 'automaticMelismata', str) + def conv(str): + str = re.sub ('automaticMelismas', 'automaticMelismata', str) return str @@ -369,8 +369,8 @@ if 1: 'automaticMelismas -> automaticMelismata') if 1: - def conv(lines): - x = re.sub ('dynamicDir', 'dynamicDirection', str) + def conv(str): + str = re.sub ('dynamicDir', 'dynamicDirection', str) return str @@ -394,7 +394,7 @@ def do_conversion (infile, from_version, outfile, to_version): conv_list = get_conversions (from_version, to_version) sys.stderr.write ('Applying conversions: ') - str = infile.read (-1) + str = infile.read () last_conversion = () try: for x in conv_list: @@ -408,13 +408,15 @@ def do_conversion (infile, from_version, outfile, to_version): if last_conversion: sys.stderr.write ('\n') new_ver = '\\\\version \"%s\"' % tup_to_str (last_conversion) - if re.search (mudela_version_re_str): + if re.search (mudela_version_re_str, str): str = re.sub (mudela_version_re_str,new_ver , str) else: str = new_ver + '\n' + str outfile.write(str) + return last_conversion + class UnknownVersion: pass @@ -450,8 +452,7 @@ def do_one_file (infile_name): else: outfile = sys.stdout - - do_conversion (infile, from_version, outfile, to_version) + touched = do_conversion (infile, from_version, outfile, to_version) if infile_name: infile.close () @@ -459,7 +460,7 @@ def do_one_file (infile_name): if outfile_name: outfile.close () - if __main__.edit: + if __main__.edit and touched: try: os.remove(infile_name + '~') except: diff --git a/stepmake/bin/package-zet.sh b/stepmake/bin/package-zet.sh index 0f997ad74c..b970f50b48 100755 --- a/stepmake/bin/package-zet.sh +++ b/stepmake/bin/package-zet.sh @@ -33,10 +33,10 @@ fi # mkdir -p $prefix/bin result=`echo $PATH | grep "$HOME/usr/bin"` -if [ "x$result" = "x" ];then +if [ "x$result" = "x" ]; then PATH=$PATH:$HOME/usr/bin fi result=`echo $PATH | grep "$sources/$package/bin"` -if [ "x$result" = "x" ];then +if [ "x$result" = "x" ]; then PATH=$PATH:$sources/$package/bin fi diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 7b013a29e7..82e8e5b101 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -20,3 +20,4 @@ $(outdir)/%.texi: %.texi cp $< $@ + diff --git a/stepmake/stepmake/yolily-topdoc-targets.make b/stepmake/stepmake/yolily-topdoc-targets.make index 5aadd24bf2..b60d82b2d3 100644 --- a/stepmake/stepmake/yolily-topdoc-targets.make +++ b/stepmake/stepmake/yolily-topdoc-targets.make @@ -1,6 +1,6 @@ # Yolily_topdoc_targets.make -default: do-doc +default: local-doc # urg $(outdir)/%.html: %.yo