FXB files


#1

I’m trying to parse those darn FXB and FXP files.
But i’m stuck. I got the source for the VstHost that was recommended on
KVR forum, but this code does not handle CHUNK files:

if ((!IsLoaded()) || (bChunk))          /* if nothing loaded or chunk file   */
  return NULL;                          /* return OUCH                       */

does anybody know how theese files look like? is there any example source anywhere to see how theese CHUNK files are constructed. I’m interested only in getting the program names really. But i really don’t know how.


#2

So i went through vstfxstore.h and found

for the fxb

struct fxBank
{
//-------------------------------------------------------------------------------------------------------
	VstInt32 chunkMagic;		///< 'CcnK'
	VstInt32 byteSize;			///< size of this chunk, excl. magic + byteSize

	VstInt32 fxMagic;			///< 'FxBk' (regular) or 'FBCh' (opaque chunk)
	VstInt32 version;			///< format version (1 or 2)
	VstInt32 fxID;				///< fx unique ID
	VstInt32 fxVersion;			///< fx version

	VstInt32 numPrograms;		///< number of programs


	VstInt32 currentProgram;	///< version 2: current program number
	char future[124];			///< reserved, should be zero

	char future[128];			///< reserved, should be zero


	union
	{
		fxProgram programs[1];	///< variable number of programs
		struct
		{
			VstInt32 size;		///< size of bank data
			char chunk[1];		///< variable sized array with opaque bank data
		} data;					///< bank chunk data
	} content;					///< bank content depending on fxMagic
//-------------------------------------------------------------------------------------------------------
};

now the part that points to an fxProgram witch is of type

struct fxProgram
{
//-------------------------------------------------------------------------------------------------------
	VstInt32 chunkMagic;		///< 'CcnK'
	VstInt32 byteSize;			///< size of this chunk, excl. magic + byteSize

	VstInt32 fxMagic;			///< 'FxCk' (regular) or 'FPCh' (opaque chunk)
	VstInt32 version;			///< format version (currently 1)
	VstInt32 fxID;				///< fx unique ID
	VstInt32 fxVersion;			///< fx version

	VstInt32 numParams;			///< number of parameters
	char prgName[28];			///< program name (null-terminated ASCII string)

	union
	{
		float params[1];		///< variable sized array with parameter values
		struct 
		{
			VstInt32 size;		///< size of program data
			char chunk[1];		///< variable sized array with opaque program data
		} data;					///< program chunk data
	} content;					///< program content depending on fxMagic
//-------------------------------------------------------------------------------------------------------
};

isn’t there or at least i can’t find it, it should start with a CcnK FOURCC
but it’s not there the file i’m testing with is here. Am i missing something obvious here (the file is a FLStudio FXB export for the VStation factory bank).


#3

I was searching around a bit for FXB/FXP file handling and found it here:

juce_VSTPluginFormat.cpp:

VSTPluginInstance::loadFromFXBFile(…)
VSTPluginInstance::saveToFXBFile(…).

so I thought it might help to update this thread in case someone else wanted to look under the bonnet of the abstract get/setStateInformation, get/setCurrentProgramStateInformation functions.


#4