MIDI is the standard for communication between electronic music instruments like keyboards and synthesizers. And computers! While tinkering with an old floppy-less GEM WS2 keyboard, I wanted to figure out the structure of their System Exclusive memory dumps. SysEx is the vendor-specific (and non-standard) part of MIDI. Vendors can use it for real-time instructions (changing a sound parameter in real-time) and for non-real-time instructions (sending or loading a configuration, sample set, etc.).
In the GEM WS2, there's two ways of saving the memory (voices, globals, styles and songs): in .ALL files on floppy, and via MIDI SysEx.
The .ALL files are binary files, 60415 bytes long. The only recognizable parts are the ASCII encoded voice and global names. The SysEx dumps are 73691 bytes long. As always in MIDI, only command start (and end) bytes have MSB 1, and all data bytes have MSB 0. The data is spread out over 576 SysEx packets, preceded by one SysEx packet with header information.
Each SysEx data packet starts with these bytes (decimal representation):
Because the original data (the WS2 memory and the .ALL file) has 8 bits per byte, and MIDI SysEx bytes can only have 7 bits (MSB 0), GEM uses an encoding to go from one to the other:
Seven 8-bit bytes have their LSB stripped, and the LSB's form byte number 8, from the first of seven bytes in the LSB of byte number 8, to the last of seven bytes in bit number 7 (64 decimal value).
Using this encoding, a group of 7 bytes from the .ALL format is transformed into a group of 8 SysEx bytes.
The length byte in each data packet indicates how many of those byte groups there are in the current data packet. Data is sent per 15 byte groups., resulting in a 127 byte SysEx packet, with the last data packet containing the remaining 6 byte groups. There's only five bytes in the .ALL format to fill the last byte group of the last data packet, and that byte group is padded with two FF(255) bytes.
The checksum byte is calculated as the XOR of all other bytes in the SysEx data packet, excluding the 240 and 247 start and stop bytes. When receiving a SysEx dump, the total XOR checksum of the bytes between 240 and 247 should therefore always be 0. (NB this is substantially different from the Roland way of doing SysEx checksums).
With this knowledge, I wrote a Perl script to convert .ALL files to SysEx (known as .syx) bytestreams. Owners of GEM WS1/WS2/WS400 keyboards who find themselves without floppies or without a working floppy drive can now load their .ALL files via a computer (with e.g. MIDI-OX or SysEx Librarian). If interested, send me an e-mail!
In the GEM WS2, there's two ways of saving the memory (voices, globals, styles and songs): in .ALL files on floppy, and via MIDI SysEx.
The .ALL files are binary files, 60415 bytes long. The only recognizable parts are the ASCII encoded voice and global names. The SysEx dumps are 73691 bytes long. As always in MIDI, only command start (and end) bytes have MSB 1, and all data bytes have MSB 0. The data is spread out over 576 SysEx packets, preceded by one SysEx packet with header information.
Each SysEx data packet starts with these bytes (decimal representation):
- 240 (SysEx start)
- 47 (GeneralMusic / GEM / Elka manufacturer ID)
- 0
- 2 (the header packet has a 1 here, the data packes have a 2)
- a six-bit packet counter (data packet number MOD 64)
- 15 (data length, discussed below)
- then there's room for 120 data bytes
- one checksum byte (discussed below)
- 247 (SysEx end)
Because the original data (the WS2 memory and the .ALL file) has 8 bits per byte, and MIDI SysEx bytes can only have 7 bits (MSB 0), GEM uses an encoding to go from one to the other:
Seven 8-bit bytes have their LSB stripped, and the LSB's form byte number 8, from the first of seven bytes in the LSB of byte number 8, to the last of seven bytes in bit number 7 (64 decimal value).
Using this encoding, a group of 7 bytes from the .ALL format is transformed into a group of 8 SysEx bytes.
The length byte in each data packet indicates how many of those byte groups there are in the current data packet. Data is sent per 15 byte groups., resulting in a 127 byte SysEx packet, with the last data packet containing the remaining 6 byte groups. There's only five bytes in the .ALL format to fill the last byte group of the last data packet, and that byte group is padded with two FF(255) bytes.
The checksum byte is calculated as the XOR of all other bytes in the SysEx data packet, excluding the 240 and 247 start and stop bytes. When receiving a SysEx dump, the total XOR checksum of the bytes between 240 and 247 should therefore always be 0. (NB this is substantially different from the Roland way of doing SysEx checksums).
With this knowledge, I wrote a Perl script to convert .ALL files to SysEx (known as .syx) bytestreams. Owners of GEM WS1/WS2/WS400 keyboards who find themselves without floppies or without a working floppy drive can now load their .ALL files via a computer (with e.g. MIDI-OX or SysEx Librarian). If interested, send me an e-mail!
Comments
Ik kwam je blog tegen en hopelijk kun jij me verder helpen. Ik heb een GEM WS1, maar mijn diskdrive is er mee gestopt... Nou ja, gestopt, bij elke diskette heeft hij aan dat de data corrupt is. Ik ben dus op zoek naar een manier om mijn .ALL files te kunnen gebruiken, zodat ik alles via MIDI kan gaan overzetten. Het klinkt als hetgeen je beschrijft mij zou kunnen helpen... Ik hoor je graag!
groet,
Ramon
I HAVE GEM WS2
I MOVED THEM FROM THE FLPOPPY TO MY PC ALL THE FILES ARE WITH EXTENSION .ALL
I WANT TO CONVERT THEM TO MIDI
HOW CAN I DO THAT ?
i cant find your email to write to you
can you write here your email
or email me :asaf0968@gmail.com
THANKS
I have GEM WS2, good old machine.
I need to convert some .all files, can You semd me your mail please?
bello@bih.net.ba
Thanks.
I have GEM WS2
I need to convert some .all files, can You semd me your mail
my email :osmanli1876@hotmail.com.tr
Thanks.
I plan to start again with my WS2 GEM device, and was wondering if we can share files with eachother ?
I have some music files (.all) i can also share with you. Of course I still will need to find a way to get the from and later on the floppy disk.....
Thanks !
I have a GEM WS2 KEYBOARD workstation. I can't find the Midi save/load option in the Midi menu on this unit or does this only apply to the WS2 MIDI workstation? My WS2 has a working floppy drive but many of my floppy disks are corrupt and i would like to re-format them and in turn reload them with the .ALL files on my PC which i have downloaded to my HD from the internet. Unfortunately my pc has no FD drive installed so a Midi dump option using Midi-Ox would've been great! Another possible option is to install a USB FD Emulator in my WS2 that will emulate a 720kb drive? Any advice is welcome Bert!
Many thanks in advance,
John
If you share your .ALL files with me, I can include them in the collection of over 150 .ALL files I have built up. For example, nine of the original GEM WS2 floppy series have been found, but many are still missing.
Hello
Bert de Bruijn
I need your help !!!
1) I have a Gem WS2 II keyboard with floppy disk.
I want to convert my .all files to midi with your Perl script.
When I run ws2-transform.pl I get this message:
C: \> ws2-transform.pl
Use of uninitialized value $ syxfilename in substitution (s ///) at C: \ ws2-transform.pl line 63.
Use of uninitialized value $ allfilename in string eq at C: \ ws2-transform.pl line 67.
Use of uninitialized value $ syxfilename in string eq at C: \ ws2-transform.pl line 67.
Use of uninitialized value $ allfilename in concatenation (.) Or string at C: \ ws2-transform.pl line 67.
Use of uninitialized value $ allfilename in concatenation (.) Or string at C: \ ws2-transform.pl line 77.
Use of uninitialized value $ allfilename in concatenation (.) Or string at C: \ ws2-transform.pl line 77.
Could not open for reading at C: \ ws2-transform.pl line 77.
How can I solve the problem ?
2) How do I enable sysex to transfer midi files with the load midi command and the midi-ox program?
3) I have about 30 songs of song, global and style that I could exchange with yours if you wish.
My email: meschinimauro2@gmail.com
Letting the WS2 wait for .syx data from MIDI-OX is in the midi menu, called "LOAD MIDI" if I remember correctly (page 5 or 6 I believe, can't check because I don't have a WS2 anymore). You need the WS2ii firmware, in the original WS2 1.00 firmware this function was not present.
Thank you so much for any input,
Gary Strickland
but i dont have understand ho i can do. please send me a mail this files are a remember of my father and i want to take care.
tanx a lot can you write at cirillo.ivano@gmail.com
best regards
Found already that i can change Styles and performances via Controller 70 on the common channel. This leaves me with some of the other functions which i cannot change via MIDI.
best regards
Leo
Never looked at the data it sends for keypresses because it is not written in the MIDi-implementation chart, but will try this soon and let you know.
Thanks