• 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: Brian Willoughby <email@hidden>
  • Date: Fri, 28 Dec 2007 01:30:28 -0800

Before anyone can think about helping you, Simon, you'll have to mention what sample code you have, and which API you're using for this oscillator. You can't send the data any way you want, you have to send it the way the API is expecting, so it helps to mention the API. If the API works with NSArray but not NSMutableArray, then perhaps you need another API. If the sample code source is available, then perhaps you could rewrite it to properly handle NSMutableArray or something else suitable.

Brian Willoughby
Sound Consulting


On Dec 27, 2007, at 16:26, Simon wrote:
I've been working on a Cocoa application that uses a simple Core Audio oscillator that I got from some sample code to play sound. I'm sending data to the oscillator in an array to generate sine waves, but I can't work out the syntax for how to do it.


Here's some of the code to show what I mean:

sinewavedef*	def = defptr; // get access to Sinewave's data
    int i;
    // load instance variables into registers
    double phase = def->phase;
    double amp = def->amp;
    double pan = def->pan;
    double freq = def->freq;
	NSArray * xArray = def->xArray;
	NSArray * xArrayz = def->xArrayz;

	double testArray[100][2] = def->testArray[100][2];

I seem to have no problem with NSArrays (though NMutableArray won't work), but I need to change the data in the arrays, so these are no good. I've tried all the variations of the last line I can think of, including the indeces or not including them, etc. And I can't find anything about it on the internet. I'm still pretty new to programming, so there's probably something really obvious I'm missing.

Can anyone help?

Hopefully, Simon

_______________________________________________
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: 
 >Loading arrays into register (From: "Simon" <email@hidden>)

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