pd-sigpack_0.0.4.2/0000755000076500007650000000000011466350414012441 5ustar hanshanspd-sigpack_0.0.4.2/impulse~.c0000644000076500007650000000401611466350200014453 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archiv.de #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ impulse~ ----------------------------- // non-bandlimited single-sample impulses // code from swh_plugins by steve harris www.plugin.org.uk static t_class *impulse_tilde_class; typedef struct _impulse_tilde { t_object x_obj; t_sample x_phase; t_sample x_sample_rate; float x_f; } t_impulse_tilde; static void *impulse_tilde_new(t_floatarg f) { t_impulse_tilde *x = (t_impulse_tilde *)pd_new(impulse_tilde_class); x->x_f = f; x->x_phase = 0.f; x->x_sample_rate = sys_getsr();//later put this in impulse_tilde_dsp??? outlet_new(&x->x_obj, gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1")); return (x); } static t_int *impulse_tilde_perform(t_int *w) { t_impulse_tilde *x = (t_impulse_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, phase_step, value; while (n--) { f = *(in++); phase_step = f / x->x_sample_rate; if (x->x_phase > 1.f) { x->x_phase -= 1.f; value = 1.f; } else { value = 0.f; } *out++ = value; x->x_phase += phase_step; } return (w+5); } static void impulse_tilde_ft1(t_impulse_tilde *x, t_float f) { x->x_phase = f; } static void impulse_tilde_dsp(t_impulse_tilde *x, t_signal **sp) { dsp_add(impulse_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void impulse_tilde_setup(void) { impulse_tilde_class = class_new(gensym("impulse~"), (t_newmethod)impulse_tilde_new, 0, sizeof(t_impulse_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(impulse_tilde_class, t_impulse_tilde, x_f); class_addmethod(impulse_tilde_class, (t_method)impulse_tilde_dsp, gensym("dsp"), 0); class_addmethod(impulse_tilde_class, (t_method)impulse_tilde_ft1, gensym("ft1"), A_FLOAT, 0); } pd-sigpack_0.0.4.2/vowel~.c0000644000076500007650000000650411466350200014135 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ vowel~ ----------------------------- */ /* simple formant filter */ /* code from musicdsp.org posted by alex@smartelectronix.com */ static t_class *vowel_tilde_class; typedef struct _vowel_tilde { t_object x_obj; t_sample x_vowelnum; float x_f; } t_vowel_tilde; static void *vowel_tilde_new(t_floatarg vowelnum) { t_vowel_tilde *x = (t_vowel_tilde *)pd_new(vowel_tilde_class); x->x_vowelnum = vowelnum; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_vowelnum); x->x_f = 0; if(vowelnum) x->x_vowelnum = vowelnum; else x->x_vowelnum = 0; return (x); } const double coeff[5][11]= { { 8.11044e-06, 8.943665402, -36.83889529, 92.01697887, -154.337906, 181.6233289, -151.8651235, 89.09614114, -35.10298511, 8.388101016, -0.923313471 ///A }, { 4.36215e-06, 8.90438318, -36.55179099, 91.05750846, -152.422234, 179.1170248, ///E -149.6496211,87.78352223, -34.60687431, 8.282228154, -0.914150747 }, { 3.33819e-06, 8.893102966, -36.49532826, 90.96543286, -152.4545478, 179.4835618, -150.315433, 88.43409371, -34.98612086, 8.407803364, -0.932568035 ///I }, { 1.13572e-06, 8.994734087, -37.2084849, 93.22900521, -156.6929844, 184.596544, ///O -154.3755513, 90.49663749, -35.58964535, 8.478996281, -0.929252233 }, { 4.09431e-07, 8.997322763, -37.20218544, 93.11385476, -156.2530937, 183.7080141, ///U -153.2631681, 89.59539726, -35.12454591, 8.338655623, -0.910251753 } }; static double memory[10] = {0,0,0,0,0,0,0,0,0,0}; float formant_filter (float in, int vowelnum) { float res; res= (float) (coeff[vowelnum][0]*in + coeff[vowelnum][1]*memory[0] + coeff[vowelnum][2]*memory[1] + coeff[vowelnum][3]*memory[2] + coeff[vowelnum][4]*memory[3] + coeff[vowelnum][5]*memory[4] + coeff[vowelnum][6]*memory[5] + coeff[vowelnum][7]*memory[6] + coeff[vowelnum][8]*memory[7] + coeff[vowelnum][9]*memory[8] + coeff[vowelnum][10]*memory[9]); memory[9]=memory[8]; memory[8]=memory[7]; memory[7]=memory[6]; memory[6]=memory[5]; memory[5]=memory[4]; memory[4]=memory[3]; memory[3]=memory[2]; memory[2]=memory[1]; memory[1]=memory[0]; memory[0]=(double)res; return res; } static t_int *vowel_tilde_perform(t_int *w) { t_vowel_tilde *x = (t_vowel_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; while (n--) { f = *in++; value = formant_filter(f, (int)x->x_vowelnum); *out++ = value; } return (w+5); } static void vowel_tilde_dsp(t_vowel_tilde *x, t_signal **sp) { dsp_add(vowel_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void vowel_tilde_setup(void) { vowel_tilde_class = class_new(gensym("vowel~"), (t_newmethod)vowel_tilde_new, 0, sizeof(t_vowel_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(vowel_tilde_class, t_vowel_tilde, x_f); class_addmethod(vowel_tilde_class, (t_method)vowel_tilde_dsp, gensym("dsp"), 0); class_addmethod(vowel_tilde_class, (t_method)formant_filter, gensym("formant_filter"), A_GIMME, A_NULL); } pd-sigpack_0.0.4.2/decimate~.c0000644000076500007650000000357111466350200014555 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ decimate~ ----------------------------- // signal decimation // code from musicdsp.org posted by tobybear static t_class *decimate_tilde_class; typedef struct _decimate_tilde { t_object x_obj; t_sample x_rate; t_sample x_bits; float x_f; } t_decimate_tilde; static void *decimate_tilde_new(t_floatarg rate, t_floatarg bits) { t_decimate_tilde *x = (t_decimate_tilde *)pd_new(decimate_tilde_class); x->x_rate = rate; x->x_bits = bits; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_rate); floatinlet_new(&x->x_obj, &x->x_bits); x->x_f = 0; if (rate) x->x_rate = rate; else x->x_rate = 0.5; if (bits) x->x_bits = bits; else x->x_bits = 16; return (x); } static t_int *decimate_tilde_perform(t_int *w) { t_decimate_tilde *x = (t_decimate_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f; long int m=1<<(int)(x->x_bits-1); float y=0, cnt=0; while (n--) { f = *in++; cnt+=x->x_rate; if (cnt>=1) { cnt-=1; y=(long int)(f*m)/(float)m; } *out++ = y; } return (w+5); } static void decimate_tilde_dsp(t_decimate_tilde *x, t_signal **sp) { dsp_add(decimate_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void decimate_tilde_setup(void) { decimate_tilde_class = class_new(gensym("decimate~"), (t_newmethod)decimate_tilde_new, 0, sizeof(t_decimate_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(decimate_tilde_class, t_decimate_tilde, x_f); class_addmethod(decimate_tilde_class, (t_method)decimate_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/sigpack-meta.pd0000644000076500007650000000043411466350200015325 0ustar hanshans#N canvas 10 10 200 200 10; #N canvas 20 20 420 300 META 0; #X text 10 10 META this is a prototype of a libdir meta file; #X text 10 30 NAME sigpack; #X text 10 50 AUTHOR weiss@weiss-archiv.de; #X text 10 70 LICENSE GNU GPL 2; #X text 10 90 VERSION 0.0.4.2; #X restore 10 10 pd META; pd-sigpack_0.0.4.2/foldover~.c0000644000076500007650000000361611466350200014622 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ foldover~ ----------------------------- */ /* foldover distortion */ /* code from swh_plugins by steve harris www.plugin.org.uk */ static t_class *foldover_tilde_class; typedef struct _foldover_tilde { t_object x_obj; t_sample x_drive_p; t_sample x_push; float x_f; } t_foldover_tilde; static void *foldover_tilde_new(t_floatarg drive_p, t_floatarg push) { t_foldover_tilde *x = (t_foldover_tilde *)pd_new(foldover_tilde_class); x->x_drive_p = drive_p; x->x_push = push; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_drive_p); floatinlet_new(&x->x_obj, &x->x_push); x->x_f = 0; if(drive_p) x->x_drive_p = drive_p; else x->x_drive_p = 0; if(push) x->x_push = push; else x->x_push = 0; return (x); } static t_int *foldover_tilde_perform(t_int *w) { t_foldover_tilde *x = (t_foldover_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value, y; float drive = x->x_drive_p + 1.0f; while (n--) { f = *in++; y = f * drive + x->x_push; value = 1.5f * y - 0.5f * y * y *y; *out++ = value; } return (w+5); } static void foldover_tilde_dsp(t_foldover_tilde *x, t_signal **sp) { dsp_add(foldover_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void foldover_tilde_setup(void) { foldover_tilde_class = class_new(gensym("foldover~"), (t_newmethod)foldover_tilde_new, 0, sizeof(t_foldover_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(foldover_tilde_class, t_foldover_tilde, x_f); class_addmethod(foldover_tilde_class, (t_method)foldover_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/chop~.c0000644000076500007650000000323411466350200013727 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ chop~ ----------------------------- // signal chopping modulator static t_class *chop_tilde_class; typedef struct _chop_tilde { t_object x_obj; t_sample x_factor; float x_f; } t_chop_tilde; static void *chop_tilde_new(t_floatarg factor) { t_chop_tilde *x = (t_chop_tilde *)pd_new(chop_tilde_class); x->x_factor = factor; outlet_new(&x->x_obj, gensym("signal")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); floatinlet_new(&x->x_obj, &x->x_factor); x->x_f = 0; if(factor) x->x_factor = factor; else x->x_factor = 0; return (x); } static t_int *chop_tilde_perform(t_int *w) { t_chop_tilde *x = (t_chop_tilde *)(w[1]); t_float *in1 = (t_float *)(w[2]); t_float *in2 = (t_float *)(w[3]); t_float *out = (t_float *)(w[4]); int n = (int)(w[5]); float f, m, value; while (n--) { f = *in1++; m = *in2++; if(m > 0.) value = f * x->x_factor; else value = f; *out++ = value; } return (w+6); } static void chop_tilde_dsp(t_chop_tilde *x, t_signal **sp) { dsp_add(chop_tilde_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } void chop_tilde_setup(void) { chop_tilde_class = class_new(gensym("chop~"), (t_newmethod)chop_tilde_new, 0, sizeof(t_chop_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(chop_tilde_class, t_chop_tilde, x_f); class_addmethod(chop_tilde_class, (t_method)chop_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/valverect~.c0000644000076500007650000001015611466350200014772 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archive.de #include "m_pd.h" #include #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ valverect~ ----------------------------- // valve rectifier // code from swh_plugins by steve harris www.plugin.org.uk // 1.0 / ln(2) #define LN2R 1.442695041f /* Fast exponentiation function, y = e^x */ #define f_exp(x) f_pow2(x * LN2R) static t_class *valverect_tilde_class; typedef struct _valverect_tilde { t_object x_obj; t_sample x_sag;//sag level[0-1] t_sample x_dist_p;//distortion[0-1] unsigned int x_apos; float *x_avg; int x_avg_size; float x_avg_sizer; float x_avgs; float x_lp1tm1; float x_lp2tm1; float x_s_rate; float x_f; } t_valverect_tilde; static void *valverect_tilde_new(t_floatarg sag, t_floatarg dist) { t_valverect_tilde *x = (t_valverect_tilde *)pd_new(valverect_tilde_class); x->x_sag = sag; x->x_dist_p = dist; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_sag); floatinlet_new(&x->x_obj, &x->x_dist_p); x->x_s_rate = sys_getsr(); x->x_avg_size = x->x_s_rate / 9;//number of samples in averaging buffer x->x_avg_sizer = 9.0f / x->x_s_rate;//reciprocal of above x->x_avg = (float *)getbytes(x->x_avg_size * sizeof(float));//averaging buffer memset(x->x_avg, 0, x->x_avg_size * sizeof(float)); x->x_avgs = 0.0f;//sum of samples in averaging buffer x->x_apos = 0;//position in averaging buffer x->x_lp1tm1 = 0.0f;//last value in lowpass 1 x->x_lp2tm1 = 0.0f;//last value in lowpass 2 x->x_f = 0; if (sag) x->x_sag = sag; else x->x_sag = 0.0; if (dist) x->x_dist_p = dist; else x->x_dist_p = 0.0; return (x); } /* Andrew Simper's pow(2, x) aproximation from the music-dsp list */ static float f_pow2(float x) { long *px = (long*)(&x); // store address of float as long pointer const float tx = (x-0.5f) + (3<<22); // temporary value for truncation const long lx = *((long*)&tx) - 0x4b400000; // integer power of 2 const float dx = x-(float)(lx); // float remainder of power of 2 x = 1.0f + dx*(0.6960656421638072f + // cubic apporoximation of 2^x dx*(0.224494337302845f + // for x in the range [0, 1] dx*(0.07944023841053369f))); *px += (lx<<23); // add integer power of 2 to exponent return x; } static t_int *valverect_tilde_perform(t_int *w) { t_valverect_tilde *x = (t_valverect_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float abs, q, fx; const float dist = x->x_dist_p * 40.0f + 0.1f; float f; while (n--) { f = *in++; abs = fabs(f); if(abs > x->x_lp1tm1) { x->x_lp1tm1 = abs; } else { x->x_lp1tm1 = 0.9999f * x->x_lp1tm1 + 0.0001f * abs; } x->x_avgs -= x->x_avg[x->x_apos]; x->x_avgs += x->x_lp1tm1; x->x_avg[x->x_apos] = x->x_lp1tm1; x->x_apos %= x->x_avg_size; x->x_lp2tm1 = 0.999f * x->x_lp2tm1 + x->x_avgs * x->x_avg_sizer * 0.001f; q = x->x_lp1tm1 * x->x_sag - x->x_lp2tm1 * 1.02f - 1.0f; if(q > -0.01f) { q = -0.01f; } else if(q < -1.0f) { q = -1.0f; } if(f == q) { fx = 1.0f / dist + q / (1.0f - f_exp(dist * q)); } else { fx = (f - q) / (1.0f - f_exp(-dist * (f - q))) + q / (1.0f - f_exp(dist * q)); } *out++ = fx; } return (w+5); } static void valverect_tilde_dsp(t_valverect_tilde *x, t_signal **sp) { dsp_add(valverect_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } static void valverect_tilde_free(t_valverect_tilde *x) { freebytes(x->x_avg, x->x_avg_size * sizeof(float)); } void valverect_tilde_setup(void) { valverect_tilde_class = class_new(gensym("valverect~"), (t_newmethod)valverect_tilde_new, (t_method)valverect_tilde_free, sizeof(t_valverect_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(valverect_tilde_class, t_valverect_tilde, x_f); class_addmethod(valverect_tilde_class, (t_method)valverect_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/wavewrap~-help.pd0000644000076500007650000000137011466350200015740 0ustar hanshans#N canvas 367 367 385 284 10; #N canvas 0 0 450 300 (subpatch) 0; #X array wrap 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 254 148 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 253 61 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 141 147 5 0 10 2 wrap - -; #X obj 62 168 wavewrap~ 2; #X text 61 13 ---wavewrap~---; #X text 60 35 sinus wavewrapper; #X text 297 12 arg; #X text 280 241 sIgpAck 0.04; #X text 209 254 2007 www.weiss-archiv.de; #X obj 62 201 tabwrite~ wrap; #X connect 1 0 4 0; #X connect 1 0 12 0; #X connect 2 0 4 0; #X connect 2 0 6 0; #X connect 5 0 6 1; #X connect 6 0 12 0; pd-sigpack_0.0.4.2/harmgen~-help.pd0000644000076500007650000000317511466350200015532 0ustar hanshans#N canvas 295 388 516 402 10; #N canvas 0 0 450 300 (subpatch) 0; #X array harm 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 377 211 graph; #X msg 22 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 376 121 graph; #X obj 72 105 tabwrite~ osc; #X text 60 35 harmonic generator; #X text 368 14 arg..; #X text 403 355 sIgpAck 0.02; #X obj 62 371 tabwrite~ harm; #X floatatom 80 132 5 -1 1 0 - - -; #X floatatom 98 153 5 -1 1 0 - - -; #X floatatom 116 174 5 -1 1 0 - - -; #X floatatom 134 195 5 -1 1 0 - - -; #X floatatom 152 214 5 -1 1 0 - - -; #X floatatom 170 235 5 -1 1 0 - - -; #X floatatom 188 254 5 -1 1 0 - - -; #X floatatom 206 273 5 -1 1 0 - - -; #X floatatom 224 291 5 -1 1 0 - - -; #X floatatom 243 311 5 -1 1 0 - - -; #X text 279 311 ->mag10[-1/1]; #X text 114 130 ->mag1[-1/1]:fundamental freq; #X text 133 151 ->mag2[-1/1]; #X text 152 172 ->mag3[-1/1]; #X text 171 193 ->mag4[-1/1]; #X text 189 213 ->mag5[-1/1]; #X text 205 234 ->mag6[-1/1]; #X text 224 253 ->mag7[-1/1]; #X text 241 272 ->mag8[-1/1]; #X text 258 290 ->mag9[-1/1]; #X obj 62 342 harmgen~ 0 0 0 0 0 0 0 0 0 0; #X text 332 369 2003 www.weiss-archiv.de; #X text 60 13 ---harmgen~---; #X connect 1 0 4 0; #X connect 1 0 8 0; #X connect 2 0 4 0; #X connect 2 0 29 0; #X connect 9 0 29 1; #X connect 10 0 29 2; #X connect 11 0 29 3; #X connect 12 0 29 4; #X connect 13 0 29 5; #X connect 14 0 29 6; #X connect 15 0 29 7; #X connect 16 0 29 8; #X connect 17 0 29 9; #X connect 18 0 29 10; #X connect 29 0 8 0; pd-sigpack_0.0.4.2/freqdiv~.c0000644000076500007650000000467311466350200014446 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ freqdiv~ ----------------------------- */ /* frequency divider */ /* code from swh_plugins by steve harris www.plugins.org.uk */ static t_class *freqdiv_tilde_class; typedef struct _freqdiv_tilde { t_object x_obj; t_sample x_denominate; t_sample x_amp; float x_count; t_sample x_lamp; t_sample x_last; t_sample x_out; int x_zeroxs; float x_f; } t_freqdiv_tilde; static void *freqdiv_tilde_new(t_floatarg denominate) { t_freqdiv_tilde *x = (t_freqdiv_tilde *)pd_new(freqdiv_tilde_class); x->x_denominate = denominate; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_denominate); x->x_f = 0; x->x_amp = 0; x->x_count = 0; x->x_lamp = 0; x->x_last = 0; x->x_out = 0; x->x_zeroxs = 0; if (denominate) x->x_denominate = denominate; else x->x_denominate = 1; return (x); } static t_int *freqdiv_tilde_perform(t_int *w) { t_freqdiv_tilde *x = (t_freqdiv_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f; int den = (int)x->x_denominate; while (n--) { f = *in++; x->x_count += 1.0f; if ((f > 0.0f && x->x_last <= 0.0f) || (f < 0.0f && x->x_last >= 0.0)) { x->x_zeroxs++; if (den == 1) { x->x_out = x->x_out > 0.0f ? -1.0f : 1.0f; x->x_lamp = x->x_amp / x->x_count; x->x_zeroxs = 0; x->x_count = 0; x->x_amp = 0; } } x->x_amp += fabs(f); if (den > 1 && (x->x_zeroxs % den) == den-1) { x->x_out = x->x_out > 0.0f ? -1.0f : 1.0f; x->x_lamp = x->x_amp / x->x_count; x->x_zeroxs = 0; x->x_count = 0; x->x_amp = 0; } x->x_last = f; *out++ = x->x_out * x->x_lamp; } return (w+5); } static void freqdiv_tilde_dsp(t_freqdiv_tilde *x, t_signal **sp) { dsp_add(freqdiv_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void freqdiv_tilde_setup(void) { freqdiv_tilde_class = class_new(gensym("freqdiv~"), (t_newmethod)freqdiv_tilde_new, 0, sizeof(t_freqdiv_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(freqdiv_tilde_class, t_freqdiv_tilde, x_f); class_addmethod(freqdiv_tilde_class, (t_method)freqdiv_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/diode~.c0000644000076500007650000000410311466350200014056 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ diode~ ----------------------------- */ /* Mangles the signal as if it had been passed through a diode rectifier network.*/ /* code from swh_plugins by steve harris www.plugin.org.uk */ static t_class *diode_tilde_class; typedef struct _diode_tilde { t_object x_obj; t_sample x_mode;//0=none,1=halfWave,2=fullWave float x_f; } t_diode_tilde; static void *diode_tilde_new(t_floatarg mode) { t_diode_tilde *x = (t_diode_tilde *)pd_new(diode_tilde_class); x->x_mode = mode; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_mode); x->x_f = 0; if(mode) x->x_mode = mode; else x->x_mode = 0; return (x); } static t_int *diode_tilde_perform(t_int *w) { t_diode_tilde *x = (t_diode_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; while (n--) { f = *in++; if(x->x_mode >= 0.0f && x->x_mode < 1.0f) { value = ((1.0f - x->x_mode) * f + (x->x_mode * (f > 0.0f ? f : 0.0f))); } else if (x->x_mode >= 1.0f && x->x_mode < 2.0f) { float fac = x->x_mode - 1.0f; value = ((1.0f - fac) * (f > 0 ? f : 0.0)) + (fac * fabs(f)); } else if (x->x_mode >= 2) { float fac = x->x_mode < 3 ? x->x_mode - 2 : 1.0; value = (1.0 - fac) * fabs(f); } else { value = f; } *out++ = value; } return (w+5); } static void diode_tilde_dsp(t_diode_tilde *x, t_signal **sp) { dsp_add(diode_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void diode_tilde_setup(void) { diode_tilde_class = class_new(gensym("diode~"), (t_newmethod)diode_tilde_new, 0, sizeof(t_diode_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(diode_tilde_class, t_diode_tilde, x_f); class_addmethod(diode_tilde_class, (t_method)diode_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/transient~.c0000644000076500007650000001043511466350200015006 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archiv.de #include "m_pd.h" #include #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif #define BUFFER_SIZE 10240 #define SSTAB 0.00001f #define ASTAB 0.02f //Truncate-to-zero modulo (ANSI C doesn`t specify) will only work //if -m < v < 2m #define MOD(v,m) (v<0?v+m:(v>=m?v-m:v)) // ------------------------ transient~ ----------------------------- // transient mangler // code from swh_plugins by steve harris www.plugin.org.uk static t_class *transient_tilde_class; typedef struct _transient_tilde { t_object x_obj; t_sample x_attack;//-1 - 1 t_sample x_sustain;//-1 - 1 float *x_buffer; int x_buffer_pos; long x_count; float x_fast_buffer_sum; float x_fast_track; float x_medi_buffer_sum; float x_medi_track; int x_sample_rate; float x_slow_buffer_sum; float x_slow_track; float x_f; } t_transient_tilde; static void *transient_tilde_new(t_floatarg attack, t_floatarg sustain) { t_transient_tilde *x = (t_transient_tilde *)pd_new(transient_tilde_class); x->x_attack = attack; x->x_sustain = sustain; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_attack); floatinlet_new(&x->x_obj, &x->x_sustain); //memset(x->x_buffer, '/0', BUFFER_SIZE * sizeof(float)); x->x_buffer = getbytes(BUFFER_SIZE * sizeof(float)); x->x_fast_buffer_sum = 0.1; x->x_medi_buffer_sum = 0.1; x->x_slow_buffer_sum = 0.1; x->x_buffer_pos = 0; x->x_fast_track = 0.0; x->x_medi_track = 0.0; x->x_slow_track = 0.0; x->x_count = 0; x->x_sample_rate = sys_getsr(); x->x_f = 0; if (attack) x->x_attack = attack; else x->x_attack = 0.0; if (sustain) x->x_sustain = sustain; else x->x_sustain = 0.0; return (x); } static t_int *transient_tilde_perform(t_int *w) { t_transient_tilde *x = (t_transient_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f; const int fast_sum_size = (2 * x->x_sample_rate) / 1000; const int medi_sum_size = (25 * x->x_sample_rate) / 1000; const int slow_sum_size = (100 * x->x_sample_rate) / 1000; const float fast_track_lag = 1.5f / fast_sum_size; const float medi_track_lag = 1.0f / medi_sum_size; const float slow_track_lag = 1.3f / slow_sum_size; float ratio; while (n--) { f = *in++; x->x_buffer[x->x_buffer_pos] = fabs(f); x->x_fast_buffer_sum += x->x_buffer[x->x_buffer_pos]; x->x_medi_buffer_sum += x->x_buffer[x->x_buffer_pos]; x->x_slow_buffer_sum += x->x_buffer[x->x_buffer_pos]; x->x_fast_buffer_sum -= x->x_buffer[MOD(x->x_buffer_pos - fast_sum_size, BUFFER_SIZE)]; x->x_medi_buffer_sum -= x->x_buffer[MOD(x->x_buffer_pos - medi_sum_size, BUFFER_SIZE)]; x->x_slow_buffer_sum -= x->x_buffer[MOD(x->x_buffer_pos - slow_sum_size, BUFFER_SIZE)]; if(x->x_count++ > slow_sum_size) { x->x_fast_track += (x->x_fast_buffer_sum/fast_sum_size - x->x_fast_track) * fast_track_lag; x->x_medi_track += (x->x_medi_buffer_sum/medi_sum_size - x->x_medi_track) * medi_track_lag; x->x_slow_track += (x->x_slow_buffer_sum/slow_sum_size - x->x_slow_track) * slow_track_lag; } //Attack ratio = (x->x_fast_track + ASTAB) / (x->x_medi_track + ASTAB); if (ratio * x->x_attack > 1.0f) { f *= ratio * x->x_attack; } else if (ratio * x->x_attack < 1.0f) { f /= ratio * -x->x_attack; } //Sustain ratio = (x->x_slow_track + SSTAB) / (x->x_medi_track + SSTAB); if (ratio * x->x_sustain > 1.0f) { f *= ratio * x->x_sustain; } else if (ratio * x->x_sustain < -1.0f) { f /= ratio * x->x_sustain; } *out++ = f; x->x_buffer_pos = (x->x_buffer_pos +1) % BUFFER_SIZE; } return (w+5); } static void transient_tilde_dsp(t_transient_tilde *x, t_signal **sp) { dsp_add(transient_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void transient_tilde_setup(void) { transient_tilde_class = class_new(gensym("transient~"), (t_newmethod)transient_tilde_new, 0, sizeof(t_transient_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(transient_tilde_class, t_transient_tilde, x_f); class_addmethod(transient_tilde_class, (t_method)transient_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/transient~-help.pd0000644000076500007650000000154411466350200016116 0ustar hanshans#N canvas 410 526 389 284 10; #N canvas 0 0 450 300 (subpatch) 0; #X array transient 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 266 146 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 265 59 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 116 137 5 0 0 2 attack[-1-1] - -; #X floatatom 171 151 5 0 0 2 sustain[-1-1] - -; #X text 60 13 ---transient~---; #X text 60 35 transient mangler; #X text 245 12 arg; #X text 290 240 sIgpAck 0.04; #X text 219 253 2007 www.weiss-archiv.de; #X obj 62 201 tabwrite~ transient; #X obj 62 168 transient~ 1 0.1; #X connect 1 0 4 0; #X connect 1 0 12 0; #X connect 2 0 4 0; #X connect 2 0 13 0; #X connect 5 0 13 1; #X connect 6 0 13 2; #X connect 13 0 12 0; pd-sigpack_0.0.4.2/sieve~.c0000644000076500007650000000421711466350200014113 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ sieve~ ----------------------------- */ /* sift samples */ static t_class *sieve_tilde_class; typedef struct _sieve_tilde { t_object x_obj; t_sample x_mode; t_sample x_sample; t_sample x_last; float x_f; } t_sieve_tilde; static void *sieve_tilde_new(t_floatarg mode, t_floatarg sample) { t_sieve_tilde *x = (t_sieve_tilde *)pd_new(sieve_tilde_class); x->x_mode = mode; x->x_sample = sample; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_mode); floatinlet_new(&x->x_obj, &x->x_sample); x->x_last = 0; x->x_f = 0; x->x_mode = 0; if(mode) x->x_mode = mode; if(x->x_mode > 1) x->x_mode = 1; if(x->x_mode < 0) x->x_mode = 0; return (x); } static float round(float in) { float y, round; int temp; { round = in * 10; temp = round; y = temp * 0.1; } return y; } static t_int *sieve_tilde_perform(t_int *w) { t_sieve_tilde *x = (t_sieve_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f; int mode = x->x_mode; while (n--) { f = *in++; switch(mode){ case(0): if (round(f) != round(x->x_sample)) { *out++ = f; x->x_last = f; } else { *out++ = x->x_last; } break; case(1): if (round(f) == round(x->x_sample)) { *out++ = f; x->x_last = f; } else { *out++ = x->x_last; } } } return (w+5); } static void sieve_tilde_dsp(t_sieve_tilde *x, t_signal **sp) { dsp_add(sieve_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void sieve_tilde_setup(void) { sieve_tilde_class = class_new(gensym("sieve~"), (t_newmethod)sieve_tilde_new, 0, sizeof(t_sieve_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(sieve_tilde_class, t_sieve_tilde, x_f); class_addmethod(sieve_tilde_class, (t_method)sieve_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/README.txt0000644000076500007650000000224411466350200014132 0ustar hanshanssigpack version 0.04 signal object library for pure-data objects: sp_chop~ sp_decimate~ sp_diode~ sp_foldback~ sp_foldover~ sp_freqdiv~ sp_freqshift~ sp_hardlimit~ sp_harmgen~ sp_impulse~ sp_rectify~ sp_round~ sp_saturate~ sp_shape~ sp_sieve~ sp_split~ sp_transient~ sp_ustep~ sp_valverect~ sp_vowel~ sp_wavewrap~ released under the GNU/GPL-license this is software with absolutely no warranty use it at your own risk contact -----------------v0.04------------------- ::cleaning up code a bit ::add GNU/GPL license.txt ::new objects: sp_hardlimit~ sp_impulse~ sp_shape~ sp_transient~ sp_valverect~ sp_wavewrap~ -----------------v0.03b------------------ ::change prefix to "sp_", so every extern compiles as single object (for pd-extended) -----------------v0.03------------------- ::add prefix "sp." to avoid nameclash ::new objects: sp_diode~ sp_freqshift~ sp_round~ sp_sieve~ -----------------v0.02------------------- ::new objects: sp_chop~ sp_decimate~ sp_foldover~ sp_freqdiv~ sp_harmgen~ sp_saturate~ sp_vowel~ -----------------v0.01------------------- ::initial releasepd-sigpack_0.0.4.2/sigpack.c0000644000076500007650000000307011466350200014217 0ustar hanshans#ifndef VERSION #define VERSION "0.04" #endif #include typedef struct _sigpack { t_object x_obj; } t_sigpack; static t_class* sigpack_class; void chop_tilde_setup(); void decimate_tilde_setup(); void diode_tilde_setup(); void foldback_tilde_setup(); void foldover_tilde_setup(); void freqdiv_tilde_setup(); void freqshift_tilde_setup(); void hardlimit_tilde_setup(); void harmgen_tilde_setup(); void impulse_tilde_setup(); void rectify_tilde_setup(); void round_tilde_setup(); void saturate_tilde_setup(); void shape_tilde_setup(); void sieve_tilde_setup(); void split_tilde_setup(); void transient_tilde_setup(); void ustep_tilde_setup(); void valverect_tilde_setup(); void vowel_tilde_setup(); void wavewrap_tilde_setup(); static void* sigpack_new(t_symbol* s) { t_sigpack *x = (t_sigpack *)pd_new(sigpack_class); return (x); } void sigpack_setup(void) { sigpack_class = class_new(gensym("sigpack"), (t_newmethod)sigpack_new, 0, sizeof(t_sigpack), 0,0); chop_tilde_setup(); decimate_tilde_setup(); diode_tilde_setup(); foldback_tilde_setup(); foldover_tilde_setup(); freqdiv_tilde_setup(); freqshift_tilde_setup(); hardlimit_tilde_setup(); harmgen_tilde_setup(); impulse_tilde_setup(); rectify_tilde_setup(); round_tilde_setup(); saturate_tilde_setup(); shape_tilde_setup(); sieve_tilde_setup(); split_tilde_setup(); transient_tilde_setup(); ustep_tilde_setup(); valverect_tilde_setup(); vowel_tilde_setup(); wavewrap_tilde_setup(); post("sigpack"" "VERSION " | 12.2007 | www.weiss-archiv.de"); } pd-sigpack_0.0.4.2/harmgen~.c0000644000076500007650000001065411466350200014423 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif #define HARMONICS 11 // ------------------------ harmgen~ ----------------------------- // harmonic generator // code from swh_plugins by steve harris www.plugins.org.uk static t_class *harmgen_tilde_class; typedef struct _harmgen_tilde { t_object x_obj; t_sample x_mag1; t_sample x_mag2; t_sample x_mag3; t_sample x_mag4; t_sample x_mag5; t_sample x_mag6; t_sample x_mag7; t_sample x_mag8; t_sample x_mag9; t_sample x_mag10; float x_itm; float x_otm; float x_f; } t_harmgen_tilde; static void *harmgen_tilde_new(t_floatarg mag1, t_floatarg mag2, t_floatarg mag3, t_floatarg mag4, t_floatarg mag5, t_floatarg mag6, t_floatarg mag7, t_floatarg mag8, t_floatarg mag9, t_floatarg mag10) { t_harmgen_tilde *x = (t_harmgen_tilde *)pd_new(harmgen_tilde_class); outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_mag1); floatinlet_new(&x->x_obj, &x->x_mag2); floatinlet_new(&x->x_obj, &x->x_mag3); floatinlet_new(&x->x_obj, &x->x_mag4); floatinlet_new(&x->x_obj, &x->x_mag5); floatinlet_new(&x->x_obj, &x->x_mag6); floatinlet_new(&x->x_obj, &x->x_mag7); floatinlet_new(&x->x_obj, &x->x_mag8); floatinlet_new(&x->x_obj, &x->x_mag9); floatinlet_new(&x->x_obj, &x->x_mag10); x->x_f = 0; if(mag1) x->x_mag1 = mag1; else x->x_mag1 = 1; if(mag2) x->x_mag2 = mag2; else x->x_mag2 = 1; if(mag3) x->x_mag3 = mag3; else x->x_mag3 = 1; if(mag4) x->x_mag4 = mag4; else x->x_mag4 = 1; if(mag5) x->x_mag5 = mag5; else x->x_mag5 = 1; if(mag6) x->x_mag6 = mag6; else x->x_mag6 = 1; if(mag7) x->x_mag7 = mag7; else x->x_mag7 = 1; if(mag8) x->x_mag8 = mag8; else x->x_mag8 = 1; if(mag9) x->x_mag9 = mag9; else x->x_mag9 = 1; if(mag10) x->x_mag10 = mag10; else x->x_mag10 = 1; return (x); } /* Calculate Chebychev coefficents from partial magnitudes, adapted from * example in Num. Rec. */ void chebpc(float c[], float d[]) { int k, j; float sv, dd[HARMONICS]; for (j = 0; j < HARMONICS; j++) { d[j] = dd[j] = 0.0; } d[0] = c[HARMONICS - 1]; for (j = HARMONICS - 2; j >= 1; j--) { for (k = HARMONICS - j; k >= 1; k--) { sv = d[k]; d[k] = 2.0 * d[k - 1] - dd[k]; dd[k] = sv; } sv = d[0]; d[0] = -dd[0] + c[j]; dd[0] = sv; } for (j = HARMONICS - 1; j >= 1; j--) { d[j] = d[j - 1] - dd[j]; } d[0] = -dd[0] + 0.5 * c[0]; } static t_int *harmgen_tilde_perform(t_int *w) { t_harmgen_tilde *x = (t_harmgen_tilde *)(w[1]); t_float *in1 = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); unsigned long i; float mag_fix, y, f, value; float mag[HARMONICS] = {0.0f, x->x_mag1, x->x_mag2, x->x_mag3, x->x_mag4, x->x_mag5, x->x_mag6, x->x_mag7, x->x_mag8, x->x_mag9, x->x_mag10}; float p[HARMONICS]; // Normalise magnitudes mag_fix = (fabs(x->x_mag1) + fabs(x->x_mag2) + fabs(x->x_mag3) + fabs(x->x_mag4) + fabs(x->x_mag5) + fabs(x->x_mag6) + fabs(x->x_mag7) + fabs(x->x_mag8) + fabs(x->x_mag9) + fabs(x->x_mag10)); if (mag_fix < 1.0f) { mag_fix = 1.0f; } else { mag_fix = 1.0f / mag_fix; } for (i=0; ix_otm = 0.999f * x->x_otm + y - x->x_itm; x->x_itm = y; *out++ = x->x_otm; } return (w+5); } static void harmgen_tilde_dsp(t_harmgen_tilde *x, t_signal **sp) { dsp_add(harmgen_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void harmgen_tilde_setup(void) { harmgen_tilde_class = class_new(gensym("harmgen~"), (t_newmethod)harmgen_tilde_new, 0, sizeof(t_harmgen_tilde), 0, A_GIMME, 0); CLASS_MAINSIGNALIN(harmgen_tilde_class, t_harmgen_tilde, x_f); class_addmethod(harmgen_tilde_class, (t_method)harmgen_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/decimate~-help.pd0000644000076500007650000000167211466350200015664 0ustar hanshans#N canvas 285 400 443 319 10; #N canvas 0 0 450 300 (subpatch) 0; #X array deci 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 305 189 graph; #X msg 16 115 bang; #X obj 52 105 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 305 102 graph; #X obj 62 132 tabwrite~ osc; #X obj 52 228 tabwrite~ deci; #X text 51 35 signal decimation; #X text 51 50 a ratio of 1 is orig. samplerate 0.5 is half; #X text 306 10 arg; #X text 51 67 of orig. samplerate etc.; #X text 331 268 sIgpAck 0.02; #X obj 52 195 decimate~ 0.5 16; #X text 260 281 2003 www.weiss-archiv.de; #X text 51 13 ---decimate~---; #X floatatom 106 175 5 0 1 2 ratio[0-1] - -; #X floatatom 183 181 5 1 32 2 bits[1-32] - -; #X connect 1 0 4 0; #X connect 1 0 5 0; #X connect 2 0 4 0; #X connect 2 0 11 0; #X connect 11 0 5 0; #X connect 14 0 11 1; #X connect 15 0 11 2; pd-sigpack_0.0.4.2/ustep~.c0000644000076500007650000000365711466350200014147 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ ustep~ ----------------------------- */ /* signal unity step function */ static t_class *ustep_tilde_class; typedef struct _ustep_tilde { t_object x_obj; t_sample x_mode; t_sample x_thres; float x_f; } t_ustep_tilde; static void *ustep_tilde_new(t_floatarg mode, t_floatarg thres) { t_ustep_tilde *x = (t_ustep_tilde *)pd_new(ustep_tilde_class); x->x_mode = mode; x->x_thres = thres; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_mode); floatinlet_new(&x->x_obj, &x->x_thres); x->x_f = 0; if(mode) x->x_mode = mode; else x->x_mode = 0; if(x->x_mode > 1) x->x_mode = 1; if(x->x_mode < 0) x->x_mode = 0; if(thres) x->x_thres = thres; else x->x_thres = 0.5; return (x); } static t_int *ustep_tilde_perform(t_int *w) { t_ustep_tilde *x = (t_ustep_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; int mode = x->x_mode; while (n--) { f = *in++; switch(mode){ case(0): if (f >= x->x_thres) value = 1; else value = 0; break; case(1): if (f >= x->x_thres) value = 1; else value = f; } *out++ = value; } return (w+5); } static void ustep_tilde_dsp(t_ustep_tilde *x, t_signal **sp) { dsp_add(ustep_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void ustep_tilde_setup(void) { ustep_tilde_class = class_new(gensym("ustep~"), (t_newmethod)ustep_tilde_new, 0, sizeof(t_ustep_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(ustep_tilde_class, t_ustep_tilde, x_f); class_addmethod(ustep_tilde_class, (t_method)ustep_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/split~.c0000644000076500007650000000331111466350200014125 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ split~ ----------------------------- */ /* signal splitter */ static t_class *split_tilde_class; typedef struct _split_tilde { t_object x_obj; float x_f; t_sample x_thres; } t_split_tilde; static void *split_tilde_new(t_floatarg thres) { t_split_tilde *x = (t_split_tilde *)pd_new(split_tilde_class); x->x_thres = thres; outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_thres); x->x_f = 0; if(thres) x->x_thres = thres; else x->x_thres = 0; return (x); } static t_int *split_tilde_perform(t_int *w) { t_split_tilde *x = (t_split_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out1 = (t_float *)(w[3]); t_float *out2 = (t_float *)(w[4]); int n = (int)(w[5]); while (n--) { float f = *in++; if(f < x->x_thres) { *out1++ = f; *out2++ = 0; } else if(f >= x->x_thres) { *out1++ = 0; *out2++ = f; } } return (w+6); } static void split_tilde_dsp(t_split_tilde *x, t_signal **sp) { dsp_add(split_tilde_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } void split_tilde_setup(void) { split_tilde_class = class_new(gensym("split~"), (t_newmethod)split_tilde_new, 0, sizeof(t_split_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(split_tilde_class, t_split_tilde, x_f); class_addmethod(split_tilde_class, (t_method)split_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/impulse~-help.pd0000644000076500007650000000101511466350200015556 0ustar hanshans#N canvas 344 491 402 206 10; #X msg 20 115 bang; #N canvas 0 0 474 324 (subpatch) 0; #X array imp 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 265 76 graph; #X text 60 13 ---impulse~---; #X text 61 35 non-bandlimited single-sample impulses; #X obj 62 132 tabwrite~ imp; #X text 292 163 sIgpAck 0.04; #X obj 62 105 impulse~ 440; #X text 309 12 arg; #X floatatom 62 83 5 0 0 2 freq - -; #X text 220 176 2007 www.weiss-archiv.de; #X connect 0 0 4 0; #X connect 6 0 4 0; #X connect 8 0 6 0; pd-sigpack_0.0.4.2/saturate~.c0000644000076500007650000000413611466350200014630 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ saturate~ ----------------------------- */ /* signal soft saturation */ /* code from www.musicdsp.org posted by bram de jong */ static t_class *saturate_tilde_class; typedef struct _saturate_tilde { t_object x_obj; t_sample x_thresh; float x_f; } t_saturate_tilde; static void *saturate_tilde_new(t_floatarg thresh) { t_saturate_tilde *x = (t_saturate_tilde *)pd_new(saturate_tilde_class); x->x_thresh = thresh; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_thresh); x->x_f = 0; if(thresh) x->x_thresh = thresh; else x->x_thresh = 1.; return (x); } static float sigmoid(float x) { if(fabs(x) < 1) return x * (1.5f - 0.5f * x * x); else return x > 0.f ? 1.f : -1.f; } static t_int *saturate_tilde_perform(t_int *w) { t_saturate_tilde *x = (t_saturate_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; float t = x->x_thresh; while (n--) { f = *in++; if(fabs(f) < t) value = f; else { if(f > 0.f) value = t + (1.f - t) * sigmoid((f - t)/((1 - t) * 1.5f)); else value = -(t + (1.f - t) * sigmoid((-f - t)/((1 - t) * 1.5f))); } *out++ = value; } return (w+5); } static void saturate_tilde_dsp(t_saturate_tilde *x, t_signal **sp) { dsp_add(saturate_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void saturate_tilde_setup(void) { saturate_tilde_class = class_new(gensym("saturate~"), (t_newmethod)saturate_tilde_new, 0, sizeof(t_saturate_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(saturate_tilde_class, t_saturate_tilde, x_f); class_addmethod(saturate_tilde_class, (t_method)saturate_tilde_dsp, gensym("dsp"), 0); class_addmethod(saturate_tilde_class, (t_method)saturate_tilde_dsp, gensym("sigmoid"), A_FLOAT, 0); } pd-sigpack_0.0.4.2/foldback~-help.pd0000644000076500007650000000150511466350200015651 0ustar hanshans#N canvas 320 476 426 288 10; #N canvas 0 0 450 300 (subpatch) 0; #X array fold 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 279 157 graph; #X msg 23 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 279 69 graph; #X obj 72 105 tabwrite~ osc; #X obj 62 201 tabwrite~ fold; #X text 305 244 sIgpAck 0.01; #X text 299 12 arg; #X text 60 35 signal mirror; #X obj 62 168 foldback~ -0.5 0.5; #X text 234 255 2002 www.weiss-archiv.de; #X text 60 13 ---foldback~---; #X floatatom 122 147 5 -1 0 2 neg[-1-0] - -; #X floatatom 183 148 5 0 1 2 pos[0-1] - -; #X connect 1 0 4 0; #X connect 1 0 5 0; #X connect 2 0 4 0; #X connect 2 0 9 0; #X connect 9 0 5 0; #X connect 12 0 9 1; #X connect 13 0 9 2; pd-sigpack_0.0.4.2/saturate~-help.pd0000644000076500007650000000153311466350200015735 0ustar hanshans#N canvas 375 417 421 310 10; #N canvas 0 0 450 300 (subpatch) 0; #X array sat 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 284 165 graph; #X msg 24 112 bang; #X obj 61 102 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 283 79 graph; #X obj 71 129 tabwrite~ osc; #X obj 61 225 tabwrite~ sat; #X text 60 35 soft saturation; #X text 316 12 arg; #X text 312 264 sIgpAck 0.02; #X text 60 50 if signal is above threshold; #X text 60 65 a soft saturation is added; #X obj 61 193 saturate~ 0.5; #X text 240 278 2003 www.weiss-archiv.de; #X text 60 13 ---saturate~---; #X floatatom 152 174 5 0 0 2 thresh[-1-1] - -; #X connect 1 0 4 0; #X connect 1 0 5 0; #X connect 2 0 4 0; #X connect 2 0 11 0; #X connect 11 0 5 0; #X connect 14 0 11 1; pd-sigpack_0.0.4.2/foldover~-help.pd0000644000076500007650000000150411466350200015723 0ustar hanshans#N canvas 310 372 412 288 10; #N canvas 0 0 450 300 (subpatch) 0; #X array fold 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 274 157 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 274 69 graph; #X obj 72 105 tabwrite~ osc; #X obj 62 201 tabwrite~ fold; #X text 60 35 foldover distortion; #X text 294 12 arg; #X text 301 241 sIgpAck 0.02; #X obj 62 168 foldover~ 0 0; #X text 230 254 2003 www.weiss-archiv.de; #X text 60 13 ---foldover~---; #X floatatom 107 149 5 0 0 2 amp[0-1] - -; #X floatatom 175 154 5 0 0 2 sym[0-1] - -; #X connect 1 0 4 0; #X connect 1 0 5 0; #X connect 2 0 4 0; #X connect 2 0 9 0; #X connect 9 0 5 0; #X connect 12 0 9 1; #X connect 13 0 9 2; pd-sigpack_0.0.4.2/split~-help.pd0000644000076500007650000000131111466350200015232 0ustar hanshans#N canvas 378 373 323 251 10; #X floatatom 182 97 5 0 0 0 - - -; #X obj 109 96 sig~; #X floatatom 109 74 5 0 0 0 - - -; #X obj 182 147 snapshot~; #X obj 109 147 snapshot~; #X obj 36 130 metro 20; #X obj 36 105 loadbang; #X floatatom 109 174 5 0 0 0 - - -; #X floatatom 182 175 5 0 0 0 - - -; #X text 60 35 signal split function; #X text 225 211 sIgpAck 0.01; #X text 239 13 arg; #X obj 109 120 split~ 0.5; #X text 153 225 2002 www.weiss-archiv.de; #X text 60 13 ---split~---; #X connect 0 0 12 1; #X connect 1 0 12 0; #X connect 2 0 1 0; #X connect 3 0 8 0; #X connect 4 0 7 0; #X connect 5 0 3 0; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 12 0 4 0; #X connect 12 1 3 0; pd-sigpack_0.0.4.2/diode~-help.pd0000644000076500007650000000137411466350200015174 0ustar hanshans#N canvas 329 389 404 298 10; #N canvas 0 0 450 300 (subpatch) 0; #X array diode 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 252 160 graph; #X msg 24 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 252 72 graph; #X obj 72 105 tabwrite~ osc; #X text 60 13 ---diode~---; #X obj 62 201 tabwrite~ diode; #X obj 62 168 diode~ 0; #X floatatom 123 147 5 0 2 2 mode[0-2] - -; #X text 294 12 arg; #X text 60 35 diode rectifier network; #X text 279 241 sIgpAck 0.03; #X text 209 254 2005 www.weiss-archiv.de; #X connect 1 0 4 0; #X connect 1 0 6 0; #X connect 2 0 4 0; #X connect 2 0 7 0; #X connect 7 0 6 0; #X connect 8 0 7 1; pd-sigpack_0.0.4.2/LICENSE.txt0000644000076500007650000004366311466350200014271 0ustar hanshans GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pd-sigpack_0.0.4.2/ustep~-help.pd0000644000076500007650000000207311466350200015245 0ustar hanshans#N canvas 286 425 449 368 10; #X obj 62 318 dac~; #X obj 62 283 *~; #X obj 94 266 line~; #X obj 94 243 pack 0 50; #X obj 94 221 dbtorms; #X floatatom 104 120 1 0 0 0 - - -; #X text 60 35 signal unity step function; #X text 117 119 Mode[0/1]; #X text 184 203 Mode0: if signal is above the; #X text 241 215 specified threshold a unity; #X text 241 227 step is output \, otherwise zero; #X text 183 242 Mode1: same as above but if below the; #X text 238 254 threshold \, the signal passes; #X text 239 266 unchanged; #X obj 62 92 osc~ 440; #X floatatom 62 70 5 0 0 0 - - -; #X text 301 15 arg; #X text 347 332 sIgpAck 0.01; #X obj 62 163 ustep~ 0 0.5; #X text 276 345 2002 www.weiss-archiv.de; #X text 60 13 ---ustep~---; #X floatatom 161 149 5 0 1 1 thresh[0-1] - -; #X floatatom 94 203 5 0 100 0 - - -; #X connect 1 0 0 0; #X connect 1 0 0 1; #X connect 2 0 1 1; #X connect 3 0 2 0; #X connect 4 0 3 0; #X connect 5 0 18 1; #X connect 14 0 18 0; #X connect 15 0 14 0; #X connect 18 0 1 0; #X connect 21 0 18 2; #X connect 22 0 4 0; pd-sigpack_0.0.4.2/round~-help.pd0000644000076500007650000000136511466350200015237 0ustar hanshans#N canvas 410 382 381 280 10; #N canvas 0 0 450 300 (subpatch) 0; #X array round 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 254 148 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 253 61 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 123 147 5 0 0 2 coarse - -; #X obj 62 201 tabwrite~ round; #X text 60 13 ---round~---; #X text 60 35 simple rounder; #X text 280 241 sIgpAck 0.03; #X text 209 254 2005 www.weiss-archiv.de; #X text 286 12 arg; #X obj 62 168 round~ 2; #X connect 1 0 4 0; #X connect 1 0 6 0; #X connect 2 0 4 0; #X connect 2 0 12 0; #X connect 5 0 12 1; #X connect 12 0 6 0; pd-sigpack_0.0.4.2/freqshift~.c0000644000076500007650000001563411466350200015000 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #define M_PI 3.14159265358979323846 #endif /* ------------------------ freqshift~ ----------------------------- */ /* frequency shifter */ /* code from swh_plugins by steve harris www.plugins.org.uk */ #define SIN_T_SIZE 64 #define D_SIZE 256 #define NZEROS 200 static t_class *freqshift_tilde_class; typedef struct _freqshift_tilde { t_object x_obj; t_float x_shift;//[0 - 5000] float *x_delay; unsigned int x_dptr; t_float x_fs; t_float x_last_shift; t_float x_phi; float *x_sint; float x_f; } t_freqshift_tilde; static void *freqshift_tilde_new(t_floatarg shift) { unsigned int i; t_freqshift_tilde *x = (t_freqshift_tilde *)pd_new(freqshift_tilde_class); //x->x_shift = shift; outlet_new(&x->x_obj, gensym("signal")); outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_shift); x->x_fs = sys_getsr(); x->x_delay = (float *)getbytes(D_SIZE * sizeof(float)); x->x_sint = (float *)getbytes(SIN_T_SIZE * sizeof(float)); x->x_dptr = 0; x->x_phi = 0.0f; x->x_last_shift = 0.0f; x->x_f = 0; for (i = 0; i < SIN_T_SIZE; i++) { x->x_sint[i] = sin(2.0f * M_PI * (float)i / (float)SIN_T_SIZE); } if (shift) x->x_shift = shift; else x->x_shift = 0; return (x); } /* The non-zero taps of the Hilbert transformer */ static float xcoeffs[] = { +0.0008103736f, +0.0008457886f, +0.0009017196f, +0.0009793364f, +0.0010798341f, +0.0012044365f, +0.0013544008f, +0.0015310235f, +0.0017356466f, +0.0019696659f, +0.0022345404f, +0.0025318040f, +0.0028630784f, +0.0032300896f, +0.0036346867f, +0.0040788644f, +0.0045647903f, +0.0050948365f, +0.0056716186f, +0.0062980419f, +0.0069773575f, +0.0077132300f, +0.0085098208f, +0.0093718901f, +0.0103049226f, +0.0113152847f, +0.0124104218f, +0.0135991079f, +0.0148917649f, +0.0163008758f, +0.0178415242f, +0.0195321089f, +0.0213953037f, +0.0234593652f, +0.0257599469f, +0.0283426636f, +0.0312667947f, +0.0346107648f, +0.0384804823f, +0.0430224431f, +0.0484451086f, +0.0550553725f, +0.0633242001f, +0.0740128560f, +0.0884368322f, +0.1090816773f, +0.1412745301f, +0.1988673273f, +0.3326528346f, +0.9997730178f, -0.9997730178f, -0.3326528346f, -0.1988673273f, -0.1412745301f, -0.1090816773f, -0.0884368322f, -0.0740128560f, -0.0633242001f, -0.0550553725f, -0.0484451086f, -0.0430224431f, -0.0384804823f, -0.0346107648f, -0.0312667947f, -0.0283426636f, -0.0257599469f, -0.0234593652f, -0.0213953037f, -0.0195321089f, -0.0178415242f, -0.0163008758f, -0.0148917649f, -0.0135991079f, -0.0124104218f, -0.0113152847f, -0.0103049226f, -0.0093718901f, -0.0085098208f, -0.0077132300f, -0.0069773575f, -0.0062980419f, -0.0056716186f, -0.0050948365f, -0.0045647903f, -0.0040788644f, -0.0036346867f, -0.0032300896f, -0.0028630784f, -0.0025318040f, -0.0022345404f, -0.0019696659f, -0.0017356466f, -0.0015310235f, -0.0013544008f, -0.0012044365f, -0.0010798341f, -0.0009793364f, -0.0009017196f, -0.0008457886f, -0.0008103736f, }; static float f_clamp(float x, float a, float b) { const float x1 = fabs(x - a); const float x2 = fabs(x - b); x = x1 + a + b; x -= x2; x *= 0.5; return x; } // Round float to int using IEEE int* hack static int f_round(float f) { f += (3<<22); return *((int*)&f) - 0x4b400000; } // Cubic interpolation function static float cube_interp(const float fr, const float inm1, const float in, const float inp1, const float inp2) { return in + 0.5f * fr * (inp1 - inm1 + fr * (4.0f * inp1 + 2.0f * inm1 - 5.0f * in - inp2 + fr * (3.0f * (in - inp1) - inm1 + inp2))); } static t_int *freqshift_tilde_perform(t_int *w) { t_freqshift_tilde *x = (t_freqshift_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out1 = (t_float *)(w[3]); t_float *out2 = (t_float *)(w[4]); int n = (int)(w[5]); float f, hilb, rm1, rm2, frac_p; float shift_i = x->x_last_shift; float sample_count = sys_getblksize(); unsigned int i; int int_p; const float shift_c = f_clamp(x->x_shift, 0.0f, 10000.0f); const float shift_inc = (shift_c - x->x_last_shift) / (float)sample_count; const float freq_fix = (float)SIN_T_SIZE / x->x_fs; while (n--) { f = *in++; x->x_delay[x->x_dptr] = f; /* Perform the Hilbert FIR convolution * (probably FFT would be faster) */ hilb = 0.0f; for (i = 0; i <= NZEROS/2; i++) { hilb += (xcoeffs[i] * x->x_delay[(x->x_dptr - i*2) & (D_SIZE - 1)]); } /* Calcuate the table positions for the sine modulator */ int_p = f_round(floor(x->x_phi)); /* Calculate ringmod1, the transformed input modulated with a shift Hz * sinewave. This creates a +180 degree sideband at source-shift Hz and * a 0 degree sindeband at source+shift Hz */ frac_p = x->x_phi - int_p; rm1 = hilb * cube_interp(frac_p, x->x_sint[int_p], x->x_sint[int_p+1], x->x_sint[int_p+2], x->x_sint[int_p+3]); /* Calcuate the table positions for the cosine modulator */ int_p = (int_p + SIN_T_SIZE / 4) & (SIN_T_SIZE - 1); /* Calculate ringmod2, the delayed input modulated with a shift Hz * cosinewave. This creates a 0 degree sideband at source+shift Hz * and a -180 degree sindeband at source-shift Hz */ rm2 = x->x_delay[(x->x_dptr - 100) & (D_SIZE - 1)] * cube_interp(frac_p, x->x_sint[int_p], x->x_sint[int_p+1], x->x_sint[int_p+2], x->x_sint[int_p+3]); /* Output the sum and differences of the ringmods. The +/-180 degree * sidebands cancel (more of less) and just leave the shifted * components */ *out1++ = (rm2 - rm1) * 0.5f; /*downshifting*/ *out2++ = (rm2 + rm1) * 0.5f; /*upshifting*/ x->x_dptr = (x->x_dptr + 1) & (D_SIZE - 1); x->x_phi += shift_i * freq_fix; while (x->x_phi > SIN_T_SIZE) { x->x_phi -= SIN_T_SIZE; } shift_i += shift_inc; } return (w+6); } static void freqshift_tilde_dsp(t_freqshift_tilde *x, t_signal **sp) { dsp_add(freqshift_tilde_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); } static void freqshift_tilde_free(t_freqshift_tilde *x) { if(x->x_delay) freebytes(x->x_delay, D_SIZE * sizeof(float)); if(x->x_sint) freebytes(x->x_sint, SIN_T_SIZE + 4 * sizeof(float)); } void freqshift_tilde_setup(void) { freqshift_tilde_class = class_new(gensym("freqshift~"), (t_newmethod)freqshift_tilde_new, (t_method)freqshift_tilde_free, sizeof(t_freqshift_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(freqshift_tilde_class, t_freqshift_tilde, x_f); class_addmethod(freqshift_tilde_class, (t_method)freqshift_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/Makefile0000644000076500007650000002503611466350200014100 0ustar hanshans## Pd library template version 1.0.3 # For instructions on how to use this template, see: # http://puredata.info/docs/developer/MakefileTemplate LIBRARY_NAME = sigpack # add your .c source files, one object per file, to the SOURCES # variable, help files will be included automatically SOURCES = chop~.c decimate~.c diode~.c foldback~.c foldover~.c freqdiv~.c freqshift~.c hardlimit~.c harmgen~.c impulse~.c rectify~.c round~.c saturate~.c shape~.c sieve~.c split~.c transient~.c ustep~.c valverect~.c vowel~.c wavewrap~.c # list all pd objects (i.e. myobject.pd) files here, and their helpfiles will # be included automatically PDOBJECTS = # example patches and related files, in the 'examples' subfolder EXAMPLES = # manuals and related files, in the 'manual' subfolder MANUAL = # if you want to include any other files in the source and binary tarballs, # list them here. This can be anything from header files, test patches, # documentation, etc. README.txt and LICENSE.txt are required and therefore # automatically included EXTRA_DIST = sigpack.c #------------------------------------------------------------------------------# # # things you might need to edit if you are using other C libraries # #------------------------------------------------------------------------------# CFLAGS = -DPD -I"$(PD_INCLUDE)" -Wall -W -g LDFLAGS = LIBS = #------------------------------------------------------------------------------# # # you shouldn't need to edit anything below here, if we did it right :) # #------------------------------------------------------------------------------# # get library version from meta file LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd) CFLAGS += -DVERSION='"$(LIBRARY_VERSION)"' PD_INCLUDE = $(PD_PATH)/include # where to install the library, overridden below depending on platform prefix = /usr/local libdir = $(prefix)/lib pkglibdir = $(libdir)/pd-externals objectsdir = $(pkglibdir) INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -m 644 INSTALL_DATA = $(INSTALL) -p -m 644 INSTALL_DIR = $(INSTALL) -p -m 755 -d ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \ $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows) DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION) ORIGDIR=pd-$(LIBRARY_NAME)_$(LIBRARY_VERSION) UNAME := $(shell uname -s) ifeq ($(UNAME),Darwin) CPU := $(shell uname -p) ifeq ($(CPU),arm) # iPhone/iPod Touch SOURCES += $(SOURCES_iphoneos) EXTENSION = pd_darwin OS = iphoneos PD_PATH = /Applications/Pd-extended.app/Contents/Resources IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin CC=$(IPHONE_BASE)/gcc CPP=$(IPHONE_BASE)/cpp CXX=$(IPHONE_BASE)/g++ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6 OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS) LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT) LIBS += -lc STRIP = strip -x DISTBINDIR=$(DISTDIR)-$(OS) else # Mac OS X SOURCES += $(SOURCES_macosx) EXTENSION = pd_darwin OS = macosx PD_PATH = /Applications/Pd-extended.app/Contents/Resources OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast # build universal 32-bit on 10.4 and 32/64 on newer ifeq ($(shell uname -r | sed 's|\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*|\1|'), 8) FAT_FLAGS = -arch ppc -arch i386 -mmacosx-version-min=10.4 else FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4 SOURCES += $(SOURCES_iphoneos) endif CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib # if the 'pd' binary exists, check the linking against it to aid with stripping LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd) LIBS += -lc STRIP = strip -x DISTBINDIR=$(DISTDIR)-$(OS) # install into ~/Library/Pd on Mac OS X since /usr/local isn't used much pkglibdir=$(HOME)/Library/Pd endif endif ifeq ($(UNAME),Linux) CPU := $(shell uname -m) SOURCES += $(SOURCES_linux) EXTENSION = pd_linux OS = linux PD_PATH = /usr OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer CFLAGS += -fPIC LDFLAGS += -Wl,--export-dynamic -shared -fPIC LIBS += -lc STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m) endif ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) CPU := $(shell uname -m) SOURCES += $(SOURCES_cygwin) EXTENSION = dll OS = cygwin PD_PATH = $(cygpath $(PROGRAMFILES))/pd OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer CFLAGS += LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" LIBS += -lc -lpd STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS) endif ifeq (MINGW,$(findstring MINGW,$(UNAME))) CPU := $(shell uname -m) SOURCES += $(SOURCES_windows) EXTENSION = dll OS = windows PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer CFLAGS += -mms-bitfields LDFLAGS += -s -shared -Wl,--enable-auto-import LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS) endif # in case somebody manually set the HELPPATCHES above HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.pd=-help.pd) CFLAGS += $(OPT_CFLAGS) .PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags $(LIBRARY_NAME) all: $(SOURCES:.c=.$(EXTENSION)) %.o: %.c $(CC) $(CFLAGS) -o "$*.o" -c "$*.c" %.$(EXTENSION): %.o $(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) chmod a-x "$*.$(EXTENSION)" # this links everything into a single binary file $(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS) chmod a-x $(LIBRARY_NAME).$(EXTENSION) install: libdir_install # The meta and help files are explicitly installed to make sure they are # actually there. Those files are not optional, then need to be there. libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc install-examples install-manual $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) test -z "$(strip $(SOURCES))" || (\ $(INSTALL_PROGRAM) $(SOURCES:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \ $(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(SOURCES:.c=.$(EXTENSION)))) test -z "$(strip $(PDOBJECTS))" || \ $(INSTALL_DATA) $(PDOBJECTS) \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) # install library linked as single binary single_install: $(LIBRARY_NAME) install-doc install-exec $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_PROGRAM) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION) install-doc: $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) test -z "$(strip $(SOURCES) $(PDOBJECTS))" || \ $(INSTALL_DATA) $(HELPPATCHES) \ $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) $(INSTALL_DATA) README.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/README.txt $(INSTALL_DATA) LICENSE.txt $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/LICENSE.txt install-examples: test -z "$(strip $(EXAMPLES))" || \ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples && \ for file in $(EXAMPLES); do \ $(INSTALL_DATA) examples/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/examples; \ done install-manual: test -z "$(strip $(MANUAL))" || \ $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual && \ for file in $(MANUAL); do \ $(INSTALL_DATA) manual/$$file $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/manual; \ done clean: -rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o) -rm -f -- $(SOURCES:.c=.$(EXTENSION)) -rm -f -- $(LIBRARY_NAME).o -rm -f -- $(LIBRARY_NAME).$(EXTENSION) distclean: clean -rm -f -- $(DISTBINDIR).tar.gz -rm -rf -- $(DISTBINDIR) -rm -f -- $(DISTDIR).tar.gz -rm -rf -- $(DISTDIR) -rm -f -- $(ORIGDIR).tar.gz -rm -rf -- $(ORIGDIR) $(DISTBINDIR): $(INSTALL_DIR) $(DISTBINDIR) libdir: all $(DISTBINDIR) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR) $(INSTALL_DATA) $(SOURCES) $(DISTBINDIR) $(INSTALL_DATA) $(HELPPATCHES) $(DISTBINDIR) test -z "$(strip $(EXTRA_DIST))" || \ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTBINDIR) # tar --exclude-vcs -czpf $(DISTBINDIR).tar.gz $(DISTBINDIR) $(DISTDIR): $(INSTALL_DIR) $(DISTDIR) $(ORIGDIR): $(INSTALL_DIR) $(ORIGDIR) dist: $(DISTDIR) $(INSTALL_DATA) Makefile $(DISTDIR) $(INSTALL_DATA) README.txt $(DISTDIR) $(INSTALL_DATA) LICENSE.txt $(DISTDIR) $(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTDIR) test -z "$(strip $(ALLSOURCES))" || \ $(INSTALL_DATA) $(ALLSOURCES) $(DISTDIR) test -z "$(strip $(PDOBJECTS))" || \ $(INSTALL_DATA) $(PDOBJECTS) $(DISTDIR) test -z "$(strip $(HELPPATCHES))" || \ $(INSTALL_DATA) $(HELPPATCHES) $(DISTDIR) test -z "$(strip $(EXTRA_DIST))" || \ $(INSTALL_DATA) $(EXTRA_DIST) $(DISTDIR) test -z "$(strip $(EXAMPLES))" || \ $(INSTALL_DIR) $(DISTDIR)/examples && \ for file in $(EXAMPLES); do \ $(INSTALL_DATA) examples/$$file $(DISTDIR)/examples; \ done test -z "$(strip $(MANUAL))" || \ $(INSTALL_DIR) $(DISTDIR)/manual && \ for file in $(MANUAL); do \ $(INSTALL_DATA) manual/$$file $(DISTDIR)/manual; \ done tar --exclude-vcs -czpf $(DISTDIR).tar.gz $(DISTDIR) # make a Debian source package dpkg-source: debclean make distclean dist mv $(DISTDIR) $(ORIGDIR) tar --exclude-vcs -czpf ../$(ORIGDIR).orig.tar.gz $(ORIGDIR) rm -f -- $(DISTDIR).tar.gz rm -rf -- $(DISTDIR) $(ORIGDIR) cd .. && dpkg-source -b $(LIBRARY_NAME) etags: etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h showsetup: @echo "CFLAGS: $(CFLAGS)" @echo "LDFLAGS: $(LDFLAGS)" @echo "LIBS: $(LIBS)" @echo "PD_INCLUDE: $(PD_INCLUDE)" @echo "PD_PATH: $(PD_PATH)" @echo "objectsdir: $(objectsdir)" @echo "LIBRARY_NAME: $(LIBRARY_NAME)" @echo "LIBRARY_VERSION: $(LIBRARY_VERSION)" @echo "SOURCES: $(SOURCES)" @echo "PDOBJECTS: $(PDOBJECTS)" @echo "ALLSOURCES: $(ALLSOURCES)" @echo "UNAME: $(UNAME)" @echo "CPU: $(CPU)" @echo "pkglibdir: $(pkglibdir)" @echo "DISTDIR: $(DISTDIR)" @echo "ORIGDIR: $(ORIGDIR)" pd-sigpack_0.0.4.2/chop~-help.pd0000644000076500007650000000156211466350200015040 0ustar hanshans#N canvas 366 389 401 359 10; #X text 60 35 signal chopping modulator; #X obj 62 116 osc~ 220; #X obj 62 312 dac~; #X obj 62 277 *~; #X obj 157 260 line~; #X obj 157 240 pack 0 50; #X obj 157 218 dbtorms; #X text 156 144 ->signal modulation input; #X text 155 116 ->signal input; #X text 60 51 multiplicates incoming signal by factor x; #X text 59 68 if modulation signal is positive; #X obj 89 146 osc~ 2; #X text 300 11 arg; #X text 293 301 sIgpAck 0.02; #X obj 62 186 chop~ 0; #X text 222 316 2003 www.weiss-archiv.de; #X text 60 13 ---chop~---; #X floatatom 157 172 5 0 0 1 -->factor[-2/2] - -; #X floatatom 157 199 5 0 100 0 - - -; #X connect 1 0 14 0; #X connect 3 0 2 0; #X connect 3 0 2 1; #X connect 4 0 3 1; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 11 0 14 1; #X connect 14 0 3 0; #X connect 17 0 14 2; #X connect 18 0 6 0; pd-sigpack_0.0.4.2/shape~.c0000644000076500007650000000372211466350200014100 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archiv.de #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ shape~ ----------------------------- // this external reshapes the wave by an exponential function, inspiration was taken from the Nord module of the same name. // code from swh_plugins by steve harris www.plugin.org.uk static t_class *shape_tilde_class; typedef struct _shape_tilde { t_object x_obj; t_sample x_shapep; float x_f; } t_shape_tilde; static void *shape_tilde_new(t_floatarg waveshape) { t_shape_tilde *x = (t_shape_tilde *)pd_new(shape_tilde_class); x->x_shapep = waveshape; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_shapep); x->x_f = 0; if (waveshape) x->x_shapep = waveshape; else x->x_shapep = 0.0f; return (x); } static t_int *shape_tilde_perform(t_int *w) { t_shape_tilde *x = (t_shape_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; float shape = 0.0f; if (x->x_shapep < 1.0f && x->x_shapep < -1.0f) { shape = 1.0f; } else if (shape < 0) { shape = -1.0f / shape; } else { shape = x->x_shapep; } while (n--) { f = *in++; if (f < 0.0f) { value = -pow(-f, shape); } else { value = pow(f, shape); } *out++ = value; } return (w+5); } static void shape_tilde_dsp(t_shape_tilde *x, t_signal **sp) { dsp_add(shape_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void shape_tilde_setup(void) { shape_tilde_class = class_new(gensym("shape~"), (t_newmethod)shape_tilde_new, 0, sizeof(t_shape_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(shape_tilde_class, t_shape_tilde, x_f); class_addmethod(shape_tilde_class, (t_method)shape_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/hardlimit~.c0000644000076500007650000000454511466350200014761 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archiv.de #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif // ------------------------ hardlimit~ ----------------------------- // brick hard limiter with residue mixer // code from swh_plugins by steve harris www.plugin.org.uk static t_class *hardlimit_tilde_class; typedef struct _hardlimit_tilde { t_object x_obj; t_sample x_limit_db;//-50.0 - 0.0 t_sample x_wet_gain;//0.0 - 1.0 t_sample x_res_gain;//0.0 - 1.0 float x_f; } t_hardlimit_tilde; static void *hardlimit_tilde_new(t_floatarg limitdb, t_floatarg wetgain, t_floatarg resgain) { t_hardlimit_tilde *x = (t_hardlimit_tilde *)pd_new(hardlimit_tilde_class); x->x_limit_db = limitdb; x->x_wet_gain = wetgain; x->x_res_gain = resgain; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_limit_db); floatinlet_new(&x->x_obj, &x->x_wet_gain); floatinlet_new(&x->x_obj, &x->x_res_gain); x->x_f = 0; if (limitdb) x->x_limit_db = limitdb; else x->x_limit_db = 0.0; if (wetgain) x->x_wet_gain = wetgain; else x->x_wet_gain = 0.0; if (resgain) x->x_res_gain = resgain; else x->x_res_gain = 0.0; return (x); } static t_int *hardlimit_tilde_perform(t_int *w) { t_hardlimit_tilde *x = (t_hardlimit_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f; float limit_g, sign, data, residue; while (n--) { f = *in++; limit_g = pow(10, x->x_limit_db / 20); sign = f < 0.0 ? -1.0 : 1.0; data = f * sign; residue = data > limit_g ? data - limit_g : 0.0; data -= residue; *out++ = sign * (x->x_wet_gain * data + x->x_res_gain * residue); } return (w+5); } static void hardlimit_tilde_dsp(t_hardlimit_tilde *x, t_signal **sp) { dsp_add(hardlimit_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void hardlimit_tilde_setup(void) { hardlimit_tilde_class = class_new(gensym("hardlimit~"), (t_newmethod)hardlimit_tilde_new, 0, sizeof(t_hardlimit_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(hardlimit_tilde_class, t_hardlimit_tilde, x_f); class_addmethod(hardlimit_tilde_class, (t_method)hardlimit_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/rectify~-help.pd0000644000076500007650000000137311466350200015554 0ustar hanshans#N canvas 381 374 379 281 10; #N canvas 0 0 450 300 (subpatch) 0; #X array rect 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 231 159 graph; #X msg 30 116 bang; #X obj 62 75 osc~ 1.345; #X obj 75 133 tabwrite~ osc; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 230 72 graph; #X text 340 68 1; #X text 333 124 -1; #X text 60 35 flips negative values to positive; #X text 342 153 1; #X text 334 213 -1; #X obj 62 201 tabwrite~ rect; #X text 277 244 sIgpAck 0.01; #X obj 62 165 rectify~; #X text 205 256 2002 www.weiss-archiv.de; #X text 60 13 ---rectify~---; #X connect 1 0 3 0; #X connect 1 0 10 0; #X connect 2 0 3 0; #X connect 2 0 12 0; #X connect 12 0 10 0; pd-sigpack_0.0.4.2/freqshift~-help.pd0000644000076500007650000000175011466350200016101 0ustar hanshans#N canvas 331 369 412 377 10; #N canvas 0 0 450 300 (subpatch) 0; #X array downshift 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 279 155 graph; #X msg 24 87 bang; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 279 67 graph; #X obj 72 105 tabwrite~ osc; #X text 60 13 ---freqshift~---; #X text 60 35 bode frequency shifter; #X text 315 12 arg; #X obj 62 168 freqshift~ 100; #X obj 62 78 osc~ 110; #X text 307 334 sIgpAck 0.03; #X text 235 349 2005 www.weiss-archiv.de; #X floatatom 159 148 5 0 0 2 shift[hz] - -; #N canvas 0 0 450 300 (subpatch) 0; #X array upshift 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 280 244 graph; #X obj 63 304 tabwrite~ downshift; #X obj 73 280 tabwrite~ upshift; #X connect 1 0 3 0; #X connect 1 0 13 0; #X connect 1 0 14 0; #X connect 7 0 13 0; #X connect 7 1 14 0; #X connect 8 0 3 0; #X connect 8 0 7 0; #X connect 11 0 7 1; pd-sigpack_0.0.4.2/valverect~-help.pd0000644000076500007650000000153111466350200016076 0ustar hanshans#N canvas 384 445 398 281 10; #N canvas 0 0 450 300 (subpatch) 0; #X array vrect 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 275 147 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 274 60 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 110 126 5 0 1 1 -->level[0-1] - -; #X floatatom 159 148 5 0 1 1 -->distortion - -; #X obj 62 201 tabwrite~ vrect; #X text 60 13 ---valverect~---; #X text 60 35 valve rectifier; #X text 243 10 arg; #X text 303 241 sIgpAck 0.04; #X text 232 254 2007 www.weiss-archiv.de; #X obj 62 168 valverect~ 1 1; #X connect 1 0 4 0; #X connect 1 0 7 0; #X connect 2 0 4 0; #X connect 2 0 13 0; #X connect 5 0 13 1; #X connect 6 0 13 2; #X connect 13 0 7 0; pd-sigpack_0.0.4.2/freqdiv~-help.pd0000644000076500007650000000144511466350200015547 0ustar hanshans#N canvas 272 399 439 284 10; #N canvas 0 0 450 300 (subpatch) 0; #X array div 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 307 158 graph; #X msg 23 88 bang; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 306 70 graph; #X obj 72 105 tabwrite~ osc; #X obj 62 201 tabwrite~ div; #X floatatom 135 145 5 0 8 1 -->denominate - -; #X text 315 12 arg; #X text 60 35 signal frequency divider; #X obj 62 78 osc~ 4; #X text 180 155 [(int)0-8]; #X text 333 241 sIgpAck 0.02; #X obj 62 168 freqdiv~ 1; #X text 262 254 2003 www.weiss-archiv.de; #X text 60 13 ---freqdiv~---; #X connect 1 0 3 0; #X connect 1 0 4 0; #X connect 5 0 11 1; #X connect 8 0 3 0; #X connect 8 0 11 0; #X connect 11 0 4 0; pd-sigpack_0.0.4.2/shape~-help.pd0000644000076500007650000000142311466350200015203 0ustar hanshans#N canvas 410 382 385 284 10; #N canvas 0 0 450 300 (subpatch) 0; #X array shape 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 254 150 graph; #X msg 25 88 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 253 63 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 129 149 5 0 0 2 shape[-10-10] - -; #X text 60 13 ---shape~---; #X text 60 31 reshape input by an exponential function; #X obj 62 168 shape~ 10; #X obj 62 201 tabwrite~ shape; #X text 293 12 arg; #X text 280 241 sIgpAck 0.04; #X text 209 254 2007 www.weiss-archiv.de; #X connect 1 0 4 0; #X connect 1 0 9 0; #X connect 2 0 4 0; #X connect 2 0 8 0; #X connect 5 0 8 1; #X connect 8 0 9 0; pd-sigpack_0.0.4.2/wavewrap~.c0000644000076500007650000000346011466350200014633 0ustar hanshans// sigpack // for // pure-data // by weiss // www.weiss-archiv.de #include "m_pd.h" #include #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif #define M_PI 3.14159265358979323846 // ------------------------ wavewrap~ ----------------------------- // sinus wavewrapper. produces an unusual distortion effect // code from swh_plugins by steve harris www.plugin.org.uk static t_class *wavewrap_tilde_class; typedef struct _wavewrap_tilde { t_object x_obj; t_sample x_wrap; float x_f; } t_wavewrap_tilde; static void *wavewrap_tilde_new(t_floatarg wrap) { t_wavewrap_tilde *x = (t_wavewrap_tilde *)pd_new(wavewrap_tilde_class); x->x_wrap = wrap; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_wrap); x->x_f = 0; if (wrap) x->x_wrap = wrap; else x->x_wrap = 0; return (x); } static t_int *wavewrap_tilde_perform(t_int *w) { t_wavewrap_tilde *x = (t_wavewrap_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; float coef = x->x_wrap * M_PI; if (coef < 0.05f) { coef = 0.05f; } while (n--) { f = *in++; value = sin(f * coef); *out++ = value; } return (w+5); } static void wavewrap_tilde_dsp(t_wavewrap_tilde *x, t_signal **sp) { dsp_add(wavewrap_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void wavewrap_tilde_setup(void) { wavewrap_tilde_class = class_new(gensym("wavewrap~"), (t_newmethod)wavewrap_tilde_new, 0, sizeof(t_wavewrap_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(wavewrap_tilde_class, t_wavewrap_tilde, x_f); class_addmethod(wavewrap_tilde_class, (t_method)wavewrap_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/vowel~-help.pd0000644000076500007650000000211111466350200015232 0ustar hanshans#N canvas 308 311 323 356 10; #X text 60 35 simple formant filter; #X text 202 11 arg; #X obj 62 78 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 62 96 metro 200; #X obj 62 120 random 440; #X msg 195 98 0; #X msg 195 120 1; #X msg 195 142 2; #X msg 195 165 3; #X msg 194 188 4; #X obj 62 294 *~; #X obj 193 277 line~; #X obj 193 254 pack 0 50; #X obj 193 232 dbtorms; #X obj 62 329 dac~; #X text 232 96 ->a; #X text 233 120 ->e; #X text 232 141 ->i; #X text 231 165 ->o; #X text 231 187 ->u; #X obj 62 145 phasor~ 220; #X text 226 315 sIgpAck 0.02; #X obj 62 205 vowel~ 0; #X text 154 329 2003 www.weiss-archiv.de; #X text 60 13 ---vowel~---; #X floatatom 193 214 5 0 100 0 - - -; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 20 0; #X connect 5 0 22 1; #X connect 6 0 22 1; #X connect 7 0 22 1; #X connect 8 0 22 1; #X connect 9 0 22 1; #X connect 10 0 14 0; #X connect 10 0 14 1; #X connect 11 0 10 1; #X connect 12 0 11 0; #X connect 13 0 12 0; #X connect 20 0 22 0; #X connect 22 0 10 0; #X connect 25 0 13 0; pd-sigpack_0.0.4.2/round~.c0000644000076500007650000000306411466350200014126 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ round~ ----------------------------- */ /* simple rounder */ static t_class *round_tilde_class; typedef struct _round_tilde { t_object x_obj; t_sample x_coarse; float x_f; } t_round_tilde; static void *round_tilde_new(t_floatarg coarse) { t_round_tilde *x = (t_round_tilde *)pd_new(round_tilde_class); x->x_coarse = coarse; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_coarse); x->x_f = 0; if(coarse) x->x_coarse = coarse; else x->x_coarse = 1; return (x); } static t_int *round_tilde_perform(t_int *w) { t_round_tilde *x = (t_round_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, mult, value; while (n--) { f = *in++; mult = f * x->x_coarse; value = (int)mult / x->x_coarse; *out++ = value; } return (w+5); } static void round_tilde_dsp(t_round_tilde *x, t_signal **sp) { dsp_add(round_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void round_tilde_setup(void) { round_tilde_class = class_new(gensym("round~"), (t_newmethod)round_tilde_new, 0, sizeof(t_round_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(round_tilde_class, t_round_tilde, x_f); class_addmethod(round_tilde_class, (t_method)round_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/hardlimit~-help.pd0000644000076500007650000000167711466350200016073 0ustar hanshans#N canvas 377 391 462 294 10; #N canvas 0 0 450 300 (subpatch) 0; #X array div 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 324 155 graph; #X msg 23 88 bang; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 323 67 graph; #X obj 72 105 tabwrite~ osc; #X obj 62 223 tabwrite~ div; #X floatatom 100 128 5 -50 0 1 -->limit[db-50-0] - -; #X obj 62 78 osc~ 4; #X text 60 13 ---hardlimit~---; #X floatatom 138 150 5 0 0 1 -->wet_mix[0-1] - -; #X floatatom 177 173 5 0 0 1 -->residue_mix[0-1] - -; #X obj 62 195 hardlimit~ -8 1 0; #X text 60 35 brick hard limiter with residue mixer; #X text 302 11 arg; #X text 350 241 sIgpAck 0.04; #X text 279 254 2007 www.weiss-archiv.de; #X connect 1 0 3 0; #X connect 1 0 4 0; #X connect 5 0 10 1; #X connect 6 0 3 0; #X connect 6 0 10 0; #X connect 8 0 10 2; #X connect 9 0 10 3; #X connect 10 0 4 0; pd-sigpack_0.0.4.2/foldback~.c0000644000076500007650000000350311466350200014542 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ foldback~ ----------------------------- */ /* signal mirror */ static t_class *foldback_tilde_class; typedef struct _foldback_tilde { t_object x_obj; t_sample x_low; t_sample x_high; float x_f; } t_foldback_tilde; static void *foldback_tilde_new(t_floatarg low, t_floatarg high) { t_foldback_tilde *x = (t_foldback_tilde *)pd_new(foldback_tilde_class); x->x_low = low; x->x_high = high; outlet_new(&x->x_obj, gensym("signal")); floatinlet_new(&x->x_obj, &x->x_low); floatinlet_new(&x->x_obj, &x->x_high); x->x_f = 0; if(low) x->x_low = low; else x->x_low = -1; if(high) x->x_high = high; else x->x_high = 1; return (x); } static t_int *foldback_tilde_perform(t_int *w) { t_foldback_tilde *x = (t_foldback_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; while (n--) { f = *in++; if(f < x->x_low) value = (f - ((f - x->x_low) * 2)); else if(f > x->x_high) value = (f - ((f - x->x_high) * 2)); else value = f; *out++ = value; } return (w+5); } static void foldback_tilde_dsp(t_foldback_tilde *x, t_signal **sp) { dsp_add(foldback_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void foldback_tilde_setup(void) { foldback_tilde_class = class_new(gensym("foldback~"), (t_newmethod)foldback_tilde_new, 0, sizeof(t_foldback_tilde), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(foldback_tilde_class, t_foldback_tilde, x_f); class_addmethod(foldback_tilde_class, (t_method)foldback_tilde_dsp, gensym("dsp"), 0); } pd-sigpack_0.0.4.2/sieve~-help.pd0000644000076500007650000000150511466350200015217 0ustar hanshans#N canvas 377 364 401 281 10; #N canvas 0 0 450 300 (subpatch) 0; #X array sieve 44100 float 0; #X coords 0 1.02 44099 -1.02 100 70 1; #X restore 269 150 graph; #X msg 24 87 bang; #X obj 62 78 osc~ 1.5; #N canvas 0 0 450 300 (subpatch) 0; #X array osc 44100 float 0; #X coords 0 1 44099 -1 100 70 1; #X restore 269 62 graph; #X obj 72 105 tabwrite~ osc; #X floatatom 104 140 1 0 0 2 mode - -; #X floatatom 147 142 5 0 0 2 samp[-1/1] - -; #X text 295 240 sIgpAck 0.03; #X text 223 253 2005 www.weiss-archiv.de; #X obj 62 201 tabwrite~ sieve; #X obj 62 168 sieve~ 0 0.5; #X text 60 13 ---sieve~---; #X text 60 35 simple sample sifter; #X text 279 13 arg; #X connect 1 0 4 0; #X connect 1 0 9 0; #X connect 2 0 4 0; #X connect 2 0 10 0; #X connect 5 0 10 1; #X connect 6 0 10 2; #X connect 10 0 9 0; pd-sigpack_0.0.4.2/rectify~.c0000644000076500007650000000272011466350200014442 0ustar hanshans/* sIgpAck * for * pure-data * www.weiss-archiv.de */ #include "m_pd.h" #ifdef _MSC_VER #pragma warning( disable : 4244 ) #pragma warning( disable : 4305 ) #endif /* ------------------------ rectify~ ----------------------------- */ /* flips negative signal values to positive */ static t_class *rectify_tilde_class; typedef struct _rectify_tilde { t_object x_obj; float x_f; } t_rectify_tilde; static void *rectify_tilde_new(void) { t_rectify_tilde *x = (t_rectify_tilde *)pd_new(rectify_tilde_class); outlet_new(&x->x_obj, gensym("signal")); x->x_f = 0; return (x); } static t_int *rectify_tilde_perform(t_int *w) { t_rectify_tilde *x = (t_rectify_tilde *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); float f, value; while (n--) { f = *in++; if (f < 0) value = f * -1; else value = f; *out++ = value; } return (w+5); } static void rectify_tilde_dsp(t_rectify_tilde *x, t_signal **sp) { dsp_add(rectify_tilde_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); } void rectify_tilde_setup(void) { rectify_tilde_class = class_new(gensym("rectify~"), (t_newmethod)rectify_tilde_new, 0, sizeof(t_rectify_tilde), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(rectify_tilde_class, t_rectify_tilde, x_f); class_addmethod(rectify_tilde_class, (t_method)rectify_tilde_dsp, gensym("dsp"), 0); }