Which Clock does Luna use for MIDI?

Official support for: mutools.com
Post Reply New Topic
RELATED
PRODUCTS

Post

I have not tested this myself yet and was curious about the answer. Does Luna use QPC or TGT for midi timing reference? I use external midi equipment regularly so it could make a difference for me. I use a Lynx One soundcard with midi interface and the drivers use QPC. Applications are not it seems consistent on using one or the other timing reference. I found Reaper's midi output to be all over the map through my Lynx but to be within a couple of ms when working through an interface with drivers using TGT so I think it uses TGT. I told this to the developers but they don't seem too concerned as Reaper is more about Audio, and these days whatever midi work people do usually ends up being rendered in software rather than driving external hardware. I have been a long time Cakewalk/Sonar user which also has always used QPC and I find the midi timing (using simple tests and no audio)to be about as good as it gets for a windows pc with a variation of no more than .5-1ms over time. My Amiga has the most accurate midi output I have seen yet with less than .5ms variation over time on the midi output but then the Amiga has 2 high resolution hardware timers. I have never had an Atari so I never tested it but since it also has a hardware timer it probably has timing similar to the Amiga. So what midi timing reference does Luna use?

Jon

Post

LUNA uses TGT within a timeSetEvent looper.

The reason for using TGT is because ASIO also uses TGT for it's timing, and so it's important for audio <> midi sync to use the same clock.

I guess it could be possible to use QPC too, just relatively within the audio slice so any clock shifts between QPC and TGT would be very very small (maybe even not nano-secs) as it's over a small time range i.e. 1 asio buffer.

But the timeSetEvent looper has only 1 ms accuracy, so using QPC won't even add much benefit, unfortunately :?

I've asked myself whether using midistreams would be a way to realize better midi timing on windows..?

But then, how to sync it to the audioclock?

Having to sync it to the audioclock will have a (small) timing penalty.

And then the question is which one of the 2 methods is best??

Anyway, i think LUNA's midi timing is very ok within the possibilities on Windows.

Post

muzycian wrote: I've asked myself whether using midistreams would be a way to realize better midi timing on windows..?
I am not sure but I thought every sequencer uses midistream for midi-timing?
In this case you could adapt deltatimes to sync between Asio and MidiStream callbacks.

Post

But how to securely sync the midistream clock to the asio clock?

It won't be a benefit if the midi timing itself may be better, but it's more out of sync with the audio...

Post

I will have to test LUna to see how it does. I don't do anything extraordinary but simply play a simple midi pulse out through external midi into another sequencer (pc and Amiga) and look at the time stamps in the event list. I fine tune the tempos so that the variation between beats does not trend fast or slow so what is left is just slight timing variations between beats. Of course you can't tease out where the timing variations are coming from just by this. But having done this a number of times I noticed that each machine in recording has a minumum amount of variation introduced that seems independent of where the midi input is coming from. But this is more statistical inference rather than directly verifiable. But you can spot when the timing variation is really crazy like with Reaper through my lynx midi interface. When I used Sonar and played it into cakewalk pro Dos on a machine with a MPU ISA midi interface I got something like 1-2ms with occasional peaks of 3ms. Then when I played it into an Amiga I got .5-1ms variations. So Cakewalk Dos was introducing its own variation which masked what Sonar was doing. When I played Amiga into Sonar I expected the same and got that but what was interesting was that the AMiga stream seemed much smoother than the Sonar stream in that variations were almost predictable whereas Sonar variations had a more random character. Strange. Nothing scientific here obviously. I'll have to see how Luna reacts with my LYnx interface and see if I have problems like with REaper. I've been reading about the QPC vs TGT issue and am I correct in saying that the timestamp would only be relavent no matter what timer when the application can't keep up with the interface so that midi events are buffered and then the timestamp has to be looked at to see which one comes first? Also if you have a motherboard where the two timers stay relatively in sync then does that mean it does not matter what timer is used?

Post

jeamsler wrote:I've been reading about the QPC vs TGT issue
any link?
and am I correct in saying that the timestamp would only be relavent no matter what timer when the application can't keep up with the interface so that midi events are buffered and then the timestamp has to be looked at to see which one comes first?
i'm sorry but i don't understand the question.
Also if you have a motherboard where the two timers stay relatively in sync then does that mean it does not matter what timer is used?
Indeed.

But how would you know whether e.g. QPC and TGT are hard-synced?

And is that on all PC's?

Post

Here is a link regarding the QPC vs TGT issue in the context of Nuendo from which I first learned of the difference. I used the utility found on this site to determine that my interface uses QPC as a reference. After reading this my concern was how relavent is this for other sequencers? It is hard to generalize from this specific Nuendo context to other sequencers if it can be done at all. The only time I had reason to think there was an issue outside of Nuendo as I said was with the app Reaper which had drasitically different midi output depending on the interface used. I then suspected but can't really prove that the difference could be because of timer reference differences between midi interface drivers and applications. I also am wondering if the timing of cakewalk dos may be partially dependent of the interface I used which was an mpu401-ipc. I think that was one of the better ones of the time but I have found a dos interface made today still which has its own onboard timer and wonder if that would better the timing accuracy. Admittedly we are talking about small differences for the most part but it was a question that I will explore.

Jon

Post

Here is a link regarding the QPC vs TGT issue in the context of Nuendo from which I first learned of the difference.

http://www.jay.fm/miditime/

I used the utility found on this site to determine that my interface uses QPC as a reference. After reading this my concern was how relavent is this for other sequencers? It is hard to generalize from this specific Nuendo context to other sequencers if it can be done at all. The only time I had reason to think there was an issue outside of Nuendo as I said was with the app Reaper which had drasitically different midi output depending on the interface used. I then suspected but can't really prove that the difference could be because of timer reference differences between midi interface drivers and applications. I also am wondering if the timing of cakewalk dos may be partially dependent of the interface I used which was an mpu401-ipc. I think that was one of the better ones of the time but I have found a dos interface made today still which has its own onboard timer and wonder if that would better the timing accuracy. Admittedly we are talking about small differences for the most part but it was a question that I will explore.

Jon

Post

Jon, note that the midi timing link is all about midi input timing, not about midi output timing.

Of course midi input timing is also important.

Post

Oh, how dumb of me. I was reading as if it pertained to midi input and output generally. I see. Then is output timing tied to the same timers or is it done in a different way? What impacts the tempo stability when playing back midi through a midi out to midi in? Forgeting for now the problems of hardware synth latency and general sloppiness in some cases and the inherent small delay of midi itself, if you look just at a constant tempo pulse coming out from the sequencer at the midi out what factors impact the stability and possible deviation from a steady pulse? Is there a general timing window for each event and how small is the window (ie each event is issued with timing accuracy within say +/- 1ms)?

Thanks for clarifying my understanding of all of this
Jon

Post

Sorry for the late answer, in some way i missed your answer.
jeamsler wrote:Oh, how dumb of me. I was reading as if it pertained to midi input and output generally. I see. Then is output timing tied to the same timers or is it done in a different way?
See explanation above.
What impacts the tempo stability when playing back midi through a midi out to midi in? Forgeting for now the problems of hardware synth latency and general sloppiness in some cases and the inherent small delay of midi itself, if you look just at a constant tempo pulse coming out from the sequencer at the midi out what factors impact the stability and possible deviation from a steady pulse? Is there a general timing window for each event and how small is the window (ie each event is issued with timing accuracy within say +/- 1ms)?
The biggest inaccuracy comes from Windows, and there is nothing to do about that.

Let's say that normally indeed midi output has a jitter-window of +-1ms.

Some general tips to get best results:

-> It's always best to minimize the number of running applications in the background, so that Windows is disturbed as minimal as possible.

-> And of course, the more RAM => the less VM swaps => the higher the chance on a stable timing.

Note that you cannot ignore the midi delays itself, and especially not the midi processing delay in the receiving synth. You have to take everything into account.

I have seen synths/drumboxes with up to 10ms of midi processing latency when they were under heavy voice load!

The more percussive a sound (i.e. fast attack) the more imporant the timing is!

And so if you would be in a situation with percussive sounds generated in an external MIDI instrument, and your ears say there is a problem (because sometimes some timing jitter could even be groovy, it depends on the musical context), then i think the best way to go is to sample/record the audio of the synth and bring that into the session.

Then you have 1/samplerate timing accuracy, thus e.g. for 44.1 kHz that is +- 22.7 microseconds which is about 50 to 100 times better than via Windows-MIDI.

Hope all this gives a musical answer :)

Post

Thanks for the reply. It was helpful. I agree the midi processing delays of hardware synths can be huge in some cases. Because hardware is devoted entirely to making sound at least it is more consistent under various loads than a computer might be under various loads. But there are variations as you noted as when you push the polyphony limits of the synth or you have alot of parameters changing over time. I remember one synth that had the lfo slow down depending on the load the synth was experiencing. And yes I agree sometimes the looseness of the timing can make things better. I wonder sometimes with old beatboxes and samplers if what people liked about them was the midi latency introduced and how that affected the groove. It may explain why some people feel that something just "grooves" better.

Jon

Post

I've always found the "rhythm" of the TR 808 so nice.

It's so... round, alive.

Maybe it's because of its analog sounds..?

As a technician, if i would have one, i would take it into the lab, and put it into various scanners and try to find why it sounds so good.

As a musician i would just enjoy it ;)

Post Reply

Return to “MuTools”