Atlas Audio: NKS Snapshot Extractor

The NKS Snapshot extractor reads product identity from Native Instruments NKS snapshot files. Snapshots are lightweight preset recall points that store a plugin’s parameter state. The extractor links each snapshot back to its parent library. It’s part of the Atlas Audio extractor pack.

Extension: .nksn

Format Overview

NKSN files use the NI DSIN container format. They are structurally similar to .nki and .nbkt files but are significantly smaller (~15-17 KB) because they store only parameter snapshots, not sample mappings or embedded audio.

Binary Structure

Offset  Content
0x00    Container size (4 bytes LE)
0x04    Padding (4 bytes)
0x0C    "hsin" marker (hash/identity block, 16-byte hash)
0x30    "DSIN" chunks begin
0xC0    "4KIN" marker (NKS identity block)

Key structural elements:

MarkerPurpose
hsinFile identity hash (appears twice — outer container and inner NKS block)
DSIN type 0x6A (106)Version/flags
DSIN type 0x01Container metadata
4KINNKS compatibility marker — identifies this as an NKS-aware file

Identity Hashes

Each NKSN file contains two hsin blocks:

  1. Outer hash — Unique to this snapshot file
  2. Inner hash (after 4KIN) — Shared across snapshots from the same library, identifying the parent product

The inner hash is consistent across all snapshots belonging to the same library, making it a reliable grouping key.

What It Extracts

TypeSourceExample
Trait: snapshot_nameFilenameGraceful Scenery
Edge (input): Library referenceAUTHORING_APP product_idHypha or kontakt:product_id:1234

NKS Preview Audio

NKS snapshots have an associated audio preview file used by NI’s browser for auditioning. The preview follows the same deterministic NKS naming convention as instruments and sound files:

Snapshots/
  Arkhis/
    Textures/
      Graceful Scenery.nksn
      .previews/
        Graceful Scenery.nksn.ogg

The extractor constructs the expected preview path (<source_dir>/.previews/<filename>.ogg) and checks if the file exists on disk. If found, it emits an output edge linking the snapshot to its preview audio.

TypeSourceExample
Edge (output): Preview audioNKS naming convention + existence check.previews/Graceful Scenery.nksn.ogg

This relationship is certain when the file exists — the NKS specification defines this convention, and preview files are generated during library installation.

Implementation Notes

This extractor reuses the NI container DSIN parsing from ni_container.rs to extract the product ID from the AUTHORING_APP chunk. The 4KIN marker is an NKS-specific addition not present in older NI formats.

Given the high file count (24,000+ in a typical large library), the extractor reads only the header portion needed for product ID extraction. Full file buffering is not required.

Example Usage

# Scan NKS snapshots
atlas scan ~/Libraries/NI/User Content/Snapshots/

# Find all snapshots for a specific library
atlas search --trait snapshot_name --inputs "Hypha"

Use Cases

  • Snapshot inventory — Catalog all NKS snapshots and associate them with their parent library
  • Library usage — See which libraries have user-created snapshots, indicating active use
  • Snapshot grouping — Group snapshots by library using the shared inner identity hash