Roland SP-404MK2: add support for reading and writing projects#225
Open
douglas-carmichael wants to merge 1 commit into
Open
Roland SP-404MK2: add support for reading and writing projects#225douglas-carmichael wants to merge 1 commit into
douglas-carmichael wants to merge 1 commit into
Conversation
douglas-carmichael
force-pushed
the
sp404mk2-format
branch
from
July 24, 2026 23:28
92e013d to
b01e11f
Compare
This was referenced Jul 24, 2026
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.
douglas-carmichael
force-pushed
the
sp404mk2-format
branch
from
July 25, 2026 13:51
b01e11f to
bf866e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:PROJECT_XX) with aPADCONF.BINpad configuration and aSMPLfolder ofBANK<bank>-<pad>.SMPsamples.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.Testing
Software-tested against two real exported projects (and a synthesized internal-form one):
PADCONF.BINheader and all modeled record fields come back byte-identical to the device's own file, including the exact scaffold of an unused pad.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
+0x04play start,+0x2Cloop 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.PTN), pattern chains and project artwork are not converted.Note
This PR is the format only. The small
AbstractCreator.createSafeFilenamechange 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.