/renoise-8-bit-sample-loader

Tentative Renoise tool to load 8 bit samples from the Amiga era

Primary LanguageLua

Tentative Renoise tool to load 8 bit samples from the Amiga era (IFF and RAW 8 bit signed mono PCM only).

Loading the sample data looks alright, reviews and some tests are welcome :)

If you wonder what a sample from the Amiga era is, you can look here:

See also:

Installation

Tested with:

  • Renoise 3.2

See this branch for a version tested with Renoise 3.1.1.

Download or clone this repository's content, then drag and drop the github.sroccaserra.8BitSampleLoader.xrnx folder on Renoise.

Note: the github.sroccaserra.8BitSampleLoader.xrnx folder is in the src folder.

How to use

After installation, this tool adds a 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.

Docs, learnings and decisions

You can learn more about this project's learnings and decisions in the doc folder.

TODO

- [X] Learn how to script Renoise for dummies
- [X] Parse the FORM chunk
- [X] Warn for unsupported file types and quit
- [X] Setup test environment for a quicker feedback
- [X] Parse sample rate info from the VHDR chunk
- [X] Find the BODY chunk
- [X] Load the BODY chunk data to the current sample <-- If I can do that, the
  project will be ok. If not I'll need some help.
- [X] Allow to load a RAW file
- [X] Parse loop info from the VHDR chunk
- [X] Set the loop start in the current sample
- [X] Deal with variable chunk order (or check that the VHDR chunk always
  starts at byte 13) - short answer: it doesn't :(
- [X] Deal with BODY only files (no sample rate or looping info)
- [ ] Deal with late IFF headers
- [ ] Check the signed char [-128, 127] to Lua [-1, 1] float conversion. How
  can it be right ?
- [ ] More checks!
- [ ] More error messages!

Then maybe:

- [ ] Add a right-click option to load the file from the disk browser panel
- [ ] Allow to select sample rate for RAW files
- [ ] Support many octaves from IFF files (add slices in Renoise?)

Running the Lua tests

Requirements: have docker installed, and having built the docker image. Run make build to build the docker image.

Since I got tired of editing / reloading the tools in Renoise / running the tools in Renoise to see the result, I wrote automated tests to have faster feedback while working.

Run the tests:

$ make test

Note: the tests use Busted.

References

About Renoise:

About Renoise script development:

About Lua and Luajit:

About the IFF sound file format: