Syncing from Live via MIDI clock and [rtin]

Feb 14, 2008 at 11:52am

Syncing from Live via MIDI clock and [rtin]

I am trying to make a step sequencer in Max that gets MIDI sync from a master ( in this case Ableton Live ) via [rtin]. Heres a subset of the sequencer patch i wrote which takes MIDI clock from a Master and sends out a MIDI note every half of a bar.There are a couple things i cant figure out:

1. There is always about an 8ms delay from the time the MIDI signal leaves Live gets processed in Max and receives the note back in Live, Is this normal or can this be done without the 8ms delay. I know i can just adjust this in Live using the MIDI Clock Sync delay Just wondering if there is any way to get this lower or is this roughly the time it takes to do something like this..

2. More importantly, The first note received back in Live is always delayed more than every other preceding note. For Instance the first note will arrive in Live something Like 1/512 off of the exact beat while all notes after will arrive around 1/2048 off of the exact beat, so the first note is shifted with respect to all other notes on the grid. I have tried various ways of triggering the first note to get it aligned with all other notes, namely different ways of using the start message from [rtin] as well as the first tick message from [rtin].

Could you good people check out my patch below and maybe explain to me what im doing wrong or maybe show me another more efficient way of doing this. I dont want to use [hostsync~] though

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 191 148 64 196617 36 100 150;
#P newex 191 254 95 196617 noteout;
#P button 13 197 15 0;
#P hidden message 13 219 14 196617 1;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 50 179 126 196620 0 1 1 0;
#X setrgb 31 31 31 187 187 187 166 236 127 228 241 188 59 173 141 112 112 112;
#X add “AU DLS Synth 1″;
#X add “IAC Driver Bus 1″;
#X add “IAC Driver IAC Bus 2″;
#X add “IAC Driver IAC Bus 3″;
#X add “to MonomeSerial 1″;
#X add “from MaxMSP 1″;
#X add “from MaxMSP 2″;
#X prefix_set 0 0 0;
#P objectname PK_2_to_LIVE;
#P window setfont “Sans Serif” 9.;
#P hidden newex 33 206 48 196617 loadbang;
#P hidden newex 33 228 46 196617 midiinfo;
#P hidden message 202 44 60 196617 controllers;
#P window setfont “Sans Serif” 12.;
#P user ubumenu 133 64 126 196620 0 1 1 0;
#X setrgb 31 31 31 187 187 187 166 236 127 228 241 188 59 173 141 112 112 112;
#X add “IAC Driver Bus 1″;
#X add “IAC Driver IAC Bus 2″;
#X add “IAC Driver IAC Bus 3″;
#X add “from MonomeSerial 1″;
#X add “to MaxMSP 1″;
#X add “to MaxMSP 2″;
#X prefix_set 0 0
0;
#P objectname METRONOME_IN;
#P window setfont “Sans Serif” 9.;
#P hidden newex 202 21 48 196617 loadbang;
#P hidden newex 147 41 46 196617 midiinfo;
#N vpatcher 525 87 1115 813;
#P origin 65 -8;
#P button 114 168 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 410 247 38 196617 del 15;
#P button 410 272 15 0;
#P newex 161 163 38 196617 del 20;
#P newex 156 291 45 196617 onebang;
#N comlet TO SEQ- RESET;
#P outlet 388 299 15 0;
#P button 156 325 15 0;
#P outlet 221 421 15 0;
#P message 256 178 14 196617 0;
#P button 388 224 15 0;
#P button 221 382 15 0;
#P button 280 380 15 0;
#P newex 221 295 32 196617 sel 0;
#P newex 221 259 34 196617 % 48;
#P newex 157 257 32 196617 sel 1;
#P inlet 114 21 15 0;
#P window setfont “Sans Serif” 12.;
#P comment 359 318 60 196620 not used;
#P button 161 117 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 114 96 153 196617 route 250 252 248;
#N counter 0 1 96;
#X flags 0 0;
#P newobj 208 199 77 196617 counter 0 1 96;
#B color 5;
#P window setfont “Sans Serif” 14.;
#P number 208 223 53 14 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P newex 114 61 43 196617 rtin;
#B color 5;
#P newex 256 151 38 196617 del 15;
#P window setfont “Sans Serif” 18.;
#P comment 62 541 513 196626 set track in to 8.8ms delay compensation in Live/Master;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 421 293 69 196617 bang for reset the seq;
#P window linecount 1;
#P comment 132 82 100 196617 start – stop – tick;
#P connect 10 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 25 0;
#P fasten 25 0 21 0 119 236 119 284 161 284;
#P connect 21 0 19 0;
#P fasten 5 0 11 0 213 251 162 251;
#P connect 7 1 8 0;
#P connect 8 0 22 0;
#P fasten 22 0 21 1 166 211 196 211;
#P connect 7 2 6 0;
#P lcolor 13;
#P connect 6 0 5 0;
#P fasten 5 0 12 0 213 251 226 251;
#P connect 12 0 13 0;
#P connect 13 0 15 0;
#P fasten 19 0 15 0 161 350 226 350;
#P fasten 14 0 18 0 285 412 226 412;
#P connect 15 0 18 0;
#P fasten 8 0 3 0 166 142 261 142;
#P connect 3 0 17 0;
#P connect 17 0 6 3;
#P fasten 3 0 16 0 261 172 393 172;
#P fasten 23 0 20 0 415 294 393 294;
#P connect 16 0 20 0;
#P fasten 16 0 24 0 393 242 415 242;
#P connect 24 0 23 0;
#P pop 1;
#P newobj 191 115 85 196617 p ClockFromHost;
#P newex 191 179 52 196617 makenote;
#P window linecount 5;
#P comment 24 92 100 196617 Receives MIDI Sync from Live/Host and outputs a note every half of a measure back to the host;
#P window setfont “Sans Serif” 12.;
#P window linecount 2;
#P comment 281 109 61 196620 Main Guts;
#P hidden connect 9 0 11 0;
#P hidden connect 12 0 11 0;
#P hidden connect 9 0 8 0;
#P hidden connect 11 0 8 0;
#P hidden fasten 8 0 10 0 38 272 7 272 7 174 55 174;
#P hidden fasten 4 0 6 0 152 61 138 61;
#P hidden connect 7 0 4 0;
#P connect 6 1 3 0;
#P connect 3 0 14 0;
#P connect 14 0 2 0;
#P connect 2 0 13 0;
#P fasten 10 1 13 0 113 226 196 226;
#P hidden connect 5 0 7 0;
#P connect 2 1 13 1;
#P window clipboard copycount 15;

Thank you!
Michael

#35810
Oct 14, 2008 at 12:12am

i’m new to max but i was trying to use your patch as a demo patch and i see that your counter is min 1 max 96.

check the patch with a min 1, max 97. since there are 96 messages in a midi clock.

but let someone confirm this because i truly don’t know anything about this stuff… can anyone chime in?

#122514
Oct 14, 2008 at 2:18am

I haven’t looked at the patch but [counter 1 96] counts 96 values as far as I know.

#122515
Oct 14, 2008 at 3:27am

If you’re still in 4.x use Pluggo.

-A

#122516
Oct 15, 2008 at 8:12am

yeah, hostsync and plugsync are a bit tighter. Plugsync being the best. I hear lots of problems with ableton’s midi syncing. This Might have something to do with it

#122517

You must be logged in to reply to this topic.