1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/*
* Instrument_tone.java
*/
import org.tritonus.share.TDebug;
public class Instrument_tone
extends AbstractInstrument
{
private float a;
private float x;
private float y;
private float init;
public Instrument_tone()
{
a = 0.0F;
x = 0.0F;
y = 0.0F;
init = 0.0F;
}
// public void doIPass()
// {
// }
// public void doKPass()
// {
// }
public void doAPass(RTSystem rtSystem)
{
// TDebug.out("doAPass()");
a = 0.196307F;
if (init == 0.0F)
{
init = 1.0F;
x = 0.5F;
}
x = x - a * y;
y = y + a * x;
rtSystem.output(y);
}
}
/*** Instrument_tone.java ***/
|