+ //addParameter(bounceamp = new BasicParameter("Amp", .5));
+ //addParameter(bouncerate = new BasicParameter("Rate", .5)); //ybounce.modulateDurationBy(bouncerate);
+ //addParameter(vibrationrate = new BasicParameter("vibration", 1000, 10000));
+ //addParameter(widthparameter = new BasicParameter("Width", .2));
+ //addModulator(xbounce = new SinLFO(model.xMax/3, 2*model.yMax/3, 2000)).trigger();
+ addModulator(ybounce= new SinLFO(model.yMax/3, 2*model.yMax/3, 240000)).trigger(); //bounce.modulateDurationBy
+
+ //addModulator(bounceamp); //ybounce.setMagnitude(bouncerate);
+ addModulator( vibration = new SinLFO( modelrad/15 - vibration_magnitude , modelrad/15 + vibration_magnitude, vperiod)).trigger(); //vibration.setPeriod(240000/lx.tempo.bpm());
+
+
+ }
+
+ // public Sphery(float f1xcenter, float f1ycenter, float f1zcenter, float vibration_magnitude, float vperiod)
+ // {
+ // this.f1xcenter = f1xcenter;
+ // this.f1ycenter = f1ycenter;
+ // this.f1zcenter = f1zcenter;
+ // this.vibration_magnitude = vibration_magnitude;
+ // this.vperiod = vperiod;
+ // addModulator(ybounce= new SinLFO(model.yMax/3, 2*model.yMax/3, 240000)).trigger(); //bounce.modulateDurationBy
+ // addModulator( vibration = new SinLFO( modelrad/10 - vibration_magnitude , modelrad/10 + vibration_magnitude, vperiod)).trigger(); //vibration.setPeriod(240000/lx.tempo.bpm());
+
+ // }
+
+ //for an ellipse
+// public Sphery(float f1xcenter, float f1ycenter, float f1zcenter, float f2xcenter, float f2ycenter, float f2zcenter,
+// float vibration_min, float vibration_max, float vperiod)
+
+// {
+// this.f1xcenter = f1xcenter;
+// this.f1ycenter = f1ycenter;
+// this.f1zcenter = f1zcenter;
+// this.f2xcenter = f2xcenter;
+// this.f2ycenter = f2ycenter;
+// this.f2zcenter = f2zcenter;
+// this.vibration_min = vibration_min;
+// this.vibration_max = vibration_max;
+// this.vperiod = vperiod;
+// //addModulator(xbounce = new SinLFO(model.xMax/3, 2*model.yMax/3, 2000)).trigger();
+// addModulator(ybounce).trigger();
+// addModulator( vibration = new SinLFO(vibration_min , vibration_max, lx.tempo.rampf())).trigger(); //vibration.modulateDurationBy(vx);
+// addParameter(widthparameter = new BasicParameter("Width", .1));
+// //addParameter(huespread = new BasicParameter("bonk", .2));
+
+// }
+
+public int c1c (float a) { return round(100*constrain(a,0,1)); }
+
+void setVibrationPeriod(double period){
+// to-do: make this conditional upon time signature
+
+this.vibration.setPeriod(period);
+}
+
+void setVibrationMagnitude(double mag){
+//to-do: make this optionally conditional upon decibel volume, frequency spectrum)
+this.vibration.setRange(-mag,mag);
+
+}
+
+
+float distfromcirclecenter(float px, float py, float pz, float f1x, float f1y, float f1z)
+{