UPDATE: The container format is fairly well understood now (enough to read blocks and extract files and presets), and compressed internal presets are spat out on all files of this type. From here, deciphering individual presets is much more straightforward.
Anyone who wants to do this with me, please get in touch. I'm on telegram at @deathdisco
Most of the source files are now unused as I transition to using binread
. I'll clean everything up shortly.
cargo install --path cli
This library is a work in progress.
- Detect various NI filetypes
- Extract compressed presets from NI Containers (most NI files)
- Extract files from Kontakt Monoliths
- Unencrypted presets
- [~] Kontakt 4/5 Unencrypted Presets
- [~] FM8
- Kontakt 2
- Encrypted presets
There is no real code quality at this point, but this will follow once the container format is more discovered.
NI Containers are embedded hierarchical chunks of data.
The file is made up of nested segments, very similar to a linked list. There are two major kinds of segments header segments (hsin
) and data segments (dsin
). Header segments have more information and nest data segments. Here's a basic example colored with high level chunks.
The magic part is a char array denoted with 'hsin' tags / magic numbers. These tags are spelt backwards. For example
hsin
Native Instruments Start HeaderDSIN
Native Instruments Start Data4KIN
Native Instruments Kontakt 4RTKR
ReaKToRE8MF
FM8 E?
I still can't work out exactly how the checksum is calculated, but NI apps don't check for file integrity anyway.
Data chunks are tricky to load, they're recursive blocks like this:
The main preset is compressed with a custom LZ77 variant. deflate.rs can deflate a segment. The segment will start as normal, but appears to embed another file (with its own data segments, compressed) as data in a DSIN
(type 115).
IMPORTANT: the compression starts 11 bytes into the data slice, but you must provide an initial dictionary of 00
.
Most strings are pascal widestrings or shortstrings.
cargo +nightly run -- test-data/deflated/002-fm7.nfm8.deflated