Transfer speed of NRPNs

...and how to do so...
User avatar
137 posts since 3 Aug, 2016 from Germany, Munich

Post Sun Mar 05, 2017 3:54 am


at the moment I'm building a MIDI controller and I want to keep open the option of implementing NRPNs alongside with standard MIDI CCs. Unfortunately NRPNs can take up 12 Bytes and transmitting them with the standard MIDI speed of 31250 Bit/s means, that one NRPN command takes more than 3 ms. Is this really the case? I find this really disturbing as I was planning to readout the ADCs for the potentiometers every millisecond.

Is this scanning rate unnecessarily high? Has any of you ever seen a difference in "smoothness" when using CCs or NRPNs?

125 posts since 13 Apr, 2017

Post Thu May 25, 2017 2:30 am

I'm into diy MIDI controllers myself, if not very experienced.

I heard LAN or USB transport instead of MIDI DIN is much faster.

Maybe you could adjust the adc scanning rate by trial/error and your own perception of tightness?

User avatar
137 posts since 3 Aug, 2016 from Germany, Munich

Post Thu May 25, 2017 5:59 am

I did a lot of testing since I opened this thread and I realised a few things:
  • The Virus B is incredibly slow in reading its potentiometers & transmitting their respective MIDI parameters. When I turn a knob really fast, the Virus may omit up to 8..10 values, so that the recorded automation is not smooth. Nevertheless I did never find this to be a problem. :shrug:
  • The opposite is the Nord Lead 3. I did not manage to make it omit even one value (though the NL3 does not send NRPNs).
  • The ideal read & transfer speed for one controller value for me is about 2..4ms.
  • Transmitting NRPNs via RS232 is definitely so slow, that all the reading (about 45 potentiometers :D) must be done in far less than a millisecond, but I'm confident that it is possible.
  • Using USB MIDI may open a huge can worms. I have no experience with USB but this soo leaves the field of electronics and I'm sure, I don't want to maintain USB code and/or libraries for all major operating sytems. Not to mention that I have absolutely no idea how to implement USB devices on a computer.
I have not heard about MIDI transmitted over LAN but I think it is more problematic than USB as I don't see any possibility to declare a LAN based device to a DAW.

But... I now think that it could all work out even with NRPNs. I very very rarely need to turn a knob so fast, that an audible amount of MIDI values can't be transmitted. And even if... I would lose perhaps one or two values at most, which is okay...
The only problem I'm facing is that I don't dare to get my board to production. The board alone is really expensive and one single mistake I'm not seeing right now and it's all for nothing... :D

User avatar
sin night
1293 posts since 1 Aug, 2006 from Italy

Post Sun May 28, 2017 3:31 am

I built a midi controller a few years ago, just for fun (it was a side project in my spare time, but I never really used it), based on an Arduino UNO. I used standard CCs because that was enough for my project (and, to be honest, I was more focused on putting the pieces together - I have a background in computer science, not in electronics, so that was the part I was most worried about) and I used usb at full speed (so no standard din ports).

There are alternative firmwares for Arduino, such hiduino, which transform the board in a usb class compliant midi device. Then all you have to do is write the code to read the potentiometers and generate the midi messages you need.

An issue I faced with my project was the use of analog multiplexers to read the inputs (my Arduino board has 6 analog inputs, which weren't enough for the project): after switching input, it takes a little time to get the right reading, so I had to apply some smoothing (both in hardware and software).

I don't know if this can be helpful to you, I guess you probably have way more knowledge than me on this things (my project was a "simple" dj controller, with 14 knobs, two faders, one encoder and a few buttons/switches... it's way smaller than your 45 potentiometers project!)

Return to “DIY: Build it and they will come”