electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
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
Extract the text boxes from patches?
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 2 [26 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 10:46 am    Post subject: Extract the text boxes from patches?
Subject description: There is a lot of documentation information associated with the factory patches that is hard to acce
Reply with quote  Mark this post and the followings unread

The factory patches in bank 4 have "name" boxes in them that give names to each of the 8 variations in each of the 61 patches. That's 488 variation names.

Is there an easy way of extracting all those names for independent reference? For example, does g2ools or something like that have the ability to extract those names?
Back to top
View user's profile Send private message Visit poster's website
Wout Blommers



Joined: Sep 07, 2003
Posts: 4517
Location: The Hague - The Netherlands
Audio files: 123
G2 patch files: 12

PostPosted: Fri May 02, 2008 11:01 am    Post subject: Reply with quote  Mark this post and the followings unread

Aren't these not the DX Patches?
If so, the names are the same as a Japanese synth has those named then Wink

Wout
Back to top
View user's profile Send private message Send e-mail
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 11:06 am    Post subject: Reply with quote  Mark this post and the followings unread

May well be, but (a) I don't have that list of names either, and (2) I'm still interested in an answer to the general question.
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20582
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Fri May 02, 2008 12:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

Don't know what you mean by easy ... Laughing

As for g2ools I'm not sure if it has g2 patch reader functionality, it does have writer functionality in a pretty structured way.

Alternatively, I did make some Delphi (Object Pascal) stuff to read g2 patches, but it would have to be modified for your purpose. When the modules holding the names are always at the same position (row, column) then it would not be to hard to modify the program for extracting the information I think.

See http://www.iaf.nl/Users/BlueHell/html/nm-open/nm-open-g2info.htm - use the link before last to get the code.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
cappy2112



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

PostPosted: Fri May 02, 2008 12:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:


As for g2ools I'm not sure if it has g2 patch reader functionality, it does have writer functionality in a pretty structured way.


Yes, it does.

Code:
def read(self, fname):
    self.fname = fname
    bindata = open(fname,'rb').read()

_________________
Free Tibet. Release the Panchen Lama from prison. Let the Dalai Lama return to his home.
Back to top
View user's profile Send private message
cappy2112



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

PostPosted: Fri May 02, 2008 12:59 pm    Post subject: Re: Extract the text boxes from patches?
Subject description: There is a lot of documentation information associated with the factory patches that is hard to acce
Reply with quote  Mark this post and the followings unread

ark wrote:

Is there an easy way of extracting all those names for independent reference? For example, does g2ools or something like that have the ability to extract those names?


If it were possible, What would you want to do with the names once they were extracted?
Written to a separate text file? On the screen?

Code:
BankX
    Patchname1
         Var1Name
          Var2Name

or something different?

_________________
Free Tibet. Release the Panchen Lama from prison. Let the Dalai Lama return to his home.
Back to top
View user's profile Send private message
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 2:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

cappy2112 wrote:
Blue Hell wrote:


As for g2ools I'm not sure if it has g2 patch reader functionality, it does have writer functionality in a pretty structured way.


Yes, it does.

Code:
def read(self, fname):
    self.fname = fname
    bindata = open(fname,'rb').read()


Um, that's not exactly fair. Usually one would think of "reading a patch" as including making that patch's information available in a more useful form than the raw bits.
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 2:05 pm    Post subject: Re: Extract the text boxes from patches?
Subject description: There is a lot of documentation information associated with the factory patches that is hard to acce
Reply with quote  Mark this post and the followings unread

cappy2112 wrote:
ark wrote:

Is there an easy way of extracting all those names for independent reference? For example, does g2ools or something like that have the ability to extract those names?


If it were possible, What would you want to do with the names once they were extracted?
Written to a separate text file? On the screen?

Code:
BankX
    Patchname1
         Var1Name
          Var2Name

or something different?


For example, an alphabetized list of all the variation names, with each name leading to the associated patch and variation number.
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20582
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Fri May 02, 2008 2:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

There is some parsing code as well (see parseg2.py and parsepch2.py) I think, but my knowledge of python is not good enough to judge it.

I made some quick additions to my pascal code so I can now write stuff like :

aName := aPatch.ModuleNameAt[ LocationVA, <Column>, <Row>];

It should not be too hard I guess to add such fuctionality to the python code, but I could make my updates public would there be a need for it.

You'll need to know the module coordinates to be able to retrieve the module name, that will require some manual lookup work.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
cappy2112



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

PostPosted: Fri May 02, 2008 2:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

ark wrote:

Um, that's not exactly fair. Usually one would think of "reading a patch" as including making that patch's information available in a more useful form than the raw bits.


Whether it is fair or not has nothing to do with this thread.

Jan simple wasn't sure if G2ools have the ability to read the G2 patch files.
I've looked it up in G2ools, and I posted the proof.
That capability may serve as the basis for some new functionality.

There is much more to the code than what I posted, and it doesn't make sense to post all of it. If you want to see what it looks like you are welcome to download the code and browse it.

As G2ools stand now, the functionality you requested is not there, and that was not the original intent of G2ools.

_________________
Free Tibet. Release the Panchen Lama from prison. Let the Dalai Lama return to his home.
Back to top
View user's profile Send private message
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 2:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
You'll need to know the module coordinates to be able to retrieve the module name, that will require some manual lookup work.


It's not clear that the name boxes have coordinates -- that's part of the problem. If they did, it would be possible to display them in the G2's LCDs, but it isn't. At least not as far as I can tell.
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20582
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Fri May 02, 2008 2:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

ark wrote:
It's not clear that the name boxes have coordinates -- that's part of the problem. If they did, it would be possible to display them in the G2's LCDs, but it isn't. At least not as far as I can tell.


Yes they do have coordinates but maybe the synth doesn't show otherwise featureless modules? (I have engines only, so I can't tell).

I don't know what the patch looks like (I don't have any factory presets), maybe you could query for the module type then. That would need some coding as well of course, still not too hard to do I think.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 2:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
I don't know what the patch looks like (I don't have any factory presets), maybe you could query for the module type then. That would need some coding as well of course, still not too hard to do I think.


They're "Name" modules (in the In/Out group). The manual says "Note that this module does not show in the G2 panel displays and only serves as a hintbox for the Editor program."
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20582
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Fri May 02, 2008 3:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can you post a patch, I think I have working code to extract all the name module's names.

edit : can understand why Clavia choose to not display them, but can also understand it to be inconvenient Laughing

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 3:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Can you post a patch, I think I have working code to extract all the name module's names.


Here's one.


Synt1 DX.pch2
 Description:
Synt 1 DX factory patch

Download
 Filename:  Synt1 DX.pch2
 Filesize:  3.93 KB
 Downloaded:  691 Time(s)

Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20582
Location: The Netherlands, Enschede
Audio files: 148
G2 patch files: 318

PostPosted: Fri May 02, 2008 3:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

Results in :

Code:

1. 1985 CHRSD
2. A V I D  2
3. A V I D  3
4. ANALOG 2
5. AmbiSYNTH1
6. Ana Sweep
7. AnalogSYNC
8. Anna 3

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
qfingers



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

PostPosted: Fri May 02, 2008 3:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I'll bite.

g2ools has an entire python module that handles g2 patches and all parameters within the data.

Look at g2cat.py in the g2ools distribution. It prints an ASCII representation of the patch. That should be the starting point for anyone wanting to write python code that handles g2 patches. That little application shows most (maybe all) the patch information available.

If you want to look at nm1 patches nmcat.py does the same as g2cat for nm1 patches.

As for banks, there is no "file" that contains a bank of patches. Only a list of .pch2 files which could also be processed from python easily.

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



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Fri May 02, 2008 6:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

qfingers wrote:
Look at g2cat.py in the g2ools distribution. It prints an ASCII representation of the patch. That should be the starting point for anyone wanting to write python code that handles g2 patches. That little application shows most (maybe all) the patch information available.


Code:
>>> ./g2cat.py initpatch.pch2
"initpatch.pch2"
patchdescription:
 voicecnt=1 height=600 unk2=0x02 mono=1 var=0 cat=0
  red=1 blue=1 yellow=1 orange=1 green=1 purple=1 white=1
knobs:
midicc:
Traceback (most recent call last):
  File "./g2cat.py", line 122, in <module>
    printpatch(pch2.patch)
  File "./g2cat.py", line 47, in printpatch
    for midiassignment in patch.midiassignments:
AttributeError: Patch instance has no attribute 'midiassignments'


I have no doubt I can find the problem, but don't feel like going on a bug hunt tonight Sad
Back to top
View user's profile Send private message Visit poster's website
qfingers



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

PostPosted: Fri May 02, 2008 6:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sorry,

The line in g2cat.py that says (line number 47):

Code:
for midiassignment in patch.midiassignments:


should say:

Code:
for midiassignment in patch.ctrls:


indented as appropriate to python.

This should solve the problem. I probably didn't test this application as much as I should have. Hopefully that will help.

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



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Sat May 03, 2008 6:33 am    Post subject: Reply with quote  Mark this post and the followings unread

qfingers wrote:
This should solve the problem. I probably didn't test this application as much as I should have. Hopefully that will help.


Yes it does; thanks! It will be trivial to run it on all of the factory patches and extract the Name boxes.
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Sat May 03, 2008 7:57 am    Post subject: Reply with quote  Mark this post and the followings unread

OK, here's a tab-separated file with all the variation names and corresponding patch numbers in factory bank 4.


Variation names.txt
 Description:
Variation names and patch numbers from G2 factory bank 4.

Download
 Filename:  Variation names.txt
 Filesize:  11.85 KB
 Downloaded:  202 Time(s)

Back to top
View user's profile Send private message Visit poster's website
dasz



Joined: Oct 16, 2004
Posts: 1640
Location: vancouver, canada
Audio files: 29
G2 patch files: 56

PostPosted: Sun May 04, 2008 1:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

dang, I should have used name modules to name my variations. I made a lot of patches for the G2 factory set, and naming the patches was hard enough Wink

/*_DZ.pch2 & *_DZ.prf2

_________________
http://www.clavia.se/misc/users/daszgarncarz.htm
http://haagenlive.blogspot.com/
Back to top
View user's profile Send private message Visit poster's website
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Sun May 04, 2008 10:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

dasz wrote:
I made a lot of patches for the G2 factory set, and naming the patches was hard enough Wink


Understanding them is not exactly easy either. I'm trying to understand the simpler ones first.
Back to top
View user's profile Send private message Visit poster's website
Wout Blommers



Joined: Sep 07, 2003
Posts: 4517
Location: The Hague - The Netherlands
Audio files: 123
G2 patch files: 12

PostPosted: Sun May 04, 2008 11:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

ark wrote:
... I'm trying to understand the simpler ones first.
Be sure you have the Manual on your lap doing this and figure out what every module does at a particular moment.

Wout
Back to top
View user's profile Send private message Send e-mail
ark



Joined: Mar 06, 2008
Posts: 676
Location: New Jersey
Audio files: 11
G2 patch files: 31

PostPosted: Mon May 05, 2008 7:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Wout Blommers wrote:
ark wrote:
... I'm trying to understand the simpler ones first.
Be sure you have the Manual on your lap doing this and figure out what every module does at a particular moment.


Yup. I have decades of experience reading operating-system and compiler source code Smile

Actually, I find that when I don't know what a module does, right-clicking on it and selecting "help" works wonders. Especially because then I get to find out the module's true type, even when the patch author has renamed it.

I've also started making patches with an eye (ear?) toward creating particular kinds of sounds. Making a patch do what I think it ought to be doing is a valuable exercise.

What I wish is that I had access to a genuine analog synth, because then I could really verify what it took to make the G2 behave the same way. Unfortunately, none of my friends has one.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 2 [26 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 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
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


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