Search Unity

usfxr - Procedural sound effects

Discussion in 'Assets and Asset Store' started by zeh, Jul 22, 2014.

  1. zeh

    zeh

    Joined:
    Feb 2, 2013
    Posts:
    28
    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!
     
  2. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    WOW, thank you very much for this.
     
  3. Mordekai

    Mordekai

    Joined:
    Nov 8, 2009
    Posts:
    24
    Thanks for this!
     
  4. Tepei

    Tepei

    Joined:
    Mar 29, 2014
    Posts:
    29
    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 .)
     
  5. vortexilation

    vortexilation

    Joined:
    Sep 25, 2009
    Posts:
    287
    Play sound doesn't work on unity 5 beta
     
    MikeTon likes this.
  6. zeh

    zeh

    Joined:
    Feb 2, 2013
    Posts:
    28
    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.
     
    Last edited: Dec 17, 2014
  7. Veemix

    Veemix

    Joined:
    Dec 5, 2014
    Posts:
    25
    Very cool, zeh! Thanks!
     
  8. Good_Venson

    Good_Venson

    Joined:
    Oct 12, 2014
    Posts:
    22
    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!
     
unityunity