Smooth incoming MIDI CC values (LFO ramp)

Hi there,

I’m currently exploring the multichannel audio capabilities of Touch, mostly by utilizing the Audio Render CHOP.

In the very end I’d like to built a ‘spatialized step sequencer’ which is driven by a hardware sequencer/sampler (Elektron Octatrack) and makes heavy use of CC locks as well as custom LFO waveshapes that can be created inside the Octatrack’s ‘LFO Designer’.

However, as the resolution of the LFOs coming from the Octatrack is limited to 16 values (in a sequence), the resulting animation inside TD becomes quite choppy. Therefore I’d like to smooth out the incoming MIDI CC values, however, I didn’t really have a lot of success with this yet…

This here is the sequence of values I’m currently sending on ‘ch1ctrl1’ which should result in a ramp:
0, 8, 17, 25, 34, 42, 51, 59, 68, 76, 85, 93, 102, 110, 119, 127

In the videos below you can clearly see the rather chopped waveshape of the incoming MIDI CC in ‘trail1’. In ‘trail2’ I’m showing the waveshape of an LFO created inside TD to show what kind of result I’m actually aiming for. Additionally, I added two videos showing how this actually affects the animation (circular motion). The first one is again rather chopped while the second is buttery smooth.

TD network

Animation example (chopped)
Animation example (smooth)

Are there any CHOPs inside TD which would allow me to smoothen the incoming sequence of values? If not, would there be a way to accomplish this using Python? Maybe via a Script CHOP?

I’m a little stuck here, any help would be greatly appreciated!

Best
Nic

For further reference:

incoming waveshape

intended waveshape

Hi @niceszett,

will the resolution of the LFOs from Octatrack always be 16?
If so, you could measure the time for each step and from that calculate the Frequency of the Octatrack’s LFO and use this to control the Frequency of a LFO in TouchDesigner.

Making use the Slope CHOP to identify and distinguish between increasing and decreasing steps (only counting increasing steps) and a logic to give me pulse whenever the value changes. This is fed into a count that resets with every logic pulse.

It works pretty well while taking a bit to adjust to frequency changes.

Let me know if this all makes sense - there is probably a simpler solution (@Jarrett ?)
Cheers
Markus
OctatrackSmooth.toe (6.2 KB)

1 Like

Thanks for providing a network-based solution @snaut, it indeed works flawlessly in the given context! However, as it kind of always assumes a ramp type of waveform and I’m sometimes sending sequences that represent other waveforms as well, I went with a custom Python script using the Script CHOP.

The core mechanism of it uses custom parameters to store new values as a ‘previous’ and a ‘current’ value to then calculate the time that passes in between which basically represents the duration of a step. This is used as a basis to get the number of frames which are needed to do a real-time linear interpolation from one value to the other. The whole script is designed to work with any number of channels on a single input connected to it.

I packed all this into a component to maybe re-use it in upcoming projects. However, right now the script depends on scipy which needs to be configured as an external library in TouchDesigner. I just went with ‘td_pip’ by @alphamoonbase - thanks a lot for providing this .tox to us!

In case anyone is interested, feel free to grab the .tox here.

Greetings
Nic

valueInterpolator.tox (4.7 KB)