electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » Clavia Nord Modular » Nord Modular G2 Discussion
Reverse engineering USB protocol, NM1 to G2 converter
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 2 of 5 [120 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Tue Dec 05, 2006 8:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

He he he... but no.

The boards only allows files from a speciffic set of extentions and it seems that .py isn't on this.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cappy2112



Joined: Dec 24, 2004
Posts: 2494
Location: San Jose, California
Audio files: 2
G2 patch files: 1

PostPosted: Tue Dec 05, 2006 10:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

[quote="dasz"]
cappy2112 wrote:

Python does have windows extensions which support COM very well, and it's actively supported.


That's good.

Quote:

providing nice extensions can make building UI's for Windows very easy. OSX/Linux is more involved (depending on the UI toolkit).
/Dasz


There are several cross-platform GUI toolkits/frameworks available for Python so GUI apps can be made for cross-patform use, without much trouble at all.
Ever heard of the KDE desktop for Linux, etc? It uses the QT library, which is available for python using some wrappers. Using a framework such as this, COM isn't needed for making GUI apps even on Windows, and you get the cross-platform flexibility- built in.

Last edited by cappy2112 on Wed Dec 06, 2006 8:09 am; edited 1 time in total
Back to top
View user's profile Send private message
tombola



Joined: Mar 11, 2005
Posts: 84
Location: London
Audio files: 3
G2 patch files: 9

PostPosted: Wed Dec 06, 2006 7:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks qfingers. I'm not a programmer, so I've only understood a tiny bit of this thread, but if there's a possibility of 27,000 new patches and harmony within the NM spheres, then it's a great thing!
_________________
http://www.musicthing.co.uk/
Back to top
View user's profile Send private message
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 18240
Location: Durham, NC
Audio files: 224
G2 patch files: 60

PostPosted: Wed Dec 06, 2006 10:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
the forum doesn't allow .py extensions (why????).


We never had a request for the py extension until now. I just enabled it. Very Happy

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Visit poster's website AIM Address
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Wed Dec 06, 2006 12:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

mosc: Thanks for updating the web site.

For you programmers/kind-of-know-programmers, the python web site http://www.python.org has a documentation section with a tutorial that takes a couple of hours to complete. The language is simple to learn (if you have any programming knowledge). The author actually has funding for research in using it to teach average people to program to better use there computer. I'm a seasoned programmer and like the language because of it's simplicity. If was the first language I used where I could understand many of the extension module it is shipped with. Most of the applications I write are written in python or as a prototype in python.

That script I posted takes about 15 minutes to run across all 27000 patches. It doesn't do much except set up the structure of the patch to allow further manipulation with other python code.

Here is a list of things done:
- .pch file parsing
- G2 Module database (module types, input/output ports, parameters, modes)
- .pch2 file parsing (about 95%)

Here is a list of things needed to be done for the NM1 to G2 converter:
- finish .pch2 file parsing (needed to make sure the writing .pch2 files and validating the output)
- Module database for NM1
- .pch2 write support (this is the hard one to get right).
- the main converter program with hooks to handle each NM1 module and cabling

The first version will be pretty simple, just convert known modules and connect to known input/output ports, set known parameters and modes. I will try and keep the vertical spacing between modules the same but not necessarily the actual vertical location. I may colorize stuff as well but I'm not sure yet. The module names will be kept in tact as well.

The next version will take into account the differing frequencies and times of various NM1 modules (mostly Osc frequencies, Env times, Lfo frequencies) into account and set the G2 modules parameters accordingly. I'm not sure about the modulation values, but those will have to be processed as well (of course).

The next version will include building block of modules to emulate the NM1's modules. Hopefully by this time the program will have a simple setup to allow non-programmers to fine tune the output of the converter. Things like creating macro blocks of G2 modules and defining what connections to use from the NM1 patch.

Versions after that will be more complex as in searching the cables and optimizing the G2's patch. This may not actually happen or be much useful. It would depend on how successful the previous 2 versions I described above work.

I think it will probably be about a month before the first version is done (if I can put time into it). We will see.

q
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24422
Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320

PostPosted: Wed Dec 06, 2006 1:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

qfingers wrote:
Most of the applications I write are written in python or as a prototype in python.


Never did anything in python, but looking at your code I had the idea I could almost read it. Seems to have some power semantics - good for a prototyping language.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Wed Dec 06, 2006 4:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:

Never did anything in python, but looking at your code I had the idea I could almost read it. Seems to have some power semantics - good for a prototyping language.


If the code is optimized and fast enough, I don't even bother with another language. Several replies above, I mentioned that I can get it receive a stream UDP packets at 100 megabytes per second without dropping data. Each packet was around 64k each.

When I need speed, I usually code a python module in C for time critical sections and it usually solve the performance problem.

The other cool feature is that it has a large set of available modules for networking, http communication, parsing, debugging, and other cool things. There is also a huge group of free 3rd party modules available for sound, video, graphics, 3d stuff, midi, etc.. I think you can find alot of that on the python web site.

q
Back to top
View user's profile Send private message
3phase



Joined: Jul 27, 2004
Posts: 1189
Location: Berlin
Audio files: 13
G2 patch files: 141

PostPosted: Wed Dec 06, 2006 11:21 pm    Post subject: Re: Update Reply with quote  Mark this post and the followings unread

qfingers wrote:
I've run against 27600 patches from the nm1 patch archive I got from somewhere with about 140 patches that it cannot parse. q


Just one note...

When you browse the NM1 libary with a NM1 physical present there are some patches that got corrupted and are not loadable...

140 in almost 30000... maybe a good part of them are dameged patches?

at least i came along unreadable files..not often...but i ve only tried a few thousend of all this patches..maybe 10%


hope this isnt offending ... just wanted to mention that the NM patches within the for years builded lib dont be as intact as they was in the past...
i also came along version 2.0 patches in the past..but maybe they are all converted by now.

Anyway..its incredible how fast you get a grip on the problem...
Very handy when real coders own a G2 Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24422
Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320

PostPosted: Thu Dec 07, 2006 12:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

I split off the object oriented programming / python discussion to : http://electro-music.com/forum/topic-14839.html - as was suggested by some.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Thu Dec 07, 2006 2:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
I split off the object oriented programming / python discussion to : http://electro-music.com/forum/topic-14839.html - as was suggested by some.


Thank you... I'm coding my application in python so it didn't make much difference to me. That's said, if you want to look and modify my code, you will have to know python (at least a little).

q
Back to top
View user's profile Send private message
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Mon Dec 11, 2006 9:05 pm    Post subject: Update Reply with quote  Mark this post and the followings unread

Hey, I just wanted everyone to know, I'm almost finished with my g2 .pch2 file parser/writer. This is the hardest piece of my NM1 to G2 converter because it's the biggest unknown. I've spent the entire weekend on disecting the file format. The problem is there are so many different versions of .pch2 files. Most parse ok, but when I try to load them into the editor, it displays an error message (mostly worthless in my estimation) or crashes the editor. I basically took the two G2 patch collections on the clavia site and read/wrote each file and tried to load it into the editor. Most of them work, I'm just fixing the code to handle the ones that done. Apparently, they have changed some of the modules inputs/outputs/parameters between versions. Once I have that done, I'm going to start the converter.

Actually, I think this is the easy part (at least the initial version). I'm going to create a set of classes with two methods: one that handles module types/parameters, and the other that handles the cable connections. This way I can build the missing NM1 modules into G2 modules and then setup the proper connections. If we have correct G2 models for the missing NM1 modules, it should be a piece of cake. Right now I won't create .pch2 files from NM1 files with missing modules. The last thing I'm going to do is a simple optimization removing unused modules or muted ones with no knobs assigned to them. One thing I'm not going to do yet is the envelope times conversion or the lfo frequency conversion, it will just map 0-127 to 0-127 (one to one). I'll correct that afterwards. Right now I just want to get a patch file that is loadable without error.

I post when I'm further along.

q

P.S. Is it ok to post .zip files? There will be a group of python modules necessary to run the converter.
Back to top
View user's profile Send private message
cappy2112



Joined: Dec 24, 2004
Posts: 2494
Location: San Jose, California
Audio files: 2
G2 patch files: 1

PostPosted: Tue Dec 12, 2006 12:37 am    Post subject: Re: Update Reply with quote  Mark this post and the followings unread

qfingers wrote:
Hey, I just wanted everyone to know, I'm almost finished with my g2 .pch2 file parser/writer. This is the hardest piece of my NM1 to G2 converter because it's the biggest unknown.
I post when I'm further along.
.


Great progress !
Back to top
View user's profile Send private message
Afro88



Joined: Jun 20, 2004
Posts: 701
Location: Brisbane, Australia
Audio files: 12
G2 patch files: 79

PostPosted: Tue Dec 12, 2006 1:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Yeah! Nice work qfingers!
Back to top
View user's profile Send private message Visit poster's website
gomidas



Joined: Jul 09, 2004
Posts: 365
Location: La Ciotat, France
Audio files: 1
G2 patch files: 6

PostPosted: Tue Dec 12, 2006 2:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Very good initiative, great work Very Happy
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24422
Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320

PostPosted: Tue Dec 12, 2006 5:40 am    Post subject: Re: Update Reply with quote  Mark this post and the followings unread

Good work !

qfingers wrote:
P.S. Is it ok to post .zip files?


Sure !

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
ian-s



Joined: Apr 01, 2004
Posts: 2672
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 626

PostPosted: Tue Dec 12, 2006 11:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Yes great work. Although I personally would have no use for a G1>G2 converter. DX7>G2 is another matter.
Back to top
View user's profile Send private message
cappy2112



Joined: Dec 24, 2004
Posts: 2494
Location: San Jose, California
Audio files: 2
G2 patch files: 1

PostPosted: Tue Dec 12, 2006 11:29 am    Post subject: Reply with quote  Mark this post and the followings unread

g2ian wrote:
Yes great work. Although I personally would have no use for a G1>G2 converter. DX7>G2 is another matter.


There are many DX7 NM1 patches- that Wout gave us as a Christmas present one year. When the converter is done, that may be a place to look for some fun.
Back to top
View user's profile Send private message
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Tue Dec 12, 2006 11:36 am    Post subject: Reply with quote  Mark this post and the followings unread

g2ian wrote:
Yes great work. Although I personally would have no use for a G1>G2 converter. DX7>G2 is another matter.


Ok, you can find someone to write one. On the other hand, I consider this the most useful. It's not even on my list of things to do. I write software for me and share it with the community. My question is why did you even bother to post this? Oh, I know, then I'll completely change what I'm doing and write you a DX7->G2 converter.

q
Back to top
View user's profile Send private message
cappy2112



Joined: Dec 24, 2004
Posts: 2494
Location: San Jose, California
Audio files: 2
G2 patch files: 1

PostPosted: Tue Dec 12, 2006 11:43 am    Post subject: Reply with quote  Mark this post and the followings unread

qfingers wrote:
g2ian wrote:
Yes great work. Although I personally would have no use for a G1>G2 converter. DX7>G2 is another matter.


Ok, you can find someone to write one. On the other hand, I consider this the most useful. It's not even on my list of things to do. I write software for me and share it with the community. My question is why did you even bother to post this? Oh, I know, then I'll completely change what I'm doing and write you a DX7->G2 converter.

q


Please don't take Ian's post as a criticism regarding your recent work.

Long before you started on the G1/G2 conversion, there was talk here about a DX7 patch converter. I can't look for the thread at the moment (perhaps the admins will jump in)...
Back to top
View user's profile Send private message
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Tue Dec 12, 2006 11:48 am    Post subject: Reply with quote  Mark this post and the followings unread

cappy2112 wrote:

Please don't take Ian's post as a criticism regarding your recent work.

Long before you started on the G1/G2 conversion, there was talk here about a DX7 patch converter. I can't look for the thread at the moment (perhaps the admins will jump in)...


Yeah, I flew off the handle, please forgive me...

Anyways, when this project is done, the infrastructure will be there to write a DX7->G2 converter. Right now this is not part of my goal (but it could be added later). My hope is someone will take my code and do similar "conversion" projects.

q
Back to top
View user's profile Send private message
cappy2112



Joined: Dec 24, 2004
Posts: 2494
Location: San Jose, California
Audio files: 2
G2 patch files: 1

PostPosted: Tue Dec 12, 2006 12:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

[quote="qfingers"]
cappy2112 wrote:

My hope is someone will take my code and do similar "conversion" projects.
q


I'd like to work on the Windows port of your G1-G2 conversion tool(s).
I took a look at the usb library for windows last night, trying to get that installed is the first step.
Back to top
View user's profile Send private message
ian-s



Joined: Apr 01, 2004
Posts: 2672
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 626

PostPosted: Tue Dec 12, 2006 2:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

My fault, I meant that when I get the time, I can write my own DX7>G2 converter, thanks to all the hardwork done by yourself (and others) on the patch file format.

Wish you the best of luck with your G1>G2 project and think it will help Clavia a lot if you are even partially sucessfull.
Back to top
View user's profile Send private message
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Tue Dec 12, 2006 2:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

What I would really like is for Clavia to port there editor to linux (or have me do it if they send me the code). I'm not a Windows guy. My hope is if they see this maybe they could do it or ask. Otherwise I have to revert to more difficult measures as in hacking wine ("Wine Is Not an Emulator" http://www.winehq.org) with enough USB driver support to run the editor if that is even possible.

Plus, I would like to check out 27000 (or some subset) of patches from the NM1. I think that would be pretty cool. I would keep me occupied for at least a month.

Not to mention having my name slapped on every converted patch.

q
Back to top
View user's profile Send private message
3phase



Joined: Jul 27, 2004
Posts: 1189
Location: Berlin
Audio files: 13
G2 patch files: 141

PostPosted: Wed Dec 13, 2006 2:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

qfingers wrote:

Not to mention having my name slapped on every converted patch.

q


You could put some stones mp3´s on the net and put your name on them...would be even cooler
Back to top
View user's profile Send private message Send e-mail Visit poster's website
qfingers



Joined: Nov 16, 2006
Posts: 186
Location: Tucson, AZ
G2 patch files: 2

PostPosted: Wed Dec 13, 2006 4:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

3phase wrote:
qfingers wrote:

Not to mention having my name slapped on every converted patch.

q


You could put some stones mp3´s on the net and put your name on them...would be even cooler


Please tell me how this relates? I'm going to place NameBars with "converted by:" block. Is this something illegal? I don't think so. But maybe you know something I don't.

q
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 2 of 5 [120 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2, 3, 4, 5 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » Nord Modular G2 Discussion
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use