Author |
Message |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 18247 Location: Durham, NC
Audio files: 225
G2 patch files: 60
|
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Fri Mar 17, 2006 6:35 pm Post subject:
|
 |
|
Can confirm it to be working on patches, after trying a few. For performances it must ne a little different.
edit :
with this code :
Code: |
function CRCClavia( Seed: Integer; X: Integer): Word;
var
i : Integer;
iCrc : Integer;
k : Integer;
begin
k := ((( Seed shr 8) xor X) and 255) shl 8;
iCrc := 0;
for i := 1 to 8
do begin
if ( iCrc xor k) and $8000 <> 0
then iCrc := ( iCrc shl 1) xor $1021
else iCrc := iCrc shl 1;
k := k shl 1;
end;
Result := (( Seed shl 8) xor iCrc) and $ffff;
end;
|
 _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
jamos

Joined: Jun 01, 2004 Posts: 514 Location: Eugene, Oregon, USA
Audio files: 4
G2 patch files: 41
|
Posted: Fri Mar 17, 2006 7:01 pm Post subject:
|
 |
|
I suspect that the header length is different in prf2 files; I just used a fixed length in my test code, whereas the correct way to do it would be to search for the first byte after the null terminator in the header string. |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Fri Mar 17, 2006 7:07 pm Post subject:
|
 |
|
Ok, performances work as well. Just do not start at a fixed offset of 0x50 but instead scan for the first occurance of \0, set the starting point just past that \0 then execute the crc over the rest of the bytes (but not the last two (*1)). This will be "better" for patches as well of course :)
*1 : when you do however include the last two byte in the CRC calculation the result will be zero, a known property for CRC's alowing for a somewhat easier check for correctness.
Edit : we cros posted :) _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
monobass

Joined: Nov 30, 2004 Posts: 275 Location: UK
G2 patch files: 12
|
Posted: Sat Mar 18, 2006 9:38 am Post subject:
|
 |
|
I missed this thread in the past. Good work
It must make the Clavia developers chuckle reading this.. I hope it does anyway. Why they don't just give away the patch format I'll never know though... they must know it'll be reverse engineered eventually. Still.. It would be a shame to deny you guys the challenge! _________________ Steve |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
|
Back to top
|
|
 |
dasz

Joined: Oct 16, 2004 Posts: 1644 Location: victoria, canada
Audio files: 29
G2 patch files: 56
|
Posted: Sun Mar 19, 2006 7:11 pm Post subject:
|
 |
|
and another nasty part is they may change the format at any time. But probably too easy, since it means h/w programming too. easier than dsp tho.
In Revolve days we reversed engineered the rebirt 1.5 and 2.0 file formats, and then the Propellerheads released the format for 2.0, thanks guys!
/Dasz |
|
Back to top
|
|
 |
ian-s

Joined: Apr 01, 2004 Posts: 2672 Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 626
|
Posted: Sun Mar 19, 2006 8:02 pm Post subject:
|
 |
|
I imagine there are some changes with 1.4, exclude from mutator etc. |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Sun Mar 19, 2006 8:03 pm Post subject:
|
 |
|
I know Dasz.
I compiled a table of the bit counts for all modules, see attachment.
Edit : attachement update.
Edit : atachment deleted, see later post on same date as last edit. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 Last edited by blue hell on Wed Mar 22, 2006 7:37 pm; edited 2 times in total |
|
Back to top
|
|
 |
3phase

Joined: Jul 27, 2004 Posts: 1189 Location: Berlin
Audio files: 13
G2 patch files: 141
|
Posted: Mon Mar 20, 2006 3:42 am Post subject:
|
 |
|
I wonder why they keep the format so secret...
Is there any harm for the product possible?
There was such nice freeware tools for the NM. I think it can be rather beneficial for the instrument when you guys succed. |
|
Back to top
|
|
 |
mosc
Site Admin

Joined: Jan 31, 2003 Posts: 18247 Location: Durham, NC
Audio files: 225
G2 patch files: 60
|
Posted: Mon Mar 20, 2006 7:03 am Post subject:
|
 |
|
I don't know what the Clavia line on this is, but I've developed programs for personal use and ones which were made public. If the level of work is 1X to develop a program, then it is 10X to support it. Some would say I'm underestimating.
During a program's life one often changes internal data structures and intermediate file formats. If these were public, then any change would have to be throughly documented and and tested - not only for whatever use the developers make of them, but for any conceivable use anyone else has devised.
I would like Clavia to continue to spend whatever resources they can devote to the G2 on improvements (new modules particularly). If they made the file format of interal operations public, then they'd have less resoruces for new stuff.
One could argue that if it were "opened up" then independent developers could make the improvements and develop new modules. I have made such arguments myself in the past. But it would then become an open source project. I love open source software, but it isn't for everyone. Such projects often diverge down separate incompatible paths; that wouldn't be very good. _________________ --Howard
my music and other stuff |
|
Back to top
|
|
 |
Fozzie

Joined: Jun 04, 2004 Posts: 875 Location: Near Wageningen, the Netherlands
Audio files: 8
G2 patch files: 49
|
Posted: Mon Mar 20, 2006 7:30 am Post subject:
|
 |
|
mosc wrote: |
One could argue that if it were "opened up" then independent developers could make the improvements and develop new modules. I have made such arguments myself in the past. But it would then become an open source project. I love open source software, but it isn't for everyone. Such projects often diverge down separate incompatible paths; that wouldn't be very good. |
I'm no programmer, but isn't this two steps ahead of just releasing the file format? The old NM file format was very open, which allowed people to make specific user applications (outside of the editor). It didn't allow them to mess with the editor or the modules themselves, nor make it an open source project. |
|
Back to top
|
|
 |
dasz

Joined: Oct 16, 2004 Posts: 1644 Location: victoria, canada
Audio files: 29
G2 patch files: 56
|
Posted: Mon Mar 20, 2006 9:37 am Post subject:
|
 |
|
I agree with mosc. Opening any file systems to the public means some kind of support. Like I and others keep saying, Clavia is no big shop, so any additional work is carefully considered. Each of the Clavia guys put in a LOT of time developing their products -- a lot more time than I would ever consider putting in on a regular basis.
Speaking from experience, one possble reason the G2 format is binary and not ascii (text based) is the speed of parsing the thing. A binary file loads quicker as there is minimal parsing involved. A human readable format takes longer (especially on a h/w platform). Since Clavia introduced a performance file, which is equivalent to 4 patches, this may have enforced the reason. I'm just guessing for Clavia's reasons.
I applaud this effort at reverse-engineering .
It's not easy, but it is do-able! Like I said before, we at Revolve (thanks to Frank --- aka Green Boy who did the reverse engineering) did succeed to figure out both Rebirth File format 1.5 and 2.0 with no help from Pheads.
/Dasz |
|
Back to top
|
|
 |
Afro88

Joined: Jun 20, 2004 Posts: 701 Location: Brisbane, Australia
Audio files: 12
G2 patch files: 79
|
Posted: Mon Mar 20, 2006 3:04 pm Post subject:
|
 |
|
They don't have to open it up, document and support the patch format. They just have to leave it in the un-encrypted text format and say they don't support any use of the G2 with non-Clavia programs. Solved.
But I guess by encrypting they avoid any external programs screwing up their support. |
|
Back to top
|
|
 |
dasz

Joined: Oct 16, 2004 Posts: 1644 Location: victoria, canada
Audio files: 29
G2 patch files: 56
|
Posted: Mon Mar 20, 2006 3:14 pm Post subject:
|
 |
|
I'd rather have pattern memories in sequencers rather than an easier to decipher file format. And loop length changes which do not reset the sequence to 1 immediately. And muteless patch loading. And ...
/Dasz |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Mon Mar 20, 2006 7:40 pm Post subject:
|
 |
|
A little update.
The extra length needed for some modules probably contains the the mode(s). You'll recognize a mode on that the patch needs to be recalculated when it changes. For the delay modules it's the delay time, for oscillator like things, when present, it's the wave shape. Each mode needs 6 extra data bits above the usual 50. The logic gate module is the only module having two modes, and it (indeed) needs 62 data bits. No modules have more than two modes.
In the file I posted earlier the Phaser was mentioned twice (one should be flanger), and there was a typo in a module name somewhere, I'll post an update above.
An example dump for a module having one mode.
Code: |
MRndClkB
(
{0000} #11001110 #00000001 #00000000 #00000000 #00010000 #00000000 #01000000
Knowledge[
BitSize = 56
ShortName = 'RndClkB'
LongName = 'Random Clock B'
Height = 3
Inputs = []
Outputs = []
Params = []
Modes = [ 'Character']
] // Knowledge
ModuleType = 206
ModuleIndex = 1
Col = 0
Row = 0
Color = 4
Unknown1 = $00
Unknown2 = $1
) // MRndClkB
|
Still quite some work to be done on that, but I've got the bit lengths OK now I think and so I can start parsing the next sections ... I'll need a proper cable dump before being able to determine the order of the inputs/outputs, and a proper parameter dump to be able to determine the module parameters' order. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Tue Mar 21, 2006 4:14 pm Post subject:
|
 |
|
Something changed in the cable list w.r. to the specs on http://www.dewb.org/g2/pch2format.html
it says :
Code: |
2 bits location
1 byte Cable count
|
I need to read 24 bits into the data though instead of 10 to reach the last bit (lsb) of the cable count. Now for version 1.4 I think the maximum amount of cables to have was changed from 255 to something larger. Having 22 bits for the cable count seems a bit overdone though, so I, arbitrarily, decided to use the following working definition fttb :
Code: |
2 bits location
12 bits unknown
10 bits Cable count
|
So here is a version dependency, and something more to guess. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Wed Mar 22, 2006 7:36 pm Post subject:
|
 |
|
Better module knowledge, no parameters yet. Present are the modes for all modules and the in/outs for about a third or so.
I'll delete the old module info file, the bit counts can be calculated from this one as 50 + mode_count * 6.
Edit : Comment( 'Learned 138 from 166, 28 to go')
Edit : Comment( 'Learned 166 from 166, 0 to go')
Edit : some error fixing, added a html version, added some params from existing module table.
Description: |
|
 Download (listen) |
Filename: |
module_table.txt |
Filesize: |
42.24 KB |
Downloaded: |
184 Time(s) |
_________________ Jan
also .. could someone please turn down the thermostat a bit.
 Last edited by blue hell on Sat Mar 25, 2006 3:41 pm; edited 6 times in total |
|
Back to top
|
|
 |
3phase

Joined: Jul 27, 2004 Posts: 1189 Location: Berlin
Audio files: 13
G2 patch files: 141
|
Posted: Thu Mar 23, 2006 3:21 am Post subject:
|
 |
|
wow..you are really working on it ...
thanks for the time you people involve in that...
I am pretty sure that once you ve suceeded there will be a practical applikation from this effort earlier or later...
good luck... |
|
Back to top
|
|
 |
Hyde

Joined: Jul 15, 2004 Posts: 118
G2 patch files: 2
|
Posted: Thu Mar 23, 2006 1:46 pm Post subject:
|
 |
|
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Thu Mar 23, 2006 6:11 pm Post subject:
|
 |
|
Code: | Comment( 'Learned 138 from 166, 28 to go') |
But I'm going to have a heavy day tomorrow, so no more now.
I'll update the file above.
BTW, it's the parameters that is going to take time. Not only would I like to know what index has what name, but for the info to be useful the ranges must be known as well,and preferably the the exact meaning of each value.
Anyway, after the last 28 for in/outputs I'll go on with parameters, starting with just gathering names and indices. Hopefully I'll see a pattern in the meanings of the parameter values, that would be helpful. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Fri Mar 24, 2006 7:16 pm Post subject:
|
 |
|
Code: | Comment( 'Learned 166 from 166, 0 to go') |
I'll update the file above, watch the edit date/time.
Right ... whats next, parameters .... _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Sat Mar 25, 2006 3:33 pm Post subject:
|
 |
|
Did some error fixing and made a pretty printer first, that is HTML output. And I copied some parameter things from the original table.
I'll update the txt file I'll add the HTML file. _________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
|
Back to top
|
|
 |
blue hell
Site Admin

Joined: Apr 03, 2004 Posts: 24451 Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320
|
Posted: Sun Mar 26, 2006 8:52 am Post subject:
|
 |
|
Found another change.
In the name dump section http://www.dewb.org/g2/pch2format.html speciefies :
Code: |
1 byte - 0x5a
2 bytes - length
2 bits - area
8 bits - Module Count
|
I however have to use
Code: |
1 byte - 0x5a
2 bytes - length
2 bits - area
6 bits - unknown
8 bits - Module Count
|
or any other combination of count and unknown ...
example :
Code: |
ModuleNames
[
{0000} #00000000 #00000001 #00000001 #01100001 #01110000 #01100101 #01101011 #01101111
{0008} #01101111 #01101100 #00000000
typeId = $5A
ByteCount = 11
Location = FX
NameCount = 1
Names[
ModuleIndex = 1
Name = 'apekool'
] // Names
] // ModuleNames
|
_________________ Jan
also .. could someone please turn down the thermostat a bit.
 |
|
Back to top
|
|
 |
|