*Midi clock patch* works only if started BEFORE the clock

dimitri's picture

Hi there,

I'm playing around with the Midi clock receiver and Kineme's Global Midi clock, and both of them work fine, but only if the external clock starts while the compsition is already listening. Is there a way to circumvent this issue?

I'm really only listening to the beat output parameter, it doesn't matter much of where we are in the clock progression.

Being able to open a composition/QCBuilder app while a midi clock is already running would be … kind of nice.

dust's picture
Re: *Midi clock patch* works only if started BEFORE the ...

you might want to send out a boolean to trigger reset on your external clock. i know with midi there are various clocks and signals smpte and midi machine time code as well as global midi clock. I use osculator to catch global midi from kineme then use it trigger things and send back to quartz composer. im not sure what DAW you are using but i know that you can set up maine stage to auto sync midi clocks + bpm's some other programs might be more difficult. i would suggest to use OSC and make a listener. so broadcast your master midi time to osc via quartz or other osculator then make a receiver patch that will parse out your measure and beats. that way when you open a qc builder app it will know what measure your on. basically you will be able to open multiple patches with the same port info with no need to restart your master clock but you can always send out that restart master but that might mess you up in performance. maybe a little more info on what your working with might help.

http://pixel8r.info

dimitri's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Hi dust,

I would follow your line if all the computers were mine. However, having to deal with other people on stage, it seems that midi clock (still, unfortunately) is the popular sync protocol sticking around - there is no OSC hardware consortium yet.

I'm more concerned about contemporary art than demo scene (not that demo scene is a bad thing!). I tend to develop dummy-proof software, particularly for installations switched on by non tech-savvy gallery workers.

At this time I'm mostly testing and messing around, writing a (not so serious) beat reactive software, mostly for experiment purpose. I hit this limitation which prevents me from integrating this macro in a bigger tool that is growing one small piece at a time.

Here, the not working so well midi beat sync logic. I believe it could be quite be useful to a few of us if it caught the signal in any situation, being launched first - or on the fly. :)

PreviewAttachmentSize
Midi_Beat.qtz6.68 KB

dust's picture
Re: *Midi clock patch* works only if started BEFORE the ...

i had a go with kineme clock and was able to get beats and measures out of it with some number formating and math but for some reason i get numbers from it without any midi devices sending clock data seems a bit buggy. here is how i calculate 16th notes from a bpm. if you add the tap control plugin you can just tap in the bpm then you will be getting a sort of synced composition. you can always the peak amplitude spectrum to get a sort of sync going by interpolating it so the peaks are hit 1 and trigger some boolean. that way no matter what gear people are trying to hook up you will be able to get some sort of time. that is predicated on the fact that the music is beat driven like in elctro if ambient well all you will have is the duration to deal with take the whole duration chop it 15 seconds and multiply by 4 to get bpm.

PreviewAttachmentSize
sixteens.qtz3.06 KB

dimitri's picture
I want to do it on the fly

Thanks, dust,

However this is not solving my question, I'm really looking for a precise midi clock driven sync - and I have it. Given my composition and for your needs, the BPM tapper could be driven by the beat pulse, and the 16th could be calculated after that.

The problem is inverse: if i can get the midi clock messages, I can sync all very precisely - But I want to be able to do it on the fly :)

ps. the pulse patch after the watcher is to be considered as "too much of a good sync" in my composition :)

gtoledo3's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Aside from an "in QC" method, as a workaround I would probably try to get ahold of a midi line amp, take off of the main midi feed, and see if toggling the line amp on and off would effectively give me control whenever I needed it. I haven't personally tested that, but it's the first thing that comes to mind as an effective second approach.

dust's picture
Re: I want to do it on the fly

im not sure like i said i use osculator to catch global midi values and route them osc or midi cc. i guess you would need some sort of qc global master time code, something that broadcasts and lets everyone snyc to qc instead of the other way. the midi tools are not that great in qc but kineme's stuff works. im waiting for a hidden markov patch so i can make stochastic music right out of qc. there is a program called plogue bidule you might want to look at. it might help not sure don't play with it much.

dimitri's picture
Feature request!

Thanks guys, workarounds like this could indeed work. However ( i know i might seem quite obstinate :) ) it's not what i am aiming for.

Concerning the midi clock patches, the clock receiver connects only upon receiving a "start" or "continue" message, not on a "measure change" or "beat change" message.

I know now that the Kineme patch should be modified for this to work, so I will just file a feature request.

Here it is: http://kineme.net/FeatureRequests/Midiclockflyconnection

dimitri's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Assuming you crash, you would have to restart everybody's clock.

Besides - and this applies for VJs, you may very well start up way after the DJ has begun, so you may want to catch up on his clock at any time.

dust's picture
Re: Feature request!

i think quartz composer is up to you to make your own clock from the start signal . thats why they give you measure and beats. it seems they give you total beats and not beats per measure. i guess different apps use different codes mtc smpte etc.. its going to be hard one. i made a little master sync clock in maxmsp a few years ago i can and if i can remember correctly it required the slave application timeline to be restarted in order to catch the midi clock. hardware its easy virtual is a headache sometimes.

cwright's picture
Re: Feature request!

query:

How should beats/ticks get aligned? As far as I recall, there are 24 midi clock messages per beat, 96 per measure. If your clock is running, and it's on message 14 (14/24) when the clock starts listening, you'll always be 14/24 of a beat off. I don't know about you, but I know some paranoid beat-alignment people that would go neurotic if such a mismatch were to happen (and continue running indefinitely).

Beat messages are exactly one byte: 0xf8. They do not convey how far into the beat they are, or any other information necessary for alignment.

dimitri's picture
Re: Feature request!

Hey cwright,

It seems from the composition I posted above (try it?) that the beat message is updated right on time, at the beginning of the beat.

I don't know much about hex strings - however, from your notice I understand that the problem has something to do with the fact that the midi clock sends an increment, instead of a position message.

In that case alignment might indeed be a key factor to the problem: The quartz receiver won't work instead of returning erroneous values. If it is working like a counter, it would need to know when the clock was started to be able to return the position in the (so-called) song. Otherwise values might not match with the original sequencer in terms of numbers.

The Midi clock "Start" message would then be a required condition to start counting. This is very unfortunate since there might be cases when you mostly need measure and beat alignment. But I can say that i started a midi clock, afterward launched Midi Monitor, and that values are sent and received all right! And the updates match the tempo.

For the alignment paranoids, I did the following composition to align a loop by hand if needed, it's very close to a "cue", in dj words.

Talking about this topic around the clock now makes me want to write a video beat-slicer! I thank you, if only for that!

PreviewAttachmentSize
dim_BPMSteps_03.qtz47.18 KB

cwright's picture
Re: Feature request!

it's right on the beat because it notices the start signal (the start will only ever happen on 0/24 beat message, so we're also synchronized exactly). If we ignore the start, we have a 4.1% chance of picking the right beat, and a 95.9% chance of being unsynchronized. There's no way around that, unfortunately, unless there's some other sync message stuff happening that I'm not aware of :/

gtoledo3's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Is the main reason you need to do this on the fly because you need to be able to flip various compositions at will and have each line up correct?

dimitri's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Hi gtoledo,

The main reason is to secure the fact that one can plug in anytime - and immediately get the midi beat and measure pulse.

I understand the reasons behind your question, a separate composition could stay open while flipping compositions and pass the pulse with OSC or a spooky patch.

Assume instead that this permanent, clock listening composition is precisely the one I am trying to put together.

I find advantages in what i am trying to do, for example if the music driving tempo changes, the visual pulse follows constantly. One could have a separate window with visual beat feedback. And there is also the fact that building it as an application allows it to run on another thread. Now if that application could be launched anytime, that would be the top of the cream!

I'll post my work in progress soon, it needs to be cleaned up a bit. It's the result of my learning curve, and focuses on control logic. It includes several macros: sync, modular GUI elements, save and load functions.

dimitri's picture
tick, not clock - reformulation

It seems to me that the beat signal happens on 0/24 as well. The clock message I can see in midi monitor doesn't convey anything, it is (you said rightly) a tick.

Midi clock are not synced relatively to their starting point, syncing is constant. The beat message (0xf8 you mentioned) is used to increment the internal counter that gives the relative position - and that's the purpose of the starting point: match the counts (archaic protection system, sort of).

I see now that I need to stop talking about the "clock", rather start talking about the "ticks".

Could you pass this 0xf8 pulse through?

dust's picture
Re: Feature request!

thats a cool step sequencer thing you made. looks like you got a good start. if you keep it up you won't have to worry about midi clocks cause you will be able to sequence both your audio and video right in quartz. at least thats my hope. i suppose one could dream.

gtoledo3's picture
Re: *Midi clock patch* works only if started BEFORE the ...

Actually, I was going to suggest using a composition loader patch, and doing it all in one qtz.