sfxr.lua - Generate sounds dynamically at runtime

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by murks »

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.
hoistbypetard
Prole
Posts: 26
Joined: Fri May 22, 2020 7:00 pm

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by hoistbypetard »

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!
screenshot of the demo running on windows 10.
screenshot of the demo running on windows 10.
demo_screenshot.png (46.62 KiB) Viewed 9466 times
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 341 times
User avatar
zorg
Party member
Posts: 3476
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by zorg »

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. :3
Me and my stuff :3True 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.
User avatar
gingerbeardman
Prole
Posts: 15
Joined: Mon Sep 14, 2015 7:22 am
Location: United Kingdom
Contact:

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by gingerbeardman »

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!
Screen shot 2025-03-10 at 12.50.05.png
Screen shot 2025-03-10 at 12.50.05.png (153.76 KiB) Viewed 278 times
Last edited by gingerbeardman on Mon Mar 10, 2025 8:36 pm, edited 2 times in total.
User avatar
gingerbeardman
Prole
Posts: 15
Joined: Mon Sep 14, 2015 7:22 am
Location: United Kingdom
Contact:

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by gingerbeardman »

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
Screen shot 2025-03-11 at 18.09.19.png
Screen shot 2025-03-11 at 18.09.19.png (179.93 KiB) Viewed 164 times
User avatar
gingerbeardman
Prole
Posts: 15
Joined: Mon Sep 14, 2015 7:22 am
Location: United Kingdom
Contact:

Re: sfxr.lua - Generate sounds dynamically at runtime

Post by gingerbeardman »

macOS and Windows binaries now available for free on itch: https://gingerbeardman.itch.io/enhanced-sfxr-for-love2d
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests