Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Offline Editor For Project Files (*.NRD)
#32
(12-22-2022, 03:16 PM)XORadmin Wrote:
(12-22-2022, 10:38 AM)eliclement Wrote:
(12-22-2022, 08:03 AM)XORadmin Wrote: By the way. The Pattern files are very easy and straight forward. The .NRD files are very complex and grow with every new version and that is why I prefer to use an export/import tool which generates XML or so.

But they are more important things to do. (Got to keep the company running)
What I actually easily could do is that you could bulk import patterns which would include all 175 patterns in one file. That would probably be something I guess?

@Thomas
Yes, a pattern file seems straight forward to import/edit and export back to a .PTN file. So that can open up already a lot of fun possibilities to edit offline and to prepare live sets etc...

Can you be more specific on your idea of having a import/export tool as the way you see it fit? 
What do you mean by "bulk import patterns which would include all 175 patterns in one file"? (If I understand correctly, we then still need to understand the .NRD structure to be able to extract the patterns from it?)

Import export would more be like that a tool could read and generate XML from and to .NRD files. A XML is much easier to maintenance and 'readable' and can be used for a fully external editor. Maybe I will write one in BASIC...mmhuuahahahaha

The Bulk one would be only a 'in between step' and you would only need to know the pattern files as I described here but then 175 times.
Could be as easy as the layout from up here but instead of:
[16] Name 'NerdSEQ Pattern' 
it would be [16] Name 'NerdSEQ Bulk xxx'     (where xxx is the pattern number or xx in hex whatever)
and that 175 times.
Both sides could detect the 'bulk' and keep on reading the patterns until EOF. On import it would detect and 'overwrite' the current patterns (not creating new ones). Possibly the sequencer data would need to be cleaned up in case the used patterns don't match the tracktypes.

Just a fast idea. Shoot on it.  (and yes..the XML one is low prio, so don't expect that anytime soon.)

Ok I'm getting somewhere for the first steps of the offline editor. I can import the .PTN file successfully. I am able to unpack the raw .PTN files as you described (for the "modular" track type ("13") only for now) and parse it as a JSON file (can be XML as well) and roughly looks like:
Code:
{
    'header': {
        'file_type': 'NerdSEQ Pattern',
        'version_number': (1, 38),
        'track_type': 10,
        'length': 64,
        'clock': 9,
        'name': '\x00\x00\x00\x00\x00\x00\x00\x00',
        'reserved': '((((((((((((((((((((((((((((((((((((((((',
        'track_type_name': 'Modular'
    },
    'pattern': {
        0: {
            'note': 254,
            'placeholder': b'\xff\xff',
            'patch': 0,
            'table': 0,
            'trigger': 0,
            'mod': 4095,
            'fx1': {'command': 0, 'value': 127},
            'fx2': {'command': 255, 'value': 65535},
            'fx3': {'command': 255, 'value': 65535},
            'fx4': {'command': 255, 'value': 65535},
            'groove': 1
        },
        1: {
            'note': 0,
            'placeholder': b'\xff\xff',
            'patch': 1,
            'table': 1,
            'trigger': 1,
            'mod': 4096,
            'fx1': {'command': 1, 'value': 4095},
            'fx2': {'command': 255, 'value': 65535},
            'fx3': {'command': 255, 'value': 65535},
            'fx4': {'command': 255, 'value': 65535},
            'groove': 2
        },
        2: {
            'note': 1,
            'placeholder': b'\xff\xff',
            'patch': 2,
            'table': 2,
            'trigger': 254,
            'mod': 4217,
        .
        .
        .


Converting back to the .PTN file is works also.

Some questions:
  1. How do I interpret the 2 bytes of the version_number of the pattern file? As 2 separate chars, as a 2 byte short int or as 2 unsigned chars (as it is in the example above)?
  2. Can you provide the structure for the other pattern track types  Big Grin?
  3. Bulk import/export is certainly possible, but then I need to be able to extract those 174 patterns out of the .NRD file... If you can give me more info on where those patterns are located, we can start from there by extracting only the patterns (hopefully the wil remain in the same position in the .NRD file. As you mentioned the .NRD files may change over different versions)

Cheers!


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
RE: Offline Editor For Project Files (*.NRD) - by eliclement - 12-23-2022, 10:10 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)