========================================================================== G2 USB messages v2 ========================================================================== see also https://github.com/msg/g2ools g2ctl.py ========================================================================== How to read the messages: Format_message/Send_message: --------------------------- Message send from PC to G2 messages are sent formatted as bytes: SS SS MM MM MM .. MM CC CC SS: Big endian 16-bit size of message MM: Message (variable length) CC: Big endian 16-bit crc of MM MM .. MM then the message itself (MM MM ..MM): messages start with 0x01 0xRC 0xDD 0xDD .. 0xDD C: command (usually just the lower nibble) R: 0x2 when request, 0x0 for response 0x3 ? maybe response-less request DD: data for command Interrupt message ----------------- Interrupt messages are send from G2 to PC It can contain the compleet reply when it fits in 16 bytes else it contains the length of the extended message. result message first byte: 0xLT 0xDD 0xDD .. 0xDD 0xCC 0xCC (16 0xDD bytes) L: embedded message length (<=0xf, always zero for extended message) T: type: 2 embedded message, 1 extended message 0xDD Extended message ---------------- These are the longer replies: 0x01 0x0C 0xDD 0xDD .. 0xDD 0xCC 0xCC C - The command the message responds to ========================================================================== Steps in start up sequence: 1. Initialisation a. Send initialisation message b. Stop communication G2->Host (PC) 2. Get G2 state a. Global settings b. Performance settings c. Settings of each slot 3. Get names from G2 (banks, patches, performances) 4. Start communication G2->Host ========================================================================== Example part of start up sequence "Trancellizer 10" Performance: ========================================================================== 1.a. Initialisation message Example: format_message 000000 - 00 05 80 91 88 ..€‘ˆ Send message 000000 - 00 05 80 91 88 ..€‘ˆ Interrupt message 000000 - 01 00 42 00 00 00 00 00 00 00 00 00 00 00 00 00 ..B............. Extended message 000000 - 80 0A 03 00 00 1A 00 A2 00 12 47 32 20 45 6E 67 €......¢..G2 Eng 000010 - 69 6E 65 00 30 00 39 14 00 00 01 97 28 AA 00 05 ine.0.9....—(Ŗ.. 000020 - 01 40 02 00 00 00 00 00 00 00 00 00 00 00 00 00 .@.............. 000030 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000040 - D2 11 Ņ. Message: 80 Response: 80 0A 03 00 00 1A 00 A2 00 12 Name 00 30 00 39 14 00 00 01 97 28 AA 00 05 01 40 02 .... G2 Type and maybe version info? This message also resets the version counters for patches/performance to 0. ========================================================================== 1.b. Stop communication G2->Host Example: format_message 000000 - 00 09 01 2C 41 7D 01 96 94 ...,A}.–” Send message 000000 - 00 09 01 2C 41 7D 01 96 94 ...,A}.–” This seems to be some sort af aknowledgement reply: Interrupt message 000000 - 62 01 0C 00 7F 8C AD 00 00 00 00 00 00 00 00 00 b...Œ­......... Message: Rc 41 7d XX XX - 01 - start, 00 - stop Response 0c 00 7f => This seems to be soms sort of universal aknoledgement message like "ok" When the initialization part is done the clavia software sends the same message as this one, with 00 in stead of 01. Then you see what i think are (midi) messages comming through from the G2 to the clavia software. I guess so it can show any changes made in de G2 by for example sysex messages or when you turn a knop on the G2 keys. With this message the passing of midi stops. =========================================================================== 2.a.1. Get patch/state version? Example: format_message 000000 - 00 09 01 2C 41 35 04 42 54 ...,A5.BT Send message 000000 - 00 09 01 2C 41 35 04 42 54 ...,A5.BT Interrupt message 000000 - 82 01 0C 40 36 04 00 1B D6 00 00 00 00 00 00 00 ‚..@6...Ö....... This message returns what looks like the patch or state version counter per slot. Message: Rc 41 35 SS In patch mode: SS - 00 : all slots; 01/04 - slot 1/4 In perf mode SS - 00/03 : slots 1/4; 04 - performance Response: 0c 40 36 SS VV SS - slot VV - version Each time a patch is loaded in a slot, the version number is increased. So when a command for a particular patch is send to G2, it checks if the patch in the slot is still the same. (You have to send the version no with the command) You get the same respons with a new version counter if you load a patch with usb. The init message resets the version numbers. ========================================================================== 2.a.1. Synth settings Example: format_message 000000 - 00 08 01 2C 41 02 9B AC ...,A.›¬ Send message 000000 - 00 08 01 2C 41 02 9B AC ...,A.›¬ Interrupt message 000000 - 01 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 ..6............. Extended message 000000 - 01 0C 00 03 47 32 20 45 6E 67 69 6E 65 00 80 00 ....G2 Engine.€. 000010 - 00 00 00 01 02 03 04 09 10 00 02 03 00 0A 00 00 ................ 000020 - 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 ..@............. 000030 - 00 00 00 00 7C 1F ....|. Message: Rc 41 02 Response: Looked it up in the "Synth settings" dialog in the clavia software. Must not be very difficult to find the meaning of all the bytes. 0C - Cmd 00 - 03 - 47..00 - Name 80 00 00 00 00 01 - Midichannel - 1 slot A? 02 - Midichannel - 1 slot B? 03 - Midichannel - 1 slot C? 04 - Midichannel - 1 slot D? 09 - Global channel - 1 10 - Sysex ID (All) 00 02 03 00 0A - Tune cent? 00 00 00 00 40 ========================================================================== 2.a.1. Unknown message 1, seems to be something about the slots Example: format_message 000000 - 00 08 01 2C 41 81 3A 47 ...,A:G Send message 000000 - 00 08 01 2C 41 81 3A 47 ...,A:G Interrupt message 000000 - 01 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ Extended message 000000 - 01 0C 00 80 00 FF 80 01 FF 80 02 FF 80 03 FF 89 ...€.’€.’€.’€.’‰ 000010 - 7E ~ Message: Rc 41 81 Response 0c 00 80 DD DD DD DD DD DD DD DD DD DD DD ========================================================================== 2.b.1 Performance settings Example: format_message 000000 - 00 08 01 2C 00 10 97 22 ...,..—" Send message 000000 - 00 08 01 2C 00 10 97 22 ...,..—" Interrupt message 000000 - 01 00 74 00 00 00 00 00 00 00 00 00 00 00 00 00 ..t............. Extended message 000000 - 01 0C 00 29 54 72 61 6E 63 65 6C 6C 69 7A 65 72 ...)Trancellizer 000010 - 20 31 30 00 11 00 5B 00 00 00 91 00 00 00 00 44 10...[...‘....D 000020 - 72 75 6D 73 20 30 31 00 01 00 00 00 03 00 7F 01 rums 01........ 000030 - 00 00 6F 6F 68 20 61 61 61 68 20 69 69 69 69 69 ..ooh aaah iiiii 000040 - 00 01 00 00 00 00 00 7F 02 00 00 53 6E 61 72 65 ..........Snare 000050 - 20 39 30 39 00 01 00 00 00 00 00 7F 03 00 00 42 909..........B 000060 - 52 46 20 4B 69 63 6B 00 01 01 00 00 00 00 7F 04 RF Kick........ 000070 - 00 00 72 D9 ..rŁ Message: Rc VV 10 -> VV = Version Response: Looked some of the values up in the "Performance settings" dialog in the clavia software. 0C - Cmd 00 - 29 - 54..00 - Performance name 11 - 00 - 5B - 00 - 00 - Patch selected 00 - Range enable 91 - Master clock 00 - Keyboard split 00 - Stop/run 00 - 00 - 44..00 - Name patch 1 01 - Active 00 - Key 00 - Hold 00 03 00 - Range Lower 7F - Range Upper 01 00 00 6F..00 - Name patch 2 01 00 00 00 00 00 7F 02 00 00 53..00 - Name Patch 3 01 00 00 00 00 00 7F 03 00 00 42..00 - Name Patch 4 01 01 00 00 00 00 7F 04 00 00 ========================================================================== 2.b.2. Unknown message 2 Example: format_message 000000 - 00 08 01 2C 00 59 4E CF ...,.YNĻ Send message 000000 - 00 08 01 2C 00 59 4E CF ...,.YNĻ Interrupt message 000000 - 72 01 0C 00 1E 00 C5 1F 00 00 00 00 00 00 00 00 r.....Å......... Message: Rc VV 59 Response: 0c 00 1E 00 ========================================================================== 2.c.1 Select slot A Example: format_message 000000 - 00 09 01 2C 00 09 00 68 B5 ...,...hµ Send message 000000 - 00 09 01 2C 00 09 00 68 B5 ...,...hµ Interrupt message 000000 - 62 01 0C 00 7F 8C AD 00 00 00 00 00 00 00 00 00 b...Œ­......... Message: Rc 00 09 SS -> Slot Response 0c 00 7F -> Ok? ========================================================================== 2.c.2 Patch version Example: format_message 000000 - 00 09 01 2C 41 35 00 02 D0 ...,A5..Š Send message 000000 - 00 09 01 2C 41 35 00 02 D0 ...,A5..Š Interrupt message 000000 - 82 01 0C 40 36 00 00 D7 12 00 00 00 00 00 00 00 ‚..@6..×........ Returns the version counter for the patch in slot A. ========================================================================== 2.c.3. Download slot A Example: format_message 000000 - 00 08 01 28 00 3C AE 0C ...(.<®. Send message 000000 - 00 08 01 28 00 3C AE 0C ...(.<®. Interrupt message 000000 - 01 15 BB 00 00 00 00 00 00 00 00 00 00 00 00 00 ..»............. Extended message 000000 - 01 08 00 21 00 0F 01 FC 00 00 01 00 00 20 41 36 ...!...ü..... A6 000010 - 43 D0 00 50 00 2D 00 4A 01 74 4E 8D C0 40 0C 02 CŠ.P.-.J.tNĄ@.. 000020 - 80 03 70 20 02 80 80 01 08 0C 00 60 20 00 51 04 €.p .€€....` .Q. 000030 - 00 44 0B 00 0D 81 40 0E 02 00 05 10 60 04 C0 B0 .D...@.....`.Ą° 000040 - 00 24 1C 00 30 20 01 00 DC 20 00 80 20 00 67 09 .$..0 ..Ü .€ .g. 000050 - 00 80 08 00 0D C2 80 18 02 80 00 90 B0 05 40 80 .€...Ā€..€.°.@€ 000060 - 04 21 30 C0 ... Message: R8+Slot VV 3c Response: 08 VV DD DD DD -> Patch data ========================================================================== 2.c.4. Patch name, if its longer then 10 bytes you get an extended message Example: format_message 000000 - 00 08 01 28 00 28 FC B9 ...(.(ü¹ Send message 000000 - 00 08 01 28 00 28 FC B9 ...(.(ü¹ Interrupt message 000000 - F2 01 08 00 27 44 72 75 6D 73 20 30 31 00 5C 26 ņ...'Drums 01.\& Message: R8+Slot VV 28 Response: 08 VV 27 DD DD DD -> Patch name ========================================================================== 2.c.5. Current note? Example: format_message 000000 - 00 08 01 28 00 68 B4 7D ...(.h“} Send message 000000 - 00 08 01 28 00 68 B4 7D ...(.h“} Interrupt message 000000 - 01 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ Extended message 000000 - 01 08 00 69 00 09 D9 FF F8 76 7F FF 00 00 01 79 ...i..Ł’ųv’...y 000010 - 17 . Message: R8+Slot VV 68 Response: 08 VV 69 DD DD DD -> looks identical to same chunk in file ========================================================================== 2.c.6. Text pad Example: format_message 000000 - 00 08 01 28 00 6E D4 BB ...(.nŌ» Send message 000000 - 00 08 01 28 00 6E D4 BB ...(.nŌ» Interrupt message 000000 - 82 01 08 00 6F 00 00 F0 D7 00 00 00 00 00 00 00 ‚...o..š×....... Message: R8+Slot VV 6E Response: 08 VV 6F DD DD 6F is also the chunk-id in de patch file for the patch text. ========================================================================== 2.c.7. Resources in Use in VA section? Example: format_message 000000 - 00 09 01 28 00 71 01 33 95 ...(.q.3• Send message 000000 - 00 09 01 28 00 71 01 33 95 ...(.q.3• Interrupt message 000000 - 01 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 .."............. Extended message 000000 - 01 08 00 72 01 04 57 06 5A 55 00 00 00 5B 00 48 ...r..W.ZU...[.H 000010 - 04 57 01 55 00 76 06 59 00 00 00 00 00 00 00 29 .W.U.v.Y.......) 000020 - E6 84 ę„ Message: R8+Slot VV 71 01 Response: 08 VV 72 01 DD DD DD DD.. This message probably contains a table, with how much of the available recourses are currently in use in the VA section. With this table the software can check if there are enough recources available to add a particular module. Resource could be cycle times, memory or delay memory or something like that. Every module has a kind of fingerprint of how much of each resource it needs. So at a particular stage you might not be able to add module x, because it would overflow the memory, but you still can add module y, that uses more cycles but less memory. Probably with this, the totals "Cycles" and "Memory" that are shown in the software are calculated. ========================================================================== 2.c.8. Resources in Use in FX section? Example: format_message 000000 - 00 09 01 28 00 71 00 23 B4 ...(.q.#“ Send message 000000 - 00 09 01 28 00 71 00 23 B4 ...(.q.#“ Interrupt message 000000 - 01 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 .."............. Extended message 000000 - 01 08 00 72 00 08 17 00 4C 1C 00 00 01 23 00 31 ...r....L....#.1 000010 - 04 79 00 10 00 08 00 46 00 00 00 03 77 16 00 12 .y.....F....w... 000020 - 5D FB ]ū Message: R8+Slot VV 71 00 Response: 08 VV 72 00 DD DD DD DD.. Like above but for the FX section. ========================================================================== 2.c.9. Unknown 6 Example: format_message 000000 - 00 08 01 28 00 70 27 44 ...(.p'D Send message 000000 - 00 08 01 28 00 70 27 44 ...(.p'D Seems to be another ackownledgement reply (7F): Interrupt message 000000 - 62 01 08 00 7F 50 6D 00 00 00 00 00 00 00 00 00 b...Pm......... Message: R8+Slot VV 70 Response: 08 VV 7F -> Ok? ========================================================================== 2.c.10. Unknown 7 Example format_message 000000 - 00 08 01 28 00 2E 9C 7F ...(..œ Send message 000000 - 00 08 01 28 00 2E 9C 7F ...(..œ Interrupt message 000000 - A2 01 08 00 2F 01 02 01 00 92 D6 00 00 00 00 00 ¢.../....’Ö..... Message: R8+Slot VV 2E Response: 08 VV 2F DD DD DD DD ========================================================================== Then come the other 3 slots... Basically the same as above. ========================================================================== 3. List names Example format_message 000000 - 00 0B 01 2C 41 14 00 00 00 EC E5 ...,A....ģå Send message 000000 - 00 0B 01 2C 41 14 00 00 00 EC E5 ...,A....ģå Interrupt message 000000 - 01 00 BE 00 00 00 00 00 00 00 00 00 00 00 00 00 ..¾............. Extended message 000000 - 01 0C 00 13 2E 02 16 01 00 03 00 00 54 72 61 6E ............Tran 000010 - 63 65 6C 6C 69 7A 65 72 20 56 6F 63 00 54 72 61 cellizer Voc.Tra 000020 - 6E 63 65 6C 6C 69 7A 65 72 20 4B 69 63 00 54 72 ncellizer Kic.Tr 000030 - 61 6E 63 65 6C 6C 69 7A 65 72 20 4C 66 6F 0C 54 ancellizer Lfo.T 000040 - 72 61 6E 63 65 6C 6C 69 7A 65 72 20 50 61 64 0A rancellizer Pad. 000050 - 54 72 61 6E 63 65 20 56 6F 63 61 6C 00 00 47 32 Trance Vocal..G2 000060 - 50 61 64 64 69 6E 67 00 0A 46 41 54 42 61 73 73 Padding..FATBass 000070 - 20 20 4E 4C 32 00 03 41 63 63 47 75 69 74 00 01 NL2..AccGuit.. 000080 - 54 68 65 50 6C 61 79 65 72 00 0B 59 65 74 41 6E ThePlayer..YetAn 000090 - 6F 74 68 65 72 4F 72 67 61 6E 00 09 5A 65 72 6F otherOrgan..Zero 0000A0 - 48 7A 4C 69 6E 46 4D 00 0C 42 65 6C 6C 73 00 01 HzLinFM..Bells.. 0000B0 - 43 75 65 20 20 20 4E 4C 33 00 0C 05 B3 B2 Cue NL3...³² Message: Rc 41 14 MOde Bank Patch Response: (got this from //github.com/msg/g2ools) 0c 00 13 DD DD DD DD DD DD DD DD -> 8 bytes unknown X times : max 16 bytes else ends with 0 NN CC - Number, continuation code CC - 01 - 02 - 03 next bank - 04 Next mode (patch->perf->finished) - 05 Contunue with patch no NN ========================================================================== Finally: 4. Start communication G2->Host? Example: format_message 000000 - 00 09 01 2C 41 7D 00 86 B5 Send message 000000 - 00 09 01 2C 41 7D 00 86 B5 Interrupt message 000000 - 62 01 0C 00 7F 8C AD 00 00 00 00 00 00 00 00 00 b...Œ­......... Message: Rc 2c 41 7d 00 Resonse: 0c 00 7f => Ok After this, there is a steady stream of messages comming from the G2. ...