Ess library...how to control parameters such as filter frequency, q and wave frequency from a variable...
in
Contributed Library Questions
•
6 months ago
Hi. I have just found Krister's Ess library. I would like to know how to control sound parameters from variables.
Does it work in the same way as Minim??
I have attempted a simple program changing the Q (resonance) of a square wave using a ControlP5 knob but I don't hear any change...
- // Change 'q.
- import krister.Ess.*;
- import controlP5.*;
- public int val;
- ControlP5 gui;
- AudioChannel myChannel;
- SquareWave sqr;
- LowPass myLowPass;
- Normalize myNormalize;
- Knob myKnobB;
- void setup() {
- size(256,200);
- // start up Ess
- Ess.start(this);
- gui=new ControlP5(this);
- // load "cell.aif" into a new AudioChannel
- myChannel=new AudioChannel();
- myChannel.initChannel(myChannel.frames(5000));
- myKnobB = gui.addKnob("knobValue",0,100,20,20,50);
- // apply a low pass filter
- myLowPass=new LowPass(960,-20,8);
- myLowPass.filter(myChannel);
- sqr=new SquareWave(480,.1);
- sqr.generate(myChannel,0,myChannel.frames(9000));
- // apply a second low pass filter
- myLowPass.frequency=480;
- myLowPass.gain=20;
- myLowPass.q=0.1;
- myLowPass.filter(myChannel);
- // normalize
- myNormalize=new Normalize();
- myNormalize.filter(myChannel);
- // play
- myChannel.play();
- }
- void draw() {
- // myChannel.play();
- // myLowPass.filter(myChannel);
- println(val);
- }
- // we are done, clean up Ess
- public void stop() {
- Ess.stop();
- super.stop();
- }
- int knobValue(int val)
- {
- myLowPass.q=val;
- return val;
Could someone please help me with this..?
1