This project has moved. For the latest updates, please go here.

VstParameter as string

May 1, 2010 at 11:02 AM

Hi,

congratulation for this work! It's simply awesome :)

I wanted to store fileNames in VstProgram. Do You have any idea how I can? :)

 

Thanks and best regards,

delo

 

Coordinator
May 3, 2010 at 5:58 AM
Edited May 3, 2010 at 5:59 AM

Thank you very much for your kind words.

Any custom data you want to attach to a VstProgram involves the following:

  • Derive a custom class from VstProgram (and instantiate those when doing initilialization) that contains your extra data (file name etc.)
  • Implement custom persistence that (de)serializes that extra information from/to you custom VstProgram class.

Note that when doing persistence yourself it pays to have a version identifier at the start of the stream, so your code can detect compatible versions or switch serializers.

See also the implementation of the VstPluginPersististenceBase class and the MidiNoteMapper sample that uses custom persistence to serialize mapping data (not using programs at all).

Hope it helps,

Marc

May 3, 2010 at 6:22 AM

Okay, thank You! It looks like helpful information, so I'll try at home.

Sorry for my dummy questions, next time I'll read the manual first. :)

Best regards,

delo

May 3, 2010 at 1:38 PM

Hi,

Thanks again. The MidiNoteMapper was helpful. I mixed that code with the Delay sample code ( program handling ) and I wrote a MyVstParameter class inherited from VstParameter class.

delo

Coordinator
May 3, 2010 at 5:47 PM

Note that parameters in the VST interface standard are always floats. There are methods that can convert a parameter from/to a string (represented by ParseValue and DisplayValue) but that is just for presentation purposes in host-generated plugin editors. If you write your own custom plugin editor (like MidiNoteMapper does), I would implement all paramters that are not directly influencing the sound or midi processing as properties of a custom VstProgram class. VstParameters are structures that allows a host to manipulate the plugin's processing (like parameter automation) and the host expects floats.

Hope it helps.

May 4, 2010 at 9:03 AM

Thanks.

I used the MidiNoteMapper project and I modified some inherited classes to handle the my inherited VstParameter class.
The custom VstParameter class contains a new propery and I handle it from UI trought a custom editor.

It is working now. I tested in cubase and reaper too. :)

Thank You again!

delo