Skip to content

Commit ba8907a

Browse files
committed
Merge branch 'master' of https://github.com/ffd8/xyscope
2 parents 16c2a2d + a3cc5a4 commit ba8907a

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

src/xyscope/XYscope.java

+37-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ public XYscope(PApplet theParent) {
9090
initMinim();
9191
setMixer();
9292
}
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+
}
93107

94108
/**
95109
* Initialize library in setup(), custom soundcard by String for XY.
@@ -120,7 +134,6 @@ public XYscope(PApplet theParent, int xyMixer) {
120134
setMixer(xyMixer);
121135
}
122136

123-
124137
/**
125138
* Initialize library in setup(), custom soundcard by String for XY, custom soundcard by String for Z.
126139
* <p>
@@ -262,6 +275,29 @@ private void setWaveTable(){
262275
waveZ.reset();
263276
}
264277
}
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+
}
265301

266302
/**
267303
* Check if z-axis waveform is being automatically drawn from added shapes.

0 commit comments

Comments
 (0)