|
-
Nov 11th, 2000, 03:28 PM
#1
Thread Starter
Fanatic Member
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.
-
Nov 11th, 2000, 03:40 PM
#2
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 11th, 2000, 04:07 PM
#3
Thread Starter
Fanatic Member
thanks. I'll see if this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|