A stupidly simple problem!
A stupidly simple problem!
- Subject: A stupidly simple problem!
- From: "Simon" <email@hidden>
- Date: Thu, 3 Aug 2006 11:26:03 -0400 (EDT)
Hi,
I'm a novice programmer. I have been designing a sound programme in Cocoa, using Core Audio to create a simple oscillator.
I am trying to use an NSStepper to adjust the octave produced by the oscillator, but have run into a problem. The setting on the NSStepper representing the default octave is 0. To shift up one octave it goes to 1. To shift down -1. I then need to multiply the default frequency by 2 to the power of the NSStepper value.
I have two floats: octaveStepperValue (the setting on the NSStepper) and octave (the factor by which to multiply the frequency).
I tried:
octave = 2. ^ octaveStepperValue;
But the debugger keeps telling me that ^ is some kind of binary operator. I've looked everywhere for how to right 'to the power of' or the 'nth root of', but just can't find it.
Sorry for the really simple question. Does anyone know where I'm going wrong?
Thanks,
Simon
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
_______________________________________________
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