Remainders - a modulo gesture generator for crow

Remainders

modulo gesture generator / cv divider

This is the utility module I’ve always wanted, inspired by Cold Mac and MI Frames, but now as a simple crow script!

Intended use (but not limited to): Throw some gestural CV in using a knob or slow lfo, and get 4 CV out. Plug those into some inputs, et voilà, have one knob to rule 4 parameters! Great tool to add expressivity to any patch.

Input 1: Gesture in
Input 2: Transpose in
Output 1-4: Gestures out, folded 1 to 4 times.

Here’s a visualization, which I admit took me longer to make than writing the actual script :sweat_smile:

Audio demo, remainders modulating qpas, felt cute, might delete later.

print friendly


Requirements

  • Monome crow

Doesn’t need norns nor computer while running.

Download

Upload the tiny script below to your crow. Not in Bowery yet.

--- Remainders (version 0.1)
-- modulo gesture generator/cv divider
-- Input a voltage and get 4 folded outputs based on a simple modulo operation. Perfect for your one knob to rule them all.

-- in 1: Gesture (CV) in (Great for knobs/joysticks)
-- in 2: Transpose in (Great for quantised melodies)
-- out 1-4: Voltages being folded 1 to 4 times, top to bottom. eg. Output 4 has modulo of 2 meaning it recents to 0V with every 2V increment meaning it folds 4 times.

function init()
    input[1].mode( 'stream', 0.01 )
    for n=1,4 do output[n].slew = 0.01 end
end

input[1].stream = function(v)
    transpose = input[2].volts
    for n=1,4 do
        remainder = v % (10/(n+1))
        output[n].volts = math.min(remainder + transpose, 10)
    end
end
63 Likes

You weren’t kidding. Thanks for the brilliant, streamlined script!

sweet! very nice and neat script. also very cool to use with an envelope follower.

Thanks! :slight_smile: Standing on the shoulders of giants as the event based api makes things like this super easy to build.

Thanks! Cool! You use the envelope follower to process the (multiple) outputs? Curious what you’ll make with it!

This will pair so well with addac’s vc transitions. Super excited to try this!

2 Likes

amazing! haiku crow scripts are the best.

3 Likes

thanks
this is so cool!

1 Like

very cool! just thought of a potentially interesting other use for in 2 that could be fun to try. a “shift register” round-robin addressing clock input that moves out 1 -> 2, 2 -> 3, 3 -> 4, 4 -> 1, etc.

Another line of code could quantize these outputs to 1/v oct 🥸

2 Likes

Cool script! Looking forward to messing around with it.

1 Like

Oh that’s a great idea, should be possible to do! Imagine self patching one of the outputs into in 2 then… :exploding_head: Might make an alternative version for this! Got to finish the rungler script first :shushing_face:

I personally wouldn’t want to quantize the outputs (although could add behind a flag). I’ve been considering adding quantization to transpose input, but still havent figured out if it makes sense.

4 Likes

My thoughts exactly!

2 Likes

@jlmitch5 Been thinking about this. Do you think it would be more interesting to have a trigger shifting the outputs or a CV input which momentarily shifts based on 2v increments (eg. 4v shifts two up)? Stateful versus quasimode. I think the latter might be more interesting for self patching/sequencing?

1 Like

That sounds cool too! I think I was more thinking along the lines of clock so you could route related (but different modulation around and change it in sync with things). I wasn’t thinking in terms of a feedback system, but that sounds really cool. Now that I’m thinking about it in terms of that/chaotic systems, It could also be very interesting with either option to route one of the outputs mixed back in a little to in 1 too. If you are round robin-ing (either way) I’d guess it would not like just completely overtake things and go into full “oscillation”

Another crazy idea, what if when you get through a “cycle” of the outputs switching, it updates either the threshold of in 2 to some random volt value (in stateful mode) or changes the voltage increments in your (quasimode). These 12 lines of code have got my mind racing on weird stuff to try so I think you have something pretty cool on your hands, hah!

Ok try this, seems to work, but I don’t have an oscilloscope at hand nor a normal euro system to test with. :sweat_smile: It also might respond weirdly to negative values.

Shift 0.1 script
--- Remainders (version 0.1-SHIFT)
-- modulo gesture generator/cv divider
-- Input a voltage and get 4 folded outputs based on a simple modulo operation. Perfect for your one knob to rule them all.

-- in 1: Gesture (CV) in (Great for knobs/joysticks)
-- in 2: Shift in (Rotates the outputs based on incoming cv, momentary, 0v no shift, 2v shifts 1 up, 4v shifts 2 up, etc.)
-- out 1-4: Voltages being folded 1 to 4 times, top to bottom. eg. Output 4 has modulo of 2 meaning it recents to 0V with every 2V increment meaning it folds 4 times.

function init()
    input[1].mode( 'stream', 0.01 )
    for n=1,4 do output[n].slew = 0.01 end
end

input[1].stream = function(v)
    shift = math.ceil(input[2].volts / 2.5)
    for n=1,4 do
	remainder = v % (10/((shift+n%4)+1))
        output[n].volts = math.min(remainder, 10)
    end
end
1 Like

Just bumped into the addac vc rotator which does both clock/reset and the CV way we described, maybe I can support both with a simple boolean switch on the REPL. Have you tried the shift 0.1 script above in the meantime?

1 Like

Not yet, apologies, will attempt today!

EDIT: @lijnenspel

Patch notes:
Crow In 1: lfo from mi stages (speed controlled by quadratt knob 2)
Crow In 2: signal 4 from crow out 4 (multed. attenuverted by quadratt knob 1)
Crow Out 1-4 to MI Veils and out to modulate stuff on Plaits

Wow yea, incredibly fun. I like what you’ve come up with for the in 2. it feels controllable but chaotic (you can hear me snapping the knob to control the amount going in to in 2 at the beginning of the video) which I feel fits perfectly with the way the rest of this script feels…basically like something that gives you some nice gestural control over things but also it’s got kind of a chaotic edge to it. The brief playing around I did, your script feels like something I would grab to explore unexpected sounds or build chaotic rhythms, and this parameter really enhances that experience I think!

6 Likes

Nice patch! Thanks for the video!

Will have some time upcoming weekend to validate all output values on the scope, update the manual and see if the script is ready for a push to the bowery. Also added a fun little jam to the first post :tada:

1 Like

FINALLY got my crow working today and this was the very first patch I uploaded.

Running those 4 outputs into MATHS and then cross-modulating yields some absolute craziness.

Thanks so much for this!

1 Like

Glad you’re enjoying the patch! I’d love to know more about the maths patch! Please record some :raised_hands:

Also, I have a txi and txo on the way so we can already start brainstorming how to grow this patch :slight_smile: