Generating sound using HybridGen

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]
komorra
Thu Sep 09, 2010 2:15 pm

x

Generating sound using HybridGen

Hi. I'am continuing working on my first plugin. I have defined my Voice:

Code: Select all

struct komorraVoice{
	PVoiceParams params;
	int pos;
	int state;
	int HostTag;
};
Defined voice trigger:

Code: Select all

int __stdcall TkomorraFLGen::TriggerVoice(PVoiceParams VoiceParams,int SetTag)
{
	komorraVoice *Voice = new komorraVoice;
	Voice->HostTag = SetTag;
	Voice->params = VoiceParams;
	Voice->state = 1;
	return (TVoiceHandle)Voice;
}
,Voice release and kill:

Code: Select all

void __stdcall TkomorraFLGen::Voice_Release(TVoiceHandle Handle)
{
	((komorraVoice*)Handle)->state = 0;
}

void __stdcall TkomorraFLGen::Voice_Kill(TVoiceHandle Handle)
{
	delete (komorraVoice*)Handle;
}
And the main part, the sound generation:

Code: Select all

int __stdcall TkomorraFLGen::Voice_Render(TVoiceHandle Handle, PWAV32FS DestBuffer, int &Length)
{
	komorraVoice *Voice = (komorraVoice*)Handle;
	for(int la=0;la<Length;la++)
	{
		(*DestBuffer)[la][0]=(float)sin(la/3000.0f);
		(*DestBuffer)[la][1]=(float)sin(la/3000.0f);
	}
	return 0;
}
When I load my plugin in FL, I would to hear nice sine, but I'm hearing something like silent saw.
The sound is more silent when I increase 3000.0f value in sin function.
What is here wrong?

gol
Thu Sep 09, 2010 2:42 pm

x

I strongly advise you not to make an hybrid gen...

komorra
Thu Sep 09, 2010 2:45 pm

x

Ok. I realized that the samples may be too shor...

komorra
Thu Sep 09, 2010 2:47 pm

x

gol wrote:I strongly advise you not to make an ...

wizanda
Sun Feb 20, 2011 9:26 am

x

Has this now been switched off or the method ch...


Return to “FL Studio Users Forum (Looptalk)”