lilypond-user
[Top][All Lists]
Advanced

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

Re: Using a variable with \relative


From: David Kastrup
Subject: Re: Using a variable with \relative
Date: Sun, 11 Sep 2011 19:54:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Basso Ridiculoso <address@hidden> writes:

> Apoligies about the nbsp's, not sure if it was Safari or gmail that
> put those in there.
>
> Is there a way to access the pitch variable and put that where I have
> the \x so something like (and sorry about the javascript-y syntax) but
> something like
>
> x.pitch (but in scheme syntax of course)
>
> so
>
> \relative #( x.pitch #) {.....} or however it would look.
>
> I am tying to generate a bunch of exercise files of which there will
> be hundreds (and potentially thousands) of groups of notes and I want
> them arranged a certain way. And the note that I want the groups to be
> relative to changes based on the note that starts the group, and there
> are far too many to put the specific relative note in by hand. So I
> was hoping for a way to pass the entire group of notes into a function
> and use whatever note starts that group as the \relative note by way
> of a variable.

\relative f

will use whatever note starts that group as the \relative note (think
about it!).

If you want to turn this into a music function, you can to this like
myrelative =
#(define-music-function (parser location music) (ly:music?)
  #{ \relative f $music #})

Does that do what you want?

-- 
David Kastrup




reply via email to

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