Brendan Byrne 

is a designer and makerspace specialist from Brooklyn. He currently manages StudioLab at Princeton University.

Community Organizing
Workshops & Talks
Destiny Clock
Kiwi Electronics
Games & Controllers
Performance Tools
Graphic Design
Modi Instructions: Programming
Product Page -
GitHub Repository -

I. Hyrbi Assembly
II. Pushi Assembly
III. Turni Assembly
IV. Slidi Assembly
V. Wiring
VI. Programming

Much of what is on this page can also be found at the GitHub Repo.

Modi Matrix(byte pcbA, byte pcbB, byte pcbC, byte toggleSmoothing)
  • Set the arguments pcbA, pcbB, and pcbC to the pins that the Modi A, B, and C PCB pins are connected to. These can be any digital output pins.
  • The toggleSmoothing argument allows you to turn a simple smoothing function on and off.
    • 0 = no smoothing
    • 1 = smooth by Paul Badger 2007
    • You have the option of changing the amount of smoothing. Matrix.smoothingAmount stores this value. .0001 indicates minimum smoothing while .999 results in maximum smoothing. The default value is .5
void Matrix.attach(byte pin, String type)
  • Call this method in the setup() portion of your sketch.
  • Start with the top most row. The library uses this to reference its position automatically.
  • The pin argument indicates the pin the row is connected to.
  • The second argument indicates the kind of row. The Modi library recognizes the following three strings: "pot", "button", and "slide".
  • The numbers for signal paths on the PCB are entirely arbitary and are intended to be used to plan electronically.
void Matrix.refresh()
  • Call this function at the beginning of each loop to refresh readings.
int Matrix.getReading(byte row, byte column)
  • Call this function to retrieve the readings from the Modi grid.
  • (0, 0) is the top-left most controller
  • The Grid object supports a matrix of up to (7, 7)
  • Pins marked as "buttons" will return a 0 or 1
  • Pins marked as "pot" or "slide" will return values between 0 and 1023
The number of channels the 4051 multiplexer supports. This constant's value is 8.

When toggleSmoothing is activated this attribute determines the amount of smoothing applied to readings. .001 indicates minimum smoothing while .999 results in maximum smoothing. The default value is .5

numMux is equal to the number of times attach() is called in setup which should also be equal to the total number of multiplexers in your Modi system.

An array that stores whether analogRead() or digitalRead() is to be used when collecting readings. This attribute comes in handy when utilizing different commands with different controller types. In the case of the midiOut example sketch contained within this library, the attribute is used to send some readings as Note On/Off messages and others as CC messages. 0 = digital and 1 = analog