Name

freq()

Class

SinOsc

Description

Sets the frequency of the oscillator.

Examples

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

Syntax

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

Parameters

  • freq(float)the desired oscillator frequency in Hertz

Return

  • void