Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
User avatar
Posts: 1726
Joined: Sat Feb 23, 2008 11:15 pm


Post by Kjell » Thu Dec 23, 2010 8:12 pm


Port of DrPetter's sfxr for use with the Sample Component.


This library is meant as a replacement to exporting / importing a .wav file from sfxr into ZGE, not as real-time synthesizer!


- Load a .sfs file using FileAction.
- Call SampleLength() and set your Sample accordingly.
- Call ResetSample() to initialize the Synthesizer.
- Call SynthSample() to render the sample to the buffer*
- Use a SampleExpression to copy the buffer to a Sample.

Attached file contains the library plus a demo scene which loads + renders Sample.sfs when pressing "R" and plays the sample when pressing "S".

*The quality argument of SynthSample has to be in the 0-3 range ( 0 being lowest, 3 be highest ).

(3.82 KiB) Downloaded 488 times

User avatar
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada

Post by jph_wacheski » Mon Jan 03, 2011 3:10 pm

Wow, nice one!

This is quite cool,.

what is the noteNr to use if i want to pitch the sounds in playback, I cant seem to find the base note?

User avatar
Posts: 1726
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Mon Jan 03, 2011 3:25 pm


Thanks jph. Ville will try to debug the script in order to see how we can speed it up some more. Let me know when you come across any problems* Anyway, the Base Note is around 148.7656.

*Other then some of the delta parameters not working at low values ( this is because ZGE doesn't support doubles ).


Posts: 5
Joined: Wed Apr 06, 2011 9:40 pm
Location: GA,USA

Post by getter77 » Thu Apr 21, 2011 10:36 pm

Bumping with the notion, or at least the tip of the hat, that another project that takes this a tad further than the base one has come into being, bfxr.


Handy/potential for further/renewed doings?
Champion of Roguelikes, living voraciously, trying to wrap my head around game creation.

Post Reply