Smoothing out MIDI value jumps

    Mar 14 2013 | 4:55 pm
    Hi everybody,
    I'm trying to assign a midi slider to a gain~ object with a catch behaviour, meaning that I have to match the gain~ slider value with the MIDI slider before taking control of it so as to avoid any unexpected jumps in gain.
    Now the way I did it was with a == object comparing both gain~ slider value with midi value, connected to a gate letting the MIDI signal through to the gain~ object only when the two signals matched. It works perfectly except for one thing, my slider doesn't output perfectly continuous data and jumps steps when moved fast, which means loosing control of the slider whenever moving it too quickly. Now I've been trying to find a way to interpolate numbers between the gaps in midi data, and have not been able so far to find a good solution. I'm sure it's quite simple though. Any idea ? Any help would be much appreciated, thanks !
    Here's a simplified version of my patch :

    • Mar 14 2013 | 7:10 pm
    • Mar 15 2013 | 5:32 pm
      Hi Chris, thanks for the link, I checked it out but there's seems a bit of a difference in what Yuni was trying to achieve and what I need.
      He was trying to smooth out jitter in a number stream, and I'm trying to interpolate values between jumps in incrementing or decrementing number streams in the MIDI range. For example this is the data value received by max when moving my MIDI Slider up and down really fast :
      midiSliderValue: 2 midiSliderValue: 49 midiSliderValue: 111 midiSliderValue: 127 midiSliderValue: 61 midiSliderValue: 0 midiSliderValue: 2 midiSliderValue: 13 midiSliderValue: 23 midiSliderValue: 36 midiSliderValue: 47 midiSliderValue: 68 midiSliderValue: 92 midiSliderValue: 114 midiSliderValue: 127 midiSliderValue: 105 midiSliderValue: 25 midiSliderValue: 0
      Now what I need is to find a way to interpolate all the numbers in between the jumps in value to have a continuous flow of numbers going trough every integer value before reaching the final value as sent by the MIDI slider. And it would then look more like this :
      midiSliderValue: 1 midiSliderValue: 2 midiSliderValue: 3 midiSliderValue: 4 midiSliderValue: 5 midiSliderValue: 6 midiSliderValue: 7 midiSliderValue: 8 midiSliderValue: 9 midiSliderValue: 10 ... midiSliderValue: 32 midiSliderValue: 33 midiSliderValue: 34 midiSliderValue: 35
      I need it to go through every integer values in between the first value and the last value, because otherwise I loose unity of gain~ slider value and Midi slider value.
      I tried using the method you provided in your topic, but it unfortunately didn't achieve this.
      Would you have any ideas on how to achieve this ?
      Thanks for the help!
    • Mar 15 2013 | 7:10 pm
      Here's an old abstraction of mine called EveryNumber:
    • Mar 15 2013 | 7:23 pm
      But if you're controlling gain~ you may prefer an approach like this:
      This doesn't hit every number, but you may not need it to.
    • May 14 2013 | 7:28 pm
      Thanks for the EveryNum abstraction. Very useful with MIDI crossfaders.
    • May 15 2013 | 2:54 pm
      f0.smooth is a brilliant object for this kind of thing.
    • May 15 2013 | 4:45 pm
      erhm... live.gain~ ... it has an interp parameter, so you don't have to fiddle with smoothing at all.
    • May 15 2013 | 5:14 pm
      @WETTERBERG : In this case the interp paramater of the live.gain~ object is of no use to me, as the slew only affects the audio output of the object not the Slider Value output. The idea was to keep unity between a MIDI slider that jumps between values and a Gain~ slider, it wasn't about smoothing out gain changes.
    • Apr 09 2014 | 7:53 am
      I need it too... any discoverie ?
    • Apr 09 2014 | 9:31 am
      What I m looking for is a regular interpolation, something like a Counter but with a live.dial
      A big live.dial moove (6->120) with a line object makes numbers increase faster than a little moove (6->24).
      I would like the increment/decr sending every values (6 7 8 9 10 11.. 100) and be regular in time (1 [5ms]> 2 [5ms]> 3 [5ms]> 4 [5ms]> 5 [5ms]> 6 [5ms] ...> 100)
      I m not sure it's easy as hell or complicated
      Hope someone can help
    • Feb 01 2017 | 7:18 pm
      None of these did what I needed but I found this smooth-line from the real time composition library that does exactly what I want.
      Just dial in how much smoothing you need in the top right inlet. I use a range of 0 - 500. Its good for smoothing my midi macro targets as the cc value jumps significantly when the range is scaled quickly and the fader is moved slowly.
    • Apr 03 2018 | 6:09 pm
      Thanks @ChrisMuir! The EveryNumber subpatch instantly fixed an issue with fading LED values.