-
Is there a way to oscilate the value of a variable from -x to +x at x cycles-per-second? Looking to form a symetrical sine wave if possible.
In case you're curious, this is for outputting to the soundcard. It seems that the data sent to the soundcard is used to manually vibrate the speaker. I'm interested on synthysizing a high-piched sine wave over through my soundcard.
BTW, I'm writing this for VB and QB. (Both display the sine wave, but only QB plays it on the soundcard) so no external dlls or ocxs please.
-
maybe this is the formula you want:
amplitude = Sin(6.283*X*t)*X
sinus reads radians in vb so therefore you see 2*pi is 6.283 and you multiply it with X to perform x cycles per second. t is specified in seconds as amplitude is a function of t. The curve will oscillate from -x to x due to the the *X outside sin since sin returns values between -1 and 1.
Hope this helped
-
thanks. I'll see if this helps