Skip to content

Conversation

@javieridcglobal
Copy link

Implement the TODO from src/context/process.rs to add parameter setting capabilities to ProcessContext, enabling plugins to update parameters from the audio thread with proper host notification.

This allows MIDI CC events in the audio thread to record automation and update the GUI in the DAW, similar to how GuiContext works but optimized for real-time safety using lock-free queues.

Changes:

  • Added raw_begin_set_parameter(), raw_set_parameter_normalized(), and raw_end_set_parameter() methods to ProcessContext trait
  • Implemented for CLAP wrapper using existing queue_parameter_event() infrastructure
  • Implemented for VST3 wrapper using component_handler API
  • Added ParamPtr import to process.rs

Implementation details:

  • CLAP: Uses OutputParamEvent queue with BeginGesture/SetValue/EndGesture
  • VST3: Uses component_handler with begin_edit/perform_edit/end_edit
  • Both implementations are real-time safe (no allocations, lock-free queues)
  • Events queued during process() are sent to host at end of audio cycle

This resolves the long-standing limitation where MIDI CC parameter changes in plugins couldn't notify the host for automation recording.

Tested with: B3 November Hammond organ emulator
Host tested: Reaper (CLAP format)

Implement the TODO from src/context/process.rs to add parameter setting
capabilities to ProcessContext, enabling plugins to update parameters from
the audio thread with proper host notification.

This allows MIDI CC events in the audio thread to record automation and
update the GUI in the DAW, similar to how GuiContext works but optimized
for real-time safety using lock-free queues.

Changes:
- Added raw_begin_set_parameter(), raw_set_parameter_normalized(), and
  raw_end_set_parameter() methods to ProcessContext trait
- Implemented for CLAP wrapper using existing queue_parameter_event() infrastructure
- Implemented for VST3 wrapper using component_handler API
- Added ParamPtr import to process.rs

Implementation details:
- CLAP: Uses OutputParamEvent queue with BeginGesture/SetValue/EndGesture
- VST3: Uses component_handler with begin_edit/perform_edit/end_edit
- Both implementations are real-time safe (no allocations, lock-free queues)
- Events queued during process() are sent to host at end of audio cycle

This resolves the long-standing limitation where MIDI CC parameter changes
in plugins couldn't notify the host for automation recording.

Tested with: B3 November Hammond organ emulator
Host tested: Reaper (CLAP format)
@javieridcglobal
Copy link
Author

I have tested it with Reaper, both in Linux and Windows. I sent midi CC codes to my CLAP instrument plugin and the parameter changes from the CC midi codes cause Reaper to change the plugin default DAW controls. Off course It should be tested with other DAWs supporting clap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant