JUCE vst2 64bit plugin using STK modules black list in cubase 9 (MAC)


#1

Hi All! I’m developing an FM synth with the STK modules by adamsky (on Git Hub).
I added the all module structure and I’m using the stk::HevyMetl class.
The plugin result in the black list of Cubase 9 Elements (MAC).
Do someone know how?


#2

STOP! Excuse me, I forgot the check in “Plugin is Synth”.
but now I have another problem:

With this code in the processBlock():

void HeavyMetalAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
buffer.clear();

MidiBuffer processedMidi;
int time;
MidiMessage m;

const float gain = *parameters.getRawParameterValue("gain");

for (MidiBuffer::Iterator i (midiMessages); i.getNextEvent (m, time);)
{
    if (m.isNoteOn())
    {
        float frequency = MidiMessage::getMidiNoteInHertz(m.getNoteNumber());
        float amplitude = 1 / 256 * m.getVelocity() * gain;
        metal.noteOn(frequency, amplitude);
    }
    else if (m.isNoteOff())
    {
        metal.noteOff(0.0);
    }
    else if (m.isAftertouch())
    {
    }
    else if (m.isPitchWheel())
    {
    }
    
    processedMidi.addEvent (m, time);
}

midiMessages.swapWith (processedMidi);

}

What I’m doing wrong?


#3

After some tries, I found that if I delete the stk::HevyMetl metal; object from the PluginProcessor.h the problem disappear, so the problem is in the instrument module iI think…


#4

Analyzing the output I figured out that the module stk::HevyMetl causes a memory leak in the object of the class “TimeThread”.
Do anyone knows this object? Is a part of the JUCE framework?


#5

Sorry, never heard of stk::HeavyMetl.

(BTW when pasting code, indent it by 4 spaces to have the forum format it correctly)


#6

The STK are modules that @danlin converted from the STK C++ library of CCRMA.
They are presented here:


#7

stk::HevyMetl ? cant find this class on the module ? But with a quick look at the stk class, have you added the content for the synth?

HevyMetl :: HevyMetl( void )
  : FM()
{
  // Concatenate the STK rawwave path to the rawwave files
  for ( unsigned int i=0; i<3; i++ )
    waves_[i] = new FileLoop( (Stk::rawwavePath() + "sinewave.raw").c_str(), true );
  waves_[3] = new FileLoop( (Stk::rawwavePath() + "fwavblnk.raw").c_str(), true );

this is the reason why i dont add this classes to my modules. you need to put binary data to your path :face_vomiting:


#8

What are raw waves? And where I have to use them?


#9

You have to look at the STK Documentation there is a part about this files.
https://ccrma.stanford.edu/software/stk/usage.html#compiling


#10

Thanks @danlin, but I think that’s too complicated for me…
But now I would like to explore generators…
I think the better start would be the SineWave.h module, but can you help me on how to implement it in a JUCE Vst Synth Plugin?
In detail, how can I generate a sine from my MIDI input in processBlock()?

With the DSP effects the process was simple: create an object of dip class and tick one buffer at a time in processBlock() with a for loop… But with generators I think I have to translate the midi input from my plugin to the generation of the sine…