LinuxCommandLibrary

psidtopgm

Convert SID (PSID) music files to PGM

TLDR

Convert the image data in a PS file to a PGM image of the specified dimensions and quality

$ psidtopgm [width] [height] [bits_per_sample] [path/to/file.ps] > [path/to/image.pgm]
copy

SYNOPSIS

psidtopgm [options] <SID_file>

PARAMETERS

-o <outfile>
    Specifies the output file name for the generated PGM data. If not provided, output goes to standard output.

-s <subtune>
    Selects a specific subtune within the SID file to convert. SID files can contain multiple distinct pieces of music or variations. The default is 1 (the first subtune).

-r
    Outputs raw PGM data without the standard PGM file header. This is useful if the PGM stream is to be embedded or processed by a tool that expects only the raw command sequence.

DESCRIPTION

psidtopgm is a command-line utility designed to convert Commodore 64 SID music files (PSID format) into a Programmable Music (.PGM) format. This specialized .PGM format captures the exact register writes to the SID chip over time, essentially providing a detailed log of the music's playback instructions. It serves as an intermediate step in the SID emulation pipeline, allowing other programs to interpret and play the music without directly parsing the original SID file. It is typically distributed as part of the libsidplay or sidplayfp suite, which are renowned for their highly accurate emulation of the C64's iconic sound chip.

CAVEATS

psidtopgm is a highly specialized utility within the C64 SID emulation ecosystem. The output .PGM file is not an audio file itself, but a sequence of commands for a SID chip emulator. It requires another program (like a SID player or emulator core) to interpret these commands and render them into audible sound.

It primarily works with PSID (Portable SID) format files, which is the most common format for C64 music outside of native C64 environments.

THE PGM FILE FORMAT

In the context of psidtopgm, PGM (Programmable Music) refers to a proprietary intermediate format used by libsidplay and related projects. A PGM file consists of a stream of instructions representing direct register writes to the virtual SID chip, along with timing information. This format allows for extremely precise re-creation of the original C64 music playback without needing to constantly re-parse the more complex SID file structure during emulation.

HISTORY

psidtopgm emerged as a utility within the broader libsidplay project, initiated by Simon White, which aimed to create a highly accurate and portable software emulator for the Commodore 64's MOS Technology 6581/8580 SID (Sound Interface Device) chip. It later became part of forks like libsidplayfp (Fast and Portable), continuing its role in processing SID files for accurate playback and analysis.

SEE ALSO

sidplayfp(1), sidtuneinfo(1)

Copied to clipboard