Today was the first chance I’ve had to work on this project for a while, but I made a fair amount of progress.
Up to this point I had just been experimenting with JACK applications on my desktop computer, but today I installed an OS on my Raspberry Pi and got my development environment set up. After a little bit of configuration, I had a JACK server running and producing sound. To my surprise, MIDI input worked out of the box, and I was able to run my
wavetable.c test program. I was also happy to find that input latency is definitely acceptable, and much better than I expected. The MIDI keyboard feels responsive enough to play comfortably, although the Pi sometimes has trouble processing MIDI events fast enough, resulting in events being dropped.
I modified my
wavetable.c test program to change its wavetable based on input from standard in. I then wrote
sendwaves.c, which allows the user to select one of five waveforms, which it then calculates a table for and writes to standard out. I can then run these programs with
./sendwaves | ./synth, which allows real-time waveform selection for the synth. These programs are in the code repository on Github.
I then switched over to the GUI side, and wrote up a quick Java program to accept wave drawings. It has a canvas which reads mouse input, and a button to write the data to standard out. I piped its output to the synth in the same way as the
sendwaves program. This works pretty well – the basic concept is there, but there is still room for improvement in sound quality. I plan to add some smoothing and interpolation to the user input to make more pure waveforms possible.
At this point I have a working prototype of the project running on my desktop computer. My next step will be to set up the Raspberry Pi touchscreen and get the application running there. Finally, I will work to improve sound quality by adding a smoothing function to the input. I could also improve quality by increasing the number of samples and the size of samples – currently each sample is 1 byte, but I could bump this up to 4 bytes without much trouble.
This work is licensed under a Creative Commons Attribution 4.0 International License.