FFT analysis: use actual latency
authorRobin Gareus <robin@gareus.org>
Wed, 17 Jul 2019 14:22:44 +0000 (16:22 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 17 Jul 2019 15:30:43 +0000 (17:30 +0200)
Ardour allows to override a plugin's reported latency. So far this
was not taken into account when plotting the phase/freq response.

gtk2_ardour/plugin_eq_gui.cc

index 19ee2c9f1a3cf32801ae24af5226473f3d4eaa1a..5b842d62a4155f73918ec1ed68eeab8b479b8a2c 100644 (file)
@@ -407,9 +407,15 @@ PluginEqGui::run_impulse_analysis ()
        }
 
        samplepos_t sample_pos = 0;
-       samplecnt_t latency = _plugin->signal_latency ();
+       samplecnt_t latency = _plugin_insert->effective_latency ();
        samplecnt_t samples_remain = _buffer_size + latency;
 
+       /* Note: https://discourse.ardour.org/t/plugins-ladspa-questions/101292/15
+        * Capture the complete response from the beginning, and more than "latency" samples,
+        * Then unwrap the phase-response corresponding to reported latency, leaving the
+        * magnitude unchanged.
+        */
+
        _impulse_fft->reset ();
 
        while (samples_remain > 0) {