Difference between revisions of "sfxr.lua"

(Update)
m (changed layout.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#set:Name=sfxr.lua}}
 
{{#set:LOVE Version=0.9.x}}
 
{{#set:Description=Generate your sounds dynamically, at runtime}}
 
 
'''sfxr.lua''' is a pure Lua port of the sfxr game sound generator. It performs fast enough for short sounds or pregenerated longer ones.
 
'''sfxr.lua''' is a pure Lua port of the sfxr game sound generator. It performs fast enough for short sounds or pregenerated longer ones.
  
[[File:sfxr_lua.png|400px|thumb|left|Screenshot]]
+
[[File:sfxr_lua.png|400px|Screenshot]]
  
 
This single-file library allows you to dynamically create retro sound effects based on game-defined parameters. It also comes with a demo application as shown above based on [[Löve Frames]].
 
This single-file library allows you to dynamically create retro sound effects based on game-defined parameters. It also comes with a demo application as shown above based on [[Löve Frames]].
Line 30: Line 27:
 
* [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/>
  
 +
{{#set:Name=sfxr.lua}}
 +
{{#set:LOVE Version=0.9.x}}
 +
{{#set:Description=Generate your sounds dynamically, at runtime}}
 +
{{#set:Keyword=Sound}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]
 +
 +
== Other Languages ==
 +
{{i18n|sfxr.lua}}

Latest revision as of 15:09, 15 December 2019

sfxr.lua is a pure Lua port of the sfxr game sound generator. It performs fast enough for short sounds or pregenerated longer ones.

Screenshot

This single-file library allows you to dynamically create retro sound effects based on game-defined parameters. 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.

You can also design sounds with the demo application and safe them either in a Lua-based format or the binary format of the original sfxr. Both formats can be loaded too, of course.

Other Languages