lfo->type = type;
static void init_lfo(lfo *lfo, int32 cycle, int type){	int32 i;	lfo->count = 0;	if(cycle < MIN_LFO_CYCLE_LENGTH) {cycle = MIN_LFO_CYCLE_LENGTH;}	lfo->cycle = cycle;	lfo->icycle = TIM_FSCALE((SINE_CYCLE_LENGTH - 1) / (double)cycle, 24) - 0.5;	if(lfo->type != type) {	/* generate waveform of LFO */		switch(type) {		case LFO_SINE:			for(i = 0; i < SINE_CYCLE_LENGTH; i++)				lfo->buf[i] = TIM_FSCALE((lookup_sine(i) + 1.0) / 2.0, 16);			break;		case LFO_TRIANGULAR:			for(i = 0; i < SINE_CYCLE_LENGTH; i++)				lfo->buf[i] = TIM_FSCALE((lookup_triangular(i) + 1.0) / 2.0, 16);			break;		default:			for(i = 0; i < SINE_CYCLE_LENGTH; i++) {lfo->buf[i] = TIM_FSCALE(0.5, 16);}			break;		}	}}