SFX in MakeCode Arcade?

The engine already has support for creating basic sound effects from waveforms with frequency and volume sweeps using music.playInstructions(), but this didn’t have a Blocks interface, and was a bit clunky to use from JavaScript since it involves modifying buffers.

I’ve recently added engine code for new waveforms for more sound effect variety, including tunable noise and distorted square waves. This is available in the beta editor but not yet on the main site. There’s more information in this rather long thread. You can try a demo using this link to the beta editor: https://arcade.makecode.com/beta#pub:_JL6P9m5fYg9u

This uses the pxt-sound-effects extension which adds a Blocks interface to make this a bit more accessible:

If you want to use it in your own project, click on Advanced / Extensions in the editor’s blocks panel, and copy the extension’s address into the search field:
https://github.com/klausw3/pxt-sound-effects

The extension works for the current version of MakeCode Arcade, but the new waveforms (tunable noise and cycle 16/32/64) will just produce silence if you’re not using the beta editor.

2 Likes