fbpx
Skip to main content

MIDI Forum

Notifications
Clear all

MIDI buffer limits

6 Posts
6 Users
4 Reactions
4,685 Views
Dolores
Posts: 1
New Member
Topic starter
 

I am running into what appears to be a MIDI buffer overload in Cubase12. I'm setting up a template with microtonal keyboards (Microzone, Lumatone) which render pitch bend microtuning of each played pitch on a separate MIDI channel (i.e. 8 MIDI channels = 8 notes polyphony). I've noticed that with VSTs and DAWs there doesn't appear to be a way to increase the size of a MIDI buffer (only audio buffers).

Question: If each multitimbral patch uses 1 channel of 14 bit pitch bend rendered microtuning per played note, how may (8 channel) multitimbral patches can be used before the transmission limit of the MIDI protocol is reached? I see that maximum MIDI transmission is 3125 bytes per second but I'm not sure how to translate that into the limit in terms of the maximum number of pitch bend rendered note/channels per cable.

If I'm not reaching a hard transmission limit, does anyone know of any way to increase the standard MIDI buffer size implemented in DAWs?

 
Posted : 18/01/2023 3:47 pm
Geoff
Posts: 1043
Noble Member
 

The MIDI transmission speed is not 3125, it's actually 31250, and that's BITS per second. Divide that by 8 for Bytes and that's 3806.

I don't think there is any MIDI buffer, not as part of MIDI. But all MIDI devices, and I assume midi software. may well impement buffering, but how large that buffering will be will be dependant on the software, and the hardware. I doubt this can be changed as far as most hardware is concerned, but the configuration for software may include the ability to change the buffer size. So you need to check the options available for your software.

Geoff

 
Posted : 18/01/2023 5:27 pm
Bavi_H
Posts: 267
Reputable Member
 

Geoff: On a DIN MIDI cable, the speed is 31250 serial bits per second and each byte of data is made of 1 start bit, 8 data bits, and 1 stop bit. Since there are 10 serial bits per data byte, that works out to 3125 data bytes per second. (Source: The MIDI 1.0 spec PDF page 6 (printed page 1) section "Hardware" begins "The hardware MIDI interface operates at 31.25 [] Kbaud, [] with a start bit, 8 data bits [], and a stop bit. This makes a total of 10 bits for a period of 320 microseconds per serial byte." 320 microseconds per byte or 0.00032 seconds per byte is the same as 3125 bytes per second.)

Dolores: As you mentioned, on a DIN MIDI cable, MIDI messages can be sent at a maximum speed of 3125 bytes per second. In the situation you describe (notes are sent on seperate channels and each note is prefixed with a Pitch Bend), and in the worst case where Running Status is never be used, each note will require:

3 bytes for the Pitch Bend message
3 bytes for the note starting message (Note On with Velocity over zero)
3 bytes for the note ending message (Note Off or Note On with Velocity zero)

So that's 347 2/9 notes per second.

If the connection between the keyboard and the computer is a single USB cable (from a USB port on the keyboard to a USB port on the computer), then my understanding is a USB MIDI connection uses a faster speed, but I don't know the details. For example, page 10 of the USB MIDI 1.0 spec mentions "The USB transfers MIDI data at rate hundreds of times faster than the original MIDI 1.0 hardware specification."

I'm not sure what to suggest next. Can you give an example of the problem you are having? (For example: What keyboard are you using? How is it connected to the computer? What symptoms are you seeing that suggest some kind of buffer overload?) Maybe we can think of some kind of test to help tell where a buffer problem might be located. (A buffer in the keyboard? A buffer in the MIDI interface? A buffer in the MIDI driver or operating system? A buffer in the DAW software?) Maybe someone else will recognize the kind of problem you are having and have a suggestion that might help.

 
Posted : 18/01/2023 7:40 pm
JohnG
Posts: 226
 

Hi Dolores,

Streamed Pitch Bend messages have caused buffering problems with MIDI devices as far back as I can remember.
The trouble is that as one moves the pitch bend wheel a stream of messages pours forth out of the device creating chaos.
It's not just buffering, but the ability of whatever is processing the data to analyse each message and forward it to e.g. the VST creating the sound.
If it's just one channel then the messages can be reduced to just two bytes, but with eight, the messages are probably just overwhelming the interface/processor with too much data to handle.

If my recollection is correct, in the old MIDI forum, this was discussed several years ago.
Polyphonic aftertouch, as I recall, can have a similar effect.

Bavi is quite correct about 10 bits per byte over the Din plug interface but I assume it's 8 bits per byte over USB.
However, USB is a polled protocol and introduces its own problems in dealing with processing large packets of data.

Just my 2c.
JohnG.

 
Posted : 19/01/2023 4:53 am
Posts: 1
New Member
 

Hi, I think my issue is related to this topic, and I am seeking for a solution. It looks like midi port has kind of a buffer and that buffer looks overloaded... How can I check that? I am sending a message from DAW Ableton to touchOSC. The issue comes out when multiple devices are connected to the port. Data loss appears. But only on windows and android devices.... On Mac and iphone issue disappears ...

Full description of an issue is described here:

removed link

 

Any ideas?

This post was modified 5 months ago 2 times by Alex Dziubenko
 
Posted : 07/07/2024 6:46 am
Muzak
Posts: 84
Estimable Member
 

This question should be in the user forum. BTW, it's really hard to tel where your problem could be unless describing the whole setup from your keyboard DIN or USB and interface and what you are doing on the keyboard. You could analyze the data from the keyboard on your system by running MIDI monitor tools,to view incoming data ( some even of those have bugs displaying the data and overflow themselves) . MIDI data from a keyboard sis generally very few bytes, mostly the problem is in the USB/MIDI interface and the way the device structures USB transfers. This can be done badly and in a good way to optimize performance. if it only sends one midi messaage per msec, then yes, you got poor performance, but it's expected a $4000 keyboard does it right.  one idea is to try it with  Bitwig on Linux as ALSA has better MIDI performance.

This post was modified 4 months ago by Muzak
 
Posted : 25/07/2024 5:06 pm
Share: