traktorino
traktorino copied to clipboard
The open-source DIY MIDI Controller for DJs.
Traktorino
Welcome to the Traktorino project! The Traktorino is a low-cost, DIY MIDI controller for DJs. It can control any software that accepts MIDI, such as Traktor, Serato, or Ableton Live. This project is open-source, so you can download all the files for the schematics, enclosure, and code to build one yourself.
Table of Contents
- Introduction
- Parts List
- Assembly Instructions
- Programming the Arduino
- Setting Up MIDI
- Enclosure Assembly
- Troubleshooting
- Support and Contributions
Introduction
Watch the video series on how to build your Traktorino:
- Video 1: Introduction and Assembly
- Video 2: Programming the Arduino
- Video 3: Setting Up MIDI
- Video 4: Enclosure Assembly
Parts List
- 1 Traktorino PCB
- 11 B10k rotary potentiometers
- 3 B10k slide potentiometers
- 2 cd4067 multiplexers
- 3 74HC595 bit shifters
- 13 tactile buttons
- 24 220 ohms resistors
- 1 1k resistor
- 11 blue LEDs
- 10 green LEDs
- 2 yellow LEDs
- 2 red LEDs
Assembly Instructions
- Resistors: Insert and solder the 220 ohm resistors. Place a 1k resistor in the specified position.
- Arduino Pin Headers: Solder the pin headers to the Arduino and snap it onto the PCB.
- Multiplexers and Bit Shifters: Solder these components onto the PCB.
- LEDs: Ensure correct polarity and solder the LEDs.
- Tactile Buttons: Solder the tactile buttons, ensuring correct orientation.
- Potentiometers: Solder the slide and rotary potentiometers.
- Rotary Encoder: Solder the rotary encoder.
Programming the Arduino
- Download and install the Arduino IDE.
- Clone the Traktorino GitHub repository:
git clone https://github.com/your-repo/traktorino
. - Open the Arduino IDE and load the Traktorino code.
- Install the required libraries: ShiftPWM, MIDI, Multiplexer4067, Thread, and Encoder.
- Verify the code and upload it to the Arduino Uno.
Setting Up MIDI
- USB MIDI Compatibility: Use an Arduino Uno with the ATmega16U2 for true USB MIDI compatibility.
- DFU Programmer: Download and install the DFU programmer.
-
Upload Firmware: Use the provided
.hex
file to flash the firmware to the ATmega16U2. - Test MIDI: Use a DAW or MIDI monitoring software to test the MIDI signals from the Traktorino.
Enclosure Assembly
- Assemble the plywood enclosure using the provided PDF files.
- Install the diffusers, spacers, and screws as specified.
- Attach the button caps and potentiometer knobs.
Troubleshooting
- If the Traktorino is not functioning, use a multimeter to check for connectivity issues.
- Verify that all components are correctly soldered and oriented.
Support and Contributions
- Subscribe to the YouTube channel for updates and tutorials.
- Purchase a Traktorino kit from our store. (Out of stock)
- Check out the DIY MIDI Controller Workshop for more in-depth learning.
Code Explanation
PWM Bit Shifter
The code uses a PWM bit shifter for controlling LEDs:
-
ShiftPWM_latchPin
: Set to pin 8. - To avoid using the SPI port and change the pin numbers, uncomment
#define SHIFTPWM_NOSPI
and setShiftPWM_dataPin
andShiftPWM_clockPin
. -
ShiftPWM_invertOutputs
: Set tofalse
. Change totrue
if your LEDs turn on when the pin is low. -
ShiftPWM_balanceLoad
: Set tofalse
. Set totrue
to distribute current peaks.
Libraries
The following libraries are included:
- ShiftPWM for PWM control.
- MIDI by Forty Seven Effects for MIDI communication.
- Multiplexer4067 for handling the CD4067 multiplexer.
- Thread and ThreadController by Ivan Seidel for managing multiple tasks.
- Encoder by Paul Stoffregen for handling rotary encoders.
Buttons
-
muxNButtons
: Number of digital inputs used in the multiplexer. -
NButtons
: Number of direct digital inputs used. -
muxButtonPin
andbuttonPin
: Arrays to store the pins used for buttons.
Debounce
-
lastDebounceTime
anddebounceDelay
: Used to handle debounce for button presses.
Potentiometers
-
NPots
: Number of analog inputs used. -
muxPotPin
: Array to store the pins used for potentiometers.
Potentiometer Reading
-
TIMEOUT
: Time the potentiometer will be read after exceedingvarThreshold
. -
varThreshold
: Threshold for potentiometer signal variation.
Encoder
-
myEnc
: Instance of theEncoder
library using pins 3 and 2. -
oldPosition
: Previous position of the encoder.
MIDI Configuration
-
midiCh
,note
, andcc
: MIDI channel, note, and CC configurations.
LEDs
- Configuration for controlling 24 LEDs with PWM.
- VU meter and button LED pins are defined.
Multiplexer
- Instances of
Multiplexer4067
for pots and buttons.
Threads
-
ThreadController
for managing tasks. - Separate threads for reading potentiometers and buttons.
Setup and Loop
In setup()
, the serial communication is initialized, MIDI thru is turned off, multiplexers and LEDs are initialized, and threads are configured.
In loop()
, the main tasks such as reading MIDI, encoder, and running threads are handled.
Functions
-
readButtons()
: Reads button states and sends MIDI note messages. -
readPots()
: Reads potentiometer states and sends MIDI control change messages. -
readEncoder()
: Reads encoder values and sends MIDI control change messages. -
handleControlChange()
,handleNoteOn()
, andhandleNoteOff()
: Handle LED feedback for MIDI control changes and note messages.
Usage
- Connect your Arduino and load the provided code.
- Ensure all components (buttons, potentiometers, LEDs) are connected to the specified pins.
- Install the required libraries mentioned above.
- Upload the code to your Arduino and start using your Traktorino MIDI controller with your favorite DJ software.
Feel free to modify the code and configurations to fit your specific needs. Happy DJing!
Author: Gustavo Silveira