[SOLVED] Questions about Parameters and Midi Learn

Hey together, I am new to JUCE and audio programming and I need some clarification on the topic of parameters and Midi Learning.

What I understand so far and please correct me if I am wrong is the following: VST3 only send Midi Note information to the processBlock function. To also have Midi Controller messages, JUCE creates parameters for each controller type and maps that back one to one to the controllers. In this way we get controller messages in the processBlock. We can disable this mapping with JUCE_VST3_EMULATE_MIDI_CC_WITH_PARAMETERS=0. So now my questions:

  1. If I enable this mapping, do I have to do the Midi Learning in the plugin by myself? Because like I understand VST3 wants to enforce that the Midi Learning only happens in the host which makes sense to me that the plugin should not have to deal with this. Because if I only get the raw controller messages I need a way to associate it to a function.
  2. If I disable this mapping, I have to work with parameters instead of controller messages, right? For example use AudioProcessorValueTreeState. But I’ve read that I don’t get sample accurate parameter changes in JUCE but only in every processBlock call and have to do some interpolation by myself to smooth it.
  3. If I disable this mapping, does my plugin works the same with all plugin formats and hosts? I mean does every host and other plugin format support parameters?
  4. If I need sample accurate parameters and don’t want to do the Midi Learning in the plugin, I need to work directly with the VST3 SDK and cannot do it with JUCE?

I hope my questions are clear so far. Thank you in advance!

We did a few instrument plugins and I think I can answer the questions. I don’t like some decisions made in the VST3 plugin format. I believe plugins should receive all MIDI events like all other plugin formats. Because of this, we have enabled this for our VST plugins.

  1. If I enable this mapping, do I have to do the Midi Learning in the plugin by myself?
    Yes, you need to find a way to map the MIDI CC number to your automation parameter. You will get MIDI CC messages also in the VST3 format when enabled. Otherwise, VST3 does not forward MIDI CC messages.

  2. If I disable this mapping, I have to work with parameters instead of controller messages, right?
    You have to work with parameters anyway. Host automation is always sent with parameter changes. Other formats will still send you MIDI CC messages.

  3. If I disable this mapping, does my plugin works the same with all plugin formats and hosts?
    No, this is only VST3-specific. All other formats forward all MIDI events.

  4. If I need sample accurate parameters and don’t want to do the Midi Learning in the plugin…
    Sample accurate automation is not possible with the current juce wrapper, only if you implement your own wrapper like the clap juce wrapper where you can have sample-accurate automation or if you modify the JUCE framework.
    I don’t recommend that. I would ask yourself if you really need sample-accurate automation. Most time a delay of a processing block is acceptable if you do some interpolation or smoothing of the most important parameter changes.

Thank you! That clears almost everything for me.

2: That’s still not 100% clear to me. If I don’t need automation data, I don’t need parameters? Or do I have to send it somehow back to the host that it can be recorded?
4: I do need sample accurate data, because I am working with a DJ controller that rapidly sends Controller messages. Else I cannot reliable calculate the jog wheel speed.

2: That’s still not 100% clear to me. If I don’t need automation data, I don’t need parameters? Or do I have to send it somehow back to the host that it can be recorded?

That’s true. You only need audio parameters if you want that the DAW can read and write them.

4: I do need sample accurate data, because I am working with a DJ controller that rapidly sends Controller messages. Else I cannot reliable calculate the jog wheel speed.

Sample accurate automation is not possible if the user makes something in real-time. It’s only possible if you draw automation in the DAW.
If you do an app, the way to go is a small buffer size.

Ah ok, so also with the VST3 SDK I would not get real-time sample accurate automation data? But I also want to record that data. I think I have to just test it if it’s sufficient in my case. If I don’t get the timing information I am always dependent on the host or user setting for the buffer size, which is not ideal.

But thanks, I think I have to jump into the programming and just try it out.

You never have sample-accurate automation when the user records in real time. This does not depend on the plugin format. You get the events always in the next buffer. The host can’t modify a buffer that is already processing.

But you could have sample-accurate automation of the recorded automation data when you play back. The host can look into the future in this case.

Ok, that makes totally sense. Thank you very much for your fast response :+1: