Bulding a MIDI controller for some rack gear

Started by iaresee, August 10, 2009, 01:17:09 AM

Previous topic - Next topic

iaresee

Moved this from Mark H.'s thread to here. It was a blatant hi-jack. My bad.

Background: I think I want to build my own MIDI foot controller for my Axe-Fx. The hardware would be off-the-shelf stuff and I think the code would be a blast to write. So here's my search for the pieces to put it all together.




So, I think I'm going to go Arduino. Specifically the Arduino Duemilanove w/ Atmega328. I'm really tempted by their Mega board but I think it'd be over kill. I think I'll be pushing the 14 digital I/O terminals on this guy, but better to push than to have a ton of waste, right?

Can I do it with 14 digital I/Os? I'm not sure. Let me see...I'm going to think this through out loud here. Chime in if I'm drifting out of reality with this design.

Right off the bat I need 2 for the LCD display using I2C for the interface.

I need another 2 for the MIDI out data.

For switches I'd really like to have 12 switches paired with LEDs for program change messages and IA continuous controller messages. 2 switches for bank up/down. 1 switch for tap tempo. 1 switch for global bypass (it's an Axe-Fx message that lets you unbypass/bypass all the bypassed blocks in a patch).

That's a bad number for binary encoding! That's 12 + 2 +1 + 1 = 16 switches which means 2^4 states. But 0000 isn't useful because that's the "no switches pressed" state. So I need 5 pins to do this, which is 2^5 - 1 = 31 states for the switches. Darn. That's a big waste. I'll have to consider slapping some more switches on there. :) I'll hit a point where wiring up all those switches will get hella nasty no doubt. Even 5 bits per switch is seeming a little daunting right now. Definitely this means a PCB/switch. Or maybe I'll do a PCB that's the entire size of the box -- like a big switch field. I can see why these beastly MIDI controllers cost what they do!

Right, so I'm up to 2 + 2 + 5 = 9 digital I/Os used.

I'm hoping to light up 12 LEDs. 8 for CC-message "instant access" switches, 4 for program change switches. That can be done with 2^4 - 1 = 15 states no problem. That means 4 bits. So that takes me up to 13 digital I/Os used.

One left. So I could do more LEDs paired to those 31 possible switches. But really I should probably use this for some sort of system switch: reset or edit or debug or something like that.

It's got 6 analog inputs! So that's 2 expression pedals and I think I'll do four assignable potentiometers that I can pair up with the Axe-Fx. My "virtual knobs" so I can bend over play with things like feedback and mix on delay blocks and feel like it's a "real pedal".

So it looks like that unit will accommodate me. But is it worth the cost? Encoding those switches means a lot of diodes. That's going to be a hella big switch buss. Wiring by hand will be a mess. And the PCB for something like this would be in the 12" x 12" range -- what do you think a through-hole plated, 12" x 12", one off, PCB would cost me to get fab'ed? If it's more than CAD$35 maybe I'm better off doing this with the Arduino Mega? That's got 52 digital I/O pins. That's enough to do 52 -2 -1 = 49 digital I/O pins after I subtract the ones I need for comm (I don't need display pins, it's got dedicated I2C pins!). So I could wire up 32 switches directly. And still have 17 pins left over drive a binary encoder for LEDs with enough encoding space to do an LED per switch. I could even encode bi-colour LEDs. That's a considerably less daunting wiring task.

Darn. Now I'm thinking the Mega is the right way to go.

What do you guys think?

iaresee

And as a late night follow up: I found, by chance, this cool article on building an 8x8 button matrix using the MCP23S17 port expander. Lets you get away with minimal, neat wiring like I'd have with the Arduino Mega, but only takes up 5 ports on the Arduino (so I could use the Duemilanove) and it's interrupt driven so no need for a polling loop (sweet). The "by chance" part comes in as I was bookmarking the Canadian retailer for Arduino stuff -- just happened to scan their front page and found that article they did. Nice.

iaresee

I should also mention: I can see these MIDI controllers like the Axess FX-1 and Liquid-Foot sell for >$800. The brains of the operation, with display and other supporting ICs, will be ~$100. The switches, if I go Carling from Small Bear, are $100. The enclosure will probably be in the $30-$50 range. That's $250 in parts and I haven't even written any code yet. Yikes!

Still: it's not about saving a buck, it's about doing it yourself and learning from the experience.

iaresee


Mark Hammer

I was in Creatron on College last Friday, staring at those Arduinos, and wondering if they would be any use to me.  Picked up some very nice momentary N.O./SPST buttons at Active Surplus for $1.95@.  They have different colour tops so that I can use the colour to help guide me to the right one.  Honson had some interesting colour-top latching SPSTs for $1.50 with triangular tops, that you can use for Up/Down buttons.  I have a spare Hitachi HD44870-controlled 16x2 display if you want.

iaresee

Thanks Mark! Yea, maybe can do some parts trading?

I'm headed to Toronto the last week of August so maybe I can scoop up some momentaries on the cheap down on College St. I ordered two of the "soft touch" ones from Small Bear. They're really quite nice. One is going to be the external switch hooked up to my Lexicon R1 for now. I was contemplating replacing all the switches in the R1 with these. The current switch setup in the Lexicon is hilarious and the switches are starting to fail a bit. The contact cleaner helped, but it's still intermittent on a few of the switches. I'll take some pictures of the Lexicon insides tonight. It's a really laugh how they put it together.

I want to make a decision this week and order up the microcontroller. The Arduino looks sweet -- and Wiring is a much better software dev environment than anything PIC (especially free). But having MIDIBox all done and tested and with a much better software set than I was envisioning for the Arduino project has made me rethink my hatred of PIC programming.

Mark Hammer

The momentaries I got at Active have a nice soft-but-substantial feel to them, and tops about 3/4" in diameter if I remember correctly.  So, nice big targets that you can feel, even if they aren't stompswitches.

If you get to Active, they are in the 2nd last aisle, where all the other switches are, near the front of the store.  Plenty to choose from.

Honson also has X-wing style momentaries for $3.75@. pricey for a momentary, but then, you could wire them up as SPST, and simply swap lugs if/when the first pair starts to act weird.  Alternatively, you could use the second set of contacts to actuate an LED to verify you've pressed the switch.  (That just occurred to me now. Finally, a use for those momentaries I bought by accident! :icon_idea: :icon_biggrin:)

iaresee

I ordered the Arduino Mega: http://www.spikenzielabs.com/Catalog/index.php?main_page=product_info&cPath=12&products_id=47

Might be overkill, but it'll be luxurious to design without having to worry about running out of I/O.

My plan now is for 6 patch access switches. 12 IA switches. A tap tempo switch, tuner switch, global bypass switch and one more utiliity switch for a 7 x 3 matrix. Bank up and down switches. Two external switches and two external continuous controllers. And 6 internal pots, mounted to the top of the unit, that'll function like knobs on pedals so I can bend over and rotate things like I used to do with ye olde pedal board.

That's easily accommodated on the unit.

I'll do a 2x16 LCD display and a 2x7-segment display for the bank numbers.

I'm pretty stoked. I started working with Wiring and their dev environment last night and the IDE is slick. Much nicer than PIC.

I'll keep a running log here of the build progress. No doubt when it comes time to fab the enclosure I'm going to have LOTS of questions. But that probably won't be until December at the earliest. :)

chrishurley

We're on a similar path.  I ordered a Aduino Duemilanove and have been tinkering with it.  Getting basic patch change and controller change messages working was easy enough, and I've started fiddling with external switches but I've been mostly distracted with other things like "how in the world am I going to get enough persistent storage to store patch information".  :)

The Mega has more of everything and that's what I should have bought, but I started with the Duemilanove instead to get my feet wet.

I need to make a clear definition of something reasonable to build first and then just rule out everything else for the time being.  A patch-only changer would probably be fine as an opener, though I'll want some way to assign which patches are fired when you press the buttons.