Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Offline Editor For Project Files (*.NRD)
#21
Just a quick confirm that I've written a test python script that modifies a trigger16 binary pattern file, and it re-imports successfully!

If anyone else is interested (@eliclement) let me know.

Thanks again Thomas for the clear and excellent info!
Reply
#22
(12-21-2022, 09:04 PM)proxemics Wrote: Just a quick confirm that I've written a test python script that modifies a trigger16 binary pattern file, and it re-imports successfully!

If anyone else is interested (@eliclement) let me know.

Thanks again Thomas for the clear and excellent info!

@proxemics
I was experimenting a bit today in Javascript and HTML to come up with a platform independent application that can run in the browser to edit the patterns. But incorporating copy/paste and easy to use interface can become quickly a lot of work.
Maybe it would make sense to think first what features the offline editor certainly must have...
Any ideas on top of your head? Any preference for the type of application? (Pure Python, web app, ...)

Your Python script that imports and exports already is most welcome! Let's discuss further, we can then maybe set up a code repo to start working on it.

@Thomas thanks for sharing the info


Attached Files Thumbnail(s)
   
Reply
#23
@eliclement honestly, I'm not much of a javascript person, I was mostly interested in exporting some hidden markov chains beats, etc., into patterns.  You are completely right that javascript is the way to go, though. I don't have much time in the next weeks but happy to brainstorm.

Here was the quick test:

Code:
# open pattern
f = open('/Users/x/Downloads/2023_BLANK-EXPO_TR16.PTN', 'rb')
content = f.read()
f.close()

length=21
start = 69
# print pattern
for i in range(0,64):
    s = content[start+length*i:start+length*i+length]
    print(' '.join('{:02X}'.format(c) for c in s))

# dumb modify pattern
content = content.replace(b"\x88",b"\x07")
f = open('/Users/x/Downloads/2023_BLANK-EXPO_TR16.PTN', 'wb')
f.write(content)
f.close()
Reply
#24
(12-21-2022, 09:56 PM)proxemics Wrote: @eliclement honestly, I'm not much of a javascript person, I was mostly interested in exporting some hidden markov chains beats, etc., into patterns.  You are completely right that javascript is the way to go, though. I don't have much time in the next weeks but happy to brainstorm.

Here was the quick test:

Code:
# open pattern
f = open('/Users/x/Downloads/2023_BLANK-EXPO_TR16.PTN', 'rb')
content = f.read()
f.close()

length=21
start = 69
# print pattern
for i in range(0,64):
    s = content[start+length*i:start+length*i+length]
    print(' '.join('{:02X}'.format(c) for c in s))

# dumb modify pattern
content = content.replace(b"\x88",b"\x07")
f = open('/Users/x/Downloads/2023_BLANK-EXPO_TR16.PTN', 'wb')
f.write(content)
f.close()

Thanks for you snippet!
Indeed JS is not the most wonderful language in the world Sad... anyway I'll experiment further.
Please list also your must have features for the offline editor here as well, so I can set priorities :-)
Reply
#25
Hahaha I think Javascript is fine, it's certainly used well by millions, just not by me at the moment.

I think my main interest in an editor would be as a way to import / export from other workflows. I actually love the drummatrix interface and the nerdseq in general. That said, I have wanted to be able to use code to generate things, or pull in melodies/chords/patterns from different workflows. So I think some sort of midi import/export of chords and patterns would be interesting. So yes, my personal main interest in an editor would be good import/export functionality.
Reply
#26
(12-22-2022, 06:06 AM)proxemics Wrote: Hahaha I think Javascript is fine, it's certainly used well by millions, just not by me at the moment.

The same goes for a language like BASIC...
...there was a time when JavaScript was responsible for more than 50% of computer hacking cases worldwide. Not sure about the current ratio but last time I looked it still was a two digit-% figure.

But everybody what she/he likes to use.
Reply
#27
(12-22-2022, 07:27 AM)mgd Wrote:
(12-22-2022, 06:06 AM)proxemics Wrote: Hahaha I think Javascript is fine, it's certainly used well by millions, just not by me at the moment.

The same goes for a language like BASIC...
...there was a time when JavaScript was responsible for more than 50% of computer hacking cases worldwide. Not sure about the current ratio but last time I looked it still was a two digit-% figure.

But everybody what she/he likes to use.

I like BASIC Cool
PLEASE use the search function if something have been asked or discussed before.
Every (unnessesary) forum support means less time to develop! But of course, i am here to help!  Smile
Reply
#28
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?
PLEASE use the search function if something have been asked or discussed before.
Every (unnessesary) forum support means less time to develop! But of course, i am here to help!  Smile
Reply
#29
(12-22-2022, 08:03 AM)XORadmin Wrote: 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?

I appreciate you keeping the company running Big Grin

Bulk export/import of all 175 pattern would probably cover more than 95% of all the use cases I do want a project file export/import for. So:
YES PLEASE !!!

Big Grin
Reply
#30
(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?)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)