SFXR
Moderator: Moderators
SFXR
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!
Instructions
- 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 ).
K
- Attachments
-
- SFXR.zip
- (3.82 KiB) Downloaded 857 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
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 ).
K
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.
http://www.bfxr.net/
Handy/potential for further/renewed doings?
http://www.bfxr.net/
Handy/potential for further/renewed doings?
Champion of Roguelikes, living voraciously, trying to wrap my head around game creation.