This message is mainly for programmers.

There have been many people asking me how a STY file is made inside.

Well, here it is:

File len is stored in bytes 5 to 8 (add 8 bytes to the computed len)

File tag (KORF) is stored in bytes 25 to 28

Index len in byes 33 to 36. Each index entry is 24 bytes long, so you can easily compute how many entries are in the index. Index entries may (or may not) be duplicated because a Pa80 style is made of two pieces: the style itself (midi data) and its performance (volume, programs, effects ... ), but the performance sometimes is missing; there is a flag in each index entry (byte 19) for distinguish styles (2) from performances (7). Style index (that is its position inside the bank) is at byte 21.

Styles begin immediately after the index. For each style, bytes 5 to 8 store the style length (again, add 8 to this value), then the style data follow.

After the styles there is another index. So read 8 more bytes and compute this index length using bytes 5 to 8 (and adding 8 to the result). Each entry simply point to the start of the data of each index entry.

Ok, this should be enough for understanding style file structure.

Now the bad new: style contents is compressed, so you cannot understand how things are inside. I asked KORG for this compression algorithmn months ago (almost 2 years ago), but they always refused to share this with me.

Please note that all the informations about style file structure come from me only, with the help of a couple of fellow users: KORG never helped in this task.