Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Step 1:
- //Copy the folder you exported from MaxMSP into your Wwise plugin project folder.
- //Step 2:
- //In you visual studio project, right click on your project module in the left panel (where all your code files are listed), and select //"add existing". Your file browser will open up. Go inside the RNBO export folder (the one you copied into the Wwise plugin folder) //and select the "rnbo_synthezzito_source.cpp" file. Repeat this step and also add the "RNBO.cpp" file.
- //Step 3:
- //In your SynthezzitoSource.h file, and the following 'include' statement after the indef/define code:
- #ifndef SynthezzitoSource_H
- #define SynthezzitoSource_H
- #include "RNBO.h"
- //Step 4:
- //In the same file as the last step, add this code at the bottom of the file (just the last line):
- private:
- SynthezzitoSourceParams* m_pParams;
- AK::IAkPluginMemAlloc* m_pAllocator;
- AK::IAkSourcePluginContext* m_pContext;
- AkFXDurationHandler m_durationHandler;
- RNBO::CoreObject rnboObject;
- };
- //Step 5:
- //Replace you Execute function code with this:
- void SynthezzitoSource::Execute(AkAudioBuffer* out_pBuffer)
- {
- m_durationHandler.SetDuration(m_pParams->RTPC.fDuration);
- m_durationHandler.ProduceBuffer(out_pBuffer);
- //Process
- rnboObject.prepareToProcess(48000, out_pBuffer->uValidFrames);
- RNBO::SampleValue** outputs = new RNBO::SampleValue * [1];
- outputs[0] = new double[out_pBuffer->uValidFrames];
- rnboObject.process(nullptr, 0, outputs, 1, out_pBuffer->uValidFrames);
- const AkUInt32 uNumChannels = out_pBuffer->NumChannels();
- AkUInt16 uFramesProduced;
- for (AkUInt32 i = 0; i < uNumChannels; ++i)
- {
- AkReal32* AK_RESTRICT pBuf = (AkReal32 * AK_RESTRICT)out_pBuffer->GetChannel(i);
- uFramesProduced = 0;
- while (uFramesProduced < out_pBuffer->uValidFrames)
- {
- // Generate output here
- *pBuf++ = static_cast<AkReal32>(((outputs[0][uFramesProduced]) * 0.5f));
- ++uFramesProduced;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement