Name

amp()

Class

TriOsc

Description

Change the amplitude/volume of this sound.

Examples

  • import processing.sound.*;
    TriOsc triangle;
    
    void setup() {
      size(640, 360);
      background(255);
        
      // Create triangle wave oscillator.
      triangle = new TriOsc(this);
      triangle.play();
      triangle.amp(0.5);
    }      
    
    void draw() {
    }
    
    

Syntax

  • soundobject.amp(amp)

Parameters

  • amp(float)A float value between 0.0 (complete silence) and 1.0 (full volume) controlling the amplitude/volume of this sound.

Return

  • void