lilypond-user
[Top][All Lists]
Advanced

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

Re: Function for note string to fraction?


From: Peter Bjuhr
Subject: Re: Function for note string to fraction?
Date: Tue, 20 May 2014 09:49:13 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Thanks a lot!

On 2014-05-20 00:50, Thomas Morley wrote:
Is it possible to include and use
>'parse-simple-duration' in a local script (without copy and pasting it)?

Well, I would have no problem to c/p 'parse-simple-duration', though
yes, it is possible:

#(define (note-to-moment notestr)
    (let ((parsed ((@@ (lily) parse-simple-duration ) notestr)))
      (ly:duration-length
         (ly:make-duration (car parsed) (cadr parsed)))))

#(write (note-to-moment "4."))

--> #<Mom 3/8>


Though, quoting guile-manual:
— syntax: @@ module-name binding-name
Refer to the binding named binding-name in module module-name. The
binding must not have been exported by the module. This syntax is only
intended for debugging purposes or as a last resort.

!!

Cheers,
   Harm

Part of the problem with copy and pasting was that it didn't work. I got the final piece of the puzzle though by Mark.

I would still prefer this solution, but what you're saying is that it isn't really suitable to use this kind of syntax and that it is better to copy-and-paste!?

Best
Peter



reply via email to

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