Stephane Boussuge Posted April 4, 2020 Share Posted April 4, 2020 Hi, i've made this function for my own usage. Sharing here if it can be useful for some others. It is a function who replace articulation by a given one on repeated notes. Best SB. ;;; OMN-REPLACE-ARTICULATION-IF-REPEAT (defun omn-replace-articulation-if-repeat (new-art omn-sequence) (do-verbose ("omn-replace-articulation-if-repeat") (let ((spn '()) (res '()) ) (progn (setf spn (get-span omn-sequence)) (setf res (loop for i from 0 to (- (length (flatten-sublist (single-events omn-sequence))) 1) collect (if (or (eq (second (nth i (flatten-sublist (single-events omn-sequence)))) (second (nth (+ 1 i) (flatten-sublist (single-events omn-sequence))))) (if (> i 0) (eq (second (nth i (flatten-sublist (single-events omn-sequence)))) (second (nth (- i 1) (flatten-sublist (single-events omn-sequence))))) ) ) (omn-replace :articulation new-art (nth i (flatten-sublist (single-events omn-sequence)))) (nth i (flatten-sublist (single-events omn-sequence))) ))) (length-span spn (flatten res)))))) ;;; EXEMPLE #| (setf mat '((s c4 p leg d4 leg e4 leg f4 q g4 f marc)(s a4 mp leg g4 leg leg f4 leg e4 leg leg leg d4 q c4 mf marc))) (omn-replace-articulation-if-repeat '(stacc) mat) => '((s c4 p leg d4 leg e4 leg f4 q g4 f marc) (s a4 mp leg g4 stacc g4 stacc f4 leg e4 stacc e4 stacc e4 stacc d4 q c4 mf marc)) |# AM and hujairi 1 1 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.