• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: On and off ramp for sine wave
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >On and off ramp for sine wave (From: "Anil Kumar Roy" <email@hidden>)

  • Prev by Date: Re: iTunes stuttering
  • Next by Date: Re: Bug in IOAudioStream?
  • Previous by thread: On and off ramp for sine wave
  • Next by thread: Targeting 10.2.x, 10.3x AND 10.4x
  • Index(es):
    • Date
    • Thread