Re: Simple wave generating?
Re: Simple wave generating?
- Subject: Re: Simple wave generating?
- From: Urs Heckmann <email@hidden>
- Date: Wed, 28 Jan 2004 14:21:28 +0100
Hi Joost,
try this:
float phase += frequency/samplerate; // frequency i.e 440.0f,
samplerate i.e. 48000.f
if ( phase >= 1.f ) phase -= 1.f;
float sinOutput = sin( 2.0f * PI * phase ); // PI = 3.14....
float sawOutput = 2.f * phase - 1.f;
where phase must be stored globally somewhere (not reinitialized each
iteration)...
more sophisticated stuff: www.musicdsp.org
Cheers,
;) Urs
Am Mittwoch, 28.01.04, um 13:57 Uhr (Europe/Berlin) schrieb Joost
Markerink:
Hello,
I'm sorry for the stupid question(newBee), but...
Is there an easy way (one/two liner) to generate a saw/sine wave with
of a specific frequency?
(Cocoa developer tries to do C tricks)
Joost Markerink
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.