lilypond-user
[Top][All Lists]
Advanced

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

Re: converting decimal numbers into rational in scheme functions


From: Janek Warchoł
Subject: Re: converting decimal numbers into rational in scheme functions
Date: Wed, 18 Sep 2013 02:20:31 +0200

2013/9/18 David Kastrup <address@hidden>:
> Janek Warchoł <address@hidden> writes:
>> Now, i would like to be able to supply a decimal number and have it
>> converted to a rational number (i.e. a fraction, which can be easily
>> converted to a moment)
>
> How did you search?  It's right in the GUILE manual where one would
> expect, with rational numbers.

I've grepped through LilyPond sources for various keywords, and looked
around definitions of other conversions.
I guess i should add guile manual to my RTFM list.

In the meantime, i have trouble with converting from a fraction to a
moment - this returns an error:

\version "2.16.2"

foof =
#(define-music-function (parser location) ()
   #{
     \override Score.SpacingSpanner.common-shortest-duration =
     #(fraction->moment (1 32))
   #})

\new Staff {
  \foof
  c'4 d' e' f'
}

i'm probably doing something stupid here...

best,
Janek

PS i'll try to answer the 'github email' tomorrow.



reply via email to

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