Jump to content

Recommended Posts



here's a function i've made for my own usage and i think could be useful for others.

It is a split point function which divide an OMN flux according to a list of split points.


Attached, you will find the French doc of the function 😉

;;; SB. 2020
;;; Fonction utile pour séparer les 2 mains pour une partie de piano
;;; renvoie une liste de listes

(defun split-point (split-points omn-seq)
  (do-verbose ("split-point")
  (let* (
         (spltconvert (if (numberp (car split-points))
                        (pitch-to-integer split-points)))
         (spltp (gen-trim (length omn-seq) spltconvert))
         (p1 (loop for sp in spltp
               for l in omn-seq
               collect (ambitus-filter `(,sp 128) l)
         (p2 (loop for sp in spltp
               for l in omn-seq
               collect (ambitus-filter `(-128 ,(- sp  1)) l)
    (list p1 p2))))

(split-point '(c4 d4) '((e a3d4 c4e4 f4c5 q g3d4 e4)(e a3d4 c4e4 f4c5 q g3d4 e4)))
=> (((e d4 c4e4 f4c5 q d4 e4)(q d4 e4 f4c5 d4 e4)) ((e a3 - - q g3 -)(e a3 c4 - q g3 -)))

;;; Example
(setf pmat (make-scale 'c2 32 :alt '(2 1 2 3)))
(setf pch (rnd-sample 128 pmat))
(setf chrd (chordize-list (gen-divide (rnd-number 8 1 4) pch)))
(setf mat (length-legato (gen-filter-euclidean 8 16 4 16 chrd 's '(mf))))
(setf split (split-point '(c4) mat))
(setf piano-rh (ambitus-chord 12 (first split)))
(setf piano-lh (ambitus-chord 12 (second split)))

(ps 'gm
    :p (list piano-rh piano-lh)





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