void swinger_init(t_swinger *x) { t_fftease *fft = x->fft; t_fftease *fft2 = x->fft2; if(!fft->initialized){ x->mute = 0; } fftease_init(fft); fftease_init(fft2); }
void pvwarpb_init(t_pvwarpb *x) { t_fftease *fft = x->fft; fftease_init(fft); if(!x->initialized){ srand(clock()); x->please_update = 0; x->verbose = 0; x->mute = 0; x->topfreq = 3000. ; x->always_update = 0; x->automate = 0; x->warpfac1 = 1.0; x->warpfac2 = 1.0; x->funcoff = 0; x->cf1 = 500.; x->cf2 = 3000.; x->bw1 = 0.2; x->bw2 = 0.2; x->initialized = 1; } if(fft->N2 > 8192){ x->warpfunc = (t_float *) realloc(x->warpfunc, fft->N2); } fftease_oscbank_setbins(fft,x->lofreq, x->hifreq); }
void thresher_init(t_thresher *x) { t_fftease *fft = x->fft; short initialized = fft->initialized; fftease_init(fft); x->tadv = (t_float) fft->D / (t_float) fft->R ; if(!initialized){ x->mute = 0; if(!x->damping_factor){ x->damping_factor = .95; } x->first_frame = 1; x->move_threshold = .00001 ; x->max_hold_time = DEFAULT_HOLD ; x->max_hold_frames = x->max_hold_time / x->tadv; x->composite_frame = (t_float *) calloc( (fft->N+2), sizeof(t_float)); x->frames_left = (int *) calloc( (fft->N+2), sizeof(int) ); } else if(initialized == 1){ x->composite_frame = (t_float *) realloc(x->composite_frame, (fft->N+2) * sizeof(t_float) ); x->frames_left = (int *) realloc(x->frames_left, (fft->N+2) * sizeof(int) ); } }
void pvoc_init(t_pvoc *x) { float curfreq; t_fftease *fft = x->fft; if(fft->initialized == -1){ return; } fftease_init(fft); if( x->hifreq < fft->c_fundamental ) { post("default hi frequency of 18000 Hz"); x->hifreq = 18000.0 ; } x->fft->hi_bin = 1; curfreq = 0; while( curfreq < x->hifreq ) { ++(x->fft->hi_bin); curfreq += fft->c_fundamental ; } x->fft->lo_bin = 0; curfreq = 0; while( curfreq < x->lofreq ) { ++(x->fft->lo_bin); curfreq += fft->c_fundamental; } }
void cross_init(t_cross *x) { t_fftease *fft = x->fft; t_fftease *fft2 = x->fft2; short initialized; initialized = fft->initialized; fftease_init(fft); fftease_init(fft2); if(!initialized){ x->threshie = .001 ; x->autonorm = 0; x->mute = 0; } }
void leaker_init(t_leaker *x) { int i; t_fftease *fft = x->fft; t_fftease *fft2 = x->fft2; short initialized = fft->initialized; fftease_init(fft); fftease_init(fft2); if(!initialized) { x->mute = 0; x->fade_value = 0; x->sieve = (int *) calloc((fft->N2 + 1),sizeof(int)); } if(initialized != 2){ for(i = 0; i < fft->N2; i++){ x->sieve[i] = i; } } }
void ether_init(t_ether *x) { t_fftease *fft = x->fft; t_fftease *fft2 = x->fft2; short initialized = fft->initialized; fftease_init(fft); fftease_init(fft2); if(!initialized){ x->mute = 0; x->invert = 0; x->threshMult = 0.; } else { x->fft->input = (t_float *) realloc(fft->input,fft->Nw * sizeof(t_float)); x->fft2->input = (t_float *) realloc(fft2->input,fft2->Nw * sizeof(t_float)); x->fft->output = (t_float *) realloc(fft->output,fft->Nw * sizeof(t_float)); } }
void scrape_init(t_scrape *x) { t_fftease *fft = x->fft; short initialized = fft->initialized; fftease_init(fft); if(!initialized){ x->mute = 0; x->threshfunc = (t_float *) calloc(fft->N2, sizeof(t_float)); update_thresh_function(x); } else if(initialized == 1){ x->threshfunc = (t_float *) realloc(x->threshfunc, fft->N2 * sizeof(t_float)); update_thresh_function(x); } }
void residency_buffer_init(t_residency_buffer *x) { t_fftease *fft = x->fft; short initialized = x->fft->initialized; if( fft->R <= 0 ){ post("bad SR"); return; } if( fft->MSPVectorSize <= 0 ){ post("bad vectorsize"); return; } fftease_init(fft); x->tadv = (t_float)fft->D / (t_float)fft->R; if(!initialized){ x->mute = 0; x->sync = 0; x->initialized = 1; x->current_frame = x->framecount = 0; x->frame_increment = 1.0 ; x->fpos = x->last_fpos = 0; } }