Atmel, emulate-the-f1, Hacking, Performance & DJing, Traktor

Emulating The Traktor Kontrol F1 – Part 1

Background

Traktor Remix Decks
Traktor Remix Decks

Native Instruments introduced a great new concept in Traktor 2.5.0 – the Remix Decks. Basically each of the decks in Traktor can be used as a 4×16 sample player, with a lot of neat features including sync, various stop/start/loop modes, individual filters on each column and so on. You can read all about them here.

Although one of Traktor’s strengths is the ability to create complex MIDI mappings for almost any of its controls, the Remix Decks are unfortunately limited to a very basic level of mapping. To use them to their full potential, you have to purchase the Traktor Kontrol F1 controller. As of Traktor 2.6.2 the Remix Decks now are mappable. The F1 is a nifty piece of kit, but in Jamaica we pay very high shipping, custom and tax charges on things like this, so a USD 279 F1 very quickly becomes a USD 500 F1 or more. Besides, the pile of Native Instruments products on my shelf is growing very high (Traktor Kontrol X1, Traktor Kontrol S4, Maschine, Komplete 7, Traktor Scratch Pro 2, etc.) so I thought this might be a good time to get my head back into some hardware hacking and build my own solution and my M-Audio Trigger Finger was looking sad and unused.

Strategy

The first part of the process is understanding how the F1 communicates with Traktor. Luckily, this work was already done by fatlimey and detailed in a GitHub project called hack-the-f1 and then further extended by Andrew Bythell with his femulator project (you can read about these excellent projects and more in this thread on the DJ TechTools forum).

Arduino Uno R3
Arduino Uno R3

The important data from these efforts are the F1’s USB descriptor dump and the description and analysis of the data sent between F1 and Traktor. It turns out the F1 works as a custom HID device and communicates with a fairly simple 22 byte input report and 81 byte output report. So essentially we need a USB device that can enumerate as an F1 and send and receive the custom HID reports. The Arduino Uno R3 is an excellent candidate for this and costs USD 21.95 on Amazon.

SparkFun MIDI Shield
SparkFun MIDI Shield

The easiest and most flexible way to communicate with arbitrary music controllers such as the Trigger Finger is via classic serial MIDI. With a few simple parts (5 pin DIN sockets, resistors and an opto-isolator such as the 6N128) you can connect a MIDI device to the Uno; I chose instead to purchase a SparkFun MIDI Shield (USD 19.95), which includes a few extra features for experimenting, including three buttons, two pots and two leds.

The Uno has two Atmel microcontrollers on it- an Atmega16U2 that handles USB communication with a host and an ATmega328 that runs Arduino “sketches” (C++ programmes with some tweaks). The ATmega16U2 firmware enumerates as a USB COM device on the host, and communicates with the ATmega328 via serial. The ATmega16U2 can be put into DFU (Device Firmware Upgrade) mode and reflashed with other firmware so that the Uno can appear to the host to be a wide variety of USB devices any arbitrary USB device (the F1 in this case). A sketch running on the ATmega328 can then translate between MIDI messages and the F1’s HID reports.

One of the advantages of this approach is that the Arduino sketches are easy to write and deploy, and there are a lot of good libraries already written for the Arduino. This allows one to quickly modify the mappings between MIDI and HID and implement whatever custom behaviours you can think of, e.g. different actions resulting from combinations of button presses.

The resulting topology is this:

MIDI To F1 Topology
MIDI To F1 Topology

In Part 2 I’ll look at my development setup for the Uno.

3 Comments

  1. Hi,

    I would appreciate if you can show me how to map trigger finger pro to traktor pro 2 remix deck. Or if you can send me the tsi file it will be a great help. I use kontrol s4 mk1.

    Thanks
    Sharath

Leave a Reply

Your email address will not be published.