Mac OS 9 Lives

Classic Mac OS Hardware => DAW - Audio & MIDI Hardware => Topic started by: Syntho on March 26, 2016, 08:01:14 PM

Title: Measuring midi latency
Post by: Syntho on March 26, 2016, 08:01:14 PM
Is there a particular method that you use for measuring midi latency on OS9? And any particular software? I'm talking when using hardware synths of course.
Title: Re: Measuring midi latency
Post by: paule on March 27, 2016, 01:27:20 AM
Hi,
very interesting question, but I have no solution at the moment. Right now I am testing my studio here with the same intention to optimize my whole system.

My Topic: Optimizing Midi in OMS environment.
At the moment I try to find out if it is better to use OMS with an Opcode5LX in "fast communication mode" or in normal "1Mhz-communcation-mode."? Maybe someone has experience with it.

It seems to me that ...
a) working in 1Mhz (normal) mode is more reliable if you use also sysex (dumps) from your hardware.
b) but it also obvious (when working with Sounddiver for example) that the midi transfer rate is better in fast mode.

Do other members have experience to share with optimizing midi flow?
Best, paule.
Title: Re: Measuring midi latency
Post by: GaryN on March 27, 2016, 04:07:32 PM
The Studio series manuals specify that you should absolutely use them in fast mode unless your computer is too slow for it.
This means that pretty much any Mac that's not a 68k should be in fast mode.
Why? Because it's connected to TWO RS-422 ports (modem and printer) that are capable of being clocked at much higher speeds that the 31.25kbps MIDI rate and so you can move a lot more MIDI between the computer and the interface than MIDI port(s) would allow. This is why you get to have a sequencer with bunches of MIDI tracks all playing at once - you shove all of the data into the interface and it sorts it all out and re-transmits it out of its multiple ports at 31.25kbps.

This does not mean that you can't over-run them, however. Get enough stuff happening and sooner or later you'll choke the pipeline just like the 405 freeway at 5PM.

So…"optimizing MIDI flow" has different meanings in different operations. The basic key to optimizing data flow is to remember that MIDI (that is, MIDI as we are using it here - NOT MIDI over USB and other newer incarnations)  is a serial data stream running at 31.25 kilobits/second. Pretty zippy at the time is was developed, but limited and prone to "data clog" due to its serial protocol. Now you're saying, "but hey, that's not the data rate between the interface and the computer" and you're right. But, MIDI was new, computers were slow, things were expected to evolve and it's doubtful that anybody anticipated sending 40 or so simultaneous tracks through a modem port, so the data stream there, while faster, is still capable of choking. Optimizing it involves, first and foremost, pruning any unnecessary data in the stream - especially if that stream is carrying multiple instruments and / or automation data.

Lowering the resolution of volume, pitch bend and other continuous controllers to whatever point is tolerable without hearing "zipper noise" or similar artifacts is a standard protocol.

Separating any MTC from all other note and controller data (by using separate ports) is mandatory.

Sys-ex dumps will usually not run faster than standard MIDI rate depending on the instrument you're dumping from / to. Sys-ex dumps require start/stop bytes, checksum bytes and "handshaking" in differing amounts - Roland, for example, requires a routine that's more complicated than Yamaha. They think it's less prone to errors (probably true) but it's definitely slower. Not much to do here to "optimize" transfers…you just wait for it. (Yamaha retaliated by inflicting "running status" on us - but that's a different discussion)

For the record, as far as I know, only Opcode guys know exactly what Studio-faces "fast" speed really is. One would guess that "1Mhz" is a cap that is a multiple of the nominal older Mac serial rate maximum X2, while "fast" is the best the interface can do flat out… like I said, that's just a guess - I give it a 70-30 chance of being close to the truth.

Anyway, after all of the above rambling, the bottom line is that you "optimize" your MIDI by trimming all unnecessary excess, and develop a Zen-like patience.
Title: Re: Measuring midi latency
Post by: Syntho on March 28, 2016, 12:34:47 AM
I was just reading the Studio 5LX manual and I'm a little confused on where it says that it distributes the midi data equitably.

Quote
NOTE: When transmitting data in a dual port configuration, as shown in Figure 3.4, the Studio 5 distributes MIDI equitably between ports “A” and “B.”
However, when the Studio 5 receives data, information from MIDI instruments enters port “A” while MIDI generated by the Studio 5 (time code, footswitch and foot controller info, and Audio In events) enters port “B.” Separating the incoming time code from incoming MIDI messages pro- vides insures accurate synchronization.

Does this mean to and fro? Or only to, or only fro? It also mentioned "when the studio 5 receives data". Does that mean midi input from a DIN connector, or receiving it from your Mac?

I'm wondering if it's even beneficial to have both serial ports connected in my setup. I won't be running any MTC, just standard midi data including an occasional pitch bend/mod wheel both on the way in and out.
Title: Re: Measuring midi latency
Post by: paule on March 28, 2016, 10:58:34 AM
Hi GaryN,
thanks for your fantastic answer and the time you took for that! I really appreciate it.
I had success to get the Opcode Studio5LX working in fast mode (MTP) in OS9. But in OSX the Studio5LX is not working in fast mode. No chance!!! These are my experiences and the information I found on the web. Working in OS X on a PowerPC (10.3.9) only works with Standard 1Mhz MidiMode. If there is anyone out there who gets the Studio5LX working on OSX, please tell me, that I can try it one more time. Maybe there is trick for that.... ;-)
Okay, because I am running my system usually in OS9 it is not so important to know.

Bytheway: I have also two Opcode Studio4 in my studio, which I used for several years, also working in OSX in fast mode (as far as I can remember!)!!!! But then I exchanged the two Studio4 against one single Studio5LX in order to optimize my Midiflow. One gear and not two Studio4s in chain. Hopefully I was right?!

Best, paule.
Title: Re: Measuring midi latency
Post by: GaryN on March 28, 2016, 02:36:00 PM
I was just reading the Studio 5LX manual and I'm a little confused on where it says that it distributes the midi data equitably.
Quote
NOTE: When transmitting data in a dual port configuration, as shown in Figure 3.4, the Studio 5 distributes MIDI equitably between ports “A” and “B.”
However, when the Studio 5 receives data, information from MIDI instruments enters port “A” while MIDI generated by the Studio 5 (time code, footswitch and foot controller info, and Audio In events) enters port “B.” Separating the incoming time code from incoming MIDI messages pro- vides insures accurate synchronization.

Wow… I know what this is trying to say but… let me try to do better…
As I was more or less explaining to Paule, you always need to separate MTC from other data. The Studio 3 and 4 have a checkbox setup page in OMS where you manually route data from various instruments and MTC through port "A" or "B" to do this.

The Five, being smarter by virtue of having its own 68000 microprocessor, works with OMS to do that automatically AND it goes a step further by dynamically routing continuous controller info when possible to keep it from clogging up note data and thereby improving overall flow. (I'm going to have to go back and clarify my answer to Paule now…)

So basically, what you do these days is always use a dual port config with a Studio 5, set it to fast, then use the "test" routine in the window that appears to determine the max speed that your Mac can throughput. This is necessary if you're pushing a lot of data through the Mac ports, as in lots of instruments / tracks, MTC etc. but is probably a good idea anyway to keep timing as spot on as possible. I personally recommend finding the max limit, then backing off a notch to leave a little "headroom".
Title: Re: Measuring midi latency
Post by: GaryN on March 28, 2016, 02:38:41 PM
Hi GaryN,
thanks for your fantastic answer and the time you took for that! I really appreciate it.

You're welcome.

Working in OS X on a PowerPC (10.3.9) only works with Standard 1Mhz MidiMode

Correct, unfortunately. That's because fast mode requires OMS, which just ain't there in OSX.
If you had Studio 4's working in OSX at all, you must have set them up in OSX Audio/MIDI Setup…no small task -  so congratulations!
I have a Studio 4 on my dual-boot MDD. It defaults to standard MIDI when OMS is not present regardless of the switch setting.

Honestly, if I could code worth a damn, my #1 project would be to port OMS to OSX or at least write an add-on for the OSX Core MIDI driver to emulate it or something!

I exchanged the two Studio4 against one single Studio5LX in order to optimize my Midiflow. One gear and not two Studio4s in chain. Hopefully I was right?!

Absolutely. What are you using for a USB convert?
Title: Re: Measuring midi latency
Post by: Syntho on March 29, 2016, 01:12:28 AM
The 5LX's manual doesn't explicitly state the exact algorithm for which info is divided up where - just that it's distributed equitably, but it does at least mention that when the Studio 5 itself generates its own midi data (time code, or you're using a footswitch connected to the back of the 5 etc), that that is definitely sent on port B.

I'm more curious about this than anything. The timing is rock solid and I've never had a problem, though I do want to run some midi latency tests and see just how accurate this actually is.
Title: Re: Measuring midi latency
Post by: paule on March 29, 2016, 01:27:24 AM
Hi syntho,
I don't know if there exists a software to do that. But maybe GaryN knows more :-)

Hi GaryN,
what do you mean about "USB convert"? I am only using MidiStuff and internal softsynths (Kontakt ...) for composing. The usb connection is only needed for controlling and transfer samples to my AkaiS6000. What do you mean with "USB convert"?

Bytheway: I had success. You gave me hope to double check again if the Studio5LX is really not working on OS X. I cannot believe it, but I found a way (and maybe it is an explanation that some people get this running and some not):
My workaround for the Studio5LX in OS X is. Important: You HAVE to do the setup starting OMS in OS9 and set the speed to standard 1Mhz (MTP)!!!!! That's really important. If you then restart with OS X you can setup the gport in both ways: 1Mhz or also FAST!!!!! Incredible. Both is running while testing the studio connections (with Audio-Midi-Configuration).
But I cannot test if this is "real" fast mode. But the Studio5LX seems to work perfectly in standard and fast mode. And that's in OS X. Incredible. Hopefully this information is helpful for somebody out there :-)

paule.
Title: Re: Measuring midi latency
Post by: GaryN on March 29, 2016, 02:55:00 PM
Hi GaryN,
what do you mean about "USB convert"?

I was starting to explain what I meant and getting more confused by the second until I re-read your post carefully and spotted the one clue I missed:

GPort


Now I'm really curious! What Mac are you using? Perhaps you're not aware of just how rare a Griffin Gport is these days! Most everybody who uses a G3 or a G4 with OMS and Opcode hardware uses some variety of serial-to-USB converter to replace the lost modem and printer ports, or a PCI-based stealth port. Gports are very rare indeed.

Now, here's the bad part: By using a converter that's plugged into the old modem slot, you're limited in two ways:
1) You've got one serial port instead of two, so everything has to go through one pipe.
2) You're limited to the max speed of the old modem circuit. While I don't know exactly what that is, when you consider that all it supported was 56kpbs, it's probably pretty slow - very likely slower that the RS-422 modem / printer ports.

Anybody know what max data transfer speed is on an old Mac modem circuit? Feel free to jump in.

The good news is since all you're putting through it is MidiStuff controller data, its probably fast enough…probably.

So now my question becomes: Why are we having this exercise to begin with? It's fun and all, but it seems moot unless you're seeing the MIDI data from the MidiStuff choking somehow…

Pleese to 'splain, Lucy?
Title: Re: Measuring midi latency
Post by: paule on March 30, 2016, 02:04:36 AM
Hi GaryN,
thanks again for your thoughts.
Yes, I am aware that the gport is really rare (and I am also a proud user of the verax fan kit, which was designed to replace the loud fans of the MDD G4/Dual 1.25Ghz. And everyday when I start the machine, I am really thrilled how quite the machine is. Incredible verax kit.)
Okay, but with the gport you gave me something to think about: could it be really true, that the gport - they have designed especially for the modem port -doesnt' have the same midi quality than on a serial port in former macs? I haven't recognized a difference in the midi speed with the gport. In former macs I have used a serial cable between my Midi-Interfaces and the serial (modem/printer) port of the mac. What it is the difference in speed because the gport uses especially the same modem port... mmmh...

But you are right, that I can only use ONE serial port with the gport. But that's also the reason why I was glad to buy an Studio5LX, because before that I had to connect two studio4 in a chain.

But I would like to re-ask your question to the public. Maybe someone can help:
Anybody know what max data transfer speed is on an old Mac modem circuit? Feel free to jump in.
And maybe this gives also Syntho some more informations, if there is a chance to check the midi-transfer speed. The only solution what comes in my mind is a menu option in the OMS Setup where you can test the speed of your transfer rate. Maybe this helps?!

Thanks in advance.
paule.
Title: Re: Measuring midi latency
Post by: GaryN on March 31, 2016, 05:03:17 PM
What it is the difference in speed because the gport uses especially the same modem port... mmmh...

That's my point…It does not. The RS-422 ports on all old Macs were labeled "modem" and "printer" because that's what they were used for 99% of the time. Lacking a schematic of a particular Mac in question, the assumption that an adapter to create such a port by replacing the stock acoustic modem card would be capable of identical speeds is just that - an assumption. This is especially true in later Macs where the original ports no longer even exist and there is no similar serial buss to even connect to.

Now…that you've finally mentioned that we're talking about an MDD and not something like an old blue & white the GPort was originally designed for, I still don't understand what your objective is. You want to maximize your MIDI throughput, but you're not using enough external MIDI devices to create an issue to begin with. You've got an MDD that you could use with a MIDI / USB converter like a Keyspan or such, which would give you two ports for your 5LX and really blaze along, but you're not even beginning to really utilize the 5LX anyway so that doesn't seem to matter and you're using an ancient GPort instead but you're concerned about speed but…but……see where I'm going here?

I'm kind of at a loss to go any further without some clarification of just what you're trying to accomplish, because at the end of the day, even if (big IF) you can determine the actual real-time MIDI data "speed" in your setup, it will not automatically give you some kind of benchmark to evaluate the overall MIDI "performance" of the rig. There are too damn many variables involved, even just in the variety of MIDI data types alone, let alone how a particular config processes them, and if you're doing it all without having some kind of dysfunction that needs curing you can actually hear, then you're just going around in circles.
Title: Re: Measuring midi latency
Post by: paule on April 01, 2016, 02:14:10 AM
Hi GaryN,
thanks for your helpful thoughts. I have to clarify:
I don't have problems with midi timing. I only want to setup my OMS setting in that manner that the best communication speed is possible for my system. And therefore I did some tests with different settings (see below).
As far as I understood you I could buy another Keyspan and see if this keyspan usb adapter is running better than the gport. When I have bought the gport for my MDD several years ago, they told me that the gport produces a much more better timing than the actual USB Adapters, but maybe I am wrong.

By the way: I am using a lot of outside gear with my (12 Samplers/Expanders at the moment) and therefore I am trying to find the best setting.
So I did some tests with the "Fast Communcation Speed Test" in the Opcode OMS Setup (see benchmarks below). The maximum communication speed is successful (24.000 bytes/sec) with my internal gport, what is not bad in my opinion. I am thinking now to buy an USB Keyspan Adapter to see if tests will be better?! Maybe you are right?

Best, paule

Test1: Communcation Speed: 8x in/out
Test2: Communcation Speed: 1.5x/8x in/out
Title: Re: Measuring midi latency
Post by: GaryN on April 01, 2016, 02:54:03 PM
By the way: I am using a lot of outside gear with my (12 Samplers/Expanders at the moment) and therefore I am trying to find the best setting.

There we go! I had suspected something like that but all I had to go on was:

what do you mean about "USB convert"? I am only using MidiStuff and internal softsynths (Kontakt ...) for composing. The usb connection is only needed for controlling and transfer samples to my AkaiS6000. What do you mean with "USB convert"?

Now that we both know what we're dealing with, I can make a few semi-intelligent observations:

• I'm actually surprised that the GPort tests as fast as it does. It appears to interface with the MDD really well. Far better than I would have guessed.

• Part of that is because of the 5LX and its ability to accept a huge amount of data through the single pipe.

• However, all else aside, a 5LX can handle more data through two serial connections than one.

• However, that won't make any difference unless and until you exceed the capacity of the single pipe.

• 12 external devices all running simultaneously with thick data (continuous controllers, etc.) is very likely enough to exceed that capacity. However, that's likely not a continuous condition - rather momentary "hiccups" here and there and that depends on the actual notes and such they're playing and that depends on the genre of music you're creating, how much you're layering synths & samplers and on and on…

• This all works because while USB is also serial in nature, it's waaay faster than MIDI and handles that data with ease. Your GPort is probably interfacing with the MDD on that buss by the way, since, I don't know, where else is it gonna go?

• However, the GPort is emulating an RS-422 port (although not exactly - rather an Apple variant, but that's another discussion) so there's a limit how fast it can be clocked and that limit is probably around 230Kbps  SO… two of those are better than one.

So, at the end of the day, if you want to absolutely maximize your MIDI chain for 12+ outboard devices, you should probably be using a Keyspan just so the 5LX can, as they say, "equitably" distribute data across the two pipes.

Final thought, as I said last time, I know of no practical way to determine exactly what your actual total MIDI data volume is from moment to moment. That would require inline monitors capable of reading and (chart?) recording all of the data from all of the modules individually. Because of the serial nature of everything, all of the data is going to get through the pipe eventually - the issue is whether it will be delayed by other data to an extent that the delay becomes audible and detrimental to the music. There are lots and lots of instances when the various MIDI notes want to hit different destinations / modules at exactly the same moment - that's one reason why the 5LX exists! All you can do is try to have as much headroom as possible throught the chain so you don't have to worry about it. Your 5LX is the biggest and baddest MIDI interface there is. Your MDD is the biggest and baddest OS9-capable computer there is. Put a Keyspan serial to USB OR (even better if you can find one) a Keyspan SX-2, SX-4 or SX-Pro Serial port PCI card in between them and that's as good as it gets.

NOW… after all of that, post a picture of all of your stuff - I sure we would all love to see it. AND

I'm curious…what Verax fans / fan kit are you so happy with? I've got my MDD in a quiet box but it could still be quieter…

Best,
Gary


Title: Re: Measuring midi latency
Post by: paule on April 03, 2016, 11:29:05 AM
Hi GaryN,
thanks again.
I have just attached some pics of the verax kit, which doesn't exist anymore. I bought it also used and haven't done the fan replacement by myself. Good luck! But it is worth every Euro!!! As far as I understood verax exchanged three fans inside of the g4.

Thanks also for the good hint about the Keyspan as PCI Card, but my G4 is maxed out with digidesigns Mixfarms. I don't want to "waste" a PCI slot for midi. Hopefully (and now I am convinced about your explanations) that the Studio5LX is working for me at the moment with the gport. I don't use excessivly midi and I never had any experiences with midi-hickups. Running 12 modules simultaniously is fun, but I don't use normally more than 5 different machines.
Thanks a lot GaryN for the time you took for me. I really appreciate it.