/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* parelled comb filters and then mixed together and then finally send thru 3
* different allpass filters.
*
* @author Karl Helgason
*/
private final static class Delay {
private float[] delaybuffer;
Delay() {
delaybuffer = null;
}
if (delay == 0)
delaybuffer = null;
else
delaybuffer = new float[delay];
rovepos = 0;
}
if (delaybuffer == null)
return;
for (int i = 0; i < len; i++) {
float x = inout[i];
delaybuffer[rovepos] = x;
rovepos = 0;
}
}
}
private final static class AllPass {
private final float[] delaybuffer;
private final int delaybuffersize;
private float feedback;
delaybuffer = new float[size];
}
}
int delaybuffersize = this.delaybuffersize;
for (int i = 0; i < len; i++) {
if (++rovepos == delaybuffersize)
rovepos = 0;
}
}
int delaybuffersize = this.delaybuffersize;
for (int i = 0; i < len; i++) {
if (++rovepos == delaybuffersize)
rovepos = 0;
}
}
}
private final static class Comb {
private final float[] delaybuffer;
private final int delaybuffersize;
private float feedback;
delaybuffer = new float[size];
}
}
int delaybuffersize = this.delaybuffersize;
float filtertemp = this.filtertemp;
float filtercoeff1 = this.filtercoeff1;
float filtercoeff2 = this.filtercoeff2;
for (int i = 0; i < len; i++) {
// One Pole Lowpass Filter
+ (filtertemp * filtercoeff1);
if (++rovepos == delaybuffersize)
rovepos = 0;
}
this.filtertemp = filtertemp;
}
int delaybuffersize = this.delaybuffersize;
float filtertemp = this.filtertemp;
float filtercoeff1 = this.filtercoeff1;
float filtercoeff2 = this.filtercoeff2;
for (int i = 0; i < len; i++) {
// One Pole Lowpass Filter
+ (filtertemp * filtercoeff1);
if (++rovepos == delaybuffersize)
rovepos = 0;
}
this.filtertemp = filtertemp;
}
filtercoeff1 = val;
}
}
private float roomsize;
private float damp;
private float[] input;
private float[] out;
private float[] pre1;
private float[] pre2;
private float[] pre3;
private boolean denormal_flip = false;
private boolean mix = true;
private boolean dirty = true;
private float dirty_roomsize;
private float dirty_damp;
private float dirty_predelay;
private float dirty_gain;
private float samplerate;
private boolean light = true;
this.samplerate = samplerate;
// freqscale = 1.0/ freqscale;
int stereospread = 23;
}
/* Init other settings */
}
if (pin == 0)
}
if (pin == 0)
if (pin == 1)
}
}
private boolean silent = true;
public void processAudio() {
if(!silent_input)
silent = false;
if(silent)
{
if (!mix) {
}
return;
}
input = new float[numsamples];
if(denormal_flip)
for (int i = 0; i < numsamples; i++)
else
for (int i = 0; i < numsamples; i++)
{
{
pre1 = new float[numsamples];
pre2 = new float[numsamples];
pre3 = new float[numsamples];
}
if (!mix)
{
}
for (int i = 0; i < numsamples; i++)
{
float m = pre3[i];
left[i] += m + p;
right[i] += m - p;
}
}
else
{
out = new float[numsamples];
if (!mix)
}
if (!mix)
}
if (silent_input) {
silent = true;
for (int i = 0; i < numsamples; i++)
{
float v = left[i];
if(v > 1E-10 || v < -1E-10)
{
silent = false;
break;
}
}
}
}
long value) {
if (param == 0) {
if (value == 0) {
// Small Room A small size room with a length
// of 5m or so.
dirty_roomsize = (1.1f);
dirty_damp = (5000);
dirty_predelay = (0);
dirty_gain = (4);
dirty = true;
}
if (value == 1) {
// Medium Room A medium size room with a length
// of 10m or so.
dirty_roomsize = (1.3f);
dirty_damp = (5000);
dirty_predelay = (0);
dirty_gain = (3);
dirty = true;
}
if (value == 2) {
// Large Room A large size room suitable for
// live performances.
dirty_roomsize = (1.5f);
dirty_damp = (5000);
dirty_predelay = (0);
dirty_gain = (2);
dirty = true;
}
if (value == 3) {
// Medium Hall A medium size concert hall.
dirty_roomsize = (1.8f);
dirty_damp = (24000);
dirty_predelay = (0.02f);
dirty_gain = (1.5f);
dirty = true;
}
if (value == 4) {
// Large Hall A large size concert hall
// suitable for a full orchestra.
dirty_roomsize = (1.8f);
dirty_damp = (24000);
dirty_predelay = (0.03f);
dirty_gain = (1.5f);
dirty = true;
}
if (value == 8) {
// Plate A plate reverb simulation.
dirty_roomsize = (1.3f);
dirty_damp = (2500);
dirty_predelay = (0);
dirty_gain = (6);
dirty = true;
}
} else if (param == 1) {
dirty = true;
}
}
}
}
public void processControlLogic() {
if (dirty) {
dirty = false;
}
}
}
}
}
}
if (damp > 1)
damp = 1;
if (damp < 0)
damp = 0;
// damp = value * 0.4f;
}
}
{
}
}