Forums > MaxMSP

Simple Audio + Midi Sync?

Dec 28 2009 | 9:40 pm

Hi everyone,

I’ve got an audio file and the (multichannel) MIDI file that I used to create it. All I’m trying to do is play both of them in sync in Max, but they keep falling out. No loops, no external devices, no frills; just sync. Should be relatively simple, right?

I’ve spent quite a while mucking with changing the playback speed (via weird messages to detonate), as well as changing the rate of the audio playback, but there doesn’t seem to be a ‘sweet spot’. No matter what, they always fall out of sync after a minute or so.

I’m not sure where to start approaching this… As for specific questions:

1. Should I instead be using some kind of click track / transport?

2. Should I be changing the speed of the midi to sync with the audio, or vice versa?

3. Anywhere I can read up on this type of thing? Can’t seem to find anything as straightforward as this on the forum.

I’m on a new MacBook Pro (core 2 duo 2.53 GHz, 4gb ram), in case it helps.


Feb 09 2011 | 5:11 pm


I am also looking for a solution for this problem (multichannel audio via sfplay~ and a separate midi track). I tried to send audio and midi simultaneously to max via Soundflower and the "to Max/MSP 1" setting. I tried to record them via sfrecord~ and different MIDI objects. seq is unusable, because audio and midi drift apart after a few seconds, seq~ is loop-based, which is not interesting for me, detonate ist only for midi notes. I could be using a external sequencer software for that task, but that’s a) an overkill and b) I need a simpler solution for my deployed audio installations.

I am also on a new Macbook Pro. Any help yould be appreciated!!

Feb 10 2011 | 4:30 pm

I found a solution. You can use seq, as long as "Scheduler in Overdrive" and "in Audio Interupt" is activated. After recording a sequence send a "hook 1.00534" message to seq to speed up the playback. It’s better to use hook and not the "start " message, because the latter is only an integer value and so your playback precision won’t be sufficiently tweekable to "sync" your midi to audio for longer track durations. Also, the hook parameter value may vary on your machine. I attached the patch that lets you record audio and midi simulatenously (I used Soundflower for that) and then play it back. With this setup I managed to fix sync up to about 10 mins of audio and MIDI. After that I got tired of tweeking hook, testing, tweeking hook, testing….

I hope this helps people with a similar problem.

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP