0

I am trying to make a FXB file previewer (VST preset banks for those who don't know) for Sylenth1 banks. I have encoded the FXB as an ASCII string and had it print to the console. The preset names show up fine. My issue is that the parameters for the oscillators, filters and effects are encoded as random characters (mainly "?" and fairly big spaces).

Console window Underlined in red: file header (?)

Underlined in blue: preset name (which I want to keep)

Underlined in yellow: osc/FX/filter parameters (which I want to discard from the string)

Here's the code I wrote:

    byte[] arr = File.ReadAllBytes(Properties.Resources.pointer); /* pointer is a string in resources I
used to point to the external FXB file for testing */
    System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
    string fstr = enc.GetString(arr);
    Console.Write(fstr);
    Console.ReadKey();

I had written a foreach loop to replace every unwanted character with string.Empty, but it also removes parts of the preset names (e.g. the L from "Lead"), leaves the spaces intact and creates new ones, so I deleted it.

My end goal for those that are curious is this:

Preset 1
Preset 2
Preset 3
Preset 4
...

I'm at a total loss. I've tried different solutions from various websites and Stack Overflow posts, but none gave me the desired result.

(I also noticed that the preset names have almost the same space between them (~ 200 chars apart), can I use the difference to exclude the unwanted parts?)

na-no.
  • 344
  • 1
  • 3
  • 11
  • The binary format of this file is either determined by the host (DAW) or the plugins themselves from what I understand.... – obiwanjacobi Mar 09 '21 at 16:46
  • @obiwanjacobi So you're saying that I should ask LennarDigital themselves? – na-no. Mar 09 '21 at 16:51
  • You could. If the plugin does not implement it's own serialization, the DAW will do it - so you may also have to reverse engineer a couple of popular DAW's. A lot of work. Loading in the actual plugins as parameter-UI would at least safe you the trouble of having to reverse engineer their formats... – obiwanjacobi Mar 10 '21 at 05:44

2 Answers2

2

It looks like a binary file not ascii. Some data in the file is easily readable because it is ASCII encoded, but other data, for example numbers, are encoded in their binary format.

Not all binary data can be converted to printable ASCII characters, so when you print it out like this you get the ???? mess.

It is better to read this file using a binary editor. Visual studio has one, there is probably an extension for vs code, other editors have a binary viewer (e.g. sublime). This will show you data in the file as it is encoded, usually using hex with the ascii in a second column.

But that is just so you can accurately see the content. It does not help you for understanding the meaning or the layout. You might be able to make something work by reverse engineering like this, but chances are it will not work for all cases. Using and API is going to be way easier.

I'm not familiar with these files but did you find this? https://new.steinberg.net/developers/ There is a forum there that might help.

mikelegg
  • 1,197
  • 6
  • 10
0

I found the answer to this myself. I basically somewhat reverse engineered the FXB in a hex editor, and proceeded to load specific bytes of the file (31 to be exact) in order to encode those in a string and have that print to the console.

I managed to do so by literally counting how many bytes there are from the beginning to the 1st preset name, then from the end of the preset name (31 bytes) to the beginning of the other preset name, and so on.

For those who are interested, I am going to develop a GUI version of it in the future. But it does (and probably will) support only Sylenth1 v2 soundbanks/FXBs.

Also thanks to the people who reached out. They helped in their own way.

na-no.
  • 344
  • 1
  • 3
  • 11