@@ -90,6 +90,20 @@ public XYscope(PApplet theParent) {
90
90
initMinim ();
91
91
setMixer ();
92
92
}
93
+
94
+ /**
95
+ * Initialize library in setup(), use default system audio out setting.
96
+ *
97
+ * @param theParent PApplet to apply to, typically 'this'
98
+ * @param outMix AudioOutput to merge instance and of XYscope to
99
+ */
100
+ // * @example basic_shapes
101
+
102
+ public XYscope (PApplet theParent , AudioOutput outMix ) {
103
+ myParent = theParent ;
104
+ initMinim ();
105
+ setWaveTable (outMix );
106
+ }
93
107
94
108
/**
95
109
* Initialize library in setup(), custom soundcard by String for XY.
@@ -120,7 +134,6 @@ public XYscope(PApplet theParent, int xyMixer) {
120
134
setMixer (xyMixer );
121
135
}
122
136
123
-
124
137
/**
125
138
* Initialize library in setup(), custom soundcard by String for XY, custom soundcard by String for Z.
126
139
* <p>
@@ -262,6 +275,29 @@ private void setWaveTable(){
262
275
waveZ .reset ();
263
276
}
264
277
}
278
+
279
+ private void setWaveTable (AudioOutput outMix ){
280
+ tableX = Waves .randomNHarms (0 );
281
+ waveX = new Oscil (freq .x , amp .x , tableX );
282
+ tableX .setWaveform (shapeX );
283
+ waveX .patch (panX ).patch (outMix );
284
+
285
+ tableY = Waves .randomNHarms (0 );
286
+ waveY = new Oscil (freq .y , amp .y , tableY );
287
+ tableY .setWaveform (shapeY );
288
+ waveY .patch (panY ).patch (outMix );
289
+
290
+ waveX .reset ();
291
+ waveY .reset ();
292
+
293
+ if (zaxis ){
294
+ tableZ = Waves .randomNHarms (0 );
295
+ waveZ = new Oscil (freq .z , amp .z , tableZ );
296
+ tableZ .setWaveform (shapeZ );
297
+ waveZ .patch (outZ ); // need pan?? or gets full amp to both channels?
298
+ waveZ .reset ();
299
+ }
300
+ }
265
301
266
302
/**
267
303
* Check if z-axis waveform is being automatically drawn from added shapes.
0 commit comments