0
0

Hi,
I want to do an application in Delphi that generates a Sinuswave.
The Frequency of the Sinus is altered by a joystick:
A Joystick controlled oscillator.

Can I do this using FMod?
And if yes – how?

Thanks
Jogi

  • You must to post comments
0
0

Take a look in the “samplesdelphi\stream2” folder, there is something similar :)

  • You must to post comments
0
0

Thanks,

I had a look at it.
But I do not understand some things:

<<<<<<

while Count < (Len shr 2) do { >>2 = 16bit stereo (4 bytes per sample) }
begin
PSmallInt(Buffer)^ := Trunc(Sin(Time1) * JoyY); { Left channel }
Inc(Buffer, 2);
PSmallInt(Buffer)^ := Trunc(Sin(Time2) * JoyZ); { Right channel }
Inc(Buffer, 2);

    Time1 := Time1 + 0.1 + Velocity1;
    Time2 := Time2 + 0.142 + Velocity2;
    Velocity1 := Velocity1 + (Sin(Time1) * 0.02);
    Velocity2 := Velocity2 + (Sin(Time2) * 0.02);

Inc(Count);
end;

>>>>>>

I found, where I can alter the Volume: See JoyY and JoyZ above.

But how can I change the Frequency of the Sinus?
Where and how to put my JoyX?

I tried a little bit, but it was without success.

Can anyone help me?

Thanks
Jogi :(

  • You must to post comments
0
0

You can change the frequency without a DSP callback using [url=http://www.fmod.org/docs/HTML/FSOUND_SetFrequency.html:3n3pqas6]FSOUND_SetFrequency[/url:3n3pqas6].

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.