Bach and M4L sync

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
lg3bass
Posts: 3
Joined: Tue Apr 05, 2022 1:24 am

Bach and M4L sync

Post by lg3bass » Wed May 03, 2023 7:35 pm

Hi, First I just want to thank you for this amazing package. I'm working on some cool projects I want to share soon.

I'm trying to run bach in M4L. is there a way to sync Bach and Ableton's clocksource? In my tests clocks to drift about 1/8note at about 5min at 152bpm.

Is there a way to keep Live and Bach in sync using at the same tempo? I'm looking at #clock in the help but I'm not sure if Max's setclock can be driven by ableton.

thanks, -=Bob

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: Bach and M4L sync

Post by danieleghisi » Thu May 04, 2023 12:36 pm

Unfortunately I am no expert in Live.
What I can suggest is to use "play preschedule" instead of play to optimize playback, and to send a "realtime 1" message which takes care of setting some cosmetic attributes to the most efficient values.
That said, I wouldn't know about setclock and syncing to Live. Perhaps someone else here does...

Best,
Daniele

lg3bass
Posts: 3
Joined: Tue Apr 05, 2022 1:24 am

Re: Bach and M4L sync

Post by lg3bass » Fri May 05, 2023 1:04 am

I figured out the problem. I just have to use a tempo where the quarter is a whole number in miliseconds. 1/4note @ bpm 152 = 394.7368421052632ms. Where as @150bpm = 400.0ms. In the patch i'm converting from score to roll. When the tempo of bach.score was set to 152, it must be that bach.score2roll rounds? I'n not sure but not a big deal... at 150bpm bach and Live stay in sync for at least 8min in my test.

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: Bach and M4L sync

Post by danieleghisi » Fri May 05, 2023 12:35 pm

Ah I see, if you're with bach.score you may want to have a look at the @tempodigits attribute. By default it is set to 2, it's the number of decimals for tempo approximations. If you increase it, it may get better...

Best,
Daniele

Post Reply