Jump to content

Automatic Cross Staff Piano Layout

Recommended Posts

Dear Friends,


I'm working on a piano piece where each hand

 plays complementary rhythms.

For example,

If LH plays  (s -s s s -s) then

   RH plays  (-s s -s -s s)  accordingly whit the concept.


Everything is parametric, each hand have a set of pitches, dynamics and articulations,

so I did one OMN assembling for each hand, to have more control over the material.

It ends like you can see in the code, below.


Since all I have is just the complementary rhythms, I'd like to write it in a form of continuous sixtenth notes, in cross staff.

So, the problem is that in Finale I have to manually do all this painful work, dragging notes up and down, to make cross staffing, because,

the output in the XML gives me two independent voices. It's really boring to do.

Is there some way to automatically generating this cross staff layout, with this architeture of coding, preserving the content

 of each hand ?  I use this kind of writing it a lot.


Thanks for help !




(setf pianoassemblerh (assemble-seq lhmat1))
;;; Material for Left hand
(setf pianoassemblelh (assemble-seq rhmat1b))
;;; Material for Right hand


(def-score Piano-1
           (:key-signature 'atonal
            ;:time-signature '((4 4 3) (4 4 1))
            :time-signature '((3 4))
           :tempo 80
            :layout (piano-layout 'piano-rh 'piano-lh :all-accidentals t))
   :omn pianoassemblerh
   :channel 1
   :sound 'gm
   :program 'acoustic-grand-piano)
   :omn pianoassemblelh   


Link to comment
Share on other sites

I can try the gen divide strategy, but first I'm going to save everything in one voice only, using Explode in Finale.

After That, import Midi to Opusmodus (loosing all articulations and Dynamics) and try to

 use gen divide, gen colletct approach (like the help of Grand Layout).

I'll have to calculate how many notes are in LH and How Many in RH to divide the staff
(Actually there's a pattern).

I don't know if I'm going to suceed.


A Better approach would be a form of merging my materials (LH and RH) all inside Opusmodus,

without loosing the dynamics and articulations and then use the Grand Layout  example Strategy

(that of gen-divide and Gen Collect)

Looks complicated but less tedious than manually doing all the stuff.


Any help ?



Link to comment
Share on other sites

Is this what you are looking for:

(setf sine (gen-sine 120 1 '(0.5 0.2 0.1) :phase 60))
(setf vec (add-sine-waves 4 120 4 0.6 :modulation sine))
(setf mat (vector-to-pitch '(g2 g7) vec))

(setf divide (gen-divide 6 mat))
(setf div1 (gen-collect 3 divide))
(setf div2 (gen-collect 3 divide :remain t))

(setf pich1 (rnd-octaves '(g2 b7) div1))
(setf pich2 (rnd-octaves '(c2 g7) div2))

(setf pitch (gen-mix pich1 pich2 :flatten t))
(setf velocity (rnd-sample 120 '(pp mp mf ff)))

(setf omn1 (make-omn 
           :length (rnd-sample 120 '(s -))
           :pitch pich1
           :velocity velocity
           :span :pitch))

(setf omn2 (make-omn 
           :length (rnd-sample 120 '(s -))
           :pitch pich2
           :velocity velocity
           :span :pitch))

(def-score grand
           (:key-signature 'atonal
            :time-signature '(3 8)
            :tempo 130
            :octave-shift '(c2 c6)
            :accidentals :all
            :layout (grand-layout 'pno))
  (pno :omn (merge-voices omn1 omn2)
       :channel 1
       :sound 'gm
       :program 0)



Accidentals types:

:accidentals :all

:accidentals :natural

:accidentals :cautionary

The :all-accidentals t is not correct.

Link to comment
Share on other sites

Sorry, it's the reverse:


RH (g3 c6) and LH (g1 g3)


I'm thinking more like left hand in lower staff and right hand in upper staff, independently of the clef used.

And, I was presuming that RH (g3 to c6) as the interval that goes from g3 (bass clef, maybe, and treble

 clef from the c4 on).

But if the RH stay just in treble clef is ok for me, since the content of eache hand is preserved, so the

extra ledger lines to reach g3 in treble clef is not a problem.

Thanks a lot !


Link to comment
Share on other sites

My definitive solution:

I took the approach of merging the material into only one stream of 16th notes.

After, I transpose up 4 semitones the pitch material, before the assembling.

So, the Grand layout did the job of cros staff and also the split, because

 with the transposition, my low note became b3, instead of g3.

So, I got it right from xml output with really need of small adjustments,

having just to transpose the thing up 4 semitones again.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use Privacy Policy