Align event in MAX with Live beat

kmll's icon

Does anyone have a good method for aligning an event in MAX with Live? I am retrieving the BPM from live using the code below so that is OK however I want to trigger an event so that it starts accurately with e.g the "one" in a bar (i.e aligned with the metronome..)

Code to get tempo:
liveapi = new LiveAPI(this.patcher);
liveapi.path = "live_set";
bpm = api.get("tempo");

Wetterberg's icon

just use transport, metro, timepoint and such. They sync up very nicely, no need to sift through the api.

...transport will also give you the tempo, should you need it for other stuff, of course.

kmll's icon

Thanks for the advise. I quickly tested with transport but how can I get it to sync with Ableton?

Cphas's icon

What are you triggering and how accurate do you want it to be? If you're looking for sample accurate triggering the best way I find is to use a [phasor~] with the lock attributed activated.

as for Wetterberg's suggestion transport is always slaved to Live's clock when used within an M4L context.