bug-lilypond
[Top][All Lists]
Advanced

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

Re: Renaissance lute and tab


From: Janek Warchoł
Subject: Re: Renaissance lute and tab
Date: Mon, 25 Jul 2011 00:36:20 +0200

2011/7/25 Neil Puttock <address@hidden>:
> 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.

Ah, so this works:

\new TabStaff {
 \set TabStaff.stringTunings = #`(   ,(ly:make-pitch 0 0 1/2)
                                     ,(ly:make-pitch 0 3 1/4)
                                     ,(ly:make-pitch 0 5 -1/2))
 cis' fih' as'
}

> 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))));
> }

Hmm, does this work or is this just a proof-of-concept?  I wasn't able
to determine it after reading
http://www.gnu.org/software/guile/manual/html_node/Exactness.html
If this works, should i wrap it into a patch and put it on Rietveld or
will you do it yourself?

thanks,
Janek



reply via email to

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