SFXR Java Port

Here is a port of the core SFXR sound effects generator with added reverb (optional). It might be good to have as a generator inside a game since it can save some space. You can also wrap a GUI around it if you like.

http://www.springworldgames.com/sfxrjava

Use the class like this:


SFXRData data = new SFXRData(seed); // Or SFXRDataWithReverb(seed)

// Set parameters here.

// Then call resetSample() to set all internal variables
data.resetSample(false); 

You can also generate random coin/pick up/explosions/lasers like this:


SFXRData data = new SFXRData(seed); // Or SFXRDataWithReverb(seed)

data.random(1); // Use 0-6 here for different types. See source code for details.
// Then call resetSample() to set all internal variables
data.resetSample(false); 

For more instructions, see the original SFXR page:

http://www.drpetter.se/project_sfxr.html

For the reverb stuff there are a couple of parameters:

  • wet1 and wet2 controls how much reverb to use
  • dry is how much of the pure sfxr signal that should get through
  • room_size is quite obvious perhaps
  • postAmp is how much the resulting signal is amplified

oh very cool, sfxr is very useful piece of code.

thx

I also plan to add some parameterized artificial reverb to this class to thicken the sound a bit.

Ace. :slight_smile:

Decided to do the reverb part as well :slight_smile:

Here is the link to the whole package including the filters that implement Freeverb (I hope :stuck_out_tongue: ):

http://www.springworldgames.com/sfxrjava

I can recommend to turn down the wet parameters and increase the dry parameter for good results.