I actually went the easy way and doubled the [delwrite~]. After adding the delay time to the [switch~] "off" message it worked just fine.
This is because I have delay times of 20 - 50 ms for doubling notes. Since note events are not happening any faster then that it is working. Indeed, using higher delay times would still result in clicks. So Mathieu's fix for [delwrite~] is the only "real" solution for this. I'm going to check it out when I get some spare time.
I hope this fix will be added to pd vanilla's / pd-extended's releases!!!
Thanks for spending the time, Mathieu!
Ingo
-----Ursprüngliche Nachricht----- Von: Mathieu Bouchard [mailto:matju@artengine.ca] Gesendet: Dienstag, 1. Februar 2011 04:07 An: Ingo Scherzinger Cc: pd-list@iem.at Betreff: Re: AW: [PD] how can I clear [vd~]
On Tue, 1 Feb 2011, Ingo Scherzinger wrote:
Yes, you are right, Mathieu! It's the [delwrite~]! I am already toggling between two [vd~] objects. I guess if I'd add a second [delwrite~] to keep the other one "cleard"
with no
signal being fed into it while the other one is active it would work. Thank you for the idea!
Well, if you switch off and on and off and on real quick, then your double-delwrite~ trick doesn't work anymore. I suppose that it would be better to actually add the clear method :
Index: d_delay.c
--- d_delay.c (révision 14844) +++ d_delay.c (copie de travail) @@ -5,6 +5,7 @@ /* send~, delread~, throw~, catch~ */
#include "m_pd.h" +#include <string.h> extern int ugen_getsortno(void);
#define DEFDELVS 64 /* LATER get this from canvas at DSP time */ @@ -129,6 +130,11 @@ (x->x_cspace.c_n + XTRASAMPS) * sizeof(t_sample)); }
+static void sigdelwrite_clear(t_sigdelwrite *x) {
- int n = XTRASAMPS + x->x_cspace.c_n;
- memset(x->x_cspace.c_vec, 0, n * sizeof(t_sample));
+}
- static void sigdelwrite_setup(void) { sigdelwrite_class = class_new(gensym("delwrite~"),
@@ -137,6 +143,8 @@ CLASS_MAINSIGNALIN(sigdelwrite_class, t_sigdelwrite, x_f); class_addmethod(sigdelwrite_class, (t_method)sigdelwrite_dsp, gensym("dsp"), 0);
class_addmethod(sigdelwrite_class, (t_method)sigdelwrite_clear,
gensym("clear"), 0);
}
/* ----------------------------- delread~ -----------------------------
*/
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC