lilypond-devel
[Top][All Lists]
Advanced

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

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


From: Reinhold Kainhofer
Subject: Calling functions defined in a .scm file in a .ly file
Date: Sun, 30 Aug 2009 14:44:50 +0200
User-agent: KMail/1.11.4 (Linux/2.6.28-15-generic; KDE/4.2.4; i686; ; )

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

Example is attached (it uses my patch  http://codereview.appspot.com/112044)

Thanks a lot,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

Attachment: calling-function-in-scm.ly
Description: Text Data


reply via email to

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