Processing stereo volume control using sound library

I want to control PC stereo volume control, the following code is doing the same but both the channels are taking the save volume gain.

Q: How do I change the volume of individual channels?

Processing Code:

import processing.sound.*;
SoundFile file;
Sound s;
float val = 0.0;
float phase = 1.0;

void setup() {
  size(640, 360);
  // Load a soundfile from the /data folder of the sketch and play it back
  file = new SoundFile(this, "song.mp3");;
  s = new Sound(this);

void draw() {
  val = val + (phase*0.001);
  if (val > 1.0){
    phase = -1.0;
  else if (val < 0.0){
    phase = 1.0;

processing SOUND lib might not have that feature now,
but check on MINIM
also find:
/ Files / Examples / Contributed Libraries / Minim / Synthesis / panExample /

I agree that minim is the way to go for stereo.

For the Processing Sound library, according to the reference (untested), if your sound is mono, you can set the stereo ratio with pan:

Thanks, good suggestion, Its working for me.

Thanks its good suggestion.