SmallsomeFormats · Language · ArchitectureJörg Burbach

RPMC Format definition

Generation 26 contract

RPMC streams carry the RPMC signature and generation 26. The serializer reads and writes Music_Format::Song, including occupied sample/instrument slots and their associated data. Pattern events and playback state remain structured music data. The reference EncodeRPMCMemory and DecodeRPMCMemory procedures specify the field order and reject malformed or unsupported input.

This is a concise format overview. The bundled reference module is the authoritative field-by-field and bitstream definition; it includes the required structures, constants, encoder and decoder. Input and output are memory buffers. File access and playback or rendering belong to the host application.

Public operations

  Declare.i EncodeRPMCMemory(*song.Music_Format::Song, *OutSize.Integer = #Null)
  Declare.i DecodeRPMCMemory(*Memory, MemorySize.i, *song.Music_Format::Song, *ownedSampleData.Integer = #Null)
  Declare.s LastError()
  Declare.s GetMusic_Format_RPMCInfo()

The source bundle preserves the include paths and contains all literal include dependencies and the MIT license. The individual module is not advertised as a dependency-free distribution.

C and JavaScript

The memory ports encode and decode generation-26 streams. The port contracts specify dependencies, buffer ownership, data structures, encoder differences and exchange-format boundaries. The complete C/JavaScript source bundle preserves shared dependency paths. Browser file conversion is separate from the codec core.

Both ports preserve all 1,399 numeric metadata bytes per sample/instrument, UTF-8 names, key maps and complete 44-byte event cells. The generated sample schema names every field and its numeric offset. MOD and XM have narrower contracts than RPMC.