mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
defaulted start values for SoundObject
updated + reorganized examples changed process() to analyze for analyzers changed play() to process() for effects
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
This is a simple WhiteNoise generator. It can be started with .play(float amp).
|
||||
In this example it is started and stopped by clicking into the renderer window.
|
||||
*/
|
||||
|
||||
import processing.sound.*;
|
||||
|
||||
Sound stream;
|
||||
WhiteNoise noise;
|
||||
|
||||
float amp=0.0;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the noise generator
|
||||
stream = new Sound(this);
|
||||
noise = new WhiteNoise(this);
|
||||
noise.play();
|
||||
}
|
||||
|
||||
void draw() {
|
||||
// Map mouseX from 0.0 to 1.0 for amplitude
|
||||
noise.amp(map(mouseX, 0, 350, 0.0, 1.0));
|
||||
|
||||
// Map mouseY from -1.0 to 1.0 for left to right
|
||||
noise.pan(map(mouseY, 0, 350, -1.0, 1.0));
|
||||
}
|
||||
@@ -11,7 +11,7 @@ Sound stream;
|
||||
Pulse pulse;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
size(640,360);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the pulse wave oscillator
|
||||
@@ -30,4 +30,3 @@ void draw() {
|
||||
// Map mouseY from 0.0 to 0.5 for amplitude
|
||||
pulse.width(map(mouseY, 0, height, 0.0, 1.0));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Sound stream;
|
||||
SawOsc saw;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
size(640, 360);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the sine oscillator.
|
||||
|
||||
@@ -14,7 +14,7 @@ float amp=0.5;
|
||||
float pos;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
size(640, 360);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the sine oscillator.
|
||||
|
||||
@@ -10,7 +10,7 @@ Sound stream;
|
||||
SqrOsc sqr;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
size(640,360);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the sine oscillator.
|
||||
|
||||
@@ -10,7 +10,7 @@ Sound stream;
|
||||
TriOsc tri;
|
||||
|
||||
void setup() {
|
||||
size(350,350);
|
||||
size(640,360);
|
||||
background(255);
|
||||
|
||||
// Create and start the sound renderer and the sine oscillator.
|
||||
|
||||
Reference in New Issue
Block a user