Music help

Does anyone know how I can use other instruments, not just the piano in arcade? Like drums

Help is appreciated.

You are probably stuck with the default sound effects (ex. power up) and the piano unless someone has written an extension to manipulate the sound in such a way to sound like the instruments you want.

Arcade audio works by pulsing the speaker using PWM (pulse width modulation) on hardware and probably some JavaScript library to play basic frequencies in the browser.

Hardware devices like the PyGamer and PyBadge (that use the ATSAMD51 chip) support CircuitPython, which is maintained by Adafruit Industries. CircuitPython can support playing .wav files and there is experimental support for .mp3 last time I checked. Other devices that use the STM32 microcontroller like the Meowbit can run MicroPython which should be able to play .wav files, but since I don’t use MicroPython, I do not know of it’s capabilities. All of the boards support Arduino as far as I know, which has the ability to play .wav files too but I can only confirm this for ATSAMD51 chips because I don’t have a Meowbit.

Wow, that was a mouthful.


If you’re comfortable with TypeScript, you can use code written by @kwx for inspiration:

1 Like

In case it helps, here’s a version with fixed synchronization for the tracks, using a 12-bar blues pattern:

If you’re OK with using the beta editor, that adds a few new waveforms for sounds, for example a tunable noise (waveform 4) which can add a bit of variety for percussion instruments: