-
Notifications
You must be signed in to change notification settings - Fork 14
WIP: VST3 wrapper #5
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
base: trunk
Are you sure you want to change the base?
Conversation
// 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); | ||
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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.
// todo: figure this out | ||
baseplug::MusicalTime { | ||
bpm: 0.0, | ||
beat: 0.0, | ||
} |
There was a problem hiding this comment.
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?
(true, false) => ("Audio Input", 2), | ||
(false, false) => ("Audio Output", 2), | ||
(true, true) => ("Event Input", 0), |
There was a problem hiding this comment.
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
Work in progress VST3 wrapper.
Notes:
WrappedPlugin
publicnormalize
/denormalize
as functions toWrappedPlugin
.The code is dense and could probably be cleaned up in a few places.