Request for a cross-staff easy function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Request for a cross-staff easy function

Paolo Prete-3
Hi all,

I think this function would be very useful for solving the limitations of the current cross-staff interface:

crossStaffExpr =  #(define-music-function (parser location staffUpMusic  staffDownMusic beamPosition) (ly:music? ly:music? number?) .....

Example:

\crossStaffExpr =  {  c '[   d'    g'   s    }
                             {  s      s     f '   a']  } # 'BeamUp

(the third parameter can be: BeamUp, BeamDown, or BeamBetween, where BeamBetween places the beam between the two staves; BeamBetween can only be used if there are no cross-staff chords)

I ask you if there are any generous volunteers who want to implement it, in case it requires not so many lines of code.
in case it requires many lines of code, is it worth opening a ticket in the dev ml?

Thanks in advance

P
Reply | Threaded
Open this post in threaded view
|

Re: Request for a cross-staff easy function

Simon Albrecht-2
Hi Paolo,

I reckon this isn’t easy to write, since you have to basically split the
expressions up into individual elements and analyse them.

You can sometimes reduce effort by ‘cheating’ using simultaneous
expressions within the voice like in this mockup: (if you explicitly
instantiated the Voice using \new Voice, you can remove the \context Bottom)

\context Bottom <<
   \relative { c'16 e d f e g d f  c e h d a c h d  c1 }
   \repeat unfold 8 { s16 \change Staff = upper \voiceTwo s \change
Staff = lower \voiceOne }
 >>

Just as a general idea—real world applications are often too complicated
for this to actually be faster to input. Also like so often, maintenance
and code sharing get a lot easier with ‘low-tech’ coding and only using
standard constructs, so the larger input effort is often worth it.

HTH, Simon

On 14.12.19 16:12, Paolo Prete wrote:

> Hi all,
>
> I think this function would be very useful for solving the limitations
> of the current cross-staff interface:
>
> crossStaffExpr =  #(define-music-function (parser location
> staffUpMusic  staffDownMusic beamPosition) (ly:music? ly:music?
> number?) .....
>
> Example:
>
> \crossStaffExpr =  {  c '[   d'    g'   s    }
>                              {  s      s     f '   a']  } # 'BeamUp
>
> (the third parameter can be: BeamUp, BeamDown, or BeamBetween, where
> BeamBetween places the beam between the two staves; BeamBetween can
> only be used if there are no cross-staff chords)
>
> I ask you if there are any generous volunteers who want to implement
> it, in case it requires not so many lines of code.
> in case it requires many lines of code, is it worth opening a ticket
> in the dev ml?
>
> Thanks in advance
>
> P