File: Instrument_tone.java

package info (click to toggle)
libtritonus-java 20070428-7
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,792 kB
  • ctags: 11,840
  • sloc: ansic: 53,846; java: 45,251; sh: 3,032; makefile: 1,189; xml: 820; cpp: 147
file content (58 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (8)
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 ***/