marqrdt Posted October 3, 2016 Share Posted October 3, 2016 Hi, Is there an OpusModus function (I'll bet there is) that can create lists (chords, etc) created from items selected from lists of varying lengths? Something like this: Source lists (3 lists): ( '(c4 d4 e4) '(f4 g4 a4 b4) '(cs4 ds4 fs4 gs4 as4) ) Output, successive items from each list: (list '(c4 f4 cs4) '(d4 g4 ds4) '(e4 a4 fs4) '(c4 b4 gs4) '(d4 f4 as4) '(e4 g4 cs4) ...) I'm having a great time learning LISP and OM (I come from Python/Java background mostly). I looked through the gen- functions, but nothing seemed to match. I was going to try to write a LISP function, but I figure there was already something in OM, as it seems geared towards these types of transformations. Thanks! Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted October 3, 2016 Share Posted October 3, 2016 May be this could help: (setf source '((c4 d4 e4) (f4 g4 a4 b4) (cs4 ds4 fs4 gs4 as4))) (interleave-map '((1 1 1)(1 1 1)(1 1 1)) source) SB. marqrdt 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted October 3, 2016 Share Posted October 3, 2016 and/or (matrix-transpose '((1 3 5) (2 4 6))) => ((1 2) (3 4) (5 6)) (setf mat1 '(c4 db4 ab4 f4 g4 bb4 a4 eb4 b4 e4 d4 gb4)) (setf mat2 '(db4 ab4 f4 g4 bb4 a4 eb4 b4 e4 d4 gb4 c4)) (gen-combine mat1 mat2) => ((c4 db4) (db4 ab4) (ab4 f4) (f4 g4) (g4 bb4) (bb4 a4) (a4 eb4) (eb4 b4) (b4 e4) (e4 d4) (d4 gb4) (gb4 c4)) (gen-combine '(a a a a) '(b b b) '(c c) :rest t) => ((a b c) (a b c) (a b) (a)) (gen-combine '(a a a a) '(b b b) '(c c) :revolving t) => ((a b c) (a b c) (a b c) (a b c)) marqrdt and Stephane Boussuge 2 Quote Link to comment Share on other sites More sharing options...
marqrdt Posted October 5, 2016 Author Share Posted October 5, 2016 wow-- thanks for both ideas. 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.