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

WIP: VST3 wrapper #5

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

WIP: VST3 wrapper #5

wants to merge 1 commit into from

Conversation

m-hilgendorf
Copy link

Work in progress VST3 wrapper.

Notes:

  • The VST3 wrapper is entirely a macro instead of an internal struct. This requires making WrappedPlugin public
  • Still need to work out how I/O negotiation should work, VST3 doesn't rely on channel count. Failing a few unit tests in the VST3 Validator
  • Parameter string functions left unimplemented
  • Added normalize/denormalize as functions to WrappedPlugin.
  • Blocked on #35 in vst3-sys, Cargo.toml points to my fork.

The code is dense and could probably be cleaned up in a few places.

@wrl wrl changed the title VST3 wrapper (WIP) WIP: VST3 wrapper Aug 23, 2020
Comment on lines +625 to +648
// drain parameter changes
// todo: interleave with events for sample accurate automation
if let Some(input_param_changes) = data.input_param_changes.upgrade() {
for i in 0..input_param_changes.get_parameter_count() {
if let Some(queue) = input_param_changes.get_parameter_data(i).upgrade() {
let id = queue.get_parameter_id();
for p in 0..queue.get_point_count() {
let mut offset = 0;
let mut value = 0.0;
if queue.get_point(p, &mut offset as *mut _, &mut value as *mut _)
!= 0
{
break;
}
if let Some(param) = baseplug::api::vst3::param_for_vst3_id::<
<$plugin as Plugin>::Model,
>(id)
{
self.plugin().set_parameter(param, value as f32);
}
}
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should already be able to use https://github.com/wrl/baseplug/blob/trunk/src/event.rs#L9-L21 to enqueue parameter change events.

doesn't support ramp events and almost certainly never will, but who cares.

Comment on lines +677 to +681
// todo: figure this out
baseplug::MusicalTime {
bpm: 0.0,
beat: 0.0,
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we pass in MusicalTime to the plugin as an Option<MusicalTime> to handle the case where the host doesn't provide any?

Comment on lines +479 to +481
(true, false) => ("Audio Input", 2),
(false, false) => ("Audio Output", 2),
(true, true) => ("Event Input", 0),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it alright as a stopgap to use Plugin::INPUT_CHANNELS, Plugin::OUTPUT_CHANNELS, Plugin::MIDI_INPUT here?

until we figure out a more comprehensive bus configuration scheme, that is

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.

2 participants