gogins / csound-vst3-opcodes

The "vst3" opcodes enable Csound to host VST3 plugin instruments and effects.
GNU General Public License v3.0
5 stars 2 forks source link

Implement program change and preset load/save #4

Closed gogins closed 3 years ago

gogins commented 3 years ago

Can't make head or tail out of VST3 program change code or documentation.

The mda examples use parameter ID 1886548852 which equals the enum kProgramChange ('prst').

Sending a parameter change with this ID seems however to do nothing.

gogins commented 3 years ago

I now have the change of program registering as a change of parameter value, but the other parameters do not change accordingly.

I am trying MIDI program change. Didn't help.

gogins commented 3 years ago

In Reaper, the mda JX10 shows up and I can change programs in the automatic UI and see parameters change accordingly, but the sound does not change. This is what Richard and I are seeing with our use of this plugin. Either I don't understand this stuff, or the actual program change is turned off or not implemented in the mda JX10. I will look for a plugin where I can change the sound by changing the program.

gogins commented 3 years ago

Indeed, there is a question in the Steinberg forum about this with a video that exactly reproduces my problem.

gogins commented 3 years ago

I got preset changes to work with with the Odin freeware synthesizer:

  1. Monkey with parameters and save as a preset.
  2. Monkey some more with parameters and save as a second preset.
  3. Selecting the preset in the plugin manger UI changes the sound as one might expect.

However, be it noted, the plugin manager UI is showing a list of presets, not a list of programs. A list of programs would show up in the plugin's own UI.

gogins commented 3 years ago

So it seems that switching factory presets does not work. You have to save them as user presets before you can change the sound by loading a preset. This also works with the mda JX10.

gogins commented 3 years ago

A potential solution is a workaround in the vst3-opcodes code to simulate program changes with preset changes, but this involves a fair amount of code to scan for and load preset files. I take it that some hosts, obviously including Reaper, do this.

I have other things to do, so I am closing this issue until a program list solution is found or presents itself.

gogins commented 3 years ago

After a Zoom call with Richard Boulanger and John Fitch, todos are:

gogins commented 3 years ago

I have fixed some bugs and misunderstandings in the preset loading and saving code, which is now completely correct as to actual code and the Steinberg documentation. But it's still not working. A binary inspection of the preset files shows differences, which I am investigating. I will try to export a preset from mda JX10 in Reaper and compare with what was saved by vst3presetsave.

gogins commented 3 years ago

From reaper for mda JX10 the class ID is: 5653544D44416A6D6461206A78313000 From vst3-opcodes the classinfo ID for mda JX10 is: 5653544D44416A6D6461206A78313000

Probably a mistake to use the component class ID, try the classinfo ID instead.

gogins commented 3 years ago

I have Csound rendering off-line with Odin2 presets exported from Reaper. If this is done during real-time rendering the Odin2 just starts spitting out noise.

Surge does not work and that appears to be because the exported .vstpreset file does not contain the correct class ID, that would be a VST3 plugin bug, not a Csound opcode bug.

CollidingCombSynth and Dexed both export .vstpreset files from Reaper that can be loaded into Csound in real time and do correctly change the sound in real time. Dexed actually sounds kind of nice.

Implementation of presets, program lists, and parameters is not consistent across plugins. I need a synth whose exported presets Csound can load, that also has parameters Csound can set to save an edited version of the preset.

VST3 plugins on Linux seem to belong in /usr/lib/vst3.

gogins commented 3 years ago

Using the class info ID rather than the processor class ID in the load and save calls did the trick.

gogins commented 3 years ago

Presets for the mda JX10 saved from Csound load in Reaper and appropriately cause parameter slides to jump to new values.