lilypond-user
[Top][All Lists]
Advanced

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

Re: Refer to a staff relatively, not by name


From: Vaughan McAlley
Subject: Re: Refer to a staff relatively, not by name
Date: Mon, 1 Apr 2013 19:55:05 +1100

On 31 March 2013 22:36, Urs Liska <address@hidden> wrote:
>
> Is it possible to refer to a staff relative to the current staff and not by 
> its name?
>
> So, is it possible to write something like
>
> \change Staff = "previous/next or "higher/lower"
>
> instead of
>
> \change Staff = "Explicit-name-of-staff"
>
> inside a PianoStaff?
>
> I'd be interested in creating a generic command like \staffUp or \staffDown.
>
> Best
> Urs
>

I have a piece for four keyboards where a motif that changes staff
note-by-note makes its way through all of the keyboards. Something
like this would be useful...

If there are normally a limited number of keyboards in any one piece,
maybe the following pseudo-code might work:

function ChangeStaff()
  current = GetCurrentStaff()
  if current == "PianoOneRH" then
    newStaff = "PianoOneLH"
  elseif current == "PianoOneLH" then
    newStaff = "PianoOneRH"
  elseif current == "PianoTwoRH" then
    newStaff = "PianoTwoLH"
  elseif current == "PianoTwoLH" then
    newStaff = "PianoTwoRH"
  end
  SetCurrentStaff(newStaff)
end


It would depend on the name of the current staff being available to
Scheme, which I don’t imagine would be a problem.

Vaughan



reply via email to

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