Problems Patching Minim UGens
in
Contributed Library Questions
•
2 years ago
I'm struggling a bit with Minim's new UGen feature. Right now, I am simply using UGen effects (delay, band pass filter, and pan so far) to directly effect audio samples in the form of a FilePlayer UGen. However, I'm having difficulty patching and unpatching multiple effects. I'm basically doing:
FilePlayer song;
Pan pan;
BandPass bpf;
Delay delay;
AudioOutput out;
song.patch(pan).patch(out);
//no problems so far. Now enable bandpass.
pan.unpatch(out);
pan.patch(bpf).patch(out);
//still no problems. Let's disable it.
bpf.unpatch(out);
pan.unpatch(bpf);
pan.patch(out);
// good. Now for delay.
pan.unpatch(out);
pan.patch(delay).patch(out);
// sounds good. Now disable
delay.unpatch(out);
pan.unpatch(delay);
pan.patch(out);
At this point, it still sounds okay (no effects now), but if I repeat the process of patching to delay again, I get ArrayIndexOutOfBoundsException, with various array indexes each time. In fact, this Index error thing happens with delay no matter what if I have a delay time of over ~0.13 sec (which is pretty darn small), even on first patching. Changing my buffer size for FIlePlayer has no effect on this limit. This makes me think I'm doing something wrong. I thought that this form of patching should just work in a chain, so that if I wanted to put all effects on at once, I could do:
song.patch(pan).patch(bpf).patch(delay).patch(out);
and it would work, but it doesn't. How should I go about this? It seems like a simple thing to do. Also, what's the issue with the array overflows on delay?
Thanks in advance,
Karl
1