NagyMusic Posted December 23, 2020 Share Posted December 23, 2020 I wonder if it's possible to evaluate a function (that has a seed argument) a set number of times (using gen-loop) with a predefined, custom seed list applied to the function. Something that I'm trying to achieve in the example below. Thank you! (setf seeds (vector-round 1 100 (gen-white-noise 8 :seed 13))) (setf rhythm (gen-loop 8 (euclidean-rhythm 16 4 16 's :type 2 :seed seeds))) Quote Link to comment Share on other sites More sharing options...
AM Posted December 23, 2020 Share Posted December 23, 2020 like that? should work... it "loops" x-times (depends on length of seeds-list) and collect the rhythms... (setf seeds (vector-round 1 100 (gen-white-noise 8 :seed 13))) (setf rhythm (loop for i in seeds collect (euclidean-rhythm 16 4 16 's :type 2 :seed i))) perhaps there is an OPMO-solution, this is LISP NagyMusic and JulioHerrlein 2 Quote Link to comment Share on other sites More sharing options...
NagyMusic Posted December 23, 2020 Author Share Posted December 23, 2020 Thank you! This is it. I figured it involved for loop iteration. Thanks again. Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted December 24, 2020 Share Posted December 24, 2020 Another possible way: (setf seeds (vector-round 1 100 (gen-white-noise 8 :seed 13))) (setf rhythm (mapcar (lambda(x) (euclidean-rhythm 16 4 16 's :type 2 :seed x)) seeds)) SB. NagyMusic and JulioHerrlein 2 Quote Link to comment Share on other sites More sharing options...
opmo Posted December 24, 2020 Share Posted December 24, 2020 (setf seeds (rnd-number 1 1 100 :seed 23)) (init-seed seed) This way you don't need to use seed in any following functions. At the end of your score set the init-seed back to nil. (init-seed nil) Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted December 24, 2020 Share Posted December 24, 2020 It seems to me that Stephane's solution is the preferred one if the euclidean-rhythm is to be generated with different seeds. - Rangarajan Quote Link to comment Share on other sites More sharing options...
NagyMusic Posted December 24, 2020 Author Share Posted December 24, 2020 Thanks, everyone! 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.