Saturday, I hooked up the Raspberry Pi to a MIDI connector, and then hooked that up to an Arturia synth: we now have end-to-end MIDI from the Pi to a MIDI device. Baud rates worked out, note on and note off signals went through as intended (although I sent them on the wrong channel).
That means that Alcyone Beta’s physical milestones have been passed.
I’ve already detected the switched inputs on the breadboard on the Pi through the chained MCP23008s. (That was the first milestone for Alcyone Beta, actually.) That means I can detect pedal presses.
The MIDI connection was the other physical test, and the one I was most concerned about, since the RX/TX on the Pi doesn’t naturally support the right baud rate for MIDI. I found a few references on how to fix this, and this did the trick:
- First, modify
/boot/config.txtto make sure it contains the following lines:Java12init_uart_clock=2441406init_uart_baud=38400
For me, they’re at the end of the file.
/boot/cmdline.txtto remove the serial console on RX/TX, by changing the line to look like this:Java12dwc_otg.lpm_enable=0 console=tty1 console=tty1 root=/dev/mmcblk0p2 /rootfstype=ext4 elevator=deadline rootwait bcm2708.uart_clock=3000000
This is supposed to be ONE line, not two.
- Uncomment the TTY in
/etc/inittab:Java12#Spawn a getty on Raspberry Pi serial line#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Anyway, this underclocks the serial line and frees it up for programmatic use. Setting it to 38400 baud ends up writing at 31250 baud (because it’s underclocked); hello, MIDI baud rate.
Now I can use wiringPi’s serial library (for example) and write MIDI data.
So the next milestone is simple: I write a program to translate the inputs from the pedals (the chained MCP23008s) into MIDI data, which should be a fairly straightforward port from the Alcyone Alpha code (the Arduino codebase, in other words.)
And now I get to go back to a more traditional C/C++ environment, too, which will be nice. The Arduino IDE is convenient, but constraining.
I’ll need to work out boot processes for the Pi in a way that makes me happy – and I’ll also need to address display and input capabilities. This will all boost the effective cost of the Alcyone Beta to a respectable amount – from the Alcyone Alpha’s investment of about $100, we’re looking closer to $250 or so estimated for the Beta’s implementation.
But I’m not building this for a production line, just for myself; the implementation cost is only for my personal gratification. After that $250, I’d have a portable sonic platform, controlled by foot pedal (and other mechanisms, too!), expandable and rather overpowered until I come up with more uses.
And it’s fun, which is a win all around.