Difference between revisions of "sfxr.lua"

(Created page for sfxr.lua)
 
m (whoops, forgot category)
Line 25: Line 25:
 
* [https://github.com/nucular/sfxrlua/wiki Documentation Wiki]<br/>
 
* [https://github.com/nucular/sfxrlua/wiki Documentation Wiki]<br/>
 
* [http://love2d.org/forums/viewtopic.php?f=5&t=78053 Forum post]<br/>
 
* [http://love2d.org/forums/viewtopic.php?f=5&t=78053 Forum post]<br/>
 +
 +
[[Category:Libraries]]

Revision as of 16:30, 3 June 2014


sfxr.lua is a pure Lua port of the sfxr game sound generator. It still performs comparatively fast, though :P

Screenshot

This single-file library allows you to dynamically create retro sound effects based on parameters from your code. It also comes with a demo application as shown above based on Löve Frames.

Usage example (plays a random sound on every keypress):

local sfxr = require("sfxr")

function love.keypressed(key, rep)
    local sound = sfxr.newSound()
    sound:randomize()
    sound:play()
end

It supports all 7 preset generators for Pickup/Coin, Laser/Shoot, Explosion, Power-Up, Hit/Hurt, Jump and Blip/Select sounds and also both a randomizing and a mutating function. It also has all parameters from the original synthesizer, including basic envelopes, frequency slides, vibrato, change, square duty sweeping, phaser effect, low and high pass filters and sweep repeating.