MCPcopy Create free account
hub / github.com/christophhart/HISE / renderVoice

Method renderVoice

hi_scripting/scripting/ScriptProcessorModules.cpp:600–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600void JavascriptPolyphonicEffect::renderVoice(int voiceIndex, AudioSampleBuffer &b, int startSample, int numSamples)
601{
602 if (auto n = getActiveNetwork())
603 {
604
605
606 float* channels[NUM_MAX_CHANNELS];
607
608 int numChannels = b.getNumChannels();
609 memcpy(channels, b.getArrayOfWritePointers(), sizeof(float*) * numChannels);
610
611 for (int i = 0; i < numChannels; i++)
612 channels[i] += startSample;
613
614 scriptnode::ProcessDataDyn d(channels, numSamples, numChannels);
615
616 if (checkPreSuspension(voiceIndex, d))
617 return;
618
619 scriptnode::DspNetwork::VoiceSetter vs(*n, voiceIndex);
620 n->getRootNode()->process(d);
621
622 checkPostSuspension(voiceIndex, d);
623
624 // overwrite the tailing with the voice index to cater in
625 // voice resetting calls...
626 isTailing = voiceData.containsVoiceIndex(voiceIndex);
627 }
628}
629
630void JavascriptPolyphonicEffect::startVoice(int voiceIndex, const HiseEvent& e)
631{

Callers 1

calculateBlockMethod · 0.45

Calls 5

getRootNodeMethod · 0.80
containsVoiceIndexMethod · 0.80
getNumChannelsMethod · 0.45
processMethod · 0.45

Tested by

no test coverage detected