Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

Monday, January 25, 2016

Mopho Morphosis



I was lucky to get the DSI Mopho desktop version for a very good price, and admittedly I like this little thing a lot. However, like with everything, there is room for improvement -  so let's improve it a bit...

Note: The tweaks work equally well for the Mopho keyboard



1. Cleaner sound

Depending on the oscillator and filter settings, the Mopho's sonic capacity can be quite - unclean. As Synthbuilder well explains in his post on Gearslutz, this is because the DAC's reference voltage is generated from the, quite noisy, 12V rail. While all oscillator waveforms are equally affected,  this noise is most audible on the pulse wave. To test the practical implications on your own Mopho, completely open the filter and turn the resonance to zero. Also make sure that any modulations (envelopes, LFOs, etc) are turned off and no sub oscillator is active. Turn one oscillator off, and the other to Pulse 50. Instead of a clean pulsewave, it will sound somewhat dirty. Increase the puslewidth, and the dirtiness increases. At Pulse99, when you actually should hear nothing, the noise will be very dominant.

Before (Top) / After (Bottom): Pulse50 - Pulse 60 - Pulse70 -Pulse80 - Pulse90 - Pulse99

Luckily there is an easy fix. Since the noise from the 12V rail goes unfiltered to the DAC, filtering it is enough to clean the sound. A simple 10 µF tantalum capacitor soldered across resistor R52 (next to U12, the DAC) does the trick. Tantalum capacitors are polarised, and the negative pin should be soldered towards the front of the unit as indicated in the picture:




Afterwards, all oscillators will be absolutely clean. Thanks again to Synthbuilder for figuring this out.!




2. USB

Depending on the situation, sometimes I prefer DIN IN/OUT for MIDI communication, sometimes I would go for USB. Unfortunately the Mopho does not offer a USB port, but also this can be changed.

A quick look at the synth's innards reveals a 6N137 - an optocoupler that is regularly used to isolate circuits for MIDI INs. Its location close to the MIDI DIN sockets supports the this usage also in the Mopho, and a quick look at the 6N137's data sheet tells us that the incoming MIDI signal is passed out at pin 6. Meaning: we can easily hijack the circuit here by implement a bidirectional MIDI THRU "port". However, our THRU will not get a physical connection to the outside world, but with a Teensy µprocessor. As the Teensy offers multiple serial lines, TX1 (pink cable) can be used to infuse our own commands into the Mopho,  RX1 (also pink cable) can listen to all incoming MIDI IN messages (let's be aware of everything that is going on in there), and RX2 (blue cable) can sneak on all commands leaving at the MIDI OUT (I do not  eally care about sending things to the Mopho's MIDI OUT, so we'll skip connecting TX2 to that).  Right in front of the DIN sockets is a row of headers from the display connection. The right-most is GND and the one next to it is a 5V rail which we can use to power the Teensy:




Best to use is the Teensy 3.1/3.2, as their pins tolerate the 5V of the Mopho's MIDI implementation. Since I only had an Teensy LC lying around (and the LC comes for half the price - however, its pins are strictly 3.3V) I had to shift the voltage levels down/up. 2N7000 transistors are cheap, abundant, and perfectly suitable for that purpose. As a bonus, they can be used to shift levels both up and down. Together with two 10K resistors, the basic circuit to shift voltage levels between 5V and 3.3V looks as following:




As the MIDI specifications suggest on page 3, we additionally pass the signals for and from our "THRU" port through two logic gates before inducing then into the 6N137. I used a 74HC14N hex inverter for that purpose, and used two of its channels for RX1 and two for TX1. To stabilise the power supply to the hex inverter, we further add a 100nF decoupling capacitor to its GND and Vcc pins. RX2 can be more or less (less because we still need the level shifter) directly connected to the Teensy, like any other receiving MIDI device. An additional optocoupler is not necessary here, since we are anyway connected to the Mopho's GND and 5V, and therefore do not need to isolate our circuit.






However, we need to isolate everything from the power lines on the USB cable, and we do this by cutting the connection between the two tiny Vusb square pads on the back side of the Teensy LC. After assembling everything on a prototyping pub, the final circuit looks like this:






The observant reader will notice two additional resistors, as well well as three cables connecting to the right side of the board - which brings us to...



3. Clock and Note Indicators

I change my setup a lot, and not always does everything work immediately. While troubleshooting, it would be nice to know if the Mopho currently does not receive any MIDI messages, or if the sound path is interrupted. Since we already hijack the MIDI connection, we can easily add several status LEDs as well. I implemented two LEDs, one that displays the clock in 8th note divisions, and one that indicates if a note is currently played. Both are visible in the title image of my post, in the black circles in the upper left corner. The LED for the clock signal is connected via a 220 Ohm resistor with pin 8 of the Teensy, the note LED via a similar resistor with pin 7. I wrote the corresponding software in a way, so that is requests a dump of all global parameters on startup, and by this knows if an internal or external clock will be used, and on which MIDI channel the Mopho listens for notes. Similarly, if either parameter is changed on the Mopho, the Teensy is aware of that by analysing the NRPN messages through RX2 on the MIDI OUT. For everything to work, make sure to upload the firmware (which you find here) to the Teensy as described here, and happily use the USB or DIN ports as you please :)

DSI Software Editor with Mopho connected by USB



4. Optical Polishing

After modifying so much, I thought it would be nice if we also optically improve the Mopho a little bit. I did so by adding dark wooden sides that nicely complement the yellow color:..





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


Friday, November 13, 2015

Play the Kaossilator Pro with standard MIDI controllers (solder-free tweak)



I very much enjoy the intuitive play on the Korg Kaossilator Pro+. However, while I experience the touch pad to be great for implementing rhythms, drone sounds and simple patterns, I often don't hit the notes accurately enough during more complex loops, and often considerably disturb my harmonies. Consequently, every now and then, I would like to play individual parts with a standard USB MIDI controller or sequencer.

Since the Kaossilator is designed to be played via the touch pad, also the MIDI implementation is tailored around corresponding commands. In practice: my MIDI keyboard sends a note on command when I hit a key, while the Kaossilator expects 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 play a sound. I experience this as quite annoying, but it is easy to fix without extensively trying to reconfigure the MIDI controller's behaviour:

In contrast of most of my other projects, this hack is optimised for easy and solder-free implementation. For this reason, together with its straight forward MIDI implementation, I again designed this project around the Teensy development board. While this could be implemented cheaper with a variety of other boards and some simple circuitry, the Teensy LC (which is available for around 12 USD/EUR) will only need a micro-usb to usb cable and my Kontroller firmware.

Since the hack is designed for stock boards, it is very suitable for the absolute DIY beginner and therefore I also guide through the installation steps of the software required to put the Kontroller (not overly creative, but quite a suitable name for this hack) firmware on the Teensy board.

Assuming you have a Mac (it is the very same on other systems, however, the software installation routines are slightly different and I cannot confirm the exact names of menu points etc.), and that this is your first contact with the Arduino world, download the Arduino software here.

After installing (by moving the Arduino icon into your application folder), download the Teensyduino extension and install it via its installer. During this process, you will have to indicate where you have just put the Arduino IDE (hint: it is in your application folder), as well as point out which Teensy libraries you want to have pre-installed (for this purpose, it is save to not install any. Particularly do not install the MIDI library, it is based on an old version. If you want the MIDI library, like for MIDI DINs etc, get it from here).

Now it is time to get the actual Kontroller firmware from my GitHub section. Download it, and open it in the Arduino IDE. You can change the setting to your liking as described in the beginning of the file. Just add or remove "#" characters at the beginning of each line to inactivate or activate the setting, respectively. Configureable options include:
  • 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?)

Connect your Teensy board and, in the Tools menu, select Board: "Teensy LC" and USB type: "MIDI". Then press Upload in the Sketch menu.

And done! Kind of. The Kaossilator gives us two options to communicate with it via MIDI: USB and DIN. Since implementation of the latter requires construction of a (very basic) circuit, I neglected this route in order to provide an assembly-free solution. However, implementing MIDI DINs is really easy and straight forward, so feel free to contact me if you want instructions for that as well.

Focusing on USB, unfortunately this communication was designed for a USB master to interact with USB slaves. That is also why you typically cannot directly connect your USB MIDI keyboard to your instruments, but have to go through a master, i.e. your computer. Having said that, this means you will have all your devices (Kaossilator, Kontroller, Keyboard/Sequencer) connected to a computer for this to work. And you need to configure your computer to pass the information from your USB MIDI device through the Teensy Kontroller to your Kaossilator. On a mac, a free software to do so is MIDI patchbay. 



MIDI Patchbay: use the Teensy as a man-in-the-middle usb device

Despite being quite aged, it does the job well. Downlaod it from the provided link, move the app to the applications folder and start it. The first patch will manage the connection between your MIDI device and the Kontroller. MIDI input should reflect the name of your device, while MIDI output should say "Teensy MIDI". Apply your corresponding Channel settings and, under Note, allow all notes. Then click the "Add Patch" button to make the Kontroller to Kaossilator connection. Here, the MIDI input is "Teensy MIDI" while the output should be "KAOSSILATOR PRO+ SOUND", while and the MIDI Channels have to be configured to your Kaossilator's settings. 

And done! This time for real.



A quick note for fruitful experimentation: Kontroller translates notes into coordinates on the touch pad's XY-axis of your Kaossilator Pro (+). This means that the scale, set on the Kaossilator, is respected and therefore does not necessarily reflect the pressed key's pitch. Similarly, the octave range of the Kaossilator will further modulate the notes played. While this can be quite fun as well, a one-to-one mapping can be achieved by setting the octave range of you Kaossilator to full.