Author |
Message |
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: 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 |
|
|
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
|
|
|
Wout Blommers
Joined: Sep 07, 2003 Posts: 4529 Location: The Hague - The Netherlands
Audio files: 123
G2 patch files: 12
|
Posted: Fri May 02, 2008 11:01 am Post subject:
|
|
|
Aren't these not the DX Patches?
If so, the names are the same as a Japanese synth has those named then
Wout |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Fri May 02, 2008 11:06 am Post subject:
|
|
|
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
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri May 02, 2008 12:12 pm Post subject:
|
|
|
Don't know what you mean by easy ...
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
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
cappy2112
Joined: Dec 24, 2004 Posts: 2465 Location: San Jose, California
Audio files: 2
G2 patch files: 1
|
Posted: Fri May 02, 2008 12:54 pm Post subject:
|
|
|
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
|
|
|
cappy2112
Joined: Dec 24, 2004 Posts: 2465 Location: San Jose, California
Audio files: 2
G2 patch files: 1
|
Posted: 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 |
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Fri May 02, 2008 2:03 pm Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: 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 |
|
|
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
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri May 02, 2008 2:14 pm Post subject:
|
|
|
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
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
cappy2112
Joined: Dec 24, 2004 Posts: 2465 Location: San Jose, California
Audio files: 2
G2 patch files: 1
|
Posted: Fri May 02, 2008 2:18 pm Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Fri May 02, 2008 2:20 pm Post subject:
|
|
|
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
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri May 02, 2008 2:40 pm Post subject:
|
|
|
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
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Fri May 02, 2008 2:50 pm Post subject:
|
|
|
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
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri May 02, 2008 3:03 pm Post subject:
|
|
|
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 _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Fri May 02, 2008 3:26 pm Post subject:
|
|
|
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
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
qfingers
Joined: Nov 16, 2006 Posts: 186 Location: Tucson, AZ
G2 patch files: 2
|
Posted: Fri May 02, 2008 3:30 pm Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Fri May 02, 2008 6:35 pm Post subject:
|
|
|
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 |
|
Back to top
|
|
|
qfingers
Joined: Nov 16, 2006 Posts: 186 Location: Tucson, AZ
G2 patch files: 2
|
Posted: Fri May 02, 2008 6:50 pm Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Sat May 03, 2008 6:33 am Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
|
Back to top
|
|
|
dasz
Joined: Oct 16, 2004 Posts: 1644 Location: victoria, canada
Audio files: 29
G2 patch files: 56
|
Posted: Sun May 04, 2008 1:35 pm Post subject:
|
|
|
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
/*_DZ.pch2 & *_DZ.prf2 |
|
Back to top
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Sun May 04, 2008 10:04 pm Post subject:
|
|
|
dasz wrote: | I made a lot of patches for the G2 factory set, and naming the patches was hard enough
|
Understanding them is not exactly easy either. I'm trying to understand the simpler ones first. |
|
Back to top
|
|
|
Wout Blommers
Joined: Sep 07, 2003 Posts: 4529 Location: The Hague - The Netherlands
Audio files: 123
G2 patch files: 12
|
Posted: Sun May 04, 2008 11:45 pm Post subject:
|
|
|
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
|
|
|
ark
Joined: Mar 06, 2008 Posts: 679 Location: New Jersey
Audio files: 13
G2 patch files: 31
|
Posted: Mon May 05, 2008 7:48 am Post subject:
|
|
|
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
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
|
|
|
|