Rate of Change Detector/Measurement to CV in Eurorack

Cwejman, Doepfer, Erica, MakeNoise, Mutable instruments, TipTop Audio, Analogue Solutions, and much more! The world’s most popular format.
Be sure to look into MANUFACTURER SUB-FORA as well..
Post Reply
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Rate of Change Detector/Measurement to CV in Eurorack

Post by Infrablue »

Is there a module that outputs a continual CV giving the rate of change of a CV signal? Would we call that a measure of voltage acceleration?

I've made a patch that I think pretty much does this but it would be nice to just have in a module or part of one.

I basically mix the CV with it's inverse, but the inverse first goes through a slew. So if the signal is in motion and then comes to a full stop... as the slewed signal catches up... it gets closer and closer to full cancellation due to the inversion. But it's not exact... the higher the slew rate, the longer it takes to get to zero/full cancelation. Which can be cool, but it means it's not exactly accurate... the larger the slew the less accurate (but there must be some slew or they will always cancel fully). This also gives a positive measurement regardless of direction of the change. Edit: (that last sentence is not true... I remembered wrong.)

So I'm basically trying to output the speed (instead of position) I am sliding traveling across a continuum controller (ribbon/Martenot style controller). In my case it's a Martenot or ring/pulley continuum, which happens to mean I can't jump from one position to another... the pulley is always sliding completely to get anywhere (the "Artemis" links and Bioluminescent Blues link in my signature show my controller that does that).

I hope I explained that well.

Thanks!
Last edited by Infrablue on Sun Oct 25, 2015 9:40 am, edited 1 time in total.
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
XponentOne
Veteran Wiggler
Posts: 549
Joined: Mon Feb 09, 2015 4:46 am
Location: Southampton, UK

Post by XponentOne »

Interesting question! I think you need to be delaying the signal not slewing it as is subtly different. And don't forget to divide the output by the delay you introduce.

Should add ive never tried this - interested to see if it works. Not sure why you are getting positive only cv output - can you post an explanation of the exact patch (which modules etc)?
XponentOne
Veteran Wiggler
Posts: 549
Joined: Mon Feb 09, 2015 4:46 am
Location: Southampton, UK

Post by XponentOne »

Sorry as in divide by a constant (say 30ms delay -> divide by 30 to get v/ms rate of change).
XponentOne
Veteran Wiggler
Posts: 549
Joined: Mon Feb 09, 2015 4:46 am
Location: Southampton, UK

Post by XponentOne »

Oh just rereading your post you mention voltage acceleration - acceleration is the rate of change of the rate of change (2nd derivative in maths lingo) so need to go through the process again on the output of the function you have made if you want that. Thatd definitely need to be a patch-in-a-module situation.

Am also interested if there are modules that do any of this too btw if people have an insight - am from a pure maths background but relatively new to modular and electronics (about 9 months wiggling now, and like £3-4k poorer - been the best music making year of my life XD).
User avatar
mbartkow
Ultra Wiggler
Posts: 753
Joined: Wed Jul 31, 2013 7:31 am
Location: Moonbase Alpha

Post by mbartkow »

Rate of change is mathematically equivalent to time derivative of the function. The problem is that exact derivative cannot be implemented because its transfer function is linearly proportional to frequency, in other words it gives extremely high amplification for very high frequencies, and thus it would be unstable. Instead, derivative may be approximated by a first order highpass filter. What you did by subtracting a slewed CV from its original version is exatly that - you created a more or less accurate highpass filter of first order. While a dedicated module could be quite easily implemented for this task, it wouldn't be much better than this, because the step response of a highpass filter looks like an exponential impulse - it never drops to absolute zero. A real derivative of a step is an infinitely short spike, but, as I said - this would be totally unstable, because it would be extremely sensitive to high frequencies (think of RF interferences, noise, etc)

Acceleration should not be confused with rate of change. Acceleration is the increase of rate which is equivalent to second derivative.
Last edited by mbartkow on Thu Oct 22, 2015 6:39 am, edited 1 time in total.
XponentOne
Veteran Wiggler
Posts: 549
Joined: Mon Feb 09, 2015 4:46 am
Location: Southampton, UK

Post by XponentOne »

Thanks for clarifying and correcting!
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

mbartkow wrote:Rate of change is mathematically equivalent to time derivative of the function. The problem is that exact derivative cannot be implemented because its transfer function is linearly proportional to frequency, in other words it gives extremely high amplification for very high frequencies, and thus it would be unstable. Instead, derivative may be approximated by a first order highpass filter. What you did by subtracting a slewed CV from its original version is exatly that - you created a more or less accurate highpass filter of first order. While a dedicated module could be quite easily implemented for this task, it wouldn't be much better than this, because the step response of a highpass filter looks like an exponential impulse - it never drops to absolute zero. A real derivative of a step is an infinitely short spike, but, as I said - this would be totally unstable, because it would be extremely sensitive to high frequencies (think of RF interferences, noise, etc)

Acceleration should not be confused with rate of change. Acceleration is the increase of rate which is equivalent to second derivative.
Ok, that helps clarify for me. Indeed I am after a CV showing rate of change and not acceleration.
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
acgenerator
Ultra Wiggler
Posts: 988
Joined: Tue Jun 30, 2015 8:44 am
Location: USA

Post by acgenerator »

http://www.elby-designs.com/contents/en-us/p360.html gives a gate rising / falling/ steady.

I'm sure this some how takes the present signal compares it against the previous state (subtraction) along the way but it out puts only a gate rater than the delta.


if you are looking for the voltage change as an output value, you could probably run a CV and a delayed + inversed copy of the CV into a addition function
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

acgenerator wrote:http://www.elby-designs.com/contents/en-us/p360.html gives a gate rising / falling/ steady.

I'm sure this some how takes the present signal compares it against the previous state (subtraction) along the way but it out puts only a gate rater than the delta.


if you are looking for the voltage change as an output value, you could probably run a CV and a delayed + inversed copy of the CV into a addition function
Yeah, I'd looked a that module, actually believing it sent a CV and not a gate and then realized. But it would be interesting to explore it with a voltmeter and see if it's doing that... would be a killer mod for that module. Maybe I'll write the developer and ask.

I like your idea about the delayed and inverted instead of slewed and then inverted. I'll give that a try. Thanks!
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
windspirit
Super Deluxe Wiggler
Posts: 3299
Joined: Thu Sep 20, 2012 11:43 pm
Location: krellifornia

Post by windspirit »

I am pretty sure a hipass filter will do this. You would just need to adjust the cutoff frequency to sort of match the frequency range of the cv that you expect to come in. For acceleration, just cascade 2 hipass filters. Afaik this is how they did things in the analog computing days.
User avatar
acgenerator
Ultra Wiggler
Posts: 988
Joined: Tue Jun 30, 2015 8:44 am
Location: USA

Post by acgenerator »

Ladik's Joystick math might be a module to add to your collection. you can subtract / invert within one 4HP module.

http://ladik.ladik.eu/?page_id=86
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

acgenerator wrote:Ladik's Joystick math might be a module to add to your collection. you can subtract / invert within one 4HP module.

http://ladik.ladik.eu/?page_id=86
Wow, I totally think that is the one.

Very cool. Thanks!
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

Infrablue wrote:
acgenerator wrote:Ladik's Joystick math might be a module to add to your collection. you can subtract / invert within one 4HP module.

http://ladik.ladik.eu/?page_id=86
Wow, I totally think that is the one.

Very cool. Thanks!
And it rectifies.

Edit... maybe not... it looks like you could mix outputs to do that though. But it gets you there, even if you need a rectifier after.

I've never seen those modules... a lot of cool, compact stuff.
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
Dcramer
Super Deluxe Wiggler
Posts: 6090
Joined: Fri Mar 29, 2013 12:11 pm
Location: Canada

Post by Dcramer »

Wow, brilliant patch here, must try it :hail:
User avatar
dumbledog
Super Deluxe Wiggler
Posts: 1219
Joined: Sun Aug 16, 2015 10:10 pm

Post by dumbledog »

I'm pretty wet behind the ears and my rig currently consists of 'a mother 32, ms-20 and a bunch of moogerfoogers,' but the concept of a differentiator or integrator kindof has my brain going. I would think for example that a triangle wave ran through a differentiator would become a perfect square wave, since dx/dt alternates between some value m and -m. Inversely of course a square wave through an integrator would become a triangle wave, and different duty cycles would introduce asymmetries to the triangle's shape. Is this the case?

And while my brain is going, it seems like you could construct a differentiator using a clock and two s&h circuits A and B. On one cycle you'd simultaneously sample the incoming frequency f into A while returning the difference B-f, while the next clock cycle would store into B and return B-f. (I'd use two S&H because reading and sampling from a S&H simultaneously seems hard). Dunno, just thinking out loud here...
User avatar
acgenerator
Ultra Wiggler
Posts: 988
Joined: Tue Jun 30, 2015 8:44 am
Location: USA

Post by acgenerator »

it seems like you could construct a differentiator using a clock and two s&h circuits A and B. On one cycle you'd simultaneously sample the incoming frequency [i wrote:f[/i] into A while returning the difference B-f, while the next clock cycle would store into B and return B-f. (I'd use two S&H because reading and sampling from a S&H simultaneously seems hard). Dunno, just thinking out loud here...
Good idea for an alternate approach. To make it work you would need a really fast clock signal to capture the movements in his video.

expanding on your idea use Track and Holds rather than Sample and holds. Have them receive opposite clocks. One always has the live signal (track), the other the sampled level (hold). A-148 is a dual module offering both S&H and T&H on the versions.

clock into A-148 top, inverse clock into A-148 bottom. Use either clock to trigger a switch between the subtractions (top - bottom) and (bottom - top).
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

Dcramer wrote:Wow, brilliant patch here, must try it :hail:
Thank you, Dcramer. That means a lot coming from you.

If you have a ribbon controller or similar (like a theremin, my Artemis or a Martenot etc.) this makes it so the position of that continuum never changes the pitch of an oscillator when not in motion, but wherever you add motion to it, like back and forth, you get a very natural, human vibrato, and when you stop or let go... right back to in tune.

I came up with the circuit trying to patch the behavior of a DC motor being turned at different speeds back and forth to add a temporary voltage (also for vibrato reasons).

I works quite well playing a keyboard with left hand (even though I suck at that) and doing vibrato with the right on a contiuum. Or other things like that.

But what is even cooler, is summing that circuit with the pitch control from the same continuum after that pitch cv has been quantized and then slewed it's self a tiny bit... you have to get the slew just right for comfort and the speed you want to play... but it makes a really nice theremin style sound that slips smoothly, right into tune when you stop moving... and never has stepping in it (depending on all your slew settings and how fast you want to play... really fast will get you some slight stepping).

To the listenner, usually, one can't hear a difference than a normal continuum/theremin (except that it's surprising how well the melody lands on the right notes when desired).

The player (in my tests, me) CAN tell the difference, and there are times you kind of want all the chaos and difficulty of tuning.


So for this I'm working on a further circuit to cross fade smoothly on command (pedal switch?), or even automatically at the right times from this "analog smooth auto tune when stopped" circuit to just a normal, difficult to tune theremin/continuum CV.

It's all quite effective, one just must make good choices in not over using something that helps you. I find it's best to keep some chaos and at times have that at 100%.

I'll put of some video of the effect. Still just working on it all. I'm still perfecting it, and using it on my Martenot style Artemis, but can't wait to try it with a theremin (especially have my friend play it, who is quite good at theremin... he grew up on trombone and me on trumpet so.... I'm a digital notes man).

I have one other idea that would possibly do this fully automatically that would require a slew rate that knows exactly when to turn it's self up and down to avoid stepping at all speeds and then landing on semi-tones. That one I haven't got working yet or tested.
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
Dcramer
Super Deluxe Wiggler
Posts: 6090
Joined: Fri Mar 29, 2013 12:11 pm
Location: Canada

Post by Dcramer »

I fiddled with this patch today and got it to do some interesting things.
I found that I was getting a bipolar signal out of it, negative when the CV was dropping and positive when it was rising.
I was also able to get it to work with a single S&H. Slower clocks meant less resolution but greater intensity.
It also works with the output of a quantizer and can track the rate of change with scaler CVs :tu:
Would love to see some of your vids involving this :party:
User avatar
Infrablue
This sentence is false
Posts: 1124
Joined: Thu Mar 29, 2012 1:10 am

Post by Infrablue »

Dcramer wrote:I fiddled with this patch today and got it to do some interesting things.
I found that I was getting a bipolar signal out of it, negative when the CV was dropping and positive when it was rising.
I was also able to get it to work with a single S&H. Slower clocks meant less resolution but greater intensity.
It also works with the output of a quantizer and can track the rate of change with scaler CVs :tu:
Would love to see some of your vids involving this :party:
You know, it's been some weeks since I've patched this and thinking back, I'm remembering I did get that same behavior (negative going down, positive going up) which I just remedied by an inverter or I think changing which of the 2 original paired signals got the slew. So was describing that outcome totally wrong... not a surprise with my memory. But that behavior then is fine for my application when it's used with for vibrato.

I want to try your approach with the quantizer and scaler CV's... but I'm not sure just what you mean by the scaler CV part.. what is an example of a scaler CV?

ThankS!
New Breath Control Demo: http://www.youtube.com/watch?v=LTiWw4rL ... bAqEVbUEOE
Lifeform Blues (wind synth/EVI at about 4:30): http://www.youtube.com/watch?v=S4VpSFhVa1I
My demo of the Steiner 24 Stage Vactrol Phase Shifter/String Filter: http://www.youtube.com/watch?v=eh1-A_dYY6Y
User avatar
Dcramer
Super Deluxe Wiggler
Posts: 6090
Joined: Fri Mar 29, 2013 12:11 pm
Location: Canada

Post by Dcramer »

Sorry! I was being obtuse :doh: I simply meant the scaled output of a quantizer.
It's a very cool patch because it creates a way to generate a voltage whose size and polarity are directly correlated with the size and direction of a melody's jump.
User avatar
Smais
Wiggling with Experience
Posts: 263
Joined: Sat Apr 11, 2015 4:04 pm
Location: UK

Post by Smais »

acgenerator wrote:Ladik's Joystick math might be a module to add to your collection. you can subtract / invert within one 4HP module.

http://ladik.ladik.eu/?page_id=86
Nice. I'd seen this module but hadn't quite figured out any applications. This thread is melting my brain. I just can't get my head round this problem. I feel like there is a simple solution just out my grasp. Very interesting though.
User avatar
TheSolenoids
Wiggling with Experience
Posts: 289
Joined: Mon Feb 23, 2015 9:28 pm
Location: 10th Dimension
Contact:

Post by TheSolenoids »

Some interesting math:

d(sin)/dt = cos. So if you have a sine wave, the first derivative is equivalent to phase offsetting the signal by 90 degrees. Modules with phase offsets include Dr. Octature.

d(triangle)/dt = square. Think about it. First the slope is a constant positive number and then a constant negative number.

d(square)/df = 0 except when at exactly phase 0 and 180, then the slope is either positive or negative infinity.

If you're interested in derivative estimation by convolution filtering, Savitsky & Golay (1964) is a good place to start. Essentially, if you filter with a polynomial convolution kernel, the derivates estimates can be obtained in a single matrix multiply between a time-delay embedded version of a matrix and a kernel that focuses on a time-window (read frequency band) of interest and has columns defined by polynomials for each derivative you want.

Thinking about this, it seems to me that derivative estimation by filtering is very similar to a band pass filter with a polynomial kernel. In order to approximate convolution, you would want to first create several time delayed signals, band pass each of them, do a multiplication with the kernel, and then add them back together. Expensive.

Cheaper would be a low pass then split into delayed and non-delayed versions and invert the non-delayed version and sum them. Perhaps this was already suggested and I'm just slow to the party. The disadvantage of this method is that there will be edge artifacts when sudden changes happen.
Critics talk about art. Artists talk about brushes.
The Solenoids new album, Tangled States is at: https://thesolenoids.hearnow.com/tangled-states
Post Reply

Return to “1U & 3U Eurorack Modules”