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

NullReferenceException in AudioProcessor.cs

Topics: Plugin Development
Nov 6, 2012 at 9:00 PM

Hi Obiwanjacobi,

  I have just generated a plugin based on VstNetAudioPlugin template in Visual Studio 2012. I changed only the UniquePluginId in Plugin.cs. After that i was able to compile the project. Everything seems to be ok but i cannot load it in a host, i tried with Ableton and with the sample host as well. The sample host says the error happens at line #37 in AudioProcessor.cs.

from AudioProcessor.cs:

/// <summary>       
/// Default constructor.       
/// </summary>       
public AudioProcessor(Plugin plugin) : base(AudioInputCount, AudioOutputCount, InitialTailSize)       
{
            _plugin = plugin;
            _sequencer = _plugin.Host.GetInstance<IVstHostSequencer>(); // this is line #37

            // TODO: We use one delay object to process two audio channels.
            // Typically you would use dedicated DSP objects for each channel.
            Delay = new Delay(plugin);
            // TODO: change this to your specific needs.
            _defaultTimeInfoFlags = VstTimeInfoFlags.ClockValid;
}

...here _plugin.Host is null, i do not know why. :(

Could you please help me with this?

Thanks in advance,
Patiati 

Coordinator
Nov 7, 2012 at 7:21 AM

I think I put an old vs-template project in the current release. Big oops! Sorry about that.
I will take down the file untill I have that sorted out. 

Refer to the source code for the VS-templates to fix it.
http://vstnet.codeplex.com/SourceControl/changeset/view/70713#1108753

 I am very sorry for the screw up. 

If you need any further assistance please do not hesitate to post your questions here.

Marc

Coordinator
Nov 7, 2012 at 8:46 AM

I've updated the VS templates download. Should be ok now.

Nov 7, 2012 at 9:50 AM

Thanks for the really quick answer, i will check again this evening. :)