• 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
A stupidly simple problem!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: A stupidly simple problem!
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Setting an aggregate device to appear to be stereo
  • Next by Date: Re: A stupidly simple problem!
  • Previous by thread: [DAFx-06] Registration: early-bird rate deadline is August 07, 2006
  • Next by thread: Re: A stupidly simple problem!
  • Index(es):
    • Date
    • Thread