lilypond-devel
[Top][All Lists]
Advanced

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

Re: Calling functions defined in a .scm file in a .ly file


From: Nicolas Sceaux
Subject: Re: Calling functions defined in a .scm file in a .ly file
Date: Sun, 30 Aug 2009 20:59:56 +0200

Le 30 août 09 à 14:44, Reinhold Kainhofer a écrit :

I'm struggling with how to access a function that is define- public'ed in an scm file. In particular, the file define-music-display-methods.scm defines the note-name->lily-string function to return a human-readable representation of the given pitch. Now, I want to call that from a custom function that I'm definin in my own .ly file. How can I call that note-name->lily- string function?

That function does not seem to be available by default (judging from the code,
it is in the display-lily module...).

I tried inserting
 #(use-module (scm display-lily))
in my .ly file, but that didn't work at all.

The note-name->lily-string function is not public in (scm display-lily)
module. Export the symbol, and you will be able to call the function
from your .ly file after the #(use-modules (scm display-lily))


Using
 #(ly:load "define-music-display-methods.scm")
makes note-name->lily-string available, but then $defaultlayout can no longer
be found?!?

When you load that file, you change the current module in your
.ly file, that's why $defaultlayout cannot be found: it is not
bound in the (scm display-lily) module.

Nicolas





reply via email to

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