Class Name

SqrOsc

Description

This is a simple Square Wave Oscillator.

Examples

  • import processing.sound.*;
    SqrOsc square;
    
    void setup() {
      size(640, 360);
      background(255);
      
      // Create square wave oscillator.
      square = new SqrOsc(this);
      square.play();
    }
    
    void draw() {
    	//the image is just for informative purposes
    	//on how the soundwave looks
    }
    
    
    Image output for example 1

Constructors

  • SqrOsc(parent)

Parameters

  • parent(PApplet)typically use "this"

Methods

  • amp()Change the amplitude/volume of this sound.
  • freq()Sets the frequency of the oscillator.
  • pan()Move the sound in a stereo panorama.
  • play()Starts the oscillator
  • set()Set multiple parameters at once
  • stop()Stop the oscillator from playing back