Jump to content
Sign in to follow this  
JulioHerrlein

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 !

 

Best,

Julio

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

;;; SCORE

(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))
(piano-rh
   :omn pianoassemblerh
   :channel 1
   :sound 'gm
   :program 'acoustic-grand-piano)
  (piano-lh
   :omn pianoassemblelh   
))

 

Share this post


Link to post
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 ?

Best

Julio

Share this post


Link to post
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)
  )

 

Note:

Accidentals types:

:accidentals :all

:accidentals :natural

:accidentals :cautionary
 

The :all-accidentals t is not correct.

Share this post


Link to post
Share on other sites

Almost there ....

Actually the cross staff worked almost perfectly but some

 notes got wrong.

I have the exact ambitus for the hands: LH (g3 c6) and RH (g1 g3).

Is there a way to force the split point of cross staff to these values ?

A kind of split point function  ?

Best,

Julio

 

Share this post


Link to post
Share on other sites
Quote

LH (g3 c6) and RH (g1 g3).

here only c6 is in the treble clef.

(def-score grand
           (:key-signature 'atonal
            :time-signature '(2 8)
            :tempo 130
            :octave-shift '(c2 c6)
            :flexible-clef t
            :layout (grand-layout 'pno))
  
  (pno :omn (merge-voices '((e g3 c6)  (e g1 g3)))
       :channel 1
       :sound 'gm
       :program 0)
  )

Screen Shot 2017-11-21 at 15.41.25.png

Share this post


Link to post
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 !

Julio

Share this post


Link to post
Share on other sites

If the LH and RH pitches are placed correctly then I would use piano-layout:

(def-score grand
           (:key-signature 'atonal
            :time-signature '(2 8)
            :tempo 130
            :octave-shift '(c2 c6)
            ;:flexible-clef t
            :layout (piano-layout 'rh 'lh))
  
  (lh :omn '(e g1 g3)
       :channel 1
       :sound 'gm
       :program 0)

  (rh :omn '(e g3 c6))
  )

Screen Shot 2017-11-21 at 16.18.50.png

 

Share this post


Link to post
Share on other sites

Great !!!

Precisely what I intended.

So, the Grand layout permit a lot of customization !

Thanks, Janusz !

Julio

added 2 minutes later

But using this, we return to the first problem, because

it supposes the rhythmic independence of the voices, am I right ?

Share this post


Link to post
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.

Thanks,

Julio

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×