## CGS Modulo Magic Manual/Explanation/Tutorial (finally!)

Discussing some incredible modules that don't quite fit into the other forum categories.

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm

### CGS Modulo Magic Manual/Explanation/Tutorial (finally!)

This is an attempt to explain Ken Stone’s CGS Modulo Magic module, as found on the Best of CGS MARSH panel, so that users will be able to patch it in a more deterministic manner.

After re-reading Ken’s webpage about the module tons of times and analyzing its output on an oscilloscope, I think I finally got a grip on how the Modulo Magic’s different parts interact.

I’d like to start without actually talking about the mathematical Modulo principle, because it seems to be just a small part of this module’s functionality.

What this module does in a nutshell:
You set a voltage threshold, called “Initiation CV”, and when the input signal reaches this level, another voltage, called “Step Size CV” is added or subtracted. Then, if the new voltage reaches the threshold again, or rather if it rises by the threshold amount, the Step Size voltage is added or subtracted again, and so on ... up to eight times, eight so-called “Steps”. After the last Step, no more processing takes place and the Output signal simply tracks the Input signal changes.

Example:
- Input signal is a linearly rising voltage, starting at 0V
- Initiation CV is set to 1.0V
- Step Size CV is set to -0.5V

This would look like the following finger paint sketch (sorry, I’m on an old iPad):

After the input voltage rises to 1V, it drops by 0.5V, then it rises by another 1V and drops by 0.5V again, etc.

That’s it. Well, there’s more to do obviously and there are some quirks, but those are the basics really.

Controls and Features:

Input: Patch the audio or CV signal to be processed in here.
Output: This is where your processed signal comes out.

Initiation Knob: Sets a positive voltage level threshold at which the module starts processing the input CV. There’s a CV input for this knob too, with a polarity switch. Without CV, keep this switch at the + position.

Offset Knob: Adds an offset to the Initiation CV threshold, but only for the very first Step. More on this later. This control also has a CV input with polarity switch. Keep it at the + position if not using CV.

Step Size Knob: This sets the voltage to be added or subtracted to/from the Input signal after the Initiation CV threshold is reached. This knob is bipolar, which is not indicated by the Best of CGS front panel graphics and also it’s reversed. In the middle position there is no voltage change after reaching the threshold, turning it CW to the right subtracts CV and turning it CCW to the left adds CV. Think of it like this:

VC Sub & VC Add: CV inputs with attenuators to add or subtract to/from the Step Size voltage.

Steps Rotary Switch: Sets the amount of times the threshold can be reached and processing takes place. Mine seems to be wired from left to right like this: 8, 1, 2, 3, 4, 5, 6, 7. Odd.

The Modulo
Okay, let’s talk about the Modulo principle now. The mathematical Modulo % operation returns the remainder after a division, blah blah blah. My head is spinning already! Haha! More importantly, the Modulo restricts an input to a certain range:

x % y returns only values from 0 to y-1, no matter how large the value of x.
Anything above y-1 is wrapped around and starts back at 0.

You can recreate this behavior with the Modulo Magic, by setting Step Size to the inverse of Initiation CV, which requires a bit of fiddling, but it shouldn't be too hard to get close enough.

Example:
- Input signal is a linearly rising voltage, starting at 0V again
- Initiation CV is set to 1.0V
- Step Size CV is set to -1.0V

This restricts the input voltage to a range between 0 and 1V:

This might be handy, for example, to restrict a pitch CV to only one octave and it’s probably why we find the Modulo Magic on the same panel as the Infinite Melody module, with its wide octave range and unpredictable CV levels. I used this technique in the following video, to more or less keep the melodies in lower octaves:
[video][/video]

The Step Count:
You can enable up to eight steps with the Steps rotary switch, which will send the Input signal through a series of comparators, each of which receives the processed signal of the previous one. So below the Initiation CV threshold, the signal simply passes through all Steps unchanged. When it reaches the threshold, the first comparator triggers the Step Size voltage addition or subtraction. This new voltage is then sent onwards through the comparator chain and as soon as it reaches the threshold again, it triggers the next one. After a maximum number of eight Steps, the last voltage result is kept and further increasing Input voltage will simply be added.

Example:
- Input signal is a linearly rising voltage, starting at 0V (yawn)
- Initiation CV is set to 1.0V
- Step Size CV is set to -1.0V
- Steps set to 4

After subtracting 1V four times after reaching the threshold, the last Step has been triggered and the output voltage now tracks the input voltage with a -4V offset.

Going down:
So far we only looked at situations where Initiation CV plus Step Size resulted in a positive voltage. If the Step Size is subtracting a larger voltage than the Initiation CV level, then the Output signal can actually decrease and even go negative.

Example:
- Input signal is a linearly rising voltage, starting at 0V
- Initiation CV is set to 0.5V
- Step Size CV is set to -1.0V

Up and Down:
Now, let’s look at a rising and falling Input signal, like a Sine wave, which is a lot more common than the infinitely rising voltage of our previous examples.

Example:
- Input signal is a Sine wave between 0 and just below 2V
- Initiation CV is set to 1.0V
- Step Size CV is set to -1.0V

As soon as the Input voltage reaches 1V, the Step Size of -1V is applied. When the Input signal drops below 1V again, the Step Size voltage is removed, so Input signal equals Output signal again.

The blue wave above obviously sounds a lot different than the original Sine wave, so we’re using the Modulo Magic as a waveshaping audio effect now. Imagine what can be done with the multitude of CV modulation inputs. Or better yet, try it out! But first, let’s look at the modulation options together.

Initiation CV Offset:
The Offset knob and CV allow you to alter the voltage at which the first Step is initiated. It basically shifts the whole processing chain up or down the voltage range, but leaves the actual Initiation-plus-Step-Size processing unchanged.

Example:
- Input signal is a linearly rising voltage, starting at 0V
- Initiation CV is 1.0V
- Offset is 3.0V
- Step Size CV is -1.0V
- Steps set to 4

As you can see, the Offset of 3V will delay the Initiation of the Steps until the Input reaches the level of Offset plus Initiation CV threshold, i.e. 3 + 1 = 4V.

Thinking of the above Sine wave example, you could imagine sending an LFO into the Offset CV input to alter the point on the Sine wave where the waveshaping starts to occur. If the Offset CV is higher than the Input signal amplitude no waveshaping will be done, but if the CV drops, the processing will slowly move along the Sine wave:

Crap, I’m on an airplane now and my lines are getting squigglier and my girlfriend is rolling her eyes at me and mocking my enthusiasm writing this document. But you get the idea. Waveshaping is cool! Try it with CV. Bet you haven’t heard that one before.

So, what’s left? Oh yes:

VC Step Size Addition and Subtraction:
You can use the VC Sub and VC Add inputs and their attenuators to modulate the Step Size for even more waveshaping fun.

An interesting feature, which is also mentioned briefly in Ken’s description, is that you can use those inputs as a mixer, if you don’t do any other processing with the module. Setting Initation CV, Offset and Step Size to 0 (middle position for Step Size!Remember it’s bipolar!), will pass the Input signal through to the Output unchanged, without the whole stepping stuff. At least in theory, as you’ll probably not get everything exactly to 0 with the knobs, and stepping might still occur lightning fast at some levels, but you’ll get close enough. When you turn the Step Size knob now, you will apply a constant voltage offset to the Input signal and by sending other signals into the VC Sub and VC Add inputs, you will subtract and/or add those to the signal.

Example:
- Input signal is a slow Sine wave
- Initiation CV is 0V
- Offset is 0V
- Step Size is 0V

While I’m not sure if this example was necessary, the drawing might at least add some comical value.

Alright, that’s it for now. Let’s quickly recap the important bits.

Recap:

Use-cases of the Modulo Magic:
- Restricting voltages to a certain range (Initiation CV equals Step Size inverted)
- Waveshaping (whoop!)
- Signal offsetting (using Step Size only, Initiation CV and Offset set to 0)
- Signal mixing (using Step Size and VC inputs only, Initiation CV and Offset set to 0)
- more?

I have a feeling that there are probably some more wild things to be done with feedback loops, which I haven’t tested yet.

Watch out for:
- Step Size knob is bipolar, with 0 in the middle, and reversed polarity, with negative voltages CW and positive ones CCW.
- Steps knob rotary switch wiring. Mine has 8 at fully CCW and then goes 1-7 when turned CW.

I think the Modulo Magic fits the Serge Modular’s “patch programming” concept incredibly well. You’ve got this rather simple mathematical principle for restricting values to a range based on the Modulo operation, but then you get access to all the variables in the underlying circuit on the front panel and can totally mess the whole thing up and create … magic.

Let me know if there are any mistakes or if you have additional insights. I’m writing this in between things from memory, because I neglected to take any notes during the past days of researching and testing. Oh well. I need a drink now.

P.S. I you need more of this nerdy stuff, check out my recent 20+ page document on coding Bytebeats, where the Modulo plays a big part as well:
viewtopic.php?t=206989&highlight=
Last edited by flx on Tue Oct 23, 2018 3:53 am, edited 5 times in total.
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

wavecircle
Big Audio Sodomite
Posts: 1871
Joined: Sun Sep 05, 2010 3:31 am
Location: Amsterdam, NL
Great man!

I don't own the module but always have been super curious about it. Hopefully one day I can pick up a best of CGS system.

It would be great if you made a tutorial video.
Instagram: https://www.instagram.com/thezyg/ (lots of Serge)

[s]http://bit.ly/2Mekran[/s]

Ciat Lonbarde stuff from many moons ago: http://soundcloud.com/polska-kliknij-muzyka

timoka
Super Deluxe Wiggler
Posts: 1639
Joined: Sat Oct 05, 2013 2:43 pm
thanks!!!

Cobramatic
Wiggling with Experience
Posts: 464
Joined: Sat Sep 21, 2013 6:45 pm
Location: Sydney
Fantastic to finally get a clearer explanation - Thank you.
I pretty well have to re-read Ken's page every time I use this module but this makes it a lot more understandable.

Be wonderful if you can next turn your skills to the sometimes equally confounding 'Infinite Melody' module....

Cobramatic
Wiggling with Experience
Posts: 464
Joined: Sat Sep 21, 2013 6:45 pm
Location: Sydney
Reading your summary again - because it is AWESOME that you have done this (and the diagrams are essential to understand it right so great job with those too), I'm wondering if your 'Step Size' and 'Step' pot and rotary switch may have been incorrectly wired?
It especially seems odd that step size is not matching the panel graphic?

I'll have to do a test with mine to confirm your results and test my pots to see if they are wired the same way. I'll need another week or so before I have time to do all that though.

unrecordings
Super Deluxe Wiggler
Posts: 1162
Joined: Mon Nov 18, 2013 10:50 am
Location: Sheffield
Contact:
Superb, thanks for this. I've had a pdf of the builders guide on my desktop for a couple of years now to finally get my head round it. I built one over a decade ago, then it ended up in a box waiting for it's foreverhome (a new case rather than selling it to someone else)

Navs
Super Deluxe Wiggler
Posts: 4047
Joined: Fri Sep 18, 2009 3:49 am
Location: Berlin, Germany
Fantastic, thank you flx!

I've long wondered what this circuit does. Based on some of your drawings it looks like what coding people call a wrapper. I first saw this in the calibration routine of Expert Sleepers' Silent Way. But I think it's also present in saw tooth animators: when the ramp hits a certain point, subtract the output of a comparator from the signal. This looks like a mega-chain of these

Prunesquallor
Wiggling with Experience
Posts: 443
Joined: Wed Nov 11, 2009 3:08 am
Location: Valencia, Spain
Cobramatic wrote:Be wonderful if you can next turn your skills to the sometimes equally confounding 'Infinite Melody' module....
If at first you don't succeed read the instruction manual.

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
wavecircle wrote:It would be great if you made a tutorial video.
I'll see about that. Sometimes I think information like this are better as a text though. Also, I found the theory of the module easy to explain with those simple example voltages, however fiddling with the knobs and their individual ranges makes it harder sometimes to dial in precise results, which I might need for a video demo. I thought it might be cool to have a digital version of the Modulo Magic, with a mix of super precise controls and more "organic" ones.
Cobramatic wrote:Be wonderful if you can next turn your skills to the sometimes equally confounding 'Infinite Melody' module....
That's definitely the next step. It's quite a bit more complex though but I'll take the challenge!
Cobramatic wrote:I'm wondering if your 'Step Size' and 'Step' pot and rotary switch may have been incorrectly wired?
It especially seems odd that step size is not matching the panel graphic?
I think the Steps rotary switch is indeed incorrectly wired, but I think the behavior of the Step Size knob is correct. If I understand Ken's description it fades between -15V and +15V (taken down to smaller maximum values with resistors) and it needs to be inverted (CCW adds, CW subtracts) for some circuit design thing. Also, it's useful to be able to subtract and add voltages and not just have one of the two operations.

Here's an excerpt of Ken's explanation (emphasis mine):
step size input should be taken to a pot to allow for a fixed step size to be selected without additional CVs present. A 100k linear pot wired between +15 and -15 volts fed into one of the subtract inputs would be ideal. Note that the +15 should be connected to the counter-clockwise end of the pot. The range should be limited by connecting a resistor 470k between the wiper of the pot and the SS pad on the PCB, or by replacing the resistor on the PCB itself with a 560k resistor.
Source:
https://web.archive.org/web/20170607093 ... magic.html
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
Navs wrote:Based on some of your drawings it looks like what coding people call a wrapper.
Yes, exactly. A wrapper with only eight stages though, but you get offset stage outputs too to make it rising or falling wraps
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
Cobramatic wrote:I'll have to do a test with mine to confirm your results and test my pots to see if they are wired the same way.
Please do and let us know what you find out
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

Cobramatic
Wiggling with Experience
Posts: 464
Joined: Sat Sep 21, 2013 6:45 pm
Location: Sydney
flx wrote:
Cobramatic wrote:Be wonderful if you can next turn your skills to the sometimes equally confounding 'Infinite Melody' module....
That's definitely the next step. It's quite a bit more complex though but I'll take the challenge!
Cobramatic wrote:I'm wondering if your 'Step Size' and 'Step' pot and rotary switch may have been incorrectly wired?
It especially seems odd that step size is not matching the panel graphic?
I think the Steps rotary switch is indeed incorrectly wired, but I think the behavior of the Step Size knob is correct. If I understand Ken's description it fades between -15V and +15V (taken down to smaller maximum values with resistors) and it needs to be inverted (CCW adds, CW subtracts) for some circuit design thing. Also, it's useful to be able to subtract and add voltages and not just have one of the two operations.

Here's an excerpt of Ken's explanation (emphasis mine):
step size input should be taken to a pot to allow for a fixed step size to be selected without additional CVs present. A 100k linear pot wired between +15 and -15 volts fed into one of the subtract inputs would be ideal. Note that the +15 should be connected to the counter-clockwise end of the pot. The range should be limited by connecting a resistor 470k between the wiper of the pot and the SS pad on the PCB, or by replacing the resistor on the PCB itself with a 560k resistor.
Source:
https://web.archive.org/web/20170607093 ... magic.html
Thanks - looking forward to the Infinite Melody post!

Yes, I agree with your assessment of the 'Step size' pot - it totally makes sense to have positive and negative gain and ken's description confirms this. The error is with the panel graphics then.

Hopefully I'll get to test this on the weekend - I don't have a proper scope myself, I use a mini eurorack one, but it should suffice to double check the results.
Thanks again.

Cobramatic
Wiggling with Experience
Posts: 464
Joined: Sat Sep 21, 2013 6:45 pm
Location: Sydney
Flx, I’m Happy to say I’ve reproduced all of your examples on my mini-scope. See pic below. Red is the input and green is the output.

I can also fully confirm that the ‘Step Size’ knob works exactly as you state - so the panel graphic for this knob is definitely wrong.

My ‘Step’ knob is slightly different to yours in that it is a continuous turn with 8 steps. Step 1 is at 6 o’clock stepping up to 8 as you turn it clock wise then 1 again.

The wave shaping on an audio rate sine wave also works exactly as your diagrams show.

Thanks again for your explanations - it has definitely assisted me with further application of this module , I’d never formally used it for wave shaping audio before.

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
Cobramatic wrote:Flx, I’m Happy to say I’ve reproduced all of your examples on my mini-scope.

...

My ‘Step’ knob is slightly different to yours in that it is a continuous turn with 8 steps. Step 1 is at 6 o’clock stepping up to 8 as you turn it clock wise then 1 again.
Thanks a lot for testing everything!!!

Having a continuous-turn rotary switch for the Step count seems like a useful idea. I'll have to check my rotary switch at some point when I feel like taking apart my MARSH boat and see if I can remove a pin or something to make it continuously turn too.
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

Super Deluxe Wiggler
Posts: 3303
Joined: Tue Oct 07, 2008 5:55 am
Location: Berlin
Your efforts are highly appreciated. Some of Ken's circuits remain rather opaque to me. Even if I have them built and hooked up to my modular. The Modulo Magic was one of the most perplexing ones. Thanks to your tutorial it seems rather simple now. Thanks!

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
e-grad wrote:The Modulo Magic was one of the most perplexing ones. Thanks to your tutorial it seems rather simple now.
Thanks! It felt the same to me. Before doing the research, I thought it was super complicated and probably wouldn't be usable other than for trial and error. But now it's actually really straightforward to patch. Haha
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
viewtopic.php?p=2941088#2941088
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

MindMachine
weekend warrior
Posts: 6520
Joined: Sun Aug 02, 2009 1:45 am
Location: Santa Susana Field Lab
You deserve a medal. Thank you for the detailed, graphic description of the Modulo. That is one of the CGS modules that always boggled my mind. I need to read it again... and again.

Honestly - thank you for the time to break it down.

B-ry
Learning to Wiggle
Posts: 28
Joined: Thu Jan 04, 2018 8:30 pm
Location: Ithaca
This is fantastic and informative . Thank you so much for using your time to help this community.
I have to admit that every time I get to the modulo magic and infinite melody sections of the marsh panel I freeze and feel like a big dummy. It is not very intuitive for me. Your description and graphics help tremendously.

Cheers.

I do agree with the above, you deserve a medal!

ashleym
Veteran Wiggler
Posts: 564
Joined: Thu Oct 22, 2009 3:34 pm
Hugely appreciated. I do like the hand drawn diagrams.

tytytytyty
Learning to Wiggle
Posts: 20
Joined: Sat Mar 31, 2018 12:14 am
Contact:
This is an awesome write-up!

Oh, and the music in the video is so good!

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
Thank you for the kind words! I’m really happy that you guys like the descriptions. In the Infinite Melody thread there was kind of a request to do the Gated Comparator next, which I think is a good idea. So stay tuned
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

ashleym
Veteran Wiggler
Posts: 564
Joined: Thu Oct 22, 2009 3:34 pm
flx wrote:Thank you for the kind words! I’m really happy that you guys like the descriptions. In the Infinite Melody thread there was kind of a request to do the Gated Comparator next, which I think is a good idea. So stay tuned
I ordered the PCB from Elby on the strength of this (gawd knows when I will build it) as this thread made the module make sense.

flx
Super Deluxe Wiggler
Posts: 1221
Joined: Wed Oct 05, 2011 4:22 pm
Here’s a thread for the Gated Comparator
viewtopic.php?p=2954581#2954581
You can also find and contact me here:
tuesdaynightmachines@gmail.com
Instagram
nightmachines.tv

syncretism
Morbidly self-aware and liking it
Posts: 1320
Joined: Sun Jan 25, 2009 7:05 pm
Contact:
I got to thinking about Modulo Magic recently and remembered flx's excellent series of posts.

Restricting voltages to a certain range (Initiation CV equals Step Size inverted)

Could this be used in practice to step a voltage range of 0-10 to 0-5v? How fiddly would that be?

Thinking about it some more, it's probably not an ideal solution. I guess I wouldn't want 10v from my BugBrand EG to turn into, say, two 0-5v slopes, except for when I do. =)