• 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: Loading arrays into register
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading arrays into register


  • Subject: Re: Loading arrays into register
  • From: "tahome izwah" <email@hidden>
  • Date: Sat, 29 Dec 2007 09:52:45 +0100

I would second what Ian just said.

As for getting the project to compile and produce some meaningful
results - why don't you get rid of the arrays and create the sine wave
on the fly:

float mCounter;  // declare this as member in the class and set it to
0 before using it

// this should go where you need the sine wave, it produces one sample
of the sine wave at a time
float sine = sin(2.*M_PI*frequency*mCounter++/sampleRate + phase);

frequency is the frequency in Hz
phase is usually 0, unless you want to start the sine wave later in its period.
sampleRate is your playback sample rate

Note that the precision of sin() gets worse with increasing argument,
so your sine wave will start to distort after a couple of minutes. But
at least you have something to work with.

HTH,
--th
 _______________________________________________
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: 
 >Re: Loading arrays into register (From: Ian Kemmish <email@hidden>)

  • Prev by Date: Re: Loading arrays into register
  • Next by Date: Re: Loading arrays into register
  • Previous by thread: Re: Loading arrays into register
  • Next by thread: Re: Loading arrays into register
  • Index(es):
    • Date
    • Thread