setPan() on ofSoundPlayer not working?

Hi everyone,

I am loading and playing a sound sample:

  
  
ofSoundPlayer  insect;  
insect.loadSound("sounds/buizzzzzzz.wav");  
insect.setLoop(true);  
insect.play();  
  

Then when I get some mouse movement I want to pan the sample within the stereo image. So I do:

  
void testApp::mouseMoved(int x, int y ){  
	insect.setPan(ofMap(x, 0, ofGetScreenWidth(), 0, 1));  
}  

It seems like this should pan the sample with the x position of the mouse. Have also tried hard wiring values for the setPan() 0,1 etc. But always sounds the same.

Running latest OF under Mac OS 10.6.2 with xCode 3.2.2.

Any suggestions?

Rob

So if you do a setPan(0) or setPan(1) elsewhere, it doesn’t work?

Have you checked your hardware first? Do you have stereo panning in other applications?

Sorry that I don’t have an answer to your question, but I have yet another question based on what I saw in your code:

Where did you find the ofMap() function?

I’m starting to learn OF and yesterday I was searching for something like that (equivalent to processing’s map() function), but I could not find it at the documentation page.
Is there another place or just a bit looking around the .h files?

Thank you!
Hemoglobina

hey, that documentation is super old, but google keeps indexing it, the current one is here:

http://www.openframeworks.cc/documentation

Ouch! I feel so stupid! Google is not my friend anymore! :slight_smile:
Thanks arturo.

[quote author=“grimus”]So if you do a setPan(0) or setPan(1) elsewhere, it doesn’t work?

Have you checked your hardware first? Do you have stereo panning in other applications?[/quote]

OK so I checked the sample in quicktime while changing the balance control. Still sounds the same. Mono-ised the sample and stereo-ised it again to make sure the channels are the same. Still the same.

Did the same on another mac - works perfectly. Compiled the OF app and ran it on another mac - works perfectly!

The main mac I use is leased and the previous owner must have plugged some high energy input into the headphone and blown the left channel on the DSP or something.

SO, it works, OF had nothing to do with it and thanks everyone for your help!

Rob

Yea that map function is super useful. I use it all the time.

ROb