當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Processing BandPass.set()用法及代碼示例

Processing, 類BandPass中的set()用法介紹。

用法

  • .set(freq, bw)

參數

  • freq (float) 設置頻率
  • bw (float) 設置帶寬

返回

  • void

說明

使用一種方法設置濾波器的頻率和帶寬。

例子

import processing.sound.*;

WhiteNoise noise;
BandPass bandPass;

void setup() {
  size(640,360);
  background(255);
    
  // Create a noise generator and a bandpass filter
  noise = new WhiteNoise(this);
  bandPass = new BandPass(this);    

  // start the noise generator and the filter
  noise.play(0.5);
  bandPass.process(noise);
}      

void draw() {
}

void mousePressed() {
  float freq=1000;
  float bw=80;
  bandPass.set(freq, bw);
}

相關用法


注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 BandPass.set()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。