midiin'midiout objects updated to include MTC/midiclock

Learn about building and using Max for Live devices.
Post Reply
leighhunt
Posts: 31
Joined: Mon Mar 30, 2009 9:41 am
Location: London UK
Contact:

midiin'midiout objects updated to include MTC/midiclock

Post by leighhunt » Sun Sep 19, 2010 4:12 pm

Hi all,
Thanks for your feedback so far.
I've now updated the objects to include MTC/midi clock.

http://web.mac.com/leighhunt/iWeb/Site/downloads.html

Anyone having issues let me know. My setup doesn't really have call for these messages, so I have only tested loopback throughput of messages.

a patch demonstrating sending midiclock....

<pre><code>
----------begin_max5_patcher----------
1734.3oc4Z07iiZCE+bl+JPQ8XZj+hu5o1pdYk5psGZOsZ0HRvIwc.bD3L6L
c01+1qwFHjLlDfPnncODBXC1u2O+7u26Y6u7vr4q3uPyla8SVezZ1ru7vrYp
hxKXVwyylGG7x5nfL0qMeMONllHluPWmf9hPU9JZPUga3IhL1+Pyq.BVBJJd
eJMS9oABFO4wT5ZgtegNNxWwxAkeEm+5VPuk.qOU7YIGhYIQTgp+gksUfX8N
Vx1ZsCwW0NHGXyMD+fnrkLIU06AVnRu3q96ez1qtlkDDqzr4+RJKHx5W4Qgy
yq8qO7P9kEsDHiXOSWt5fPH61hV+4fzpF2P0MgeDhB+vJE1t7Z2wOWhF+PM2
P0vOXGvOmJUHHUpfBZ5izjfUQz5eftsEutmpkm4yq54rfmogOFHDoLIjPOdW
VA.Wfv4PXzAJeSYwkkWum4ogzzZV.mTYHcSyUlsmRCiXwJodow2PP2m0zmyR
dlkwJzZSu.UhvE5Neyl4Kj+kTABm9lurmmjOMrQIIHIgWXpTYSM2v6cHgIxD
uVLTXpkhklsM2OwRiKk9Xr1xQSjQ3fIjSfpYIXDQ2wSEWXVwoBCOrTXQtFEn
Hdx1tzZWR4hXIOk2VMNfm2.7PZy1Ca3WdbQWqtRE8R4ecjqQJiYAaougzljb
EJ6S3NPMycX6o4N.tJtWzRaI2gyU4NpyQfuFG6EnI5AjjP+rraeChHA+Tt0O
GbPvyDAoBKn7g0BoghE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
TAjNDiO1A35QVX7tqDjewVOVLzTdRN5zpybAeoiztwFcXqrG92g57rnBHChT
wUXi69Bb16jdxXRN7nbavh6FZThkLrfDo2XD79fQJAXtzM14GBXkJjW9o.WF
+P55xlt7jHcb6ulGJCtikTQ.8wim+yZuzNVXHMo9FgHmXumKoTpHjLNL1ZYB
2FYJWvgilLo1giqKT3tATHfZA+zYAYK+q3gaTXwsQVyOBEi3fZqEoQbLsM1Y
mgk2aYJe+PlbxDZ5ISHPKjIHdbwoVHRmM9duEI21HSHvzSlNyl69Su2Fa7yj
76NP0FY5bI+tiTmPQ2fA03Ri2FS7wkHnMhjWGCUfXmGc.wSeVRgEGcxSdhn2
Fd8pzqd5ViDqMyTgcSQv9d4hmMPuiBxD+dySDcb1kpb9S2nh30Bq1wkYF1lI
RczFg3izaPnac6.r6MCetNsgcbbmj4BaE6HYj8iPldHkWqCBXpkOkm+MjOE1
GMP4So8wdsIqiavAXvcfa9r0V3gu9v+wEhjT3
-----------end_max5_patcher-----------
</code></pre>

comments i was sent...

' the clock is a little more jittery than using abletons clock BUT:
as the clock is placed on audio track it now magically gets
Latency compensated :) :) :)
very cool. ive been strugglicng to use the sequencer on my rs7000 in sync with live for a long time
now it works much better, without need to adjust clock offset with every plugin i drop into live.
furthermore if you use en 'ext.insrtument' on all your midi tracks that go to external gear, they all get latency compensated.
so basically you made the best workaround yet for lives latency compensating shortcomings with
external midi gear. '

One possibility on the jittery front is having a delay message to set a system delay more precisely within the external. I'm not sure if this will lessen the jitter, but I'll give it a go over the next week.


broc wrote:
leighhunt wrote:These objects can equally be used in maxmsp, but differ only slightly from maxmsp's midiin and midiout objects.
Can you please explain the differences (and reasons) in more detail?
Would it be possible for the user to build abstractions which are fully compatible with Max?
The only difference is that lh_midiin outputs lists (except for single byte messages, which output as int), whereas the maxmsp midiin outputs streams of ints. I haven't fully checked what clock/mtc that max's midiin outputs.
broc wrote:]How about 1-byte real time messages like MIDI clock and MTC?
For example, I have a MTC generator built in Max.
Running it in M4L would turn Live into a MTC master (which currently is a missing feature).
Hopefully this works now with the updated objects. Let me know if you have problems.
ShelLuser wrote: Within this context I'm one of the 'losers'; running on Windows here. ;-)

I've given the whole idea some thought before and well; don't pick this up the wrong way: I know my way around Windows but hardly every detail, yet having said that I think you might have a hard time porting this.

Unix(-like) environments tend to be much more open with regards to device and file access. As in; when $text_editor opens a file a backup process will have no problem at all accessing that file for backup purposes. On Windows the OS itself would tend to block access.

Sometimes this behavior is (semi-) optional; a soundcard can often be setup so that the OS won't grant dedicated control over it (hardware properties) but other devices such as USB midi devices do not seem to support settings like that.

But who knows... ;-)
I guess windows porting is off then..... sorry.

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: midiin'midiout objects updated to include MTC/midiclock

Post by broc » Sun Sep 19, 2010 10:27 pm

Thanks for the update!

So I've just checked MTC output with my MTC generator patch in M4L.
And I was in fact able to run Logic as slave synced to Live ... a historical moment.

However, for MIDI clock and MTC output, finding the proper start time is still an open question.
Unfortunately, as discussed in other threads the 'ObserveTransport' object sends 1-0-1 at start.
These values are sent within a range of 100ms and it's not clear which (if any) 1 corresponds to the actual start of Live's transport.
Maybe the best method would be using instead the first bang from a quantized metro with attribut @active 1.
Anyway, I think this needs some investigation/clarification.

Regarding MTC input, there seems to be a little bug.
For example, when sending <241 32> it receives nothing at first attempt, and then <241 32 32>.
Note that MTC messages are 2 bytes (not 1 as I've said wrongly in a previous post).

Thanks again for the great work!

leighhunt
Posts: 31
Joined: Mon Mar 30, 2009 9:41 am
Location: London UK
Contact:

Re: midiin'midiout objects updated to include MTC/midiclock

Post by leighhunt » Sun Sep 19, 2010 11:10 pm

broc wrote: Thanks for the update!

So I've just checked MTC output with my MTC generator patch in M4L.
And I was in fact able to run Logic as slave synced to Live ... a historical moment.
Great to hear!
broc wrote: However, for MIDI clock and MTC output, finding the proper start time is still an open question.
Unfortunately, as discussed in other threads the 'ObserveTransport' object sends 1-0-1 at start.
These values are sent within a range of 100ms and it's not clear which (if any) 1 corresponds to the actual start of Live's transport.
Maybe the best method would be using instead the first bang from a quantized metro with attribut @active 1.
Anyway, I think this needs some investigation/clarification.
If you could send me the MTC generator patch I'll look into options for that.
broc wrote: Regarding MTC input, there seems to be a little bug.
For example, when sending <241 32> it receives nothing at first attempt, and then <241 32 32>.
Note that MTC messages are 2 bytes (not 1 as I've said wrongly in a previous post).
The reason will be that I have it formulating 3 byte messages - whoops!, so I will fix in the next update.
broc wrote: Thanks again for the great work!
You're welcome!

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: midiin'midiout objects updated to include MTC/midiclock

Post by broc » Sun Sep 19, 2010 11:56 pm

So here is the MTC generator patch.
It's a simplified version adapted from Peter Elsea tutorials ftp://arts.ucsc.edu/pub/ems/maxtutors/

- framerate fixed at 25, i.e. quarter frame interval is exactly 10ms (no rounding errors).
- start time fixed at 0:0:0:0. (e.g. Logic uses 1:0:0:0 by default, so it must be changed there!).
- each run starts at the beginning, i.e. no support of stop/continue.

<pre><code>
----------begin_max5_patcher----------
2729.3oc6cs0iiaaE94Y9UHXfVzjNcBuoaEnAHoEKZenYQQebQv.M1zyntxR
FRxN6tI4+dEuHaIaIaJRYMRdMVr1iEkoNmOdtQdNz7Wu+tYOm7IZ1Lq+p0Gr
t6te896tieI1EtS946lsJ3SyiBx321r4IqVQiym8fnsb5mx4WOKOHMOKOYs0
eB9cfuor83MqR1jGQy4eaf7pqCxm+ZX7KOkRmmKd5HG2GAOX4.Yu5ZydE58H
v5mkekkIw4YgegxtaH3wxdJbA+om77+6u3LqxsFGrheqy9gzvfnJTSXbIw.Y
W62u+d1KOnH2GS+khG0QL+KA4zl4X3I3XHmWgDNiiQOZ2YVFV9PEOw7OulJ5
6Yyp0K0QCqeLIZQiPBxXHYaP5tG1FGeW...QdGAXEvQdZyHFtcDCZiXPEw2i
+liFBIPu1grGj+WKnqbfNkVnDjJ6y8TVVvV5hmJnfBl4IFyG97lbgl2c6.VF
SmV77xooOQiCdNhtSNkMfTsm10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: 2
Joined: Mon Dec 19, 2011 9:51 pm

Re: midiin'midiout objects updated to include MTC/midiclock

Post by mikecreates » Thu Dec 29, 2011 3:39 am

So I just stumbled upon this thread because I need Ableton to be an MTC master for a lighting board.

I am very new to M4L and need a little direction- how I can get this into Ableton and set it up?

Help would be incredibly appreciated as I've tried to figure this out for the past couple of hours now to no avail. Please walk me through getting this into an Ableton project. I'm currently running M4L in Demo to see if this is a viable option.

Thank you in advance!

-Mike

twisted-space
Posts: 1253
Joined: Fri Aug 31, 2007 5:50 pm
Location: UK Midlands

Re: midiin'midiout objects updated to include MTC/midiclock

Post by twisted-space » Thu Dec 29, 2011 11:14 am

leighhunt wrote:
ShelLuser wrote: this behavior is (semi-) optional; a soundcard can often be setup so that the OS won't grant dedicated control over it (hardware properties) but other devices such as USB midi devices do not seem to support settings like that.

But who knows... ;-)
I guess windows porting is off then..... sorry.
It does depend on the device, but e.g. my babyface, midisport 8x8s and midisport uno are all multi client capable under win7 x64

maky355
Posts: 238
Joined: Thu Apr 07, 2011 6:10 am

Re: midiin'midiout objects updated to include MTC/midiclock

Post by maky355 » Wed Oct 30, 2013 3:44 pm

mikecreates wrote:So I just stumbled upon this thread because I need Ableton to be an MTC master for a lighting board.

I am very new to M4L and need a little direction- how I can get this into Ableton and set it up?

Help would be incredibly appreciated as I've tried to figure this out for the past couple of hours now to no avail. Please walk me through getting this into an Ableton project. I'm currently running M4L in Demo to see if this is a viable option.

Thank you in advance!

-Mike
Same here. I am new to m4l and don't even know how to paste code posted above. But using m4l devices quite a lot. I am coming from Cubase and i need MTC (which cubase can generate easily) to sync with my hardware devices. I need basic MTC, 25 frames, with STOP/Continue function if possible but if not even basic (start only) will do..

I will appreciate help.

Kind regards

Post Reply