bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with scaled durations


From: David Kastrup
Subject: Re: Problem with scaled durations
Date: Fri, 04 Jan 2013 10:15:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

"Trevor Daniels" <address@hidden> writes:

> David Kastrup wrote Friday, January 04, 2013 8:21 AM
>
>> Oscar Dub <address@hidden> writes:
>>>
>>> From a user perspective, I thought it might be nice for the compiler
>>> to send out some kind of error or warning message. Currently there's
>>> no sign of anything wrong except the final output. Is this valid
>>> enough an issue to be worth a quick bug report?
>> 
>> Overflow in C++ Rational arithmetic would take effort to reliably and
>> would complicate the code base considerably.  At some point of time, the
>> Rational class will likely get replaced with Scheme rationals (which
>> have "arbitrary precision") and the problem will go away.
>
> Until then we ought to document this as a "Known issue" in NR 1.2.1
> under Scaling durations.
>
> Copying to Bug list so bug squad can raise a Doc issue if they agree.

I disagree.  LilyPond uses "Rational" in a number of places, like for
alterations/accidentals/tunings, time management in general, and... uh.

git grep Rational lily/include

lily/include/beaming-pattern.hh:  Rational factor_;
lily/include/beaming-pattern.hh:  Beam_rhythmic_element (Moment, int, bool, 
Rational, bool);
lily/include/beaming-pattern.hh:  void add_stem (Moment d, int beams, bool 
invisible, Rational factor, bool tuplet_starrt);
lily/include/beaming-pattern.hh:  Rational factor (int idx) const;
lily/include/context.hh:Rational measure_length (Context const *context);
lily/include/duration.hh:  Duration (Rational, bool scale);
lily/include/duration.hh:  Duration compressed (Rational) const;
lily/include/duration.hh:  Rational get_length () const;
lily/include/duration.hh:  Rational factor () const { return factor_; }
lily/include/duration.hh:  Rational factor_;
lily/include/grace-fixup.hh:  Rational grace_start_;
lily/include/lily-guile.hh:Rational ly_scm2rational (SCM);
lily/include/lily-guile.hh:SCM ly_rational2scm (Rational);
lily/include/lily-guile.hh:Rational robust_scm2rational (SCM, Rational);
lily/include/lily-proto.hh:class Rational;
lily/include/moment.hh:  Moment (Rational, Rational);
lily/include/moment.hh:  Moment (Rational m);
lily/include/moment.hh:  Rational main_part_;
lily/include/moment.hh:  Rational grace_part_;
lily/include/pitch.hh:  Rational alteration_;
lily/include/pitch.hh:  Rational get_alteration () const;
lily/include/pitch.hh:  Pitch (int octave, int notename, Rational accidental);
lily/include/pitch.hh:  Rational tone_pitch () const;
lily/include/pitch.hh:extern Rational DOUBLE_FLAT_ALTERATION;
lily/include/pitch.hh:extern Rational THREE_Q_FLAT_ALTERATION;
lily/include/pitch.hh:extern Rational FLAT_ALTERATION;
lily/include/pitch.hh:extern Rational SEMI_FLAT_ALTERATION;
lily/include/pitch.hh:extern Rational NATURAL_ALTERATION;
lily/include/pitch.hh:extern Rational SEMI_SHARP_ALTERATION;
lily/include/pitch.hh:extern Rational SHARP_ALTERATION;
lily/include/pitch.hh:extern Rational THREE_Q_SHARP_ALTERATION;
lily/include/pitch.hh:extern Rational DOUBLE_SHARP_ALTERATION;
lily/include/scale.hh:  Scale (vector<Rational> const &);
lily/include/scale.hh:  Rational tones_at_step (int step, int octave) const;
lily/include/scale.hh:  Rational step_size (int step) const;
lily/include/scale.hh:  vector<Rational> step_tones_;
lily/include/spacing-options.hh:  Rational global_shortest_;
lily/include/spacing-options.hh:  Real get_duration_space (Rational d) const;
lily/include/spacing-spanner.hh:  static Rational effective_shortest_duration 
(Grob *me, vector<Grob *> const &all);
lily/include/timing-translator.hh:  Rational measure_length () const;

Uh, possibly something in relation to beaming.  That would seem to be
about it.  But at any rate, there are oodles of places in LilyPond where
you can trigger silent overflow in non-Guile types.  Totally not
restricted to duration scales.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]