Skip to content

Roland SP-404MK2: add support for reading and writing projects#225

Open
douglas-carmichael wants to merge 1 commit into
git-moss:mainfrom
douglas-carmichael:sp404mk2-format
Open

Roland SP-404MK2: add support for reading and writing projects#225
douglas-carmichael wants to merge 1 commit into
git-moss:mainfrom
douglas-carmichael:sp404mk2-format

Conversation

@douglas-carmichael

@douglas-carmichael douglas-carmichael commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds a detector and creator for the Roland SP-404MK2, requested in #215.

The SP-404MK2 is a pad sampler, not a keyboard multi-sampler - a project holds 10 banks (A-J) of 16 pads, and each pad plays one sample; there are no key ranges. So, as with the other pad devices, each populated bank is converted to one multi-sample and each pad becomes a single-key zone.

Format

Not documented by Roland. It was reverse-engineered from real exported projects and the SP-404MKII v5.52 firmware image, and written up in documentation/design/SP404MK2_FORMAT.md:

  • A project is a folder (PROJECT_XX) with a PADCONF.BIN pad configuration and a SMPL folder of BANK<bank>-<pad>.SMP samples.
  • PADCONF.BIN (RFPD): 160 pad records of 172 bytes plus a name block. Both forms are read - the 31,488-byte export form and the 52,000-byte device-internal form (they differ only in the header size, which shifts the two blocks, and a trailing marks section). The export form is written, since that is what IMPORT PROJECT accepts.
  • .SMP (RFWV): 32-byte header, 48 kHz / 16-bit, and the PCM is big-endian.
  • Read and written per pad: the name, level, panning, loop on/off, pitch/fine tune.

Testing

Software-tested against two real exported projects (and a synthesized internal-form one):

  • SP-404MK2 -> SP-404MK2 round-trips with byte-identical audio; the PADCONF.BIN header and all modeled record fields come back byte-identical to the device's own file, including the exact scaffold of an unused pad.
  • Also tested: conversion from a foreign format (Bitwig) into the format and back, library/multi-bank mode, the mono processing option, bank overflow (a 170-zone source fills 160 pads and logs the rest as skipped), and malformed input (wrong size/magic, missing SMPL, corrupt .SMP, empty project) which is skipped without an exception.

Not yet verified on hardware - I do not own the device, so I matched the byte layout of real exports as closely as possible, but a real IMPORT PROJECT test is still outstanding. @allcounter offered hardware testing in #215.

Known limitations

  • The on-device start/end trim and loop points are preserved in the file but not applied on reading - the full sample is always extracted. The field semantics are decoded (+0x04 play start, +0x2C loop start, byte offsets, untrimmed = 512), but the exact frame base could not be pinned down from the available projects, and extracting the wrong window would corrupt audio. Details are in the design doc.
  • Patterns (PTN), pattern chains and project artwork are not converted.

Note

This PR is the format only. The small AbstractCreator.createSafeFilename change it originally carried has been split out into #226, since it affects the output of every creator and deserves to be judged separately. This PR does not depend on it - without #226 the SP-404MK2 simply shows an underscore instead of a dot in the few pad names that contain one (e.g. @1prod.mars Gala), and nothing else differs.

The SP-404MK2 is a pad sampler: a project holds 10 banks of 16 pads, each pad
playing one sample. Like the other pad devices, each populated bank is converted
to one multi-sample with a single-key zone per pad.

Reads a project folder (PADCONF.BIN pad configuration - both the 31,488-byte export
and the 52,000-byte internal form - plus the SMPL folder of RFWV BANK<b>-<p>.SMP
samples, 48 kHz/16-bit big-endian) and writes an importable project. The format was
reverse-engineered and validated in software against real projects and the v5.52
firmware (see documentation/design/SP404MK2_FORMAT.md); writing is not yet verified
on hardware.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant