A .pch2 file begins with a text header, terminated by the first NULL byte. The text consists of key-value
pairs separated by 0x0D0A (CRLF).
Typical header:
Version=Nord Modular G2 File Format 1
Type=Patch
Version=22
Info=BUILD 192
The next two bytes after the 0x00 that ends the text header are a binary header of sorts, repeating the version already given in the text header, and specifying whether the file is a patch or a performance.
The rest of the information in a patch is stored in a series of "data objects".
Each begins with a unique header byte followed by two bytes giving the length (in bytes) of the data in the object. The data fields of each object are tightly packed, and as a result most fields are NOT byte aligned. This saves space but makes parsing more of a challenge.
The objects appear in the following order in a Patch file. (In a Performance, the order and quantity of the modules are different.) Some objects appear twice -- one for the Voice Area, one for the FX Area.
Patch Description
Module List (x2)
Mystery Object 1
Cable List (x2)
Patch Settings
Module Parameters (x2)
Mystery Object 2
Knob Assignments
MIDI Controller Assignments
Mystery Object 3 (x3)
Module Names (x2)
Textpad
Patch Description
7 bytes |
unknown |
All zeros |
5 bits |
unknown |
5 bits |
Voice count |
14 bits |
Height of FX/VA bar |
3 bits |
unknown |
1 bit |
Red cable visibility |
0: off, 1: on |
1 bit |
Blue cable visibility |
0: off, 1: on |
1 bit |
Yellow cable visibility |
0: off, 1: on |
1 bit |
Orange cable visibility |
0: off, 1: on |
1 bit |
Green cable visibility |
0: off, 1: on |
1 bit |
Purple cable visibility |
0: off, 1: on |
1 bit |
White cable visibility |
0: off, 1: on |
2 bits |
Mono/Poly |
0: Poly, 1: Mono, 2: Legato |
1 byte |
Active variation |
0-7 |
1 byte |
Category |
0: No Cat, 1: Acoustic, 2: Sequencer, 3: Bass, 4: Classic,
5: Drum, 6: Fantasy, 7: FX, 8: Lead, 9: Organ, 10: Pad,
11: Piano, 12: Synth, 13: Audio In, 14: User 1, 15: User 2
|
... |
Padding to <length> bytes |
Module List (x2)
2 bits | Location | 0: FX Area, 1: Voice Area |
1 byte | Module count | Number of modules in this area |
1 byte | Module Type | For type codes, see the Table of Modules. |
1 byte | Module Index | ID # of this module. Generally starts at 1 and increases as you add
modules to the patch. Deleting and adding new modules will fill in holes in the sequence. This value is used to refer to the module in other tables (cables, module parameters, etc.) |
7 bits | Horizontal position | 0: leftmost column, 1: second column, etc. |
7 bits | Vertical position | 0: top of screen, 1: one step down, etc. |
1 byte | Color | TODO: document codes for the various colors available in the editor |
1 byte | unknown |
4 bits | unknown |
... |
Padding to <length> bytes |
Mystery object 1
The meaning of the information in this object isn't yet known.
... |
<length> bytes of data |
80 00 00 20 00 00 |
Cable List (x2)
2 bits | Location | 0: FX Area, 1: Voice Area |
1 byte | Cable count | Number of cables in this area |
3 bits | Color | 0: Red, 1: Blue, 2: Yellow, 3: Orange, 4: Green, 5: Purple, 6: White |
1 byte | Module From | ID # of one module that this cable is attached to. Module IDs are given in the Module List object. |
6 bits | Jack From | 0-63. Will be either an input or an output jack depending on the Type parameter. The input and output jacks on each module are numbered separately. See the Table of Modules for input and output jack numbering. |
1 bit | Type | 0: Input to Input cable, 1: Output to Input cable |
1 byte | Module To | ID # of other module that this cable is attached to |
6 bits | Jack To | 0-63. Always refers to an input jack. |
... |
Padding to <length> bytes |
Patch settings
Most patch settings are repeated 9 times (for Variations 1-8, and the Init Variation.)
6 bytes | unknown | 81 c2 40 48 00 00 |
6 bytes | unknown | All zeros? |
1 byte | Morph Group 1 | 0: Group #, 1: Wheel, 2: Vel, 4: Keyb, 8: Aft.Tch, 16: Sust.Pd, 32: Ctrl.Pd, 64: P.Stick, 128+: --- |
1 byte | Morph Group 2 |
1 byte | Morph Group 3 |
1 byte | Morph Group 4 |
1 byte | Morph Group 5 |
1 byte | Morph Group 6 |
1 byte | Morph Group 7 |
1 byte | Morph Group 8 |
1 byte | unknown |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
1 byte | Patch volume |
6 bits | Active/Muted | 0: Muted, 1: Active |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
7 bits | Glide | 0: Off, 1: Normal, 2: Auto |
7 bits | Glide time |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
7 bits | Bend | 0: Off, 1: On |
7 bits | Bend semitones | 0: 1 semitone, 1: 2 semitones... 23: 24 semitones |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
7 bits | Vibrato | 0: None, 1: AfTouch, 2: Wheel |
7 bits | Vibrato cents |
7 bits | Vibrato rate |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
7 bits | Arpeggiator | 0: Off, 1: On |
7 bits | Arpeggiator time | 0: 1/8, 1: 1/8T, 2: 1/16, 3: 1/16T |
7 bits | Arpeggiator type | 0: Up, 1: Down, 2: Up/Down, 3: Rnd |
7 bits | Arpeggiator octaves |
1 byte | Variation | 0-7: Variations 1-8, 8: Init Variation |
7 bits | Octave shift | 0: -2, 1: -1, 2: 0, 3: 1, 4: 2 |
7 bits | Sustain pedal | 0: Off, 1: On |
... |
Padding to <length> bytes |
Module Parameters (x2)
2 bits | Location | 0: FX Area, 1: Voice Area |
1 byte | Module count | Number of modules in this area |
1 byte | unknown |
1 byte | Module Index | ID # of module, see the Module List object |
1 byte | Parameter count | Number of parameters on this module |
1 byte | Variation # (0-8) | |
7 bits | Parameter value (0-127) | |
. . . | One 7-bit entry for each of <parameter count> parameters. For the parameters of each module, see the Table of Modules. |
|
... |
Padding to <length> bytes |
Mystery object 2
The meaning of the information in this object isn't yet known.
... |
<length> bytes of data |
Example: 09 80 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 60 00 00 00 00 00 00 00 00 70 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 |
Knob assignments
2 bits | unknown |
1 byte | Module index |
2 bits | unknown |
7 bits | Knob index |
... |
Padding to <length> bytes |
MIDI Controller Assignments
7 bits | Assignment count | Number of MIDI assignments in the patch |
7 bits | MIDI CC# |
2 bits | Type | 1: User, 2: System |
1 byte | Module Index | (purpose unknown if Type=System) |
7 bits | Knob Index | (purpose unknown if Type=System) |
... |
Padding to <length> bytes |
Mystery object 3 (x3)
The meaning of the information in this object isn't yet known. There are three of these in a patch, each with different contents.
... |
<length> bytes of data |
Example A: 80 40 54 00 42 02 11 dc 9b dd 5c 08 0c 40 42 02 51 dc 9b dd 5c 08 0c 80 42 02 91 dc 9b dd 5c 08 0c c0 42 02 d1 dc 9b dd 5c 08 0d 00 42 03 11 dc 9b dd 5c 08 0d 40 42 03 51 dc 9b dd 5c 08 0d 80 42 03 91 dc 9b dd 5c 08 0d c0 42 03 d1 dc 9b dd 5c 08 0e 00
Example B: 40 00
Example C: 00 00
|
Module Names (x2)
2 bits | Location | 0: FX Area, 1: Voice Area |
1 byte | Module count | Number of modules in this area |
1 byte | Module Index |
... | Module Name | Null-terminated string |
... |
Padding to <length> bytes |
Textpad
... |
<length> bytes of text | Not null terminated |
Binary Footer
Finally, the .pch file ends with two bytes that appear to be some sort of checksum or timestamp.