vpolajnar Posted July 19, 2022 Posted July 19, 2022 Dear Opusmodus masters! I Have a chord: And I was wondering if i could arpeggiate this chord depending on subdivisions? For example (e s 3q): Or for example (e s 3q 5q): I don't know if Opusmodus is build for this kind of stuff, but i always have to calculate if 2nd note of quintuplet comes before or earlier of 2nd note of triplet. For any response I'd be very thankful! Best wishes, Vili Quote
AM Posted July 30, 2022 Posted July 30, 2022 (edited) here is a possible solution... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; THE FUNCTION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-arpeggio (event &key (rhy'(1/28)) (legato nil)) (let* ((pitches (melodize (omn :pitch event))) (length (car (omn :length event))) (velo (car (omn :velocity event))) (art (car (omn :articulation event))) (rhy (gen-repeat 10 rhy)) (arpeggio-voices (loop repeat (length pitches) for i from 0 to (1- (length pitches)) for j in pitches for rhy in rhy collect (if (= i 0) (length-rational-quantize (list rhy j velo art) :round length) (length-rational-quantize (append (gen-length (list i) (* -1 rhy)) (list rhy) (list j) (list velo) (list art)) :round length))))) (assign-variable 'voice (if (null legato) arpeggio-voices (loop for x in arpeggio-voices collect (length-legato x)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; IT WORKS LIKE THAT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; type in ONE single-event (l p v a) with CHORD... for example: (setf event '(q c4e4g4b4 mf ten)) ;;; evaluate the function (with a arpeggio-length, for example :ryh 1/28) (gen-arpeggio event :rhy 1/28) ; now the the result are "bounded" on 4 voices/variables = the number of the chord-pitches ; => (voice1 voice2 voice3 voice4) ;;; list every variable, so you will have the four "arpeggio-rhythm/times", so you can use that for 4 parts on your score (list voice1) (list voice2) (list voice3) (list voice4) ;;; VARIANTS AND OPTIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; if you choose ":legato t" => all the voices are like with PEDAL played (gen-arpeggio event :rhy 1/28 :legato t) ;;; if you want to put/merge all that into ONE VOICE just: (merge-voices voice1 voice2 voice3 voice4) => (7q c4 ten e4 ten g4 ten b4 ten -7h.) ;;; if you want to have different rhy's just do it like that (gen-arpeggio event :rhy '(1/28 1/20 1/12 1/8)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Edited July 30, 2022 by AM Stephane Boussuge, vpolajnar and opmo 3 Quote
vpolajnar Posted August 2, 2022 Author Posted August 2, 2022 You are just awesome, thank you so so so much!!! You helped me so much. Quote
vpolajnar Posted August 2, 2022 Author Posted August 2, 2022 I am really sorry to bother you again, I am just wondering If is in any way possible that I would get more this effect: From (gen-arpeggio event :rhy '(1/8 1/12)) I am receiving: I hope I don't take you too much time, you helped me already a lot! Quote
AM Posted August 2, 2022 Posted August 2, 2022 here's a correction (bug) and a variant: okay... you want to "sum" the rests in a sequence 0, 2 ,3, 4 ... by -1/24 rhy. (a special version) so i have to code this case as option. take the new version and use :offset 1 (defun gen-arpeggio* (event &key (rhy'(1/28)) (legato nil) (offset nil)) (let* ((pitches (melodize (omn :pitch event))) (length (car (omn :length event))) (velo (car (omn :velocity event))) (art (car (omn :articulation event))) (rhy (gen-repeat 10 rhy)) (arpeggio-voices (loop repeat (length pitches) for i from 0 to (1- (length pitches)) for j in pitches for rhy in rhy collect (if (= i 0) (length-adjust length (list rhy j velo art)) (length-adjust length (append (gen-length (if (null offset) (list i) (list (+ i offset))) (* -1 rhy)) (list rhy) (list j) (list velo) (list art))))))) (assign-variable 'voice (if (null legato) arpeggio-voices (loop for x in arpeggio-voices collect (length-legato x)))))) (setf event '(q c4e4g4b4 mf ten)) ;;; now it works correct (gen-arpeggio* event :rhy '(1/8 1/12 1/16 1/20)) (list voice1) (list voice2) (list voice3) (list voice4) ;;; what makes intuitiv sense (old version/result) (gen-arpeggio* event :rhy '(1/24) :offset nil) ;; with OFFSET nil: the rests at the beginning are: ;; * 0 rhy ;; * 1 rhy ;; * 2 rhy ;; * 3 rhy (list voice1) (list voice2) (list voice3) (list voice4) ;;; what are you looking for... (gen-arpeggio* event :rhy '(1/24) :offset 1) ;; with OFFSET 1: the rests at the beginning are: ;; * 0 rhy ;; * 2 rhy ;; * 3 rhy ;; * 4 rhy (list voice1) (list voice2) (list voice3) (list voice4) Quote
vpolajnar Posted August 3, 2022 Author Posted August 3, 2022 That's now really working good!! Many thanks.. I just now I have problems with different rhys. I can't get more than 2 voices from that: (gen-arpeggio* event :rhy '(1/8) :offset nil) Sorry again. Quote
AM Posted August 3, 2022 Posted August 3, 2022 in general: you have to define exactly what you want (in a limited number of cases), if you change your idea along the way, you have to adapt the CODE again... look at the CODE, and the EVENT etc... ;; you have to define al longer length-value in EVENT: (* 4 1/8) = 1/2 => in EVENT '(h c4e4g4b4 mf ten) (setf event '(h c4e4g4b4 mf ten)) (gen-arpeggio* event :rhy '(1/8) :offset nil) Quote
vpolajnar Posted August 4, 2022 Author Posted August 4, 2022 Oh yes thats fine now and works really great! But whether I have different rhythms I don't quite get the same effect. I'd like to get somehow polyrhytmical effect. So Id just enter (1/8 1/12) and get sth like this: But notes apreggiates: Or from '(1/16 1/16 1/12 1/16 1/12 1/16: Arpeggio: Best, Vili Quote
AM Posted August 4, 2022 Posted August 4, 2022 i think you should code it yourself, then you'll get what you want greetings andré Quote
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.