Jump to content

Randomizing size argument of gen-interleave


Recommended Posts

Hi,
Is there a way that I can randomize the size argument of GEN-INTERLEAVE in the following code?
That is, not just initially but continuously, so you get a variable interleave size.
 
All the best,
Erik
(ambitus '(g3 g5)
(gen-interleave 5
(integer-to-pitch
(gen-accumulate '(2 7) :start -5 :count 16)))
 :type :invert)

 

Link to comment
Share on other sites

Just added the possibility to use list.

(gen-interleave '(1 2 2 3) '(c4 d4 e4 f4 g4 a4))
=> ((c4) (d4 e4) (e4 f4) (f4 g4 a4) (g4))

Examples:

(ambitus '(g3 g5)
 (gen-interleave
  '(3 5 3 4)
  (integer-to-pitch
   (gen-accumulate '(2 7) :start -5 :count 16)))
 :type :invert)

=> ((g3 a3 e4) (a3 e4 fs4 cs5 eb5) (e4 fs4 cs5)
    (fs4 cs5 eb5 gs4) (cs5 eb5 gs4) (eb5 gs4 fs4 b3 a3)
    (bb4 c5 g5) (c5 g5 f5 bb4) (g5 f5 bb4) (a4 e5 fs5 b4 a4)
    (e5 fs5 b4) (fs5 b4 a4 d4) (cs5 eb5 gs4))

now with random size:

(ambitus '(g3 g5)
 (gen-interleave
  (rnd-sample 15 '(3 5 3 4) :seed 45)
  (integer-to-pitch
   (gen-accumulate '(2 7) :start -5 :count 16)))
 :type :invert)

=> ((g3 a3 e4) (a3 e4 fs4 cs5 eb5) (e4 fs4 cs5 eb5)
    (fs4 cs5 eb5 gs4 fs4) (cs5 eb5 gs4) (eb5 gs4 fs4 b3)
    (bb4 c5 g5) (c5 g5 f5 bb4) (g5 f5 bb4 gs4 cs4)
    (a4 e5 fs5) (e5 fs5 b4 a4) (fs5 b4 a4 d4)
    (cs5 eb5 gs4 fs4) (eb5 gs4 fs4))

This is part of version 1.1 now.

Edited by opmo
Link to comment
Share on other sites

Oh, great!

I guess it's generally a good thing that an argument could be either a single value, a list or a function that returns a single value or a list.

I've been doing some work using Patterns in SuperCollider and I find it really flexible, but I'm sure the developers at Opusmodus are already familiar with that concept.

Having a good time over here going through the tutorials of Opusmodus.

All the best,

Erik

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy