PURE DATA forum~

...that deal with pure data

You are not logged in.

#1 2008-01-28 23:40:29

jade
Member

midi clock/sync in

I want to controll the speed of a metronome with midi sync, how should i do?
I have searched the forums and googled but can't find a good answer how to do this and the documentation for midi in messages is kinda sparse.

Also since its my first message i guess i should say hi:
Hi everyone!

Offline

 

#2 2008-01-29 00:23:33

obiwannabe
Administrator

Re: midi clock/sync in

Hello jade,

There's a [midirealtimein] object for that. You might have to ask a few people who've used it exactly how it works. Remember there are three ways of doing things, a resynced metro that freeruns and gets re-triggered every so often, using midi clock as the timer to make bangs, and using midi-timecode to give you a song position.


Use the Source.

Offline

 

#3 2008-01-29 15:38:19

boonier
Member

Re: midi clock/sync in

HI Jade

If you have the latest autobuild of Pd 0.40.3-extended then this will give you the correct [midirealtimein]. By correct I mean one that works properly and that spits out coherent values.

WHen you've set up all the IAC busses and your clock source is running, the left outlet of [midirealtimein] spits out the number 248 at 24 times per beat. (248 is the midi message for 'clock'.  250 is start. 252 is stop)

To tap this usefully do this:

-You need to work at intervals of 0, 24, 48, 72 [sel 0 24 48 72]
-a counter that goes from 0 to 96
-a reset mechanism to forces counter back to 0 if source clock is stopped.

The attached patch explains it better.

Useful to note, the less latency you set for Pd, the more accurate midi will be. Midi messages move with audio blocks in Pd. Also, if you use Jack on OSX you'll get better performance at low latency sizes

as a reference...
http://www.borg.com/~jglatt/tech/midispec/clock.htm


boonier

Attachments:
Attachment Icon midisync_in.pd, Size: 1,914 bytes, Downloads: 577

Offline

 

#4 2008-01-30 22:42:09

jade
Member

Re: midi clock/sync in

thanks a lot, this will get me going again

Offline

 

#5 2008-12-13 19:22:02

hardoff
Member

Re: midi clock/sync in

hey thanks boonier.  i didn't think midi sync was going to work for me, but it just did and all thanks to you and this patch.  cheers.

Offline

 

#6 2008-12-13 23:07:13

boonier
Member

Re: midi clock/sync in

no probs :) what did you end up syncing, and is it quite tight sync?

cheers


boonier

Offline

 

#7 2008-12-14 05:33:11

hardoff
Member

Re: midi clock/sync in

well, i just synced a sequencer here in linux, but actually i have no idea how to use that program so it was just running without any output.  but it was definitely getting the 250 start, 252 stop and 248 clock messages.

the final goal though is to help a friend sync some stuff i made to ableton live.

Offline

 

#8 2012-04-05 22:36:17

dnk777
Member

Re: midi clock/sync in

hi boonier,
thanks for the patch. could you please explain how exactly it works? because i might be wrong, but it seems incorrect to me.
There is a [== 248] object and [t b b] after it.
From what i understand, the == object doesn't send bangs to the outputs, but 0s (if not equal) or 1 (if equal), so the [t b b] object is banged (with zero) even if you receive other than 248 (=clock) midi message from the [midirealtimein] ??

could you (or sombody) explain it to me, please?

i'm very confused as i'm unable to find documentation for "midiin" and for "midirealtimein". when i right click and choose help, it opens a help page where these objects are not mentioned.

(i'm having troubles syncing two of my patches on two machines using midi clock in/out. on receiving the clock, i seem to be receiving more bangs per measure than i expect and i'm getting out of sync because of it.)

thanks and regards
daniel

edit: I am in windows os, so the midirealtimein should work...

Last edited by dnk777 (2012-04-05 22:40:30)

Offline

 

#9 2012-04-09 01:06:14

ShawnPD
Member

Re: midi clock/sync in

just about the post this thanks i will give it a test with my daw

Offline

 

#10 2012-07-30 18:20:32

cacosomoza
Member

Re: midi clock/sync in

dnk777 wrote:

hi boonier,
thanks for the patch. could you please explain how exactly it works? because i might be wrong, but it seems incorrect to me.
There is a [== 248] object and [t b b] after it.
From what i understand, the == object doesn't send bangs to the outputs, but 0s (if not equal) or 1 (if equal), so the [t b b] object is banged (with zero) even if you receive other than 248 (=clock) midi message from the [midirealtimein] ??

could you (or sombody) explain it to me, please?

I find the same problem, it doesn't make any sense to me the [== 248] object since [t b b] will still trigger its bangs either if the condition is satisfied or not.

Besides, I don't understand this patch correctly. Which is the purpose of delaying 500 ms each bang and resetting the counter to 0? Could you explain this patch thoroughly?

Offline

 

#11 2012-07-31 00:20:03

boonier
Member

Re: midi clock/sync in

Hi - quite a while since I saw that patch! not sure about the [== 248] bit as the triggers will still be there regardless as you say.

THe purpose of resetting the counter to 0 after the stream of 248s stops coming in is so that the counter fires on the downbeat when re-started, and not off beat...

To be honest, I think I stopped using this method in favour of just using the [midirealtimein] to trigger the stop/stop pf an internal metro as the timing was more rock solid and only relied on the initial start trigger being relatively accurate. THe stream of 248 was subject to jitter over the IAC bus. Using this last method seemed more satisfactory.

Perhaps the first  method is worth revisiting now as Jack osx now has sample accurate midi?

hope this helps/clarifies :)


boonier

Offline

 

#12 2014-03-04 13:08:15

did
Member

Re: midi clock/sync in

thanks a lot

Offline

 

Board footer

Powered by PunBB
Copyright 20022005 Rickard Andersson


pd.webring info