Possible to modulo a CV?

A bit stuck on this one.

Consider this scenario:

… where an LFO is time stretching across the full span of an audio file. (In the screenshot, it’s using a unipolar LFO, but it would work just as well to put POS in the middle and use a bipolar LFO… that might make a difference to the next bit, or not.)

Then I’d like to randomize in segments, by mixing in a stepped RANDOM CV.

When the LFO is close to the boundary, the random value might push POS outside of 0 to 10. At that point, I think Grain Engine will clip the voltage at 0 to 10, so that you would hear a complete freeze rather than slow movement through the audio.

In an audio programming environment, I would modulo the position, so that at least it would jump to somewhere else where it could move.

I’ve seen nysthi Modulo Magic but it looks like it’s intended to modulo over a smaller voltage range.

So then I thought, maybe the solution is to attenuate both LFO and RANDOM, mix, modulo-magic, and then RSCL back up? Except that most “amplifiers” are really only attenuators – how would one put 5V in and get 10V out?

Any other suggestions?

TIA, hjh

RSCL itself may do what you need.

It clamps to 10v, but it also has reflect at maximum and reflect at minimum, which means voltage outside the range will continue moving. Viola, nothing gets stuck at 10 or 0.

And not all VCAs in rack are limited to 1x, there are a few that go to 2x or more.

That would do it, sure, maybe even preferable to wrapping from one end to the other.

Thanks!

hjh

Since you mention an audio programming environment (i.e. if you’re not opposed to scripting): the scripting language of my TimeSeq module allows the remainder calculation to be perfomed on input voltages. To get the modulo (i.e. always positive iso either positive or negative result), a signcalc after that will take care of making it a positive value. A quick script to do those calculations between input 1 and output 1 to get a modulo 10 would be:

{
	"$schema": "https://not-things.com/schemas/timeseq-script-1.1.0.schema.json",
	"type": "not-things_timeseq_script",
	"version": "1.1.0",
	"timelines": [
		{
			"lanes": [
				{
					"loop": true,
					"segments": [
						{
							"duration": { "samples": 1 },
							"actions": [
								{
									"set-value":
									{
										"output": 1,
										"value": {
											"input": 1,
											"calc": [
												{ "remain": 10 },
												{ "sign": "pos" }
											]
										}
									}
								}
							]
						}
					]
				}
			]
		}
	]
}

The "duration": { "samples": 1 } combined with the "loop": true causes this action to be performed continuously, and you can replace those calc entries with any combination you need (e.g. a mult 2 to go from 5V to 10V)

1 Like

Submarine AO will modulo values greater than 10.

The BASICally module has many math functions, including a mod() function.