1 2 3// 4// instr tone 5// plays a 1kHz sine wave 6// 7 8instr tone () 9 10{ 11 12 // variable declaration 13 14 asig a, x, y, init; 15 16 // computing starts here 17 18 a = 0.196307; 19 20 if (init == 0) 21 { 22 init = 1; 23 x = 0.5; 24 } 25 26 x = x - a*y; 27 y = y + a*x; 28 29 output(y); 30 31} 32