The requirements I need to meet are as follows:
- The controller must support a minimum of two Roland pads
- The controller must be able to replicate the soundset of the Alesis Samplepad it will be replacing
- It must be easy to add new sounds
- It must be simple to use
- It must be robust
I have researched a few options in order to help establish the best way to achieve the requirements.
My initial instinct was to build a Pi-based solution and use an analog Zero pHat I have to attach the pad inputs, using python to read the pads and play audio files, however I feel that the need to safely shut it down wouldn't meet the simplicity or robust requirements in my eyes.
After some further searching for a Microcontroller-based answer to the problem I stumbled across the DFRduino M0 board by DFRobot. The board looks perfect; An ARM Cortex M0 board, complete with an IIS chip onboard for handling audio processing. The board is less than $10 too!
After looking further into this board I found the perfect companion shield for the board: Audio Shield For DFRduino M0. Complete with Micro SD card slot, line out and recording features and a small onboard amp, this board will give me the functionality I need to achieve all of the above targets and give plenty of features for future development.
In addition to this shield I will also include an i2c 16x2 LCD screen and a rotary encoder for menu and navigation control. Add in a handful of 1/4" jack sockets and an enclosure and this should give us a complete unit.
I have a rough idea on how I am going to tackle the code of this project:
Sample sounds will be uploaded to the MicroSD Card, and follow a naming convention of group number followed by the intended pad to trigger it. For example, 1_1m.wav will be the sound for pad 1 main in group 1, and 3_3r.wav would be the sound for pad 3 rim in group 3.
The rotary encoder and lcd will allow the setting of the volume of the output and also the number of the group of sounds to be triggered - switching between the two will be done by pressing the encoder button.
The main loop of the code will check the pad pins (A0-A5) and check for a reading; if > 0 then a hit has been registered. The play command will send the name of the pad, the currently selected group number and the reading of the analog pin.
The Reading will be mapped against 100 and used to dictate the percentage of the main volume that the sound should be played, allowing velocity of the hit to be reflected in playback. The group number and pad name will be combined to give the name of the file that should be triggered from the SD card.