+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
include $(depth)/make/stepmake.make
-default: do-doc
+default: local-doc
local-WWW: copy-for-me
include $(depth)/make/stepmake.make
-default: do-doc
+default: local-doc
local-WWW: $(addprefix $(outdir)/, $(addsuffix .txt, $(TEXTS)))
include $(depth)/make/stepmake.make
-default: do-doc dist-plain
+default: local-doc dist-plain
$(outdir)/%.texi: %.texi
m4 -DTOPLEVEL_VERSION=$(TOPLEVEL_VERSION) < $< > $@
@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
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.
@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
@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
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
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.
========
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
.* 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
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.
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
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.
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)
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
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
ostream &
operator << (ostream &, Rational);
+const Rational infinity_rat = INT_MAX;
+
#endif // RATIONAL_HH
#include "string.hh"
#include "real.hh"
+#include "protected-scm.hh"
#error
/// Perl -like scalar type.
--- /dev/null
+\score {
+ \notes \relative c'' \context GrandStaff <
+ \context Staff = up { c4 c4 }
+ \context Staff = down { \property Staff. staffLineLeading = #5.5 c4
+ <c8 d f g>
+ }
+>
+}
--- /dev/null
+
+g''4 \property Voice.stemLength = #14 g4 \property Voice.stemLength = #3 g4 g,,4
*/
SCM grsp = get_property ("graceAccidentalSpace", 0);
- if (SCM_NUMBERP(grsp))
+ if (gh_number_p(grsp))
{
/*
ugh.
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:
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;
}
{
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));
}
}
create_items (0);
text_p_->text_str_ = to_str (time->bars_i_);
- text_p_->style_str_ = "roman";
}
}
*/
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))
if (inf.origin_trans_l_arr_.size () != 1)
return;
- do_acknowledge_element (i);
+ attach_script_to_item (i);
}
}
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);
}
/* 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]));
}
{
slope_f_ = 0;
left_y_ = 0;
- quantisation_ = NORMAL;
multiple_i_ = 0;
}
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;
}
+ 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 ();
Real quanty_f = 0.0;
- /* UGR. ICE in 2.8.1; bugreport filed. */
Array<Real> allowed_fraction (3);
allowed_fraction[0] = 0;
allowed_fraction[1] = (beam_f / 2 + staffline_f / 2);
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);
/*
----------------------------------------------------------
Real beamdy_f = beamdx_f * slope_f_ * internote_f;
Array<Real> allowed_position;
- if (quantisation_ <= NORMAL)
+ if (q == gh_symbol2scm ("normal"))
{
if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
allowed_position.push (straddle);
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))
{
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"));
}
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));
}
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;
}
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);
}
prop = get_property ("dynamicDirection", 0);
- if (SCM_NUMBERP(prop))
+ if (gh_number_p(prop))
{
staff_side_p_->dir_ = to_dir (prop);
}
}
prop = get_property ("dynamicPadding", 0);
- if (SCM_NUMBERP(prop))
+ if (gh_number_p(prop))
{
staff_side_p_->set_elt_property (padding_scm_sym, prop);
}
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);
}
Font_size_engraver::Font_size_engraver ()
{
- size_i_ = 0;
+ size_ = SCM_EOL;
}
void
{
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);
/**
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.
*/
should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
+slope_quantisation: 'none, 'normal or 'traditional
*/
class Beam : public Directional_spanner {
/// 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_;
#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.
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 ();
#include "lily-proto.hh"
#include "virtual-methods.hh"
#include "dictionary.hh"
+#include "scm-hash.hh"
/**
Definition of how to output mudela.
Scope *scope_p_;
Array<String> filename_str_arr_;
+ Scheme_hash_table default_properties_;
Music_output_def (Music_output_def const&);
Music_output_def ();
Real get_realvar (SCM symbol) const;
Real get_var (String id) const;
- SCM get_scm_var (SCM sym) const;
void reinit ();
Paper_def ();
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();\
{
public:
String text_str_;
- String style_str_;
- Text_item ();
VIRTUAL_COPY_CONS (Score_element);
protected:
virtual void do_print () const;
public:
Time_signature () ;
Array<int> args_;
- String time_sig_type_str_;
-
VIRTUAL_COPY_CONS(Score_element);
};
Cons_list<Translator> 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_;
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:
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
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_));
{
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);
}
}
}
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;
+}
}
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);
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 ())
}
}
-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<Real_identifier*> (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
$$->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);
--- /dev/null
+/*
+ property-engraver.cc -- implement Property engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "lily-guile.hh"
+#include "engraver.hh"
+#include "protected-scm.hh"
+#include "dictionary.hh"
+#include "score-element.hh"
+
+class Property_engraver : public Engraver
+{
+ Dictionary<Protected_scm> 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);
bool
isdir_b (SCM s)
{
- if (SCM_NUMBERP (s))
+ if (gh_number_p (s))
{
int i = gh_int2scm (s);
return i>= -1 && i <= 1;
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_));
}
}
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));
}
{
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;
}
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
}
#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;
+}
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 ;
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);
}
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);
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);
}
// 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);
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);
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");
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);
+ }
}
-
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 "";
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);
}
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);
}
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);
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;
}
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))
{
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
{
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);
{
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;
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<int> 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
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);
}
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)
}
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;
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);
}
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 ();
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);
}
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"
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
RhythmicStaffContext=\translator{
\type "Engraver_group_engraver";
numberOfStaffLines = #1
+ \consists "Property_engraver";
+
+ Generic_property_list = #generic-staff-properties
barSize = \staffheight;
\consists "Pitch_squash_engraver";
};
\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";
\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";
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";
\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;
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;
};
\accepts "GrandStaff";
\accepts "ChoirStaff";
\accepts "PianoStaff";
+
+ clefBreakPriority = #-2
+ breathingSignBreakPriority = #-4
};
\translator { \ScoreContext }
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
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
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 <hanwen@cs.uu.nl>
#endif
#include "proto.hh"
-#include "moment.hh"
+#include "rational.hh"
#include "midi2ly-proto.hh"
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"
#include "proto.hh"
#include "cons.hh"
-#include "moment.hh"
+#include "rational.hh"
#include "midi2ly-proto.hh"
#include "midi-parser.hh"
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:
Mudela_item* parse_event (Mudela_column* col_l);
void parse_header ();
- Moment at_mom_;
+ Rational at_mom_;
Byte running_byte_;
Cons_list<Mudela_note> open_note_l_list_;
Mudela_staff* mudela_staff_p_;
#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> mudela_item_l_list_;
- Moment at_mom_;
+ Rational at_mom_;
Mudela_score* mudela_score_l_;
};
#include "midi2ly-proto.hh"
#include "string.hh"
-#include "moment.hh"
+#include "rational.hh"
#include "duration.hh"
// should these:
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;
int den_i ();
int num_i ();
virtual String str ();
- Moment bar_mom ();
+ Rational bar_mom ();
private:
Real sync_f_;
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?
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_;
};
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
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 ();
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> mudela_voice_p_list_;
Cons_list<Mudela_item> mudela_item_p_list_;
#include "midi2ly-proto.hh"
#include "string.hh"
-#include "scalar.hh"
+//#include "scalar.hh"
/// Lily output
class Mudela_stream {
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:
(c) 1997--1998 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "moment.hh"
+#include "rational.hh"
#include "source-file.hh"
#include "source.hh"
#include "midi2ly-global.hh"
Midi_score_parser::find_earliest_i (Link_array<Midi_track_parser>& 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 )
{
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;
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 )
delete track_info_p_;
}
-Moment
+Rational
Midi_track_parser::at_mom ()
{
return at_mom_;
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);
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*
#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;
mudela_item_l_list_.append (new Cons<Mudela_item> (mudela_item_l, 0));
}
-Moment
+Rational
Mudela_column::at_mom()
{
return at_mom_;
{
}
-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
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
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_);
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;
return Duration_convert::mom2_dur (mom_);
}
-Moment
+Rational
Mudela_skip::duration_mom ()
{
return Duration_convert::dur2_mom (duration ());
: 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;
}
}
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;
}
// copyright 1997 Jan Nieuwenhuizen <janneke@gnu.org>
#include <assert.h>
-#include "moment.hh"
+#include "rational.hh"
#include "duration.hh"
#include "duration-convert.hh"
#include "midi2ly-global.hh"
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;
}
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)
}
Mudela_column*
-Mudela_score::get_column_l (Moment mom)
+Mudela_score::get_column_l (Rational mom)
{
int i;
Mudela_column *c=0;
&& (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";
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)
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)
#include <assert.h>
#include <ctype.h>
-#include "moment.hh"
+#include "rational.hh"
#include "duration-convert.hh"
#include "string-convert.hh"
#include "midi2ly-proto.hh"
Mudela_voice* voice_p = new Mudela_voice (this);
mudela_voice_p_list_.append (new Killing_cons<Mudela_voice> (voice_p, 0));
- // Moment mom = items.top ()->at_mom ();
- Moment mom = 0;
+ // Rational mom = items.top ()->at_mom ();
+ Rational mom = 0;
for (Cons<Mudela_item>** pp = &items.head_; *pp;)
{
Cons<Mudela_item>* 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));
trackbody += "\\" + voicename + "\n";
- mudela_stream_r << "\n";
+ mudela_stream_r << '\n';
i->car_->output (mudela_stream_r);
c++;
}
}
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)
#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;
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;
// 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;
}
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)
{
header();
}
-Mudela_stream::~Mudela_stream()
+Mudela_stream::~Mudela_stream ()
{
delete os_p_;
if (indent_i_)
}
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())
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<Mudela_item>* 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, ' ');
--- /dev/null
+
+(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))
+
############################
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()
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
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
'\\meter -> \\time'))
if 1:
- def conv (lines):
+ def conv (str):
return lines
conversions.append (
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
'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
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()
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, '<a ~ b> c -> <a b> ~ 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
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
if 1:
- def conv(lines):
+ def conv(str):
if re.search ('\\\\repeat',str):
sys.stderr.write ('\nNot smart enough to convert \\repeat')
raise FatalConversionError()
'\\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
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
if 1:
- def conv(lines):
- x = re.sub ('hshift','horizontalNoteShift', str)
+ def conv(str):
+ str = re.sub ('hshift','horizontalNoteShift', str)
return str
if 1:
- def conv(lines):
- x = re.sub ('\\\\grouping[^;]*;','', str)
+ def conv(str):
+ str = re.sub ('\\\\grouping[^;]*;','', str)
return str
if 1:
- def conv(lines):
- x = re.sub ('\\\\wheel','\\\\coda', str)
+ def conv(str):
+ str = re.sub ('\\\\wheel','\\\\coda', str)
return str
'\\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
'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
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
'beamAuto -> noAutoBeaming')
if 1:
- def conv(lines):
- x = re.sub ('automaticMelismas', 'automaticMelismata', str)
+ def conv(str):
+ str = re.sub ('automaticMelismas', 'automaticMelismata', str)
return str
'automaticMelismas -> automaticMelismata')
if 1:
- def conv(lines):
- x = re.sub ('dynamicDir', 'dynamicDirection', str)
+ def conv(str):
+ str = re.sub ('dynamicDir', 'dynamicDirection', str)
return str
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:
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
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 ()
if outfile_name:
outfile.close ()
- if __main__.edit:
+ if __main__.edit and touched:
try:
os.remove(infile_name + '~')
except:
#
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
# Yolily_topdoc_targets.make
-default: do-doc
+default: local-doc
# urg
$(outdir)/%.html: %.yo