Help needed with stutter effect. ADSR is clicking sometimes
Hello. I’m working on a stutter type effect, designed to be used as an insert plugin.
You can see a youtube video of the current version in operation here:
And you can get the mxf file here:
As you can hear in the video, the stutter effect clicks sometimes and often the ‘grains’ play erratically (sometimes they do not stop when they are supposed to).
Advice i’ve gotten so far (thanks em411 guys!) suggests that the clicking and erratic quirks have to do with the fact that i’m using an adsr~ object, triggered by a control rate message, to control the amplitude envelope of each grain (i chose for the adsr~ because it suppresses clicks on retriggers), rather than an object that is running at audio rate.
So i’m wondering what would be the best way of controlling the amplitude of these grains, in a way that guarantees that there is no ‘sloppiness’ like you can currently hear.
I’m using a groove~ object to play the grains, so i could use the third ‘position’ output to drive something else, at audio rate, that could provide the information that would modulate the amplitude. Would an audio rate control over amplitude eliminate the messy artifacts i’m getting at the moment, do you think?
This is where my max/msp knowledge lets me down:
Should i be looking at a table? or a buffer? or would line~ be better?
If i use a buffer like thing, what would be an elegant way of getting a simple ‘envelope’ shape into it? and how could i avoid clicks if the ‘envelope’ retriggers before it’s finished?
Thanks in advance to anyone who takes a look, or a crack at any of the questions!
> I’m using a groove~ object to play the grains, so i could use the third ‘position’ output to drive >something else, at audio rate, that could provide the information that would modulate the amplitude. >Would an audio rate control over amplitude eliminate the messy artifacts i’m getting at the moment, >do you think?
You could try using the third outlet of the groove~ as a driver for the phase in a cycle~ object (right inlet). Load a window into a buffer~ object, add an argument corresponding to the buffer~’s name and use it in a similar way to your adsr~.
#N vpatcher 10 59 255 427;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 25 293 31 196617 dac~;
#P message 24 69 43 196617 replace;
#P newex 24 90 81 196617 buffer~ window;
#P newex 25 249 30 196617 *~;
#P newex 45 199 74 196617 cycle~ window;
#P newex 25 135 94 196617 groove~ sound;
#P comment 68 70 148 196617 < - load a windowing file in here;
#P connect 5 0 4 0;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P connect 2 0 3 1;
#P fasten 3 0 6 1 30 282 51 282;
#P connect 1 1 2 1;
Thanks very much george, i’ll look into implementing this technique.