Showing posts with label DIN. Show all posts
Showing posts with label DIN. Show all posts

Tuesday, January 12, 2016

Kaoss Update: solder-free solution for enhanced MIDI DIN control




Wow, I am blown away by the receptions I receive for my Kaossilator / Kaoss Pad MIDI mod.

As a thank you, I want to throw a small goodie in the ring:

A solder-free version of the DIN mod. If you can spare USB connectivity, there is a very easy solution to play your Kaossilator Pro(+) or Kaoss Pad 3(+) with standard Note On/Off messages generated by any keyboard, sequencer, DAW, etc.

Naturally, this is also the most expensive solution, but we speak about being expensive in the range of less than 20,- Euro/Dollar here. All you need are two devices (if you look for third-party clones, less than 10,- each): an Arduino/Genuino (Uno, Leonardo, or any compatible clone) and a MIDI shield.

Sorry, to be precise, you'll need these two devices, a USB cable and an internet connection (the fact that you read this, tells me you are on the right track):


  1. Put the Arduino and the MIDI shield together
  2. Get the Arduino IDE from here and install it
  3. Get the MIDI library from here and install it (described here)
  4. Get the Kontroller firmware from here
  5. Open the firmware in the Arduino IDE and edit the features listed in the beginning of the file
  6. Use the USB cable to connect the Arduino to your computer
  7. Choose your Arduino board and its connected USB port in the Tools menu of the IDE 
  8. Press the Upload button
  9. Happy Kaoss on your gig!

Monday, January 4, 2016

Play the Kaossilator and Kaoss Pad with any Din MIDI equipment



Due to popular demand after my post about how to Play the Korg Kaossilator Pro(+) and the Kaoss Pad (+) with standard MIDI controllers (solder-free tweak), here is an update of the tweak that adds the option to use DIN connections (alone and in any DIN-USB mix).

To quickly summarise my initial problem: the Korg Kaoss devices are designed to be played via their touch pads. Accordingly, the MIDI implementation is tailored around corresponding commands. In practice: MIDI controllers send a note on command to play a tone, while the Kaoss devices expect a control change # 74 (to signal that the touch pad was pressed), and then control changes # 12 and # 13 (to define the X and Y coordinates on the pad) to make a sound. This is a very consequent design choice, however, I frequently struggle to hit exact notes which would be very beneficial at times.

After already posting a way to circumvent this problem by making a small device that translates all USB MIDI messages for the Kaoss devices, this idea is elaborated by adding MIDI DINs here. While this greatly improves the usability for computer-free life performances, unfortunately it cannot be implemented without assembling a small electronic circuit. However, this circuit is particularly simple, very cheap, and comprehensive instructions are posted here.

After adding the DINs in hardware, get the latest Kontroller firmware and change the following parameters in the beginning of Kontroller.ino with the Arduino IDE:

  • USB on/off
  • DIN on/off
  • MIDI channel
  • enable/disable modulation of the X-axis (the note's pitch) by your keyboard's pitch wheel
  • enable/disable notes velocity to define the Y-axis (often a filter or delay)
  • enable/disable a control change # (which can be freely chosen) to define the Y-axis
  • enable/disable aftertouch to modify the Y-axis value
  • enable/disable indication of played notes on the built-in LED of the Teensy (Why not?)

For DIN connectivity, the MIDI library needs to be installed. Connect your Teensy board and, in the Tools menu, select Board: "Teensy LC", "Teensy 3.1" or "Teensy 3.2" with USB type: "MIDI". Then press Upload in the Sketch menu.


The Kontroller firmware is now under the umbrella of my MDMA project.

Update: a solder-free DIN solution without USB connectivity


Sunday, January 3, 2016

MIDIfication

My projects are regularly based on the Teensy and Arduino/Genuino development platforms. While the former natively supports MIDI over USB, I often have the need for DIN support. The following instructions connect DIN input and outputs to you Teensy (all) and Arduino (Zero, Uno, Due, Mega, Leonardo, Yun, Nano, Micro, Mini) boards.

The circuit in general is very simple and can be soldered by beginners as well. For testing purposes, a prototyping board can also be used:




MIDI Out

Connecting a DIN output to the Teensy is straight forward. Although the Teensy runs at 3.3V, while the MIDI standard specifies 5V operation, virtually all MIDI devices function with a 3.3V connection without any problem. To have DIN MIDI output, connect pin 2 of the output DIN to ground (Teensy pin GND), pin 4 through a 220 Ohm resistor to 3.3V (on the Teensy), and pin 5 gets connected to the Teensy's TX (Teensy pin 1):

  • MIDI OUT pin 2 - Teensy GND
  • MIDI OUT pin 4 - 220 Ohm resistor - Teensy 3.3V
  • MIDI OUT pin 5 - Teensy pin 1 (TX)


MIDI In

The DIN input is a bit more elaborate. Here, we isolate our circuit from the circuit of the MIDI partner (which itself will be isolated from all input, that is why our output can be so simple). We do this with an opto-isolator, and a good one for this purpose is the 6N137 for its sharp transient signals and 3.3V suitability. Also it is cheap and available from numerous manufacturers.  Pin 4 of the input DIN is connected through a 220 Ohm resistor to pin 2 of the 6N137 (the spot marks pin 1, we use the one directly next to that), and DIN pin 5 goes to 6N137 pin 3. Similarly, pin 5 on the 6N137 is connected to the GND pin on the Teensy. Pin 6 goes to RX (pin 0) on the Teensy, and 8 on the 6N137 goes to 3.3V as well as RX (the latter through a 5.6 kOhm resistor). If you want to be extra secure, you can stabilise the 6N137s power lines by putting a 100n capacitor (ceramic is fine) between them (pin 5 and pin 8) as close to the chip as possible. To further protect your circuit from reverse polarity (someone swapping + and - on the MIDI cable), add a 1N4148 diode between pin 2 and 3 of the 6N137. While the orientation of all resistors and capacitors used here does not matter, the diode has to be put in a specific direction: the side with the solid black line points to pin 2:

  • MIDI IN pin 4 - 220 Ohm resistor - 6N137 pin 2
  • MIDI IN pin 5 - 6N137 pin 3
  • 6N137 pin 2 - 1N4148 diode - 6N137 pin 3 (the black bar on the diode points to pin 2)
  • 6N137 pin 5 - Teensy GND
  • 6N137 pin 6 - Teensy pin 0 (RX)
  • 6N137 pin 8 - Teensy 3.3V
  • 6N137 pin 8 - 5.6K resistor - Teensy pin 0 (RX)
  • 6N137 pin 5 - 100nF capacitor - 6N137 pin 8

Software

The standard Arduino MIDI library can be used to access the DINs. Actually, please use the standard MIDI library. The one that comes with the Teensyduino environment is based on a much older version and will not function correctly with my code (it is initialised differently).

If you start from scratch on a Mac (it is basically the same in Windows, but I happen to have a Mac):
  • Get the Arduino IDE from here and install it
  • Get the MIDI library from here and install it (described here)
  • Get the software you want to install from my GiHub repository
  • Open the firmware in the Arduino IDE and edit the features listed in the beginning of the file
  • Use the USB cable to connect the Arduino to your computer
  • Choose your Arduino board and its connected USB port in the Tools menu of the IDE
  • Press the Upload button
  • VoilĂ 

Prototyping

In the above picture, the connections are as following (always from left to right): top left - DIN input pins 5, 4; bottom left - DIN output pins 2, 4, 5; bottom right - Teensy pins 1, 0. Also don't forget to connect + to 3.3V on the Teensy, and - to GND. For the interested among you, the schematics are the following: