What would it take for me to build something similar to the mockup below?
Best Answer
Well, not much, really, the biggest problem is making it look nice, if you can handle that, then the electronics and the firmware ought to be relatively easy to handle.
I'd use a small 8bit AVR with a bunch of analog inputs, like an ATmega168, but that's pretty arbitrary and based on what I have in my parts drawer.
You could use one of the new AVRs with built in USB, but as MIDI is so low bandwidth, you should be able to get away with using V-USB.
Sounds like a PIC 18F2550 is just the thing, or maybe a 18F4550 if the extra I/O lines are needed. I don't know why you say a PIC 18 is not easy. You say you are a programmer, so I don't see what you're afraid of. Perhaps nobody has done a MIDI USB interface ready for you to add the keyboard scanning code to, but certainly there are various examples of the basic USB driver out there. Microchip has some code, and so do I. My 18F USB firmware is available from the downloads page, and fits into our PIC development environment.
I've never done a MIDI device, but I sortof vaguely remember there is a USB class standard for that. If so, then it's really easy since you don't have to write a host driver and it will work with any OS that implements that USB class. All you have to do is look at the class definition, fill in the right enumeration data in the include file for that purpose, then send/receive data over the appropriate endpoints according to the standard.
Any other microcontroller will require something similar. Again, short of finding free USB MIDI firmware out there (which you say you can't find), you need to do pretty much what I said above regardless of what flavor microcontroller you use. USB is USB, so all the USB device peripherals in microcontrollers do pretty much the same thing with only a few details different.
You say that you know how to implement a software UART and that you understand the format of MIDI messages. Your question suggests that you just want to transmit MIDI data using six buttons - perhaps to transmit control-change or program-change messages. There is no protocol as such to do this, you just need to transmit the data bytes in the correct order.
The simplest way would be to implement a bit banging UART transmitter. This would need to toggle one of the processor's IO port pins. First, the pin is driven low for 32us to represent the start bit. Next the pin is driven high or low to represent each of the 8 data bits in the byte you wish to transmit with the least-significant-bit sent first. The pin is driven to the appropriate level for 32us for each bit. Finally, the pin is driven high for at 32us to represent the stop bit. You might like to view wikipedia's article on asynchronous serial communications.
For instance, to transmit a control change message to set "Effect Control 1" (Controller number 0C) to the value 7 on channel 3, you would need to transmit 3 data bytes - 0xB3, 0x0C, 0x07 in sequence.
(Be aware that this "bit banging" technique may not be suitable if your processor is going to be doing a lot of other work simultaneously).
Of course you will also need the standard opto-isolated interface as recommended by the Midi Manufacturers' Association which also has several useful free pdfs containing message formats etc.
Best Answer
Well, not much, really, the biggest problem is making it look nice, if you can handle that, then the electronics and the firmware ought to be relatively easy to handle.
I'd use a small 8bit AVR with a bunch of analog inputs, like an ATmega168, but that's pretty arbitrary and based on what I have in my parts drawer.
You could use one of the new AVRs with built in USB, but as MIDI is so low bandwidth, you should be able to get away with using V-USB.
This project looks like a good place to start research: http://cryptomys.de/horo/V-USB-MIDI/index.html