I have a class that I would like to have an envelop class created with it and only for it. I keep trying to construct an envelop inside it but can’t because new Env(this);
won’t work and gives a Constructor doesn’t exist error. Thoughts?
Here is the class code. SinOsc also doesn’t work so this doesn’t even run without the Env
import processing.sound.*;
class Biker {
Env env = new Env(this);
int xPos;
int yPos;
int xCord;
int yCord;
int diameter = 20;
//Chord frequency Ratio 1:1.2:1.5
float lowChord;
float midChord;
float highChord;
SinOsc[] chord = new SinOsc[3];
float attackTime = 0.001;
float sustainTime = 0.004;
float sustainLevel = 0.3;
float releaseTime = 0.4;
Biker(int xPosition, int yPosition, int index) {
xCord = xPosition;
yCord = yPosition;
//A1 base + (index * note offset)
lowChord = 55 * pow(1.059463094359, index);
midChord = 55 * pow(1.059463094359, index+3);
highChord = 55 * pow(1.059463094359, index+7);
print(this);
chord[0].freq(lowChord);
chord[0].amp(0.2);
chord[1].freq(midChord);
chord[1].amp(0.2);
chord[2].freq(highChord);
chord[2].amp(0.2);
}
void display() {
int xSpacing = width/sideLength;
int ySpacing = height/sideLength;
xPos = xCord*xSpacing+(xSpacing/2);
yPos = yCord*ySpacing+(ySpacing/2);
ellipse(xPos, yPos, diameter, diameter);
}
void playChord() {
for (int i = 0; i < 3; i++) {
chord[i].play();
// env.play(chord[i], attackTime, sustainTime, sustainLevel, releaseTime);
}
}
}