The MIDI Tricorder is designed to introduce a few types of sensors (button, toggle, knob, light sensor) and an actuator (an led) in a simple and clear way, but with avenues for expansion. The enclosure is created using a 3D printed base and a laser cut top panel. All of the design files are available in this folder, which also includes the arduino code and a max patch with some examples of how to work with the tricorder.
While Max is useful in mapping the MIDI data in a variety of ways, the embedded pro micro sends and receives common midi messages over USB, so you can use it with lots of other software programs too.
Each Tricorder costs under $20 to make. Here are the parts you’ll need…
- pro micro with header pins
- 10k potentiometer
- ldr (light dependant resistor)
- button
- toggle
- led (any color will work)
- 2 led holders (one for the ldr)
- copper wire (about 10″)
- usb micro data cable (some micro usb cables are charging only, not data)
- laser cut plywood panel (files here)
- 3d printed triangle base (files here)
- 6 dupont cables (cut in half makes 12!)
Start by orienting the plywood panel as above and mount the main components, noting the layout above. For the button, toggle, and potentiometer, first unscrew the small nut on the threaded part of the component, then re-thread it through the mounting hole to secure the component. The LDR and LED can be taped into holes 4 and 5 respectively. Try to align the components as seen in the back view below, which will make soldering everything together a bit easier.
code
/**
*
* MIDI TRICORDER
*
* This code is part of a system developed as a learning tool for the
* new media + sound arts program at Emily Carr University. It is designed
* to be used with the Arduino Pro Micro, but will likely work with other
* microcontroller boards as well. Without changing the code, you can connect
* 5 digital inputs, 4 analog inputs, and 2 digital outputs.
*
* The MIDI TRICORDER only uses a few of the available inputs/outputs
* - 2 digital inputs (a button and a toggle switch)
* - 2 analog inputs (potentiometer and LDR)
* - 1 digital output (LED)
*
* From these building blocks, you can create midi interfaces with different
* types and arrangements of sensors and/or actuators. You can also adjust the
* code below to add more sensors or substitute pin functions.
*
* For more information, look at this site:
*
* http://www.newmusicalinstruments.org
*
* At the core of this system is a wonderful Arduino library called
* "control surface", written by PieterP:
* https://github.com/tttapa/Control-Surface
*
* -----------
* CONNECTIONS
* -----------
*
* printable wiring diagram:
* http://bussigel.com/newinstruments/midi-tricorder/
*
* Digital Inputs
* - pin 5: momentary push button (midi note 61)
* - pin 6: toggle switch (midi note 62)
* connect one leg to the pin and one leg to ground
*
* Analog Inputs
* - pin A0: potentiometer (CC 10)
* - pin A1: Light Dependant Resistor (CC 11)
*
* Digital Output
* - pin 9: LED output (midi note 70)
*
* You can add additional buttons, toggles, potentionmeters,
* LEDs and other sensors/actuators to support your ideas.
*
* Look at the Control_Surface examples (File > Examples > Control Surface)
* for more complex components/connections (pwm, LCD screens, multiplexers, LED rings, etc)
*
*/
#include <Control_Surface.h> // Include the Control Surface library
USBMIDI_Interface midi; // Instantiate a MIDI over USB interface.
// Instantiate an array of NoteButton objects that send
// MIDI note events when a push button or toggle is pressed/released
NoteButton buttons[]{
{ 4, 60 },
{ 5, 61 }, // push button on pin 5
{ 6, 62 }, // toggle switch on pin 6
{ 7, 63 },
{ 8, 64 },
};
// Instantiate an array of CCPotentiometer objects that send
// MIDI CC messages when an analog sensor is changed (0-127)
CCPotentiometer potentiometers[]{
{ A0, 10 }, // Analog pin (A0) connected to potentiometer, midi controller number (10)
{ A1, 11 }, // Analog pin (A1) connected to light dependant resistor (LDR), midi controller number (11)
// { A2, 12 },
// { A3, 13 },
};
// Instantiate an array of NoteLED objects that receive midi note events from the
// computer to turn LEDs on and off on the microcontroller
NoteLED leds[]{
{ 9, 70 }, // Pin of built-in LED, Note C4 on MIDI channel 1
{ 10, 71 },
};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}