Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI-CAT - Add CV smoothing #79

Closed
johnnovak opened this issue Jan 1, 2020 · 11 comments
Closed

MIDI-CAT - Add CV smoothing #79

johnnovak opened this issue Jan 1, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@johnnovak
Copy link

First of all, this is a great module, so thanks for taking the time to write it!

However, it's not really usable for me because it's a step back from MIDI-MAP in one important regard and also the soft takeover is a bit buggy. So here's the problems I found so far:

  1. Assign the freq of VCO-1 to a MIDI fader. Start wiggling the MIDI knob at various speeds. Notice that the CV is stepped, the frequency jumps, even when wiggling the MIDI knob at fast speeds. A little jumpiness is also noticeable with MIDI-MAP at very slow speeds, but as you increase the speed of movement, the generated CV is completely smooth. You can also try this with a VCA; MIDI-CAT will generate zipper noises when wiggling the knob, while MIDI-MAP is completely smooth and artifact free (this is more noticeable with high-pitched sounds through the VCA).

  2. The soft takeover jumps a bit, making is not really useable with certain parameters like osc frequencies. Again, test is with controlling VCO-1 freq. It's of course not very noticeable with filters, although with controller resonance you can get into problems with the jumpiness.

That's all for today, if you fix these two issues it will be a really great module! I especially like it that you can still control the mapped UI control with the mouse--this is not possible with MIDI-MAP.

@stoermelder
Copy link
Owner

Hi John,

  1. I understand what you are describing but it can be hardly seen as a bug. Are you aware that every MIDI CC has values from 0 to 127? This is a very limiting precision when it comes to controlling the frequency of a VCO and it will be "stepped" by design so to say. I am aware that MIDI-MAP has some slew limiting going on which has been added in Rack v1.1.0 or so. I tried adding it too but it caused some issues with parameter-pickup so I dropped it. I can investigate if it can be added but it won't increase the precision, parameter-movements will look more smooth but you won't get more than 128 possible values.
  2. I'm not sure what you mean by "soft takeover"?

@stoermelder stoermelder self-assigned this Jan 2, 2020
@johnnovak
Copy link
Author

Thanks for your quick reply! Ok, so here's some clarification:

  1. Yeah, I'm fully aware of it how MIDI CC workse. The slew limiting/interpolation was added to MIDI-MAP for a reason, the reason being that when you turn a MIDI knob fader slowly, you don't want to hear a stepped response. That's not just a useful outcome for most scenarios, e.g. you turn a MIDI knob controlling something, you want a smoothed response. 90% of the cases a stepped response is not what you want.

My VCO example was just an example, the stepping causes audible artifacts when controlling volume too, or just about anything. As I explained, when for example you control a simple volume fader with this stepped input, you will hear artifacts ("zipper noise") when changing the volume at moderate speeds (I mean manually, not even close to audio rate modulation). With a pure sine wave you can definitely hear this, with other complex signal maybe not always.

Virtually all VSTs do some form of interpolation like this when automating parameters via MIDI CC, precisely because MIDI CC only has 127 discrete values, as you pointed out. So in VCV rack we need to build this into the MIDI mapper module, as it was done with MIDI-MAP.

You could make this a context menu option, so if some people really want the uninterpolated discrete values, it's there. But I'd say mimicing the MIDI-MAP module is very reasonable, and without interpolation I for example can't use this module for my purposes and I'm sure others will report the same problem in time.

  1. "Soft-takeover" refers to the same thing you call parameter pickup. This should be faily easy to replicate: if you're approaching the parameter value "from below", so the MIDI knob is fully left and you really slowly turn it up, there will always be a little upward jump when the pickup (takeover) happens. So say the value is 60, so you turn the knob slowly from 0 upwards, you're at 56, 57, 58, 59 and then suddenly it will jump to 61 or 62 or something (I'm just talking about MIDI CC values here). So maybe a rounding error or something in your code, it's definitely reproducible, just move the faders slowly and see for yourself.

@johnnovak
Copy link
Author

I checked my favourite softsynth plugin, Zebra 2 from u-he, and the MIDI CC smoothing is actually configurable:

image

So probably it would be best to do something similar.

@Boscop
Copy link

Boscop commented Jan 12, 2020

Yes, it would be useful (probably even as a default, but only in fast setting) but it also should be possible to disable it (via context menu) for some use cases.

@stoermelder This smoothing method works quite well:
https://github.com/JordanTHarris/VAStateVariableFilter/blob/b4ee4ac688a27b8cd1fa7c135ed8e316a3ac53be/Source/Utilities/ParameterSmoother.h#L123
It has configurable smoothing speed. (Btw, that constant is ln 2.)

@stoermelder
Copy link
Owner

I had slew like MIDI-CC added at some point but it caused major problems with MIDI feedback so I dropped it. I thought a lot about it since then and I don't think it can be done with reliable MIDI feedback. Does any of you have a suggestion how smoothing can be added without breaking MIDI feedback?

@johnnovak
Copy link
Author

Maybe if you would describe the feedback problem in detail some of us could help? I'm not sure yet what the problem is.

@johnnovak
Copy link
Author

Also, this means the official MIDI module is also prone to feedback problems? If not, how so?

@stoermelder
Copy link
Owner

Maybe if you would describe the feedback problem in detail some of us could help? I'm not sure yet what the problem is.

The problem is that smoothing will cause a „MIDI feedback loop“, not sure how to call it. When a new value is received by MIDI and smoothing is applied, the actual knob position will have some different value which will be sent back to the controller. In most cases the controller will jump its position to the smoothed value but you’re might still be moving the control. This will sent another MIDI message which will be also smoothed. As result the controller jumps around like crazy and will break definitively any pick-up behavior.

Also, this means the official MIDI module is also prone to feedback problems? If not, how so?

There is no official MIDI module which provides MIDI feedback.

@johnnovak
Copy link
Author

Ah, I think I see what you mean. What about disabling sending back values when smoothing is applied? That would solve the problem for now for sure. I think many people could live with that compromise (I for one don't care about sending values back, so it's a non issue for me).

Then maybe in the future you can devise a method to get rid of the "feedback" when sending back values.

@stoermelder stoermelder added the enhancement New feature or request label Aug 16, 2020
@stoermelder stoermelder added this to the v1.8.0 milestone Aug 16, 2020
stoermelder added a commit that referenced this issue Aug 23, 2020
@stoermelder
Copy link
Owner

Ok, it has been a long time but I finally added filtering/slew-limiting to MIDI-CAT. I had the solution for my feedback-issues quite some time and I finally spent an evening implementing it.
It needs further testing but I think it's on a good way.

@johnnovak
Copy link
Author

@stoermelder Great news!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants