Too bad about the broken "demo" program as it would be really useful for creating sounds and the code that creates it. I got it to work with löve 0.9, a pre löve 0.10 version of frames and a few simple edits, but it still crashes when I hit any of the "randomize" buttons.
It is useable, but it would be so much better to have a version that works properly without hassle.
sfxr.lua - Generate sounds dynamically at runtime
-
- Prole
- Posts: 26
- Joined: Fri May 22, 2020 7:00 pm
Re: sfxr.lua - Generate sounds dynamically at runtime
Sorry if it's bad form to resurrect this thread. If so, let me know and I will start a new one.
I was excited to find this because I wanted similar functionality in a project I'm working on. So I spent some time over the past couple of nights getting it to work nicely with 11.3. After building the original (C/SDL) sfxr tool on Linux, I decided that it would be easier to fix this up than to generate builds of the original one for my collaborators to use. It was!
I used @linux-man's fork of LoveFrames with 11.x support and have posted a PR for @nucular's sfxr.lua repository here. I hope that will get merged in some form. If anyone wants to kick the tires in the meantime or would just find this as useful as I have, I've attached a .love archive to this post.
I was excited to find this because I wanted similar functionality in a project I'm working on. So I spent some time over the past couple of nights getting it to work nicely with 11.3. After building the original (C/SDL) sfxr tool on Linux, I decided that it would be easier to fix this up than to generate builds of the original one for my collaborators to use. It was!
I used @linux-man's fork of LoveFrames with 11.x support and have posted a PR for @nucular's sfxr.lua repository here. I hope that will get merged in some form. If anyone wants to kick the tires in the meantime or would just find this as useful as I have, I've attached a .love archive to this post.
- Attachments
-
sfxr_demo.love
- An archive of the demo as submitted in my PR
- (608.21 KiB) Downloaded 376 times
- zorg
- Party member
- Posts: 3477
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
Nah, this i think is one of the legit cases where bumping old threads is fine, since it's on-topic AND you basically worked to do some compatibility edits on the old project to get it working again. 

Me and my stuff
True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

- gingerbeardman
- Prole
- Posts: 19
- Joined: Mon Sep 14, 2015 7:22 am
- Location: United Kingdom
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
Just to say that I'm using this in 2025 with the PR mentioned above
Plus the getDirectoryItems fix mentioned on that PR.
Plus my own fix so space plays the current sound.
Fixed love file in post below.
(sorry don't know why it's picked up the .zip extension)
Thanks to all involved!
Plus the getDirectoryItems fix mentioned on that PR.
Plus my own fix so space plays the current sound.
Fixed love file in post below.
(sorry don't know why it's picked up the .zip extension)
Thanks to all involved!
Last edited by gingerbeardman on Mon Mar 10, 2025 8:36 pm, edited 2 times in total.
- gingerbeardman
- Prole
- Posts: 19
- Joined: Mon Sep 14, 2015 7:22 am
- Location: United Kingdom
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
I got a bit carried away and have added a history feature with picker list and undo/redo, I'll look to make a PR soon and will upload another version here soon when I'm happy with it.
My use case is that I use random and mutate extensively to discover interesting sounds, but often miss a good one. Now we can go back to a previous sound.
edit:
- added "auto play on changes" so that any time you adjust a slider the sound plays
- fixed a bug where the selected wave form was being ignored (sounds were always square wave)
- fixed wave form not updating when sound was loaded (but sound was playing correctly)
- fix off by one error as shown in a sfxrlua PR
- added keyboard navigation in file picker (type a-z to jump between files, enter to choose selected, esc to close picker)
macOS and Windows binaries now available for free on itch: https://gingerbeardman.itch.io/enhanced-sfxr-for-love2d
My use case is that I use random and mutate extensively to discover interesting sounds, but often miss a good one. Now we can go back to a previous sound.
edit:
- added "auto play on changes" so that any time you adjust a slider the sound plays
- fixed a bug where the selected wave form was being ignored (sounds were always square wave)
- fixed wave form not updating when sound was loaded (but sound was playing correctly)
- fix off by one error as shown in a sfxrlua PR
- added keyboard navigation in file picker (type a-z to jump between files, enter to choose selected, esc to close picker)
macOS and Windows binaries now available for free on itch: https://gingerbeardman.itch.io/enhanced-sfxr-for-love2d
- gingerbeardman
- Prole
- Posts: 19
- Joined: Mon Sep 14, 2015 7:22 am
- Location: United Kingdom
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
macOS and Windows binaries now available for free on itch: https://gingerbeardman.itch.io/enhanced-sfxr-for-love2d
- gingerbeardman
- Prole
- Posts: 19
- Joined: Mon Sep 14, 2015 7:22 am
- Location: United Kingdom
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
updated build at itch that includes better filename and save directory handling
Re: sfxr.lua - Generate sounds dynamically at runtime
I've got the error:gingerbeardman wrote: ↑Wed Mar 12, 2025 6:53 pm macOS and Windows binaries now available for free on itch: https://gingerbeardman.itch.io/enhanced-sfxr-for-love2d
Code: Select all
Error
sfxr.lua:1257: bad argument #1 to 'char' (invalid value)
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'char'
sfxr.lua:1257: in function 'bytes'
sfxr.lua:1264: in function 'w16'
sfxr.lua:1310: in function 'exportWAV'
main.lua:679: in function 'cb'
main.lua:586: in function 'onclick'
loveframes/loveframes/objects/button.lua:162: in function 'mousereleased'
loveframes/loveframes/objects/frame.lua:628: in function 'mousereleased'
loveframes/loveframes/objects/base.lua:143: in function 'mousereleased'
loveframes/loveframes/init.lua:244: in function <loveframes/loveframes/init.lua:241>
[love "callbacks.lua"]:154: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
- gingerbeardman
- Prole
- Posts: 19
- Joined: Mon Sep 14, 2015 7:22 am
- Location: United Kingdom
- Contact:
Re: sfxr.lua - Generate sounds dynamically at runtime
Thanks! I'll look into it this week.
@darkfrei if you have a lua or sfs file that can reproduce this it could save me some time?
@darkfrei if you have a lua or sfs file that can reproduce this it could save me some time?
Re: sfxr.lua - Generate sounds dynamically at runtime
It was sfxr_demo.lovegingerbeardman wrote: ↑Sun Mar 23, 2025 9:36 pm Thanks! I'll look into it this week.
@darkfrei if you have a lua or sfs file that can reproduce this it could save me some time?
156 kB from your link.
Who is online
Users browsing this forum: Amazon [Bot] and 4 guests