Trigger the cycle of a continuous function in time with a pattern?

hello!

Is is possible to trigger the cycle of a continuous function in time with a pattern?

For example, I want to modulate a filter's cutoff with a saw, that is gated in time with the LHS sound pattern and has the same cycle length as each event:

s "[~ speakspell:4]!2" # lpf (struct "[~ 1]!2" $ range 0 20000 saw) # lpq 1

I believe that the above code only samples from saw as it goes from 0 to 20000 over a whole cycle

I think struct "[~ 1]!2" is not needed in this case because you use #: the pattern s "[~ speakspell:4]!2" dictates the structure and a value of saw is sampled whenever the LHS pattern produces an event.
But perhaps I didn't get your question?

If I understand right, you'd like each sound to have a low pass filter sweep from 0 to 20000?

In theory I think this would work:

d1 $ s "[~ bd]!2" # lpf (bite 1 "[~ 0]!2" $ range 0 20000 saw) # lpq 0.2

In practice unfortunately it doesn't, because currently, each sound only sends one event at the start, with effect values fixed at that point.

A semi-workaround is to chop the sound into bits:

d1 $ (chop 32 $ s "[~ bd]!2") # lpf (bite 1 "[~ 0]!2" $ range 0 20000 saw) # lpq 0.2
1 Like

(moved this to its own post as it's a nice question..)

Here's a function splat for taking case of the chopping and structuring:

let splat epat pat = (chop 32 pat) # bite 1 (const 0 <$> pat) epat

A demo:

d1 $ chunk 4 (hurry 2) $ 
  jux rev $ splat (lpf $ range 0 20000 saw) $ s "snare [clap snare:4] bd*2 arpy"
  # lpq 0.2

fun!

3 Likes