Name

freq()

Class

SqrOsc

Description

Sets the frequency of the oscillator.

Examples

  • import processing.sound.*;
    SqrOsc square;
    
    void setup() {
      size(640, 360);
      background(255);
      
      // Create square wave oscillator.
      square = new SqrOsc(this);
      square.play();
      square.freq(200);
    }      
    
    void draw() {
    }
    
    

Syntax

  • oscillator.freq(freq)
  • oscillator.freq(modulator)

Parameters

  • freq(float)the desired oscillator frequency in Hertz

Return

  • void