usfxr - Procedural sound effects

To help me create game jam games with actual sound, I’ve decided to port the famous sfxr to Unity. I had been using as3sfxr’s online version to create static sound effect files, but I wanted an all-Unity solution. usfxr is what I ended up creating.

It is a quick free solution for dynamic, original, quick audio effect creation in Unity. The result are mostly “retro” sound effects since they’re synthesized based on certain rules (procedural), but they sound great when well designed.

usfxr has:

  • A pure code-based library that allows you to generate and play audio in realtime, with no static assets. Think write some code, and having a “coin/pickup” sound play:

SfxrSynth synth = new SfxrSynth();
synth.parameters.SetSettingsString(“2,0.5,0.0263,0.4567,0.2888,0.3,0.6098,0.375,0.6106,1,”);
synth.Play();

  • An in-editor window allowing you to play around and create sounds, and either copying them as string parameters (for code execution) or static WAVs
  • A way to create unique, original audio, and play them with small “mutations” over time, for less repetitive effects.

usfxr is free, and open source. The full source (updated more frequently than the asset store package) is available on GitHub.

Most of usfxr’s code is based on as3sfxr, the Flash/AS3 version of SFXR, but I’ve recently added support to BFXR’s new features too. BFXR is another Flash/AS3 port of SFXR, but one that added several new filters, parameters and wave types.

Since this is a port, you can also copy and paste parameters between usfxr and SFXR/AS3SFXR/BFXR, and the sounds will be the same between these versions if possible (advanced BFXR-style filters won’t work on SFXR/AS3SFXR).

I’ve also posted a few articles on my blog that explain different parts of usfxr.

This is my first asset store package, and my Unity experience is limited. Advice and comments are welcomed!

WOW, thank you very much for this.

Thanks for this!

I like it thanks ! I would like to use it inside js script,
but i could not find the correct code translation for
this part : private SfxrSynth synthA ;
(i’m a little beginner .)

Play sound doesn’t work on unity 5 beta

1 Like

Hey HGarry, thanks for letting me know.

In Unity 5 apparently AudioSource game objects are not automatically played while in editing mode inside the editor. So the sound generation window didn’t work when testing. It did work if the game was playing, and normal game usfxr audio worked as usual.

Thankfully it was an easy fix. It’s now updated on GitHub, and the asset store version should be live soon.

Very cool, zeh! Thanks!

Lol, I was using bfxr.net, and saving five different variations of each sound I needed. Now I can just save a single string, and have it generate basically unlimited variations? Awesome!
Thank you!