Clarification of getUnitByBus

How should a host map program change events to a plugin that doesn’t implement getUnitByBus?

I’ve seen a number of plugins that return kNotImplemented for getUnitByBus, but do have ParameterInfo::kIsProgramChange set for some (maybe just one) parameters. Without getUnitByBus there’s no way to tell which channel the program change applies to.

Should the host:

  1. Suppress the program change events and not forward them
  2. Assume the parameter applies to channel 1 only and only forward program changes received for channel 1
  3. Forward any program change on any channel to that parameter
  4. Something else?

Also, could you please confirm that getMidiControllerAssignment with kCtrlProgramChange is only used for mapping program changes generated by the plugin and not for sending program changes to the plugin.

Any insight greatly appreciated.

Brad

Hi Brad,
if the plug-in does not implement getUnitByBus (), but providing multiple program change parameters, the plug-in is illformed. If the plug-in report multiple units, you can only change the programs per unit and not via channel. Don’t know if this makes much sense in your case.
The getMidiControllerAssignment is used for mapping MIDI CC to parameter ID’s.

Hi @Arne_Scheffler,

Thanks for the reply. I’m still not really clear on this case:

  1. Plugin reports one parameter as program change kIsProgramChange
  2. Plugin returns kNotImplemented for getUnitByBus
  3. Host receives a MIDI program change event… should it be dispatched to the plugin as a parameter change for the flagged parameter?

(I’m not sure I was clear enough in my original post that I’m specifically talking about mapping MIDI program changes when getUnitByBus is not implemented)

Brad

In this case (one unit, or no unit), you dispatch the MIDI program change as parameter change event to the plug-in.

OK so a program change on any MIDI channel will change the plugin’s program?

Another related question for clarification…

When setting a program change parameter, it needs to be normalized by dividing by the program count. Which program count should be used:

  1. The info.stepCount returned from getParameterInfo() or,
  2. The info.programCount returned from getProgramListInfo() or,
  3. getProgramListInfo() if available otherwise getParameterInfo() or,
  4. Should they always match?

Brad

Do you send any MIDI channel note on to the plug-in?
Most likely the plug-in is a simple one channel plug-in it should report only one channel in its event bus.

The parameter info.stepCount and the program list stepCount must match, otherwise the plug-in is illformed. If the plug-in does not implement IUnitInfo it can have one parameter acting as program list and this one is then to be used.

1 Like

Great… thanks Arne.