ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2017-01-26T17:34:39+02:00 https://brainmodular.com/forums/app.php/feed/topic/5592 2017-01-26T17:34:39+02:00 2017-01-26T17:34:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36677#p36677 <![CDATA[VST rename preset]]> Usine is calling the higher level AudioPluginInstance class that does not seem to have this function
(not possible on Audio Units ?).

The saveToFXBFile() also does FXP (see isFXB parameter).
So it seems the basic functionality is there, but Usine would need some tweaks in the
way it uses the Juce library.

void changeProgramName (int index, const String& newName) override
{
if (index >= 0 && index == getCurrentProgram())
{
if (getNumPrograms() > 0 && newName != getCurrentProgramName())
dispatch (plugInOpcodeSetCurrentProgramName, 0, 0, (void*) newName.substring (0, 24).toRawUTF8(), 0.0f);
}
else
{
jassertfalse; // xxx not implemented!
}
}

bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB = 128)
{
const int numPrograms = getNumPrograms();
const int numParams = getNumParameters();

if (usesChunks())
{
MemoryBlock chunk;
getChunkData (chunk, ! isFXB, maxSizeMB);

if (isFXB)
{
const size_t totalLen = sizeof (fxChunkSet) + chunk.getSize() - 8;
dest.setSize (totalLen, true);

fxChunkSet* const set = (fxChunkSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FBCh");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);
set->chunkSize = fxbSwap ((int32) chunk.getSize());

chunk.copyTo (set->chunk, 0, chunk.getSize());
}
else
{
const size_t totalLen = sizeof (fxProgramSet) + chunk.getSize() - 8;
dest.setSize (totalLen, true);

fxProgramSet* const set = (fxProgramSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FPCh");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);
set->chunkSize = fxbSwap ((int32) chunk.getSize());

getCurrentProgramName().copyToUTF8 (set->name, sizeof (set->name) - 1);
chunk.copyTo (set->chunk, 0, chunk.getSize());
}
}
else
{
if (isFXB)
{
const int progLen = (int) sizeof (fxProgram) + (numParams - 1) * (int) sizeof (float);
const size_t len = (sizeof (fxSet) - sizeof (fxProgram)) + (size_t) (progLen * jmax (1, numPrograms));
dest.setSize (len, true);

fxSet* const set = (fxSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FxBk");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);

MemoryBlock oldSettings;
createTempParameterStore (oldSettings);

const int oldProgram = getCurrentProgram();

if (oldProgram >= 0)
setParamsInProgramBlock ((fxProgram*) (((char*) (set->programs)) + oldProgram * progLen));

for (int i = 0; i < numPrograms; ++i)
{
if (i != oldProgram)
{
setCurrentProgram (i);
setParamsInProgramBlock ((fxProgram*) (((char*) (set->programs)) + i * progLen));
}
}

if (oldProgram >= 0)
setCurrentProgram (oldProgram);

restoreFromTempParameterStore (oldSettings);
}
else
{
dest.setSize (sizeof (fxProgram) + (size_t) ((numParams - 1) * (int) sizeof (float)), true);
setParamsInProgramBlock ((fxProgram*) dest.getData());
}
}

return true;
}

Statistics: Posted by sm_jamieson — 26 Jan 2017, 16:34


]]>
2017-01-26T16:32:21+02:00 2017-01-26T16:32:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36675#p36675 <![CDATA[VST rename preset]]> This file format is undocumented, and was obtained by reverse engineering.

The file format of an fxp file is apparently this:

struct fxProgram
{
long chunkMagic; // 'CcnK'
long byteSize; // of this chunk, excl. magic + byteSize

long fxMagic; // 'FxCk' or 'FPCh'
long version;
long fxID; // fx unique id
long fxVersion;

long numParams;
char prgName[28];
float params[1]; // variable no. of parameters
};

Note the comment for fxMagic - 'FxCk' is used for programs that are stored as a set of parameters.
For a chunk, it should contain 'FPCh' (i.e., chunkPresetMagic) instead... and params contains the length of the chunk as a VstInt32 value. This is followed by the chunk itself.

This "chunk" is not to be confused with Usine's SDK "chunk", although they both represent a blob of binary data.

I saved an fxp file from the VB3 plugin. It contained "VB3" in the fxID and the preset name in prgName.
It also contained the preset name at the start of the chunk (starting at params[0]).

I edited the program name in prgName and when I reloaded the file, this preset name was being used (although I had not edited the preset name in the chunk so the two did not match). When I resaved the preset, the edited preset name was showing up prgName and in the chunk.

So whatever writes the fxp header can change the name of the preset, i.e. the missing RENAME functionality.
Since VB3 suggest the host can do this it suggests the plugin does not write this but - it just supplies the chunk, and the host is responsible for the header.

Note that Usine appears to use the Juce library for the plugin wrapper, and whether Juce can change the preset name remains to be seen.
Since Juce is mainly open source it should be easy to investigate.

The FXB bank format can apparently contain all the presets in a single chunk, so banks are harder to deal with.
The basic method would be to save as FXP using a different prgName. Then load those presets back into the VST and save as a bank.

Simon.

Statistics: Posted by sm_jamieson — 26 Jan 2017, 15:32


]]>
2017-01-13T07:48:36+02:00 2017-01-13T07:48:36+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36610#p36610 <![CDATA[VST rename preset]]> http://www.sensomusic.org/forums/viewtopic.php?id=5652

And I am still searching for a solution. But, maybe here are some useful hints: http://www.kvraudio.com/forum/viewtopic.php?t=277776

The "Minihost" that you can download from that forum, seems to be able to rename and reorganize presets into banks. But, only for 32bit plugins. I simply loaded the 32 bit version of my 64 bit plugin - seems to work with the same fxp files. I am still experimenting with it...

If you find some better solution, please let us know.

Statistics: Posted by magickz — 13 Jan 2017, 06:48


]]>
2016-12-09T20:01:40+02:00 2016-12-09T20:01:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36407#p36407 <![CDATA[VST rename preset]]>
No , there's no "preset rename" in Usine, and not sure it will be easy to implement because there's so many way to create Plugins and no really "standart" ways
This is really nothing to do with Usine's presets - just the VSTi format files.

As far as I understand it the VSTi preset name is simply stored in the header of the preset in an fxb (bank) or fxp (preset file). Since you can do SAVE to an fxb or fxp file in Usine, I cannot see why it would be difficult to implement at all. It just requires the header name to be changed before saving.

If you modify presets you certainly want to save them under a different name. If you have multiple instances of a VSTi with different fxb banks loaded imagine the same preset name being used for different presets - confusion !

Simon.

Statistics: Posted by sm_jamieson — 09 Dec 2016, 19:01


]]>
2016-12-03T12:52:23+02:00 2016-12-03T12:52:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36346#p36346 <![CDATA[VST rename preset]]> Statistics: Posted by nay-seven — 03 Dec 2016, 11:52


]]>
2016-11-16T20:18:41+02:00 2016-11-16T20:18:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36305#p36305 <![CDATA[VST rename preset]]>
All VST plugins that don't have their own preset handling work this way, which is the standard preset handling in the VST system. Verify that your host provides the functions:
- SAVE Bank,
- LOAD Bank,
- SAVE Preset,
- LOAD Preset,
- RENAME Preset.
If it doesn't or if you don't know where these functions are accessible, please contact your host's manufacturer.
Once verified that your host is able to manage VST presets, just move to the desired preset among the 32 available and tweak your sound, then RENAME it. You don't need to store it, it gets stored automatically until you quit the plugin. After having modified all your presets, SAVE the whole BANK. Your host will create a file {name_of_file}.fxb. You can now quit the plugin. The next time you'll open the plugin, you'll find the factory presets again. Now you can overwrite the whole bank by LOADing the BANK file you saved previously.

At the top of the Usine VST window you have the following:
Load Bank, Save Bank, Load Preset, Save Preset, <<, >>, show all parameters, hide all parameters.

In addition, the name of the preset is shown in the VST window title bar.

But Usine has no "RENAME Preset" option. Is this missing functionality in Usine, or can it be done another way ?

Simon.

Statistics: Posted by sm_jamieson — 16 Nov 2016, 19:18


]]>
BrainModular BrainModular Users Forum 2017-01-26T17:34:39+02:00 https://brainmodular.com/forums/app.php/feed/topic/5592 2017-01-26T17:34:39+02:00 2017-01-26T17:34:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36677#p36677 <![CDATA[VST rename preset]]> Usine is calling the higher level AudioPluginInstance class that does not seem to have this function
(not possible on Audio Units ?).

The saveToFXBFile() also does FXP (see isFXB parameter).
So it seems the basic functionality is there, but Usine would need some tweaks in the
way it uses the Juce library.

void changeProgramName (int index, const String& newName) override
{
if (index >= 0 && index == getCurrentProgram())
{
if (getNumPrograms() > 0 && newName != getCurrentProgramName())
dispatch (plugInOpcodeSetCurrentProgramName, 0, 0, (void*) newName.substring (0, 24).toRawUTF8(), 0.0f);
}
else
{
jassertfalse; // xxx not implemented!
}
}

bool saveToFXBFile (MemoryBlock& dest, bool isFXB, int maxSizeMB = 128)
{
const int numPrograms = getNumPrograms();
const int numParams = getNumParameters();

if (usesChunks())
{
MemoryBlock chunk;
getChunkData (chunk, ! isFXB, maxSizeMB);

if (isFXB)
{
const size_t totalLen = sizeof (fxChunkSet) + chunk.getSize() - 8;
dest.setSize (totalLen, true);

fxChunkSet* const set = (fxChunkSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FBCh");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);
set->chunkSize = fxbSwap ((int32) chunk.getSize());

chunk.copyTo (set->chunk, 0, chunk.getSize());
}
else
{
const size_t totalLen = sizeof (fxProgramSet) + chunk.getSize() - 8;
dest.setSize (totalLen, true);

fxProgramSet* const set = (fxProgramSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FPCh");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);
set->chunkSize = fxbSwap ((int32) chunk.getSize());

getCurrentProgramName().copyToUTF8 (set->name, sizeof (set->name) - 1);
chunk.copyTo (set->chunk, 0, chunk.getSize());
}
}
else
{
if (isFXB)
{
const int progLen = (int) sizeof (fxProgram) + (numParams - 1) * (int) sizeof (float);
const size_t len = (sizeof (fxSet) - sizeof (fxProgram)) + (size_t) (progLen * jmax (1, numPrograms));
dest.setSize (len, true);

fxSet* const set = (fxSet*) dest.getData();
set->chunkMagic = fxbName ("CcnK");
set->byteSize = 0;
set->fxMagic = fxbName ("FxBk");
set->version = fxbSwap (fxbVersionNum);
set->fxID = fxbSwap (getUID());
set->fxVersion = fxbSwap (getVersionNumber());
set->numPrograms = fxbSwap (numPrograms);

MemoryBlock oldSettings;
createTempParameterStore (oldSettings);

const int oldProgram = getCurrentProgram();

if (oldProgram >= 0)
setParamsInProgramBlock ((fxProgram*) (((char*) (set->programs)) + oldProgram * progLen));

for (int i = 0; i < numPrograms; ++i)
{
if (i != oldProgram)
{
setCurrentProgram (i);
setParamsInProgramBlock ((fxProgram*) (((char*) (set->programs)) + i * progLen));
}
}

if (oldProgram >= 0)
setCurrentProgram (oldProgram);

restoreFromTempParameterStore (oldSettings);
}
else
{
dest.setSize (sizeof (fxProgram) + (size_t) ((numParams - 1) * (int) sizeof (float)), true);
setParamsInProgramBlock ((fxProgram*) dest.getData());
}
}

return true;
}

Statistics: Posted by sm_jamieson — 26 Jan 2017, 16:34


]]>
2017-01-26T16:32:21+02:00 2017-01-26T16:32:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36675#p36675 <![CDATA[VST rename preset]]> This file format is undocumented, and was obtained by reverse engineering.

The file format of an fxp file is apparently this:

struct fxProgram
{
long chunkMagic; // 'CcnK'
long byteSize; // of this chunk, excl. magic + byteSize

long fxMagic; // 'FxCk' or 'FPCh'
long version;
long fxID; // fx unique id
long fxVersion;

long numParams;
char prgName[28];
float params[1]; // variable no. of parameters
};

Note the comment for fxMagic - 'FxCk' is used for programs that are stored as a set of parameters.
For a chunk, it should contain 'FPCh' (i.e., chunkPresetMagic) instead... and params contains the length of the chunk as a VstInt32 value. This is followed by the chunk itself.

This "chunk" is not to be confused with Usine's SDK "chunk", although they both represent a blob of binary data.

I saved an fxp file from the VB3 plugin. It contained "VB3" in the fxID and the preset name in prgName.
It also contained the preset name at the start of the chunk (starting at params[0]).

I edited the program name in prgName and when I reloaded the file, this preset name was being used (although I had not edited the preset name in the chunk so the two did not match). When I resaved the preset, the edited preset name was showing up prgName and in the chunk.

So whatever writes the fxp header can change the name of the preset, i.e. the missing RENAME functionality.
Since VB3 suggest the host can do this it suggests the plugin does not write this but - it just supplies the chunk, and the host is responsible for the header.

Note that Usine appears to use the Juce library for the plugin wrapper, and whether Juce can change the preset name remains to be seen.
Since Juce is mainly open source it should be easy to investigate.

The FXB bank format can apparently contain all the presets in a single chunk, so banks are harder to deal with.
The basic method would be to save as FXP using a different prgName. Then load those presets back into the VST and save as a bank.

Simon.

Statistics: Posted by sm_jamieson — 26 Jan 2017, 15:32


]]>
2017-01-13T07:48:36+02:00 2017-01-13T07:48:36+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36610#p36610 <![CDATA[VST rename preset]]> http://www.sensomusic.org/forums/viewtopic.php?id=5652

And I am still searching for a solution. But, maybe here are some useful hints: http://www.kvraudio.com/forum/viewtopic.php?t=277776

The "Minihost" that you can download from that forum, seems to be able to rename and reorganize presets into banks. But, only for 32bit plugins. I simply loaded the 32 bit version of my 64 bit plugin - seems to work with the same fxp files. I am still experimenting with it...

If you find some better solution, please let us know.

Statistics: Posted by magickz — 13 Jan 2017, 06:48


]]>
2016-12-09T20:01:40+02:00 2016-12-09T20:01:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36407#p36407 <![CDATA[VST rename preset]]>
No , there's no "preset rename" in Usine, and not sure it will be easy to implement because there's so many way to create Plugins and no really "standart" ways
This is really nothing to do with Usine's presets - just the VSTi format files.

As far as I understand it the VSTi preset name is simply stored in the header of the preset in an fxb (bank) or fxp (preset file). Since you can do SAVE to an fxb or fxp file in Usine, I cannot see why it would be difficult to implement at all. It just requires the header name to be changed before saving.

If you modify presets you certainly want to save them under a different name. If you have multiple instances of a VSTi with different fxb banks loaded imagine the same preset name being used for different presets - confusion !

Simon.

Statistics: Posted by sm_jamieson — 09 Dec 2016, 19:01


]]>
2016-12-03T12:52:23+02:00 2016-12-03T12:52:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36346#p36346 <![CDATA[VST rename preset]]> Statistics: Posted by nay-seven — 03 Dec 2016, 11:52


]]>
2016-11-16T20:18:41+02:00 2016-11-16T20:18:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=5592&p=36305#p36305 <![CDATA[VST rename preset]]>
All VST plugins that don't have their own preset handling work this way, which is the standard preset handling in the VST system. Verify that your host provides the functions:
- SAVE Bank,
- LOAD Bank,
- SAVE Preset,
- LOAD Preset,
- RENAME Preset.
If it doesn't or if you don't know where these functions are accessible, please contact your host's manufacturer.
Once verified that your host is able to manage VST presets, just move to the desired preset among the 32 available and tweak your sound, then RENAME it. You don't need to store it, it gets stored automatically until you quit the plugin. After having modified all your presets, SAVE the whole BANK. Your host will create a file {name_of_file}.fxb. You can now quit the plugin. The next time you'll open the plugin, you'll find the factory presets again. Now you can overwrite the whole bank by LOADing the BANK file you saved previously.

At the top of the Usine VST window you have the following:
Load Bank, Save Bank, Load Preset, Save Preset, <<, >>, show all parameters, hide all parameters.

In addition, the name of the preset is shown in the VST window title bar.

But Usine has no "RENAME Preset" option. Is this missing functionality in Usine, or can it be done another way ?

Simon.

Statistics: Posted by sm_jamieson — 16 Nov 2016, 19:18


]]>