Hi all,
I’m running into an issue where when use the seq function the second sound is carried forward until the end of the selection. Instead of returning the result of both short sounds played right after each other, I receive the first short sound and then the next selected sound except it keeps going until the end of the selection, way past what I stored in the variable.
Here is my code:
(setf seclen (get-duration 1))
(setf seclen (truncate seclen))
(print seclen)
;length of clips
(setf len 0.5)
;generate random number in range of clip
(setf secFloat (/ (float (random (* seclen 100))) 100))
;gen random clip
(setf whole (extract-abs secFloat (+ secFloat len) s))
(play whole)
;main loop
(dotimes (i 4)
;generate random number in range of clip
(setf secFloat (/ (float (random (* seclen 100))) 100))
;gen random clip
(setf one (extract-abs secFloat (+ secFloat len) s))
(play one)
;add clip to end of running total
(setf whole
(seq (cue whole) (cue one))
)
;(play whole)
)
(force-srate 44100 whole)
I’m using version 3 syntax btw.
What I would like the code to do is take a selection, store a short randomly selected clip in a variable and add that to the previous clip in a loop, so the result is a randomly generated track that jumps around constantly.
This is my first time doing any audio processing, so apologies if this question is trivial.
Thanks.