Demo 4: Adafruit Feather M4 Synth
A platform testing the audio generating capabilities of the Adafruit Feather M4 Express, built onto a QICBase_DD board. The QICBase_DD replaces the cover of a Hammond 1590DD box, making a nice, portable setup.
The QICBase_DD can also provide +5V and +/-12V derived from a +15V desktop supply, but for this demo, we're getting power from USB, and running all of the modules from 5V.
Indeed, we have to do it that way because of the way the Feather is set up: its external 5V input is wired directly to the USB 5V, so it can't share 5V with the QICBase. You can see that the Feather's USB line is driving the QICBase 5V rail in order to power the other modules. While not having an external power supply simplifies the demo, it also limits us to QICBoards that don't need +/-12V. An alternative is to add a USB Isolator QICBoard, then powering everything from the QICBase supply.
Here's the setup with the QICIsoUSB board installed in the lower left. Now the USB is galvanically isolated, and you can – and must – use the on-board voltage regulators.
You can get up and running with just the Feather and the QICAudioDAC. The AudioDAC is a stereo DAC with line-level outputs, controlled with an I2S interface. Hook up to the Feather this way:
Feather "TX" to DAC "BCK"
Feather "10" to DAC "FS"
Feather "11" to DAC "SDO"
Feather "5" to DAC "MUT"
As mentioned earlier, the Feather "USB" should be connected to the 5V rail, and the Feather "GND" should be connected to the ground rail.
The Audio DAC gets its 5V and ground from its own 8-pin connector, but I added a redundant ground from the DAC "GND" pin to the breadboard's ground rail, to reduce ground bounce.
This minimal setup of Feather + DAC is all you need for the first few demo programs, but you will probably want to add MIDI at some point. The MIDI board (upper left of the pic) is connected as follows:
"GND" to a nearby breadboard ground rail
"OUT" to the Feather "RX" pin
"V" to the Feather 3V pin. This provides regulated 3.3V to the MIDI board.
In addition, potentiometer boards come in handy. For both boards, connect "CCW" to the breadboard ground and "CW" to the Feather's 3V pin. The wiper pins go to the Feather "A1" and "A2" pins.
I used 20K linear pots on the pot boards, but the values aren't critical.
Follow Adafruit's setup procedure to get your Feather M4 up and running.Â
Note: the programs listed below all work, but I'm still fleshing out the documentation. Pls be patient.
The program "M4I2SChirpInterp" will test that you've got the necessary libraries installed, and that your DAC is connected properly. It runs a slow low-to-high sinewave chirp on both outputs. The left output is uninterpolated, so that students can listen to the difference between interpolated and non-interpolated versions.
You will need to install the Adafruit Zero I2S and Adafruit Zero DMA libraries.
Once you've got your Feather chirping away like a proper ox-bird, it's time to try the M4KarplusStrong:
This is a simple program to demonstrate the Karplus-Strong string simulation algorithm. I think I got this particular version from PJRC, but I'll need to double-check.
This program plays a plucked string every second. Note how every note sounds slightly different – this is because the "seed" noise of each note comes from a random number generator.
M4Guitar1 turns the Karplus-Strong into a 6-string guitar playing a little tune. This is lifted from the Teensy guitar demo.
M4KeytarMIDIPoly adds the MIDI interface, making a 4-voice MIDI-activated guitar synthesizer. You will need to add the MIDI library.
M4WaveTable plays compressed wavetables, with the two potentiometers controlling playback speed and pitch.
you will need the ulaw compression code from PJRC:
And I added two vocoder wavetables, which I created with Vital's text-to-wavetable tool:
Details about the processing steps coming soon.
Note that these tables are heavily compressed, in order to fit onto their original demo platform, the MKRZero. At some point, I'll decompress them a bit for the M4, which should improve the sound quality.
Copyright © 2024 The President and Fellows of Harvard College * Accessibility * Support * Request Access * Terms of Use