FL SDK question about Hybrid Generators and Voice_Render

Discuss how to use FL Studio

Return to “FL Studio Users Forum (Looptalk)”

Forum rules
Please read them here.
[You can only see part of this thread as you are not logged in to the forums]
IllusionCatalyst
Sun Feb 10, 2019 11:23 pm

x

FL SDK question about Hybrid Generators and Voice_Render

Hello Guys,

I am experimenting with every type of plug-in for FL Studio. I came across an unexpected behavior with Hybrid Generators and I would like to know if it is intended.

A Hybrid Generator calls the function:
int _stdcall Voice_Render( TVoiceHandle Handle, PWAV32FS DestBuffer, int &Length );
to let each individual triggered voice to render itself and write its output in DestBuffer.

From my understanding, the function should return either FVR_Ok or FVR_NoMoreData to let the Host know if it should either carry on or stop calling the Voice_Render function. Taking into account the full cycle of playing a note, the sequence of function calls should be:
  1. TVoiceHandle _stdcall TriggerVoice( PVoiceParams VoiceParams, intptr_t SetTag ); // once on key press
  2. int _stdcall Voice_Render( TVoiceHandle Handle, PWAV32FS DestBuffer, int& Length ); // multiple times while it returns FVR_Ok
  3. void _stdcall Voice_Release( TVoiceHandle Handle ); // once on key release
  4. int _stdcall Voice_Render( TVoiceHandle Handle, PWAV32FS DestBuffer, int& Length ); // multiple times until it returns FVR_NoMoreData
  5. void _stdcall Voice_Kill( TVoiceHandle Handle ); // once to allow resource destruction
The extra calls to Voice_Render after Voice_Release (Point 4) would allow for a Release Stage, where the voice can fade out. Once the overall volume drops to zero, the function can return FVR_NoMoreData to let the Host call the Voice_Kill.

The behavior I am seeing is that right after releasing the key, Voice_Release is called as expected, but after that Voice_Render is called only 3 times, regardless the return value, then Voice_Kill is called. If this is the intended behavior, it seems that there is no way to account for a Release Stage in a Hybrid Generator. Is it correct or am I missing something?

Thank you very much
Enrico


reflex
Site Admin
Mon Feb 11, 2019 3:44 pm

x

Re: FL SDK question about Hybrid Generators and Voice_Render

Please don't make any new hybrid generator plug...


reflex
Site Admin
Tue Feb 12, 2019 10:10 am

x

Re: FL SDK question about Hybrid Generators and Voice_Render

I'm afraid I don't have time to give any genera...


Return to “FL Studio Users Forum (Looptalk)”