void multigrain_dsp_free(t_multigrain *x)
{
	dsp_free((t_pxobject *)x);
	t_freebytes(x->grains, MAXGRAINS * sizeof(t_grain));
	t_freebytes(x->pitchscale, MAXSCALE * sizeof(float));
    t_freebytes(x->changroup, x->output_channels * sizeof(long));
}
Exemple #2
0
static void specBrightness_tilde_bang(t_specBrightness_tilde *x)
{
    int i, j, window, window_half, bang_sample, bin_boundary;
    float dividend, divisor, brightness;
    t_sample *signal_R, *signal_I;
	double current_time;

    window = x->window;
    window_half = window*0.5;

	// create local memory
	signal_R = (t_sample *)getbytes(0);
	signal_I = (t_sample *)getbytes(0);
	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));
	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));
	
    bin_boundary = specBrightness_tilde_nearest_bin_index(x->freq_boundary, x->bin_freqs);  // hard-coded based on 1200, but can use nearest_bin_freq function later
    
	current_time = clock_gettimesince(x->last_dsp_time);
	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round

	if (bang_sample < 0)
        bang_sample = 0;
    else if ( bang_sample >= x->n )
        bang_sample = x->n - 1;
            
	// construct analysis window using bang_sample as the end of the window
	for(i=0, j=bang_sample; i<window; i++, j++)
		signal_R[i] = x->signal_R[j];
	
	specBrightness_tilde_hann(window, signal_R, x->hann);
	mayer_realfft(window, signal_R);
	specBrightness_tilde_realfft_unpack(window, window_half, signal_R, signal_I);
	specBrightness_tilde_abs(window_half, signal_R, signal_I);
	
// 	if(x->normalize)
// 		specBrightness_tilde_normal(window_half, signal_R);

	dividend=0;
	divisor=0;
	brightness=0;
	
	for(i=bin_boundary; i<window_half; i++)
		dividend += signal_R[i];

	for(i=0; i<window_half; i++)
		divisor += signal_R[i];
	
	if(divisor==0)
		divisor=1;
		
	brightness = dividend/divisor;
		
	outlet_float(x->x_brightness, brightness);

	// free local memory
	t_freebytes(signal_R, window * sizeof(t_sample));
	t_freebytes(signal_I, window_half * sizeof(t_sample));
}
Exemple #3
0
void  getonset_free(t_getonset *x) {
	if (x->Buf1) t_freebytes(x->Buf1, x->BufSize * sizeof(float));
	if (x->Buf2) t_freebytes(x->Buf2, x->BufSize * sizeof(float));
	if (x->BufFFT) t_freebytes(x->BufFFT, x->FFTSize * sizeof(float));
	if (x->memFFT) t_freebytes(x->memFFT, CMAX * x->FFTSize * sizeof(float));
	freeobject((t_object *)x->g_clock);
	dsp_free((t_pxobject *)x);
}
Exemple #4
0
static void specCentroid_tilde_free(t_specCentroid_tilde *x)
{
	// free the input buffer memory
    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));

	// free the hann window memory
    t_freebytes(x->hann, x->window*sizeof(float));
}
Exemple #5
0
static void pique_free(t_pique *x)
{
    int n = x->x_n;
    t_freebytes(x->x_freq, n * sizeof(*x->x_freq));
    t_freebytes(x->x_amp, n * sizeof(*x->x_amp));
    t_freebytes(x->x_ampre, n * sizeof(*x->x_ampre));
    t_freebytes(x->x_ampim, n * sizeof(*x->x_ampim));
}
void oscil_dsp_free(t_oscil *x)
{

	t_freebytes(x->wavetable, x->table_length * sizeof(float));
	t_freebytes(x->old_wavetable, x->table_length * sizeof(float));
	t_freebytes(x->harmonic_weights, OSCIL_MAXIMUM_HARMONICS * sizeof(float));
	t_freebytes(x->harmonic_phases, OSCIL_MAXIMUM_HARMONICS * sizeof(float));
}
Exemple #7
0
void resample_free(t_resample *x)
{
  if (x->s_n) t_freebytes(x->s_vec, x->s_n*sizeof(*x->s_vec));
  if (x->coefsize) t_freebytes(x->coeffs, x->coefsize*sizeof(*x->coeffs));
  if (x->bufsize) t_freebytes(x->buffer, x->bufsize*sizeof(*x->buffer));

  x->s_n = x->coefsize = x->bufsize = 0;
  x->s_vec = x->coeffs = x->buffer  = 0;
}
Exemple #8
0
void  centroid_free(t_centroid *x) {
	if (x->Buf1) t_freebytes(x->Buf1, x->BufSize * sizeof(float));
	if (x->Buf2) t_freebytes(x->Buf2, x->BufSize * sizeof(float));
	if (x->BufFFT) t_freebytes(x->BufFFT, x->FFTSize * sizeof(float));
	if (x->WindFFT) t_freebytes(x->WindFFT, x->FFTSize * sizeof(float));
	if (x->memFFT) t_freebytes(x->memFFT, CMAX * x->FFTSize * sizeof(float));
	freeobject((t_object *)x->c_clock);
	dsp_free((t_pxobject *)x);
}
Exemple #9
0
static void specCentroid_tilde_bang(t_specCentroid_tilde *x)
{
    int i, j, window, window_half, bang_sample;
    float dividend, divisor, centroid;
    t_sample *signal_R, *signal_I;
	double current_time;

    window = x->window;
    window_half = window*0.5;

	// create local memory
	signal_R = (t_sample *)getbytes(0);
	signal_I = (t_sample *)getbytes(0);
	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));
	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));
    
	current_time = clock_gettimesince(x->last_dsp_time);
	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round

	if (bang_sample < 0)
        bang_sample = 0;
    else if ( bang_sample >= x->n )
        bang_sample = x->n - 1;
            
	// construct analysis window using bang_sample as the end of the window
	for(i=0, j=bang_sample; i<window; i++, j++)
		signal_R[i] = x->signal_R[j];
	
	specCentroid_tilde_hann(window, signal_R, x->hann);
	mayer_realfft(window, signal_R);
	specCentroid_tilde_realfft_unpack(window, window_half, signal_R, signal_I);
	specCentroid_tilde_abs(window_half, signal_R, signal_I);
	
// 	if(x->normalize)
// 		specCentroid_tilde_normal(window_half, signal_R);

	dividend=0;
	divisor=0;
	centroid=0;
	
	for(i=0; i<window_half; i++)
		dividend += signal_R[i]*(i*(x->sr/window));  // weight by bin freq

	for(i=0; i<window_half; i++)
		divisor += signal_R[i];
		
	if(divisor==0) divisor = 1; // don't divide by zero
	
	centroid = dividend/divisor;
		
	outlet_float(x->x_centroid, centroid);

	// free local memory
	t_freebytes(signal_R, window * sizeof(t_sample));
	t_freebytes(signal_I, window_half * sizeof(t_sample));
}
Exemple #10
0
static void cepstrum_tilde_bang(t_cepstrum_tilde *x)
{
    int i, j, window, window_half, bang_sample;
   	t_atom *listOut;
    t_sample *signal_R, *signal_I;
	double current_time;

    window = x->window;
    window_half = window*0.5;

   	signal_R = (t_sample *)getbytes(0);
	signal_I = (t_sample *)getbytes(0);
	listOut = (t_atom *)getbytes(0);
	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));
	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));
	listOut = (t_atom *)t_resizebytes(listOut, 0, ((int)x->window*0.5)*sizeof(t_atom));
	
	current_time = clock_gettimesince(x->last_dsp_time);
	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round

	if (bang_sample < 0)
        bang_sample = 0;
    else if ( bang_sample >= x->n )
        bang_sample = x->n - 1;
            
	// construct analysis window using bang_sample as the end of the window
	for(i=0, j=bang_sample; i<window; i++, j++)
		signal_R[i] = x->signal_R[j];
	
	cepstrum_tilde_hann(window, signal_R, x->hann);
	mayer_realfft(window, signal_R);
	cepstrum_tilde_realfft_unpack(window, window_half, signal_R, signal_I);
	cepstrum_tilde_abs(window_half, signal_R, signal_I);
	
	if(x->normalize)
		cepstrum_tilde_normal(window_half, signal_R);
	
	cepstrum_tilde_log(window_half, signal_R);

	// fill out the negative frequencies
	for(i=0; i<window_half; i++)
		signal_I[i] = signal_R[i];
//		signal_I[i] = 0.0; // or we could zero them out...
		
	cepstrum_tilde_realifft(window, window_half, signal_R, signal_I);

				
	for(i=0; i<window_half; i++)
		SETFLOAT(listOut+i, signal_R[i]);

	outlet_list(x->x_featureList, 0, window_half, listOut);

	t_freebytes(signal_R, window * sizeof(t_sample));
	t_freebytes(signal_I, window_half * sizeof(t_sample));
	t_freebytes(listOut, window_half * sizeof(t_atom));
}
Exemple #11
0
void pitcher_free(t_pitcher *x) {
	
	if (x->ringBufSize != 0) {
		t_freebytes(x->inputRingBuf, (long) (x->ringBufSize * sizeof(float)));
	}	
	if (x->ringBufSize != 0) {
		t_freebytes(x->outputRingBuf, (long) (x->ringBufSize * sizeof(float)));
	}	
	dsp_free(&(x->x_obj));
}
Exemple #12
0
void namelist_free(t_namelist *listwas)
{
    t_namelist *nl, *nl2;
    for (nl = listwas; nl; nl = nl2)
    {
        nl2 = nl->nl_next;
        t_freebytes(nl->nl_string, strlen(nl->nl_string) + 1);
        t_freebytes(nl, sizeof(*nl));
    }
}
Exemple #13
0
static void bfcc_tilde_free(t_bfcc_tilde *x)
{
	int i;
	
	// free the input buffer memory
    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));

	// free the blackman window memory
    t_freebytes(x->blackman, x->window*sizeof(float));

	// free the cosine window memory
    t_freebytes(x->cosine, x->window*sizeof(float));

	// free the hamming window memory
    t_freebytes(x->hamming, x->window*sizeof(float));

	// free the hann window memory
    t_freebytes(x->hann, x->window*sizeof(float));
    
	// free the bfcc memory
    t_freebytes(x->bfcc, x->num_filters*sizeof(float));
       
    // free the filterbank memory
	for(i=0; i<x->num_filters; i++)
		t_freebytes(x->x_filterbank[i].filter, x->x_filterbank_sizes[i]*sizeof(float));
    
	t_freebytes(x->x_filterbank, x->num_filters*sizeof(t_filter));

	// free the indices memory
    t_freebytes(x->x_indices, x->num_filters*sizeof(t_indices));
}
Exemple #14
0
static void specBrightness_tilde_free(t_specBrightness_tilde *x)
{
	// free the input buffer memory
    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));

	// free the hann window memory
    t_freebytes(x->hann, x->window*sizeof(float));

	// free the bin freq memory
    t_freebytes(x->bin_freqs, x->window*sizeof(float));
}
Exemple #15
0
static void magSpec_tilde_free(t_magSpec_tilde *x)
{
	// free the input buffer memory
    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));

	// free the window memory
	t_freebytes(x->blackman, x->window*sizeof(t_float));
	t_freebytes(x->cosine, x->window*sizeof(t_float));
	t_freebytes(x->hamming, x->window*sizeof(t_float));
	t_freebytes(x->hann, x->window*sizeof(t_float));
}
Exemple #16
0
static void nearestPoint_free(t_nearestPoint *x)
{
	int i;
		
	for(i=0; i<x->numPoints; i++)
		t_freebytes(x->x_coordinates[i].coordinate, x->dimensions*sizeof(t_float));
	
	t_freebytes(x->x_coordinates, x->numPoints*sizeof(t_coordinate));
	
	t_freebytes(x->x_input, x->dimensions*sizeof(t_float));
}
Exemple #17
0
static void udpsend_tilde_free(t_udpsend_tilde* x)
{
    udpsend_tilde_disconnect(x);

    /* free the memory */
    if (x->x_cbuf)t_freebytes(x->x_cbuf, x->x_cbufsize);
    if (x->x_myvec)t_freebytes(x->x_myvec, sizeof(t_int) * (x->x_ninlets + 3));

    clock_free(x->x_clock);

    pthread_mutex_destroy(&x->x_mutex);
}
Exemple #18
0
void fft_free(t_fft *x)
{
	if (x->f_realin)
		t_freebytes(x->f_realin,x->f_points * sizeof(float));
	if (x->f_imagin)
		t_freebytes(x->f_imagin,x->f_points * sizeof(float));
	if (x->f_realout)
		t_freebytes(x->f_realout,x->f_points * sizeof(float));
	if (x->f_imagout)
		t_freebytes(x->f_imagout,x->f_points * sizeof(float));
	dsp_free((t_pxobject *)x);
	if (fts_mode)
		freeobject(x->f_clock);
}
Exemple #19
0
void fft_free(t_fft *x)
{
	if (x->x_realin)
		t_freebytes(x->x_realin,x->x_fftsize * sizeof(float));
	if (x->x_imagin)
		t_freebytes(x->x_imagin,x->x_fftsize * sizeof(float));
	if (x->x_realout)
		t_freebytes(x->x_realout,x->x_fftsize * sizeof(float));
	if (x->x_imagout)
		t_freebytes(x->x_imagout,x->x_fftsize * sizeof(float));
	if (x->x_window)
		t_freebytes(x->x_window,x->x_fftsize * sizeof(float));
	dsp_free((t_pxobject *)x);

}
Exemple #20
0
void stft_free(t_stft *x)
{
	if (x->x_in)
		t_freebytes(x->x_in,x->x_fftsize * sizeof(float));
	if (x->x_out)
		t_freebytes(x->x_out,x->x_fftsize * sizeof(float));
	if (x->x_window)
		t_freebytes(x->x_window,x->x_fftsize * sizeof(float));	
	if (x->x_sdifbuf)
		t_freebytes(x->x_sdifbuf,x->x_sdifbufsize * sizeof(t_complex));
	//if (x->x_twiddle) 
	//	t_freebytes(x->x_twiddle, CMAX * x->x_fftsize * sizeof(float));
	dsp_free((t_pxobject *)x);

}
Exemple #21
0
static void zeroCrossing_tilde_bang(t_zeroCrossing_tilde *x)
{
    int i, j, window, bang_sample;
    float crossings;
    t_sample *signal_R;
	double current_time;

    window = x->window;

	signal_R = (t_sample *)getbytes(0);
	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window * sizeof(t_sample));
    
	current_time = clock_gettimesince(x->last_dsp_time);
	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round

	if (bang_sample < 0)
        bang_sample = 0;
    else if ( bang_sample >= x->n )
        bang_sample = x->n - 1;
            
	// construct analysis window using bang_sample as the end of the window
	for(i=0, j=bang_sample; i<window; i++, j++)
		signal_R[i] = x->signal_R[j];

	
	crossings=0;
	
	crossings = zeroCrossing_tilde_zero_crossing_rate(window, signal_R);
		
	outlet_float(x->x_crossings, crossings);

	// free local memory
    t_freebytes(signal_R, window*sizeof(t_sample));
}
Exemple #22
0
static void gstub_dis(t_gstub *gs)
{
    int refcount = --gs->gs_refcount;
    if ((!refcount) && gs->gs_which == GP_NONE)
        t_freebytes(gs, sizeof (*gs));
    else if (refcount < 0) bug("gstub_dis");
}
static void pack_bang(t_pack *x)
{
    int i, reentered = 0, size = x->x_n * sizeof (t_atom);
    t_gpointer *gp;
    t_atom *outvec;
    for (i = x->x_nptr, gp = x->x_gpointer; i--; gp++)
    	if (!gpointer_check(gp, 1))
    {
    	pd_error(x, "pack: stale pointer");
    	return;
    }
    	/* reentrancy protection.  The first time through use the pre-allocated
	x_outvec; if we're reentered we have to allocate new memory. */
    if (!x->x_outvec)
    {
    	    /* LATER figure out how to deal with reentrancy and pointers... */
    	if (x->x_nptr)
	    post("pack_bang: warning: reentry with pointers unprotected");
	outvec = t_getbytes(size);
	reentered = 1;
    }
    else
    {
    	outvec = x->x_outvec;
	x->x_outvec = 0;
    }
    memcpy(outvec, x->x_vec, size);
    outlet_list(x->x_obj.ob_outlet, &s_list, x->x_n, outvec);
    if (reentered)
    	t_freebytes(outvec, size);
    else x->x_outvec = outvec;
}
Exemple #24
0
static void vinlet_free(t_vinlet *x)
{
    canvas_rminlet(x->x_canvas, x->x_inlet);
    if (x->x_buf)
        t_freebytes(x->x_buf, x->x_bufsize * sizeof(*x->x_buf));
    resample_free(&x->x_updown);
}
Exemple #25
0
void conv_tilde_free(t_conv_tilde *x)
{
	#ifdef THREADS
		int rc = pthread_join(x->childthread, NULL);
		if (rc != 0 )
			post("conv~: pthread_join() error %d.", rc);
	#endif

	/* Free channel variable arrays. */
	//free(x->parameters);
	free(x->input_rw_ptr);
	free(x->ir_end_ptr);
	free(x->ir_frames);
	free(x->frames_stored);
	free(x->irlength);
	free(x->ircount);
	free(x->ircount_prev);

	/* Free fft plans and associated arrays. */
	conv_tilde_free_fft_plans(x);

	/* free the dsp vector */
	if (x->x_myvec)
		t_freebytes(x->x_myvec, sizeof(t_int) * (x->all_channels + 3));
}
Exemple #26
0
static void vline_tilde_float(t_vline *x, t_float f)
{
    t_time timenow = clock_gettimesince(x->x_referencetime);
    t_sample inlet1 = (x->x_inlet1 < 0 ? 0 : (t_sample)x->x_inlet1);
    t_sample inlet2 = (t_sample) x->x_inlet2;
    t_time starttime = timenow + inlet2;
    t_vseg *s1, *s2, *deletefrom = 0,
    	*snew = (t_vseg *)t_getbytes(sizeof(*snew));
    if (PD_BADFLOAT(f))
	f = 0;

    	/* negative delay input means stop and jump immediately to new value */
    if (inlet2 < 0)
    {
    	vline_tilde_stop(x);
	x->x_value = ftofix(f);
	return;
    }
    	/* check if we supplant the first item in the list.  We supplant
	an item by having an earlier starttime, or an equal starttime unless
	the equal one was instantaneous and the new one isn't (in which case
	we'll do a jump-and-slide starting at that time.) */
    if (!x->x_list || x->x_list->s_starttime > starttime ||
    	(x->x_list->s_starttime == starttime &&
	    (x->x_list->s_targettime > x->x_list->s_starttime || inlet1 <= 0)))
    {
    	deletefrom = x->x_list;
	x->x_list = snew;
    }
    else
    {
    	for (s1 = x->x_list; (s2 = s1->s_next); s1 = s2)
	{
    	    if (s2->s_starttime > starttime ||
    		(s2->s_starttime == starttime &&
		    (s2->s_targettime > s2->s_starttime || inlet1 <= 0)))
	    {
    		deletefrom = s2;
		s1->s_next = snew;
		goto didit;
	    }
	}
	s1->s_next = snew;
	deletefrom = 0;
    didit: ;
    }
    while (deletefrom)
    {
    	s1 = deletefrom->s_next;
	t_freebytes(deletefrom, sizeof(*deletefrom));
	deletefrom = s1;
    }
    snew->s_next = 0;
    snew->s_target = f;
    snew->s_starttime = starttime;
    snew->s_targettime = starttime + inlet1;
    x->x_inlet1 = x->x_inlet2 = 0;
}
Exemple #27
0
static void vline_tilde_stop(t_vline *x)
{
    t_vseg *s1, *s2;
    for (s1 = x->x_list; s1; s1 = s2)
    	s2 = s1->s_next, t_freebytes(s1, sizeof(*s1));
    x->x_list = 0;
    x->x_inc = 0;
    x->x_inlet1 = x->x_inlet2 = 0;
}
	// clean up
static void freeverb_free(t_freeverb *x)    
{
	int i;
#ifndef PD
	dsp_free((t_pxobject *)x);		// Free the object
#endif
	// free memory used by delay lines
	for(i = 0; i < numcombs; i++)
	{
		t_freebytes(x->x_bufcombL[i], x->x_combtuningL[i]*sizeof(t_float));
		t_freebytes(x->x_bufcombR[i], x->x_combtuningR[i]*sizeof(t_float));
	}

	for(i = 0; i < numallpasses; i++)
	{
		t_freebytes(x->x_bufallpassL[i], x->x_allpasstuningL[i]*sizeof(t_float));
		t_freebytes(x->x_bufallpassR[i], x->x_allpasstuningR[i]*sizeof(t_float));
	}
}
Exemple #29
0
static void netsend_send(t_netsend *x, t_symbol *s, int argc, t_atom *argv)
{
#ifdef ROCKBOX
    (void) x;
    (void) s;
    (void) argc;
    (void) argv;
#else /* ROCKBOX */
    if (x->x_fd >= 0)
    {
	t_binbuf *b = binbuf_new();
	char *buf, *bp;
	int length, sent;
	t_atom at;
	binbuf_add(b, argc, argv);
	SETSEMI(&at);
	binbuf_add(b, 1, &at);
	binbuf_gettext(b, &buf, &length);
	for (bp = buf, sent = 0; sent < length;)
	{
	    static double lastwarntime;
	    static double pleasewarn;
	    double timebefore = sys_getrealtime();
    	    int res = send(x->x_fd, buf, length-sent, 0);
    	    double timeafter = sys_getrealtime();
    	    int late = (timeafter - timebefore > 0.005);
    	    if (late || pleasewarn)
    	    {
    	    	if (timeafter > lastwarntime + 2)
    	    	{
    	    	     post("netsend blocked %d msec",
    	    	     	(int)(1000 * ((timeafter - timebefore) + pleasewarn)));
    	    	     pleasewarn = 0;
    	    	     lastwarntime = timeafter;
    	    	}
    	    	else if (late) pleasewarn += timeafter - timebefore;
    	    }
    	    if (res <= 0)
    	    {
    		sys_sockerror("netsend");
    		netsend_disconnect(x);
    		break;
    	    }
    	    else
    	    {
    		sent += res;
    		bp += res;
    	    }
	}
	t_freebytes(buf, length);
	binbuf_free(b);
    }
    else error("netsend: not connected");
#endif /* ROCKBOX */
}
Exemple #30
0
static t_int *vline_tilde_perform(t_int *w)
{
    t_vline *x = (t_vline *)(w[1]);
    t_sample *out = (t_sample *)(w[2]);
    int n = (int)(w[3]), i;
    t_sample f = x->x_value;
    t_sample inc = x->x_inc;
    t_time msecpersamp = x->x_msecpersamp;
#ifndef ROCKBOX
    t_time samppermsec = x->x_samppermsec;
#endif
    t_time timenow = clock_gettimesince(x->x_referencetime) - n * msecpersamp;
    t_vseg *s = x->x_list;
    for (i = 0; i < n; i++)
    {
    	t_time timenext = timenow + msecpersamp;
    checknext:
	if (s)
	{
	    /* has starttime elapsed?  If so update value and increment */
	    if (s->s_starttime < timenext)
	    {
		if (x->x_targettime <= timenext)
		    f = x->x_target, inc = 0;
	    	    /* if zero-length segment bash output value */
	    	if (s->s_targettime <= s->s_starttime)
		{
		    f = s->s_target;
		    inc = 0;
		}
		else
		{
		    t_time incpermsec = idiv((s->s_target - f),
		    	(s->s_targettime - s->s_starttime));
		    f = mult(f + incpermsec,(timenext - s->s_starttime));
		    inc = mult(incpermsec,msecpersamp);
		}
    	    	x->x_inc = inc;
		x->x_target = s->s_target;
		x->x_targettime = s->s_targettime;
		x->x_list = s->s_next;
		t_freebytes(s, sizeof(*s));
		s = x->x_list;
		goto checknext;
	    }
	}
	if (x->x_targettime <= timenext)
	    f = x->x_target, inc = 0;
	*out++ = f;
	f = f + inc;
	timenow = timenext;
    }
    x->x_value = f;
    return (w+4);
}