Name

pan()

Class

SinOsc

Description

Move the sound in a stereo panorama.

Examples

  • import processing.sound.*;
    SinOsc sine;
    
    void setup() {
      size(640, 360);
      background(255);
        
      // Create the sine oscillator
      sine = new SinOsc(this);
      sine.play();
    }      
    
    void draw() {
      // Map mouseX from -1.0 to 1.0 for left to right
      sine.pan(map(mouseX, 0, width, -1.0, 1.0));
    }
    
    

Syntax

  • soundobject.pan(pos)

Parameters

  • pos(float)The panoramic position of this sound unit as a float from -1.0 (left) to 1.0 (right).

Return

  • void