Page 1 of 1

SFXR

Posted: Thu Dec 23, 2010 8:12 pm
by Kjell
8)

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

Image

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

Posted: Mon Jan 03, 2011 3:10 pm
by jph_wacheski
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?

Posted: Mon Jan 03, 2011 3:25 pm
by Kjell
:)

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

Posted: Thu Apr 21, 2011 10:36 pm
by getter77
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?