On 7/31/11 3:32 PM, "Wols Lists" <[email protected]> wrote:
> This is mostly saying "where do I start", so hints and clues are fine > ... but what I want to do is have syntax along the lines of > > \key C \major > \capokey A > > ie capokey comes after key (and relies on being able to find out that > information). > > The problem I've got is that I guess I don't want to do a markup if I > can avoid it (I want this to print the relevant text, and it goes above > all the clef/timesig/keysig clutter at the start of the piece). > > And I want it to calculate and set capopitch at the same time, but > that's probably trivial compared to getting it to print the text. > > So basically, it's do I need to return the text as a markup? If not, > what? If yes, what do I attach it to, and how? There are two fundamentally different ways to approach this. The first is to return the text as a markup. You could attach it to nothing if it were a top-level markup. But I don't know if that's feasible or not. If you want to do it this way, you would probably define \capoKey as a music function. The second is to create a capo_engraver that will create a Capo grob. I think the second is the best way to do it, but it will be more complex. If I were doing it, I'd probably start with the music function. > > I'm guessing it's best written in scheme, so also there's which > directory (and what file) should I put the code in, and how do I get > lilypond to autoload it? Probably written in scheme, but in a .ly file, using define-music-function. Most likely ly/music-functions-init.ly. Any helper functions that are pure scheme would probably be in scm/chord-names.scm. They're already autoloaded. scm/lily.scm handles the autoloading of the .scm files. See line 400. HTH, Carl --- ---- Join the Frogs!
