Intro
Contents
Up until now all firmware flavours of the RK-002 are custom built but we’ve received numerous requests for solving specific MIDI issues for sometimes pretty exotic devices…
To have a more generic (but powerful!) platform on the RK-002 without people drowning in the available options we decided to make a bootloader for the RK-002 which enables development on the free and widely supported Arduino platform
With the new /DUY firmware and our Arduino RK-002 Board extension you can use your MIDI interface to program the RK-002 with any MIDI processing software you would need.
And if you’re not that savy on programming: There’s also the RK-002 DUY Exchange Portal where you can share or download firmware sketches, for yourself or from others.
NOTE: Using the DUY firmware gives you a great amount of flexibility on the RK-002 cable but it needs a certain level of programming knowledge!
With a few simple steps you can started writing Arduino sketches for your cable.
Using Arduino development IDE
Note that if you register and verify on the DUY portal you can CCU (code, compile and upload) from within the browser but – you can also use the Arduino IDE for development. Download the IDE via the Arduino site: http://www.arduino.cc
Once installed add the RK002 board to the IDE: Open preferences and enter in the field ‘Additional Boards Manager URLs’ the URL of the Retrokits RK002 support package:
https://retrokits.com/rk002/arduino/package_retrokits_index.json
note that the RK002 Retrokits package is supported in Windows, MacOSX and Linux !
Step 2 : select ‘Retrokits RK002’ board
After adding our board support package in the Arduino IDE settings you can go to the Arduino ‘Board manager’ (under Tools–>Boards) and search for ‘RK002’.
Install the files via this menu and the RK-002 and after closing this, the RK-002 will be selectable from the Boards menu.
You might need to update your Java environment with these link:
java.com/download/ and/or oracle.com/technetwork/java/
Download the JDK and you are ready to write custom sketches for the RK-002!
Step 3 : start coding your custom RK002 Arduino sketch
Below is an ‘Hello World’ example of an Arduino sketch for the RK002 cable to get you started.
#include <RK002.h> RK002_DECLARE_INFO("SAMPLE CODE","duy@retrokits.com","1.0","7b47d3dd-991a-4197-ac02-d340cdabfb59") boolean RK002_onNoteOn(byte channel, byte key, byte velocity) { RK002_sendNoteOn(channel, key+7, velocity); return true; } boolean RK002_onNoteOff(byte channel, byte key, byte velocity) { RK002_sendNoteOff(channel, key+7, velocity); return true; } void setup() { } void loop() { }
PS,Goodie: we developed a quicklook plugin for OSX which allows you to quickly browse through .ino codes used by our DUY and Arduino
Step 4 : compile & upload
Arduino has to be connected via USB or serial adapter to be programmed, the RK-002 programming works via the MIDI interface.
Connect the RK002 cable to your computer’s MIDI interface input and output (black end to MIDI-out, orange end to MIDI-in), and press the ‘upload’ button inside the Arduino IDE to upload the sketch. This will start the RK002 loader tool. The first time the loader tool starts, it’s necessary to select correct MIDI INPUT and MIDI OUTPUT ports. After the ports have been selected, the upload process should start automatically. If the Arduino IDE gives you a message that you need to select a port to upload, just select any available port from the Tools-> Port menu item.
The settings will be stored, so next time when you press ‘upload’ the upload will automatically start. The RK002 loader window can be kept open, and can be used as a general purpose MIDI monitor.
The uploader tool requires Java to be installed on your platform; www.oracle.com/technetwork/java/javase/downloads
happy coding!