AM Posted June 30, 2017 Share Posted June 30, 2017 (edited) ;;; SPLITS CHORDS INTO APP/ACC ;;; SUB -> could be replaced by an original-OPMPO-function (defun omn-component-replace (omn-sequence replace-component) (make-omn :length (if (lengthp (car replace-component)) (append replace-component) (omn :length omn-sequence)) :pitch (if (or (pitchp (car replace-component)) (chordp (car replace-component))) (append replace-component) (omn :pitch omn-sequence)) :velocity (if (velocityp (car replace-component)) (append replace-component) (omn :velocity omn-sequence)) :articulation (if (articulationp (car replace-component)) (append replace-component) (omn :articulation omn-sequence)))) ;;; MAIN (defun split-chord-to-app/acc (omn-list &key (type 'app)) (let ((i)) (loop repeat (length (single-events (flatten omn-list))) for cnt = 0 then (incf cnt) do (setf i (nth cnt (single-events (flatten omn-list)))) when (chordp (car (omn :pitch i))) append (append (list (append (list type) (list'e) (butlast (melodize (car (omn :pitch i)))))) (omn-component-replace i (last (melodize (car (omn :pitch i)))))) and do (incf cnt) and do (setf i (nth cnt (single-events (flatten omn-list)))) else append i))) (split-chord-to-app/acc '(e c4 ppp d4 ff pizz e4f4 g4 a4) :type 'acc) (split-chord-to-app/acc '(e c4 ppp d4 ff pizz e4f4 g4 a4) :type 'app) (split-chord-to-app/acc '(e c4 ppp d4 ff pizz e4f4c5 g4 a4) :type 'acc) (split-chord-to-app/acc '(e c4 ppp d4 ff pizz e4f4c5 g4 a4) :type 'app) Edited July 1, 2017 by AM added subfunction Quote Link to comment Share on other sites More sharing options...
opmo Posted July 1, 2017 Share Posted July 1, 2017 OMN-COMPONENT-REPLACE is missing. Quote Link to comment Share on other sites More sharing options...
AM Posted July 1, 2017 Author Share Posted July 1, 2017 added! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.