Krotos Modules 3
Loading...
Searching...
No Matches
krotos::KwidgetSynthVoice Class Reference

Adapter for using KwidgetProcessorGraph objects with juce::Synthesiser. More...

#include <KwidgetSynthesiser.h>

Inheritance diagram for krotos::KwidgetSynthVoice:

Public Member Functions

 KwidgetSynthVoice (int idx, int numOutputChannels, std::vector< KwidgetProcessorGraph * > processors)
 
 ~KwidgetSynthVoice () override=default
 
bool canPlaySound (SynthesiserSound *sound) override
 
void startNote (int midiNote, float velocity, SynthesiserSound *sound, int) override
 
void stopNote (float velocity, bool allowTailOff) override
 
void pitchWheelMoved (int) override
 
void controllerMoved (int, int) override
 
void renderNextBlock (AudioBuffer< float > &buffer, int startSample, int numSamples) override
 

Private Member Functions

void addProcessor (KwidgetProcessorGraph *p)
 

Private Attributes

const int m_voiceIndex
 
AudioBuffer< float > m_workingBuffer
 
Array< KwidgetProcessorGraph * > m_processors
 

Detailed Description

Adapter for using KwidgetProcessorGraph objects with juce::Synthesiser.

Constructor & Destructor Documentation

◆ KwidgetSynthVoice()

krotos::KwidgetSynthVoice::KwidgetSynthVoice ( int idx,
int numOutputChannels,
std::vector< KwidgetProcessorGraph * > processors )

TODO: Currently, KwidgetProcessorGraph overwrites the data of the buffer it is given, so a temporary buffer is used to store the output and then add it to the I/O buffer supplied by the DAW.

It is dimensioned here to the maximum number of channels that the plugin might require In the renderNextBlock method, only the number of channels being processed by the synth will be used

Sandy 20/6/22 the 4096 is evidently simply supposed to cover the largest DAW audio block size, so this probably should still go into prepare to play Pending that, the renderNextBlock method is reajusting the channel depth (without reallocation)

◆ ~KwidgetSynthVoice()

krotos::KwidgetSynthVoice::~KwidgetSynthVoice ( )
overridedefault

Member Function Documentation

◆ addProcessor()

void krotos::KwidgetSynthVoice::addProcessor ( KwidgetProcessorGraph * p)
private

◆ canPlaySound()

bool krotos::krotos::KwidgetSynthVoice::canPlaySound ( SynthesiserSound * sound)
override

◆ controllerMoved()

void krotos::KwidgetSynthVoice::controllerMoved ( int ,
int  )
override

◆ pitchWheelMoved()

void krotos::KwidgetSynthVoice::pitchWheelMoved ( int )
override

◆ renderNextBlock()

void krotos::KwidgetSynthVoice::renderNextBlock ( AudioBuffer< float > & buffer,
int startSample,
int numSamples )
override

◆ startNote()

void krotos::KwidgetSynthVoice::startNote ( int midiNote,
float velocity,
SynthesiserSound * sound,
int  )
override

◆ stopNote()

void krotos::KwidgetSynthVoice::stopNote ( float velocity,
bool allowTailOff )
override

Member Data Documentation

◆ m_processors

Array<KwidgetProcessorGraph*> krotos::KwidgetSynthVoice::m_processors
private

◆ m_voiceIndex

const int krotos::KwidgetSynthVoice::m_voiceIndex
private

◆ m_workingBuffer

AudioBuffer<float> krotos::KwidgetSynthVoice::m_workingBuffer
private

The documentation for this class was generated from the following files: