class sinePulse{ float circle;////////// float meter; float duration; float amp; int counter; float fundamental;//////////// float pitchNow; boolean sounding = false; boolean change; boolean ring; SineWave sine; sinePulse(int f, int m, int c){ circle = c; fundamental = f; change = false; meter = m; counter = 0; duration = meter / circle ; pitchNow = circle * fundamental; amp = 0.1; sine = new SineWave(pitchNow, 0, 44100); sine.portamento(900); out.addSignal(sine); } void changeCircle(int c){ change = true; circle = c; } void pulse(){ if(sounding){ counter--; } else { counter++; } if (counter < 0){ sounding = false; sine.setAmp(0); if(change){ duration = meter / circle ; pitchNow = circle * fundamental; amp = 0.1f / circle; sine.setFreq(pitchNow); change = false; } } if (counter > duration){ sounding = true; ring = true; sine.setAmp(amp); sine.setFreq(pitchNow); counter -= 5; } } }