Skip to content

Instantly share code, notes, and snippets.

@carlossaraiva
Created July 11, 2014 16:22
Show Gist options
  • Save carlossaraiva/afa75b99fd18fd507205 to your computer and use it in GitHub Desktop.
Save carlossaraiva/afa75b99fd18fd507205 to your computer and use it in GitHub Desktop.
A simple somewhat Theremim using Beads/Processing.
import beads.*;
AudioContext ac;
WavePlayer wp;
Gain g;
Glide gainGlide;
Glide frequencyGlide;
void setup()
{
size(800, 600);
ac = new AudioContext();
gainGlide = new Glide(ac, 0.0, 50);
frequencyGlide = new Glide(ac, 20, 50); //20 hz
wp = new WavePlayer(ac, frequencyGlide, Buffer.SINE);
g= new Gain(ac, 1, gainGlide);
g.addInput(wp);
ac.out.addInput(g);
ac.start();
background(0);
}
void draw()
{
gainGlide.setValue(mouseX/ (float)width);
frequencyGlide.setValue(mouseY);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment