Hi, as seen in this thread, I have started this tool to load 8 bit samples from the Amiga era (IFF and RAW 8 bit signed mono PCM only) in their original format:
Reviews and help are welcome, particularly on this part:
What is the proper way to convert a [-128, 127] int value to a [-1, 1] Lua float value? I’m dividing the int value by 128 and the result sounds right to me (at least exactly like loading the file from outside my tool), but is there a better way?
I’d like to be able to load files from my tool by right clicking them in the disk browser. I could add a menu item there, but I can’t access to the path of the file that was right clicked. Is it possible?
What it does
After installation, this tool adds a 8 bit sample loader > Load IFF or RAW file… menu entry to the Tools menu.
Clicking on it opens a file browser. Selecting an IFF or RAW 8 bit signed mono file will load it in the current instrument’s current sample
For IFF files: sample rate, loop start info, and sample name are used if present. Octaves and compression are not supported (maybe a nice addition).
For RAW files: a sample rate of 16726 Hz is assumed (allow to customize this would be a nice addition).
Tip: try turning off interpolation in the sample options for that extra 8 bit noise. After that you can try a ~ 7 kHz low pass filter to tame some of it.
Note: this needs more tests at the moment.
If you want to try it you will need the files in their original format:
Samples I tested the IFF loader on:
st-01/strings6 = base sample and loop are clicky (I need more checks on this part if you want to help)
st-02/fatbrass = no loop
st-02/guitar1 = uselessly looping?
st-17/Afterthought = nice loop
st-17/badsample = a nice loop from Bad
st-17/bass.drum = ends with a silent loop ?
st-17/brass1 = no loop
st-17/BrassEns.1 = no loop
st-17/Fantasy2 = nice loop
The ST-17 directory looks like a good one to test IFF properties.
Another (sort of) possibility might be to use a file hook (although you may have to put an extension on the sample filenames):
--[[
file_import_hooks: Add support for new filetypes in Renoise. Registered file
types will show up in Renoise's disk browser and can also be loaded by drag and
dropping the files onto the Renoise window. When adding hooks for files which
Renoise already supports, your tool's import functions will override the internal
import functions.
Always load the file into the currently selected component, like
'renoise.song().selected_track','selected_instrument','selected_sample'.
Preloading/prehearing sample files is not supported via tools.
The Lua table passed to 'add_file_import_hook' is defined as:
* Required fields:
+ ["category"] = in which disk browser category the file type shows up.
"song", "instrument", "effect chain", "effect preset", "modulation set",
"phrase", "sample" or "theme"
+ ["extensions"] = a list of strings, file extensions, that will invoke
your hook, like for example {"txt", "swave"}
+ ["invoke"] = function that is called to do the import. return true when
the import succeeded, else false.
]]
Why not create a raw file with say all 256 numbers from 0 to 255. Import raw into Renoise. Then use your own routine to import the same file. Compare the two samples (both graphically and numerically)? Personally I would’ve just stuck with divide 128. Even basic mathematics is ridiculously difficult
Allow loading files with a VHDR but no 8SVX tag (only VHDR and BODY chunk are required to be considered an IFF 8SVX file)
When no VHDR is found in a file, it is considered a raw file (we have no sample rate info) but if an unexpected BODY chunk is found in this file, the tool will signal it to the user and ask if he wants to insert a slice marker at that position
Update to Renoise 3.2 (there is still a 3.1.1 branch if you need it)
If you are interested, more info about this project’s learnings and decisions are found in the doc folder
Next possible steps:
If the header of an IFF file is found in the middle of the file (unfortunately it is the case for a few files), read the sample rate but propose to either start after the BODY (skipping a large part of the file) or to use the whole file as data, marking the first body with a slice?