Skip to content

Commit c1fb771

Browse files
committed
Ok solution
1 parent 86ad448 commit c1fb771

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ impl Plugin for Gain {
376376
let mut current_beat: f64 = context.transport().pos_beats().unwrap();
377377

378378
if *self.alt_sync.lock() {
379+
// This is scaled a little more to catch things earlier due to thread timing in Ardour
380+
// This should still play well with other DAWs using this timing
381+
current_beat = ((current_beat + 0.036) * 100.0 as f64).round() / 100.0 as f64;
379382
let current_bar = current_beat as i64;
380383
// Tracks based off beat number for other daws - this is a mutex instead of atomic for locking
381384
if *self.alt_sync_beat.lock() != current_bar {
@@ -385,7 +388,7 @@ impl Plugin for Gain {
385388
}
386389
} else {
387390
// Works in FL Studio but not other daws, hence the previous couple of lines
388-
current_beat = (current_beat * 1000.0 as f64).round() / 1000.0 as f64;
391+
current_beat = (current_beat * 10000.0 as f64).round() / 10000.0 as f64;
389392
if current_beat % 1.0 == 0.0 {
390393
// Reset our index to the sample vecdeques
391394
self.in_place_index = Arc::new(AtomicI32::new(0));

0 commit comments

Comments
 (0)