Rack Mount MIDI Meters

Eight small colour screens display MIDI data, in a 1U rack format

Public Chat
Similar projects worth following
Eight 240x240 pixel colour screens are mounted on a custom carrier board, and controlled by a Teensy 4.0 microcontroller. A custom MIDI DIN input module provides MIDI 1.0 data to the Teensy. Power is provided to the system via a USB-B connector.

The firmware was developed with Arduino. The background image was licensed from a stock photo site, the PNG image converted into a hex data array, and then that PNG data interpreted by an Arduino library. Another Arduino library was adapted for driving the displays.

MIDI Control Change messages are interpreted into needle angle. The needle is drawn over the PNG image, a simple one-pixel wide line without anti-aliasing. The MIDI channel and controller numbers are hard-wired on the first version of the firmware. It is about as simple a meter implementation as possible.

The front panel holes were cut with a waterjet.

The idea for this project came from a brainstorming session with my friend Jerry. We were trying to come up with a good application for circular TFT LCD displays. Meters of course came to mind, there was a time when they were usually circular. Then it occurred to me that these displays were small enough to fit into the very limited vertical space of a 1U rack box. And with these one could create a meter array like on old mixing consoles. 

Console meters are normally rectangular, and the same idea would have worked with rectangular screens...but whatever. How the mind works, nobody knows.

So we ordered some of the displays, and got to work on a board for mounting them. Jerry helped me to create the board in Kicad. I have been an Eagle user, soon to change over to Kicad. The dimensions were too big for my free Eagle license, and my paid-for Eagle license disappeared when that software changed ownership.

The board is largely just a means of mounting the screens. It has a few connectors on it, and a 74HC138 which enables the MCU to select a display, but requiring fewer signal lines. The MCU outputs the number of the display (0-7) then proceeds as it would normally if talking to only one display. 

I chose the Teensy 4.0 because for its high throughput, as I imagined driving multiple displays might require that in the worst case. With this simple meter, its just line drawing, and line erasing, which most likely could be done with a less capable chip.

The Teensy is mounted on a breakout board that I created earlier. Its part of a set of boards I made for prototyping rack mount systems. Its mostly just an MCU socket broken out to some connectors. The serial ports interface at 5 volts, because that was what MIDI and DMX needed. So its got some level shifters on it. I also had the SPI port brought out at 3.3V on a 2x3 header with same pinout as the Atmel ICSP (Arduino programming port). That is used for writing the displays, though I messed up the pinout on one of the boards, and so used Dupont jumper wires to connect, rather than a ribbon cable as intended.

The Arduino code utilizes the PNG decoding library from Larry Bank. Also it uses code from The needle drawing and GC9A01 driver were adapted from his code.

  • 8 × 1.28" Round TFT LCD Display Module, 240x240, GC9A01
  • 1 × Teensy 4.0
  • 1 × Hammond 1U 19" Rack Box
  • 1 × DIN MIDI receiver module
  • 1 × 74HC138 decoder IC

  • Pitch Wheel Message Intepreter

    Tom Dowada day ago 0 comments

    The meter box has so far been only a set of VUs, but my intention is to interpret a range of MIDI message types into different displays. A few days ago I got the pitch wheel message display working, though it has no PNG background image yet.

    The pitch wheel message carries 14-bit value, that is interpreted as positive or negative. Typically the full scale positive and negative values will result in a pitch change up or down one octave.

    This is quite straightforward to convert into a display, using the same needle as with the VUs. A few parameters in the needle line drawing function needed to be changed to get the needle to move in a way appropriate to the task.

    There was one surprise. I had just bought the keyboard controller through craigslist, and was not familiar with its operation. At first I was thrown by the MIDI activity, so I used my protocol analyser to have a look. It turned out this device uses MIDI's running status. With running status, the device sends the pitch wheel command once, then any number of the 14-bit values after that, as long as no other MIDI messages needing to share the cable. So running status was coded into the message interpreter.

  • Simulating Needle Physics

    Tom Dowad2 days ago 0 comments

    There was some interest in the skeuomorph aspect of this project. That is, new tech simulating old. So I reckoned I might as well follow that thread. I got some new PNG images on order, inspired by vintage meters. And I reckoned I might as well get the needles moving in a way that is more realistic, ie simulating physics.

    Maker [sjm4306] did it in this project:

    I had a look at the code for that project. While I'm sure its quite accurate, I couldn't get my head around the PI method used. But I did pick up something from this implementation: that physics only required a few lines of code.

    I didn't really understand how one of these meters worked either. So I went to Youtube, what else? This video was helpful:

    I knew about the spring and the magnet, but I was surprised to learn about the damper, and how it was implemented. I could see the hard stops on each end. I had certainly "pinned" one of these needles in my day, but never seen the inner mechanics of it.

    I was just about to jump into writing C code, then realized it might not be as easy as imagined. I often write code in Xojo, a VB-like language, for testing algorithms. Its fast, inputting values is easy, and it has a good debugger. VB is, like most languages, similar to C.  And it was only a half-dozen lines of code.

    Here is the code I settled on:

    It is not the definitive physics simulation, but I am happy enough with the results.

    Here is the simulation running:

    Sorry its just a screen capture and no voice over. I will do time.

    The PULL setting is meant to simulate the amount of force applied by the spring (to the left) and the magnet (to the right). As it is increased, the needle moves faster. If set to 0.0 the needle won’t move at all.

    The DAMPING setting is meant to simulate the damper, which is a drag on the needle movement and slows it down. In the code its as a multiplier on the velocity. If set to 1.0, the needle will oscillate, forever apparently. If set to 0.0, the needle will not move.

    The VALUE setting only changes on mouse button release, not when dragging the slider. You’ll see when it changes as there is a numeric field up top.

    Toward the end of the video I move the slider to minimum and maximum positions. Look for the needle bouncing off of the hard stops on either end.

    I’ll get this algorithm into the rack unit shortly.

  • Some Video

    Tom Dowad6 days ago 0 comments

    I just made a short phone video to show the meters in operation:

    In order to get a MIDI data stream to demonstrate the workability of 8 meters running simultaneously over one MIDI DIN cable (31250 baud), I programmed another MCU to generate it. That MCU generated sine waves, with a range of 0-127, then as each wave value would change, it output the value in a Control Change message. 

    My math on this is that all 8 displays could be updated about every 8 milliseconds. Given that a video frame rate of 30 frames-per-second (33 ms/frame) is generally adequate for smooth animation,  32 channels could be transmitted on one MIDI 1.0 cable. That would saturate the MIDI stream. 

View all 3 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates