OPM File Format

From vgmrips

Description

This format contains voice information for the YM2151 (OPM). It is commonly used to load the voice data into the VOPM VST.

Format

An OPM file is a plaintext file which consists of a list of voices. Comments starting with // are allowed.

Each voice is defined as:

@:voice_num voice_title
LFO: LFRQ AMD PMD WF NFRQ
CH: PAN FL CON AMS PMS slot_mask NE
M1: AR D1R D2R RR D1L TL KS MUL DT1 DT2 AME
C1: -"-
M2: -"-
C2: -"-

All values are in decimal. AME is bit shifted << 7, so it is either 0 or 128. PAN is bit shifted << 6, so it is either 0, 64, 128 or 192. As you can see, M1, C1, M2 and C2 are the operators, and they have identical parameters (thus the -"-). The names of the parameters are the same as the names of the YM2151 registers.

Example

Here is an example taken from Green Hill Zone (Sonic the Hedgehog/Genesis).

//MiOPMdrv sound bank Paramer Ver2002.04.22
//LFO: LFRQ AMD PMD WF NFRQ
//@:[Num] [Name]
//CH: PAN   FL CON AMS PMS SLOT NE
//[OPname]: AR D1R D2R  RR D1L  TL  KS MUL DT1 DT2 AMS-EN

@:0 Instrument 0
LFO: 0 0 0 0 0
CH: 64 6 6 0 0 120 0
M1: 31 18 0 15 15 24 0 15 3 0 0
C1: 31 17 10 15 0 18 0 1 3 0 0
M2: 31 14 7 15 1 18 0 1 3 0 0
C2: 31 0 9 15 0 18 0 1 3 0 0

@:1 Instrument 1
LFO: 0 0 0 0 0
CH: 64 1 0 0 0 120 0
M1: 31 18 0 15 2 36 0 10 3 0 0
C1: 31 14 4 15 2 45 0 0 0 0 0
M2: 31 10 4 15 2 19 1 0 6 0 0
C2: 31 10 3 15 2 11 1 0 3 0 0

@:2 Instrument 2
LFO: 0 0 0 0 0
CH: 64 4 0 0 0 120 0
M1: 31 7 7 0 2 25 3 6 6 0 0
C1: 31 6 6 0 1 55 3 5 6 0 0
M2: 31 9 6 0 1 19 2 0 6 0 0
C2: 31 6 8 8 15 11 2 1 6 0 0

Tools

Tools that output OPM files:

Tools that take OPM files as input:

Tools that do both:

Libraries