[sharing] I made a M4L looper with gen~, check it out?

I eventually want to submit this as a project, but it's not quite polished enough for me to take the plunge, and I want to get documentation together. I made a very brief overview of the device that you cna check out here:

All the audio processes are done in one big codebox in gen~. It was my first stab and writing audio code at that level, and I learned a ton. And also made a bunch of mistakes, some of which are still in there. Another reason not to put it through as a project yet ;)

Sorry if the post seems self serving, but I've been having a lot of fun using this, and maybe someone here will too!

Hey man would love to try this out and pick your brain. I'm developing a similar but different looper and am getting stuck synchronizing the loop to the ableton clock. Would love to chat. If you get a second to email your device to vince.cimo@gmail.com that would be awesome. Thanks brother.

I am simply starting an a clock in my gen code whenever Live's transport starts. If it ever get's off from Live's clock due to tempo changes, meter changes, or if you start the transport in the middle of a bar, you can manually resync to the next 16th note. There's not much synchronization except for a few events.

Mostly building using java externals, i'm using a javascript object as a passthrough which sends the java external Live transport data. I'm attaching a dead simple project that shows how if the transport is running and there's a loop & you hit play, it should sync up by calculating the ms till the next bar. I'd be happy to share the whole project with you if you're interested. It's a midi looper, so no audio data is being processed.

@vince cimo: Your javascript wasn't included in the device, so I can't take a look at that. But after hearing your description, it sounds like you are using both javascript, and the Live API to calculate timing parameters/events? javascript gnerally shouldn't be used (in my experience) for tasks that require really precise timing. And the Live API definitely shouldn't be used if you're after really accurate data, there's always been a bit of unpredictability when using the Live API to synchronize (again, in my experience).

There are a few things you could do. The easiest might be using plugsync~ or plugphasor~ to get the audio rate clock of Live and do all your timing that way. Even if you're only recording MIDI events and you're not processing any audio, you might get better results if you were clocking with audio rather than asking the Live API for info, and then calculating the delay time. Here's a few ways to do it:

Thanks so much for the info! I'm gonna play around with this and see if I can get things syncing tighter. By the way....you should charge for your patch and release it to the public. There's a market for that sort of thing.....

@evan! you are a badass. It was a bit of a pain but I pulled all of my data manipulation out of JS and into Max and fed that into my Java external and this thing is working so much better. Thanks so much for getting me unstuck.