1
0
Fork 0

Fix sample accurate automation for VST3

This commit is contained in:
Robbert van der Helm 2022-03-29 00:55:24 +02:00
parent 6dd11561c5
commit f301726f37

View file

@ -717,17 +717,21 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
{
let param_hash = param_change_queue.get_parameter_id();
let num_changes = param_change_queue.get_point_count();
if num_changes <= 0 {
continue;
}
let mut sample_offset = 0i32;
let mut value = 0.0f64;
if num_changes > 0
&& param_change_queue.get_point(
num_changes - 1,
#[allow(clippy::collapsible_else_if)]
if P::SAMPLE_ACCURATE_AUTOMATION {
for change_idx in 0..num_changes {
if param_change_queue.get_point(
change_idx,
&mut sample_offset,
&mut value,
) == kResultOk
{
if P::SAMPLE_ACCURATE_AUTOMATION {
input_param_changes.push(Reverse((
sample_offset as usize,
ParameterChange {
@ -735,7 +739,15 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
normalized_value: value as f32,
},
)));
}
}
} else {
if param_change_queue.get_point(
num_changes - 1,
&mut sample_offset,
&mut value,
) == kResultOk
{
self.inner.set_normalized_value_by_hash(
param_hash,
value as f32,