Contributors

Overview

This guide shows you how to build your own soundboard. A soundboard is a set of buttons that will play sounds or music clips when the corresponding button is pressed.

This project uses the NeoTrellis M4 to create a soundboard capable of playing any 32 audio clips, and puts on a good light show at the same time too!

Soundboards are commonly used for sound effects or to select various pieces of dialog on command. They are sometimes used for pranks (as in this famous example), or by DJs to interject prerecorded sounds.

About the NeoTrellis M4

The NeoTrellis M4 is an all-in-one Audio board, ready to become your next synth, soundboard, drum machine, keyboard, or any other invention you'd like to adapt it for. It’s powered by the SAMD51, a Cortex M4 core running at 120 MHz, featuring a roomy 512KB of flash and 192KB of SRAM. A separate flash chip provides a full 8MB of space for files and audio clips.

On the front side is a 4x8 grid of elastomer button pads with a NeoPixel nestled in the center of each one. You can read any/all button presses simultaneously thanks to the fully diode'd matrix, and also set each button color to any of 24-bit colors.

Prepare Audio Files

This soundboard requires 32 different audio clips. In this project we will use clips from Star Trek (the original late 1960s TV series) to demonstrate how to work with .mp3 files, resulting in a nerd-tastic tool.

Add Audio

Ensure your created sound clips are numbered 01.wav to 32.wav (don't forget those leading zeroes!). They all must be 16 Bit, 22KHz WAV files in mono (single channel audio) or stereo (2 channel audio) and cannot be mixed mono & stereo.

Connect your NeoTrellis to your computer via a known good USB cable. Your operating system will show a new "thumb drive" named CIRCUITPY is available. If you do not see this happening, visit the NeoTrellis M4 introductory tutorial to ensure CircuitPython has been loaded onto the device.

Next, in your file explorer/Finder, create a folder on the CIRCUITPY flash drive labeled /startrek. You can then drag and drop your audio files into that directory (ensuring the files are named from 01.wav through 32.wav). You can change the name of the folder later in the code if you want.

Soundboard Code

Onto the final step, the code itself!

Copy code.py from the link below and put it in CIRCUITPY root directory. You can work with this code in any text editing application, or open and save with Mu if you prefer.

Also copy the linked color_names.py file into CIRCUITPY root directory.

Boot up: Color!

Once you have all your files set up, your board should reboot and start running your code automatically.

The boot-up sequence illuminates all neopixels in a rainbow pattern, then goes dark for a second before coming back on in an array of Star Trek-inspired colors.

Making Changes

If you'd like to change the code, you can do so as follows:

The line INTRO_SWIRL= [PINK, TEAL, YELLOW] can be changed to be any three color names listed in color_names.py. You can even put more color values in that file and refer to them in your code.

In the definition of SAMPLES near the top of the code - it lists a file name and the color of the button. Feel free to color the buttons how you wish using the color names in color_names.py.

While Star Trek used lots of primary colors (as an early color TV program), your other soundboards may be different. Say, different shades of green for Teenage Mutant Turtles, etc.

Images from Star Trek, copyright by the license holder, reproduced under fair use as outlined in 17 U.S.C. 107 Educational Use.

Troubleshooting

You can use the serial capability in Mu or a serial terminal program to connect to the NeoTrellis M4 to interact with the CircuitPython prompt. You can see error messages, restart the program, etc. If you use a terminal program, set it to the COM port that appears when the device is plugged in. In Windows, Device Manager will show a keyboard when NeoTrellis is plugged in. Right click, Properties, Hardware will show the COM port. Connect at 9600 baud.

Problem: I don't see the CIRCUITPY drive when I plug the NeoTrellis M4 into my computer

Solution: Check the files on the CIRCUITPY drive. /lib should have the latest CircuitPython 4.x libraries, /startrek holds the 32 sound files, code.py and color_names.py should be in the main (root) directory.

Problem: Not enough disk space for all the files.

Solution: You cannot use long stereo clips or songs for each button, there is not enough flash memory space. You can reduce the number of files below 32. You can trim your clips to make them shorter. Or you can ensure all your clips are mono instead of stereo. Advanced users can remove libraries in /lib for sensors that are not used by your device to free up small amounts of flash but please do not delete any libraries used by the program or low level input/output libraries.

Problem: My board isn't booting up!

Solution: Make sure your /lib folder is set up with the libraries in the 4.0 latest release and includes trellism4.mpy in its contents.

Problem: I'm not hearing any sounds!

Solution: Check that all your files are formatted as Stereo 16-bit, 22,050Hz, PCM

Use It!

Some clips are noticeably longer than others, and you will notice that one button press is able to interrupt the audio clip that came before it, so you can press as messily as you like and the soundboard will keep up with you.

Exploring Further

Other Sound Sources

You can use any 32 sounds you want, so you are not limited to Star Trek. If you search the web for "Soundboard", you can find several sites that host groups of sound files.

You will most likely have to convert the files you do find to the WAV format as noted in the Prepare Audio Files section.

Some sounds may be Open Source (or Creative Commons unrestricted CC 0) and others may be commercial. If you want to use your soundboard in a commercial way or to record on Youtube, it is best you either use unrestricted sounds or buy a license for the material you use. This is the reason in this tutorial we state the Star Trek sounds may be purchased via CD or download.

OUT OF STOCK NOTIFICATION

YOUR NAME

YOUR EMAIL

You have been successfully subscribed to the Notification List for this product and will therefore receive an e-mail from us when it is back in stock!

For security reasons, an e-mail has been sent to you acknowledging your subscription. Please remember that this subscription will not result in you receiving any e-mail from us about anything other than the restocking of this item.

If, for any reason, you would like to unsubscribe from the Notification List for this product you will find details of how to do so in the e-mail that has just been sent to you!