diff --git a/pd/nw/todo.txt b/pd/nw/todo.txt index 5582ae718009dd4f8b41d8f74d81026d9f8b499e..d42d240a17a323a4e8a382e1456f5504f1336200 100644 --- a/pd/nw/todo.txt +++ b/pd/nw/todo.txt @@ -241,7 +241,7 @@ Everything else: (A [x] means we've fixed it) [ ] port the bug fix from pd-l2ork git repo in commit 6084c8e5f86d1521edde3a899a6d5b5821aa27c6 "*fixed bug reported by Gilberto in..." -[ ] same for 50719c4c455291be3ac679486f7e4d72706bd9e4 +[x] same for 50719c4c455291be3ac679486f7e4d72706bd9e4 [ ] same for a620228554d1662bacd0f2f8cfc65259049164ec [ ] same for "*fixed spaces in old UI objects that were converted to \t..." 262447434c3548c53bc0b52e7f5bb5431b233311 diff --git a/pd/src/d_filter.c b/pd/src/d_filter.c index 618f2ac303ba60efe613999746dbbbf549cf7440..448782f757c334d8fe2ea0bf62aba42eea54fd87 100644 --- a/pd/src/d_filter.c +++ b/pd/src/d_filter.c @@ -53,6 +53,37 @@ static void sighip_ft1(t_sighip *x, t_floatarg f) } static t_int *sighip_perform(t_int *w) +{ + t_sample *in = (t_sample *)(w[1]); + t_sample *out = (t_sample *)(w[2]); + t_hipctl *c = (t_hipctl *)(w[3]); + int n = (t_int)(w[4]); + int i; + t_sample last = c->c_x; + t_sample coef = c->c_coef; + if (coef < 1) + { + t_sample normal = 0.5*(1+coef); + for (i = 0; i < n; i++) + { + t_sample new = *in++ + coef * last; + *out++ = normal * (new - last); + last = new; + } + if (PD_BIGORSMALL(last)) + last = 0; + c->c_x = last; + } + else + { + for (i = 0; i < n; i++) + *out++ = *in++; + c->c_x = 0; + } + return (w+5); +} + +static t_int *sighip_perform_old(t_int *w) { t_sample *in = (t_sample *)(w[1]); t_sample *out = (t_sample *)(w[2]); @@ -86,10 +117,9 @@ static void sighip_dsp(t_sighip *x, t_signal **sp) { x->x_sr = sp[0]->s_sr; sighip_ft1(x, x->x_hz); - dsp_add(sighip_perform, 4, - sp[0]->s_vec, sp[1]->s_vec, - x->x_ctl, sp[0]->s_n); - + dsp_add((pd_compatibilitylevel > 43 ? + sighip_perform : sighip_perform_old), + 4, sp[0]->s_vec, sp[1]->s_vec, x->x_ctl, sp[0]->s_n); } static void sighip_clear(t_sighip *x, t_floatarg q) @@ -102,8 +132,8 @@ void sighip_setup(void) sighip_class = class_new(gensym("hip~"), (t_newmethod)sighip_new, 0, sizeof(t_sighip), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(sighip_class, t_sighip, x_f); - class_addmethod(sighip_class, (t_method)sighip_dsp, gensym("dsp"), - A_CANT, 0); + class_addmethod(sighip_class, (t_method)sighip_dsp, + gensym("dsp"), A_CANT, 0); class_addmethod(sighip_class, (t_method)sighip_ft1, gensym("ft1"), A_FLOAT, 0); class_addmethod(sighip_class, (t_method)sighip_clear, gensym("clear"), 0); @@ -193,8 +223,8 @@ void siglop_setup(void) siglop_class = class_new(gensym("lop~"), (t_newmethod)siglop_new, 0, sizeof(t_siglop), 0, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(siglop_class, t_siglop, x_f); - class_addmethod(siglop_class, (t_method)siglop_dsp, gensym("dsp"), - A_CANT, 0); + class_addmethod(siglop_class, (t_method)siglop_dsp, + gensym("dsp"), A_CANT, 0); class_addmethod(siglop_class, (t_method)siglop_ft1, gensym("ft1"), A_FLOAT, 0); class_addmethod(siglop_class, (t_method)siglop_clear, gensym("clear"), 0); @@ -328,8 +358,8 @@ void sigbp_setup(void) sigbp_class = class_new(gensym("bp~"), (t_newmethod)sigbp_new, 0, sizeof(t_sigbp), 0, A_DEFFLOAT, A_DEFFLOAT, 0); CLASS_MAINSIGNALIN(sigbp_class, t_sigbp, x_f); - class_addmethod(sigbp_class, (t_method)sigbp_dsp, gensym("dsp"), - A_CANT, 0); + class_addmethod(sigbp_class, (t_method)sigbp_dsp, + gensym("dsp"), A_CANT, 0); class_addmethod(sigbp_class, (t_method)sigbp_ft1, gensym("ft1"), A_FLOAT, 0); class_addmethod(sigbp_class, (t_method)sigbp_ft2, @@ -455,8 +485,8 @@ void sigbiquad_setup(void) sigbiquad_class = class_new(gensym("biquad~"), (t_newmethod)sigbiquad_new, 0, sizeof(t_sigbiquad), 0, A_GIMME, 0); CLASS_MAINSIGNALIN(sigbiquad_class, t_sigbiquad, x_f); - class_addmethod(sigbiquad_class, (t_method)sigbiquad_dsp, gensym("dsp"), - A_CANT, 0); + class_addmethod(sigbiquad_class, (t_method)sigbiquad_dsp, + gensym("dsp"), A_CANT, 0); class_addlist(sigbiquad_class, sigbiquad_list); class_addmethod(sigbiquad_class, (t_method)sigbiquad_set, gensym("set"), A_GIMME, 0); @@ -497,7 +527,7 @@ static t_int *sigsamphold_perform(t_int *w) int i; t_sample lastin = x->x_lastin; t_sample lastout = x->x_lastout; - for (i = 0; i < n; i++, *in1++) + for (i = 0; i < n; i++, in1++) { t_sample next = *in2++; if (next < lastin) lastout = *in1; diff --git a/pd/src/m_glob.c b/pd/src/m_glob.c index d6e7f58c31903a461d573dfb40108e7c5c0e0a5c..028d462453597e1c2243f5ef60cfb3ec21bc5663 100644 --- a/pd/src/m_glob.c +++ b/pd/src/m_glob.c @@ -9,6 +9,7 @@ t_class *glob_pdobject; static t_class *maxclass; int sys_perf; /* true if we should query user on close and quit */ +int pd_compatibilitylevel = 43; /* e.g., 43 for pd 0.43 compatibility */ /* These "glob" routines, which implement messages to Pd, are from all over. Some others are prototyped in m_imp.h as well. */ @@ -38,6 +39,12 @@ void glob_savepreferences(t_pd *dummy); void alsa_resync( void); +static void glob_compatibility(t_pd *dummy, t_floatarg level) +{ + int dspwas = canvas_suspend_dsp(); + pd_compatibilitylevel = 0.5 + 100. * level; + canvas_resume_dsp(dspwas); +} #ifdef MSW void glob_audio(void *dummy, t_floatarg adc, t_floatarg dac); diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index 7fb61be59727b085f164838296222361849bfb61..f3c0a9b791452f5f6228e1bec116d0d2cd83467d 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -13,8 +13,9 @@ extern "C" { #define PD_MAJOR_VERSION 0 #define PD_MINOR_VERSION 42 #define PD_BUGFIX_VERSION 7 -#define PD_TEST_VERSION "20140903" +#define PD_TEST_VERSION "20150804" #define PDL2ORK +extern int pd_compatibilitylevel; /* e.g., 43 for pd 0.43 compatibility */ /* old name for "MSW" flag -- we have to take it for the sake of many old "nmakefiles" for externs, which will define NT and not MSW */