Re: On and off ramp for sine wave
Re: On and off ramp for sine wave
- Subject: Re: On and off ramp for sine wave
- From: Phil Brayshaw <email@hidden>
- Date: Thu, 18 Aug 2005 12:34:07 +0100
Anil, I'm not a core audio expert and may have misunderstood your
question, but wouldn't it be as simple as calling it once for each
sample you have to render (assuming you're expecting to render at
48khz)?
When you get informed of a note on, keep a record of the sample number
for the event. When you get requested to render to a buffer, call your
method for each sample to render (or just those after the sample of the
note on event). Multiply the result by the sine wave to get the desired
result.
This should be a lot simpler than trying to get timer events at 48khz
and attempting to buffer the results till you need to render.
If the sample rate for the rendering is 44.1khz and your method needs
to be called at 48khz then you may need to interpolate the results to
match the render rate. Or by attempting to change the output volume
48000 times a second.
ph.
Anil Kumar Roy wrote:
Hi,
I've been using the sine wave example from AudioSynth for my
application. I want to add a ramping feature to this example.
What I mean is that when I hit play, the amplitude increases over a 25
millisecond period, to the desired amplitude level. The rise in
amplitude will be determined by a function I already have(cosine
based). However this function needs to get called 48000 times every
second, of course it will work only for the first 25 milliseconds but,
the frequency has to be the same.
Each time it gets called, my function will raise the amplitude a little
more, until 25 milliseconds by when the amplitude will have reached the
desired level.
Can someone please tell me how I can get this function to be called at
the desired rate?
Any help is really appreciated.
Thanks a lot.
Anil.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden