Hayling Island

Hayling Island

Saturday, January 25, 2014

Hakkedpad !

I was bidding on that auction site again, and came across a Novation Launchpad. Owner said that he'd had a bit of an accident with power supplies and it had fried all of his stuff, so he was selling it dead.

Well I was delighted to win the auction for the Launchpad for not very many pennies, and when it arrived, all other projects went on hold for a while. I found that it was mostly alive except for the CPU, which had decided to depart this life. So what do you do?

Hack in an AVR instead!

The launchpad is an array of 80 buttons, and 160 LEDs, two per key. It's not touch sensitive, but all the same ... 

There are five 74HC164, and three 74HC165 inside. 164s (serial to parallel) drive the LEDs, and 165s read the state of the keys. The matrix is broken into four columns, each 40 LEDs (and 20 keys) long; you clock the LED states out, and clock the key states in at the same time.

So, I desoldered the CPU from the board, and wired in an Arduino Leonardo - since it was what I have lying around. The eventual target is a 32u4 micro board from my Chinese friends, when it comes.

The Leonardo happens also to have embedded USB, and there is a lovely lump of hack for the Arduino core called arcore, which happens to implement a simple USB MIDI interface. I found the programmers' guide to the Launchpad, so I could code up what was expected inbound and outbound, and a few days later (well, I have to do work as well, c'mon now) I have a reasonable emulation of a Launchpad. The refresh rate is only 53Hz, now I have implemented the three shades of green and red by PWM. I have a legitimate copy of Renoise for Linux (and Mac), and I wanted to use the Duplex mapper, which has lots of built in maps for Launchpad, but they do use all of the shades of colours.

It also has the benefit of a much faster MIDI implementation than the original - though maybe no faster than a Launchpad S, which uses a newer engine. Anyhow, I don't seem to need double buffering or anything like that to make the update performance OK .. it updates the entire button array in one refresh time, so as far as the user is concerned, it's instant. 

If you check the top RH corner, you'll see the dead CPU I removed from it ..

.. and now, I have improved the code a bit, so the refresh rate is now over 70Hz, and the colours still look good. I am going to call it done for the time being, and maybe revisit it in the future. For now, I am going to play with it ... !