Search the Community
Showing results for tags 'omn processing'.
-
Hi, here's a small function i did for one of my work in progress. The idea is to process omn pitch material relating to omn length values. For example, if omn length value faster than 1/8, "monodize" the melody at this point. ;;; =============================================================== ;;; MONO-FAST ;;; "Monodize" (remove chords) the omn parts faster than the given rhythmic value. ;; Utility function (defun mono-fast* (max-length-value mat) (let* (; disassembling the omn mat into his components (omn-mat (disassemble-omn mat)) (p-mat (getf omn-mat :pitch)) (l-mat (getf omn-mat :length)) (v-mat (getf omn-mat :velocity)) (a-mat (getf omn-mat :articulation)) ; empty list for the result of pitch processing (re-pmat '()) ) (loop for i from 0 to (-(length p-mat)1) do (if (< (nth i l-mat) max-length-value) (push (pitch-demix 1 (list (nth i p-mat))) re-pmat) (push (nth i p-mat) re-pmat) ) ) ; re-assembling the omn material (make-omn :pitch (reverse (flatten re-pmat)) :length l-mat :velocity v-mat :articulation a-mat ))) ;; Main function (defun mono-fast (max-length-value mat) (if (listp (car mat)) (mapcar (lambda(x) (mono-fast* max-length-value x)) mat) (mono-fast* max-length-value mat))) (setf test-seq '(q c4e4 p d4f4 e4g4 s f4a4 g4b4 a4c5 b4d5 q c5e5)) (setf test-seq2 '((q c4e4 p d4f4 e4g4) (s f4a4 g4b4 a4c5 b4d5 q c5e5))) (mono-fast '1/8 test-seq) (mono-fast '1/8 test-seq2) SB.