lv2plugins: correctly compute tempo to be passed to LV2 plugins
This commit is contained in:
parent
f08299ea1e
commit
9fd0076c93
@ -54,6 +54,8 @@
|
|||||||
#include "pbd/windows_special_dirs.h"
|
#include "pbd/windows_special_dirs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "temporal/superclock.h"
|
||||||
|
|
||||||
#ifdef WAF_BUILD
|
#ifdef WAF_BUILD
|
||||||
#include "libardour-config.h"
|
#include "libardour-config.h"
|
||||||
#endif
|
#endif
|
||||||
@ -2857,7 +2859,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||||||
if (valid && (flags & PORT_INPUT)) {
|
if (valid && (flags & PORT_INPUT)) {
|
||||||
if ((flags & PORT_POSITION)) {
|
if ((flags & PORT_POSITION)) {
|
||||||
Temporal::BBT_Time bbt (metric.bbt_at (timepos_t (start0)));
|
Temporal::BBT_Time bbt (metric.bbt_at (timepos_t (start0)));
|
||||||
double bpm = metric.tempo().note_types_per_minute();
|
double bpm = (superclock_ticks_per_second() * 60) / metric.superclocks_per_note_type_at_superclock (samples_to_superclock (start0, TEMPORAL_SAMPLE_RATE));
|
||||||
double time_scale = Port::speed_ratio ();
|
double time_scale = Port::speed_ratio ();
|
||||||
double beatpos = (bbt.bars - 1) * metric.meter().divisions_per_bar()
|
double beatpos = (bbt.bars - 1) * metric.meter().divisions_per_bar()
|
||||||
+ (bbt.beats - 1)
|
+ (bbt.beats - 1)
|
||||||
@ -3244,7 +3246,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||||||
* Note: for no-midi plugins, we only ever send information at cycle-start,
|
* Note: for no-midi plugins, we only ever send information at cycle-start,
|
||||||
* so it needs to be realative to that.
|
* so it needs to be realative to that.
|
||||||
*/
|
*/
|
||||||
_current_bpm = metric.tempo().note_types_per_minute();
|
_current_bpm = (superclock_ticks_per_second() * 60) / metric.superclocks_per_note_type_at_superclock (samples_to_superclock (start0, TEMPORAL_SAMPLE_RATE));
|
||||||
Temporal::BBT_Time bbt (metric.bbt_at (timepos_t (start0)));
|
Temporal::BBT_Time bbt (metric.bbt_at (timepos_t (start0)));
|
||||||
double beatpos = (bbt.bars - 1) * metric.divisions_per_bar()
|
double beatpos = (bbt.bars - 1) * metric.divisions_per_bar()
|
||||||
+ (bbt.beats - 1)
|
+ (bbt.beats - 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user