lilypond-user
[Top][All Lists]
Advanced

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

Re: Renaissance lute and tab


From: Neil Puttock
Subject: Re: Renaissance lute and tab
Date: Sun, 24 Jul 2011 23:23:10 +0100

2011/7/24 Janek Warchoł <address@hidden>:
> Oops, sorry for the late answer!
>
> 2011/7/18 Mario Moles <address@hidden>
>> even if I correct the syntax (without "= c", "= d", "= f") the error remains.
>
> I'm surprised too.
> I've discovered that when you use words for alteration (i.e.
> ,(ly:make-pitch 0 1 FLAT)  for des,  ,(ly:make-pitch 0 3 SHARP)  for
> fis) everything seems to work.
> You can also use \contextStringTuning described in Notation Reference.
> I don't have much experience with ly:make-pitch not tab tunings, so
> maybe i'm missing something, but i'm forwarding this to bugreports.
>
> %%  this throws a GUILE error:
> \version "2.15.5"
> \new TabStaff {
>  \set TabStaff.stringTunings = #`(   ,(ly:make-pitch 0 0 0.5)
>                                      ,(ly:make-pitch 0 3 0.25)
>                                      ,(ly:make-pitch 0 5 -0.5))
>  cis' fih' as'
> }

This is a bug in ly_scm2rational.

Rational
ly_scm2rational (SCM r)
{
  return Rational (scm_to_int64 (scm_numerator (r)),
                   scm_to_int64 (scm_denominator (r)));
}

This assumes that a scheme rational will be a fraction, since
scm_to_int64 expects an integer.  If we pass a floating point rational
(like the alterations in ly:make-pitch above), scm_numerator and
scm_denominator return floating point objects.

A possible fix would be to use inexact->exact to tidy up the arguments
before converting to integers:

Rational
ly_scm2rational (SCM r)
{
  return Rational (scm_to_int64 (scm_inexact_to_exact (scm_numerator (r))),
                         scm_to_int64 (scm_inexact_to_exact
(scm_denominator (r))));
}

Cheers,
Neil



reply via email to

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