Forums > MaxMSP

gate -> ramp, adsr?

October 19, 2008 | 12:31 pm

hey all. I’m trying to make a little abstraction that takes a (signal) gate
in and puts out a ramp (0-1) of length specified in ms.

The solution i’m working with atm uses rampsmooth, but this is problematic
because if the gate is shorter than the desired grain length then the ramp
is too short.

the other thing i need it to do is that if it gets a second gate before the
first one is complete I want it to ignore the second gate and just complete
the ramp.

Is adsr~ the best solution?

here’s the patch i’ve got now:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 15 55 334 247;
#P window setfont "Sans Serif" 9.;
#P message 187 77 52 9109513 rampup $1;
#P newex 135 50 62 9109513 mstosamps~;
#P newex 50 103 101 9109513 rampsmooth~ 20000 0;
#N comlet grain length (ms);
#P inlet 135 30 15 0;
#N comlet gate in;
#P inlet 50 83 15 0;
#P outlet 50 127 15 0;
#P connect 5 0 3 0;
#P connect 1 0 3 0;
#P connect 3 0 0 0;
#P connect 2 0 4 0;
#P connect 4 1 5 0;
#P pop;
#P newobj 138 204 67 9109513 p make Ramp;
#P window clipboard copytext "p make Ramp" #E;
#P window clipboard copycount 1;


October 19, 2008 | 1:04 pm

If it’d just a gate~ with variable ramp time that you’re after, why not use matrix~ ?
Cheers
Roger


October 19, 2008 | 2:51 pm

sorry, i meant gate as in cv/gate. In this case I want to use a comparator
to trigger sample playback for granulation. noise~ => sah~ => >~ => (rampy
thingy) => wave~

On Sun, Oct 19, 2008 at 9:04 AM, roger.carruthers <
roger.carruthers@btinternet.com> wrote:

>
> If it’d just a gate~ with variable ramp time that you’re after,
> why not use matrix~ ?
> Cheers
> Roger
>
>
>


October 19, 2008 | 3:28 pm

blast, adsr~ doesn’t work cuz it decays when the gate goes away.

On Sun, Oct 19, 2008 at 10:51 AM, George Locke <
george.locke.maxmsp@gmail.com> wrote:

> sorry, i meant gate as in cv/gate. In this case I want to use a comparator
> to trigger sample playback for granulation. noise~ => sah~ => >~ => (rampy
> thingy) => wave~
>
>
> On Sun, Oct 19, 2008 at 9:04 AM, roger.carruthers <
> roger.carruthers@btinternet.com> wrote:
>
>>
>> If it’d just a gate~ with variable ramp time that you’re
>> after, why not use matrix~ ?
>> Cheers
>> Roger
>>
>>
>>
>
>


October 21, 2008 | 3:18 pm

So I found a solution that solved part of the problem: comparator ->
change~ -> ==~ -1 -> rampsmooth~ X 0 -> +~ 1

This will make a fixed length ramp from 0 to 1.

What I haven’t solved is preventing the ramp from retriggering.

The first thing I thought of was to put a ==~0 on the ramp and use this to
control a gate~ between the comparator and the change~ object, but max
doesn’t allow this kind of feedback without tapin/out. If it comes down to
it, using tapin would not be such a big deal since retriggers less than a
signal vector apart won’t be necessary, but i’m wondering if there is a more
elegant solution?

On Sun, Oct 19, 2008 at 11:28 AM, George Locke <
george.locke.maxmsp@gmail.com> wrote:

> blast, adsr~ doesn’t work cuz it decays when the gate goes away.
>
>
> On Sun, Oct 19, 2008 at 10:51 AM, George Locke <
> george.locke.maxmsp@gmail.com> wrote:
>
>> sorry, i meant gate as in cv/gate. In this case I want to use a
>> comparator to trigger sample playback for granulation. noise~ => sah~ => >~
>> => (rampy thingy) => wave~
>>
>>
>> On Sun, Oct 19, 2008 at 9:04 AM, roger.carruthers <
>> roger.carruthers@btinternet.com> wrote:
>>
>>>
>>> If it’d just a gate~ with variable ramp time that you’re
>>> after, why not use matrix~ ?
>>> Cheers
>>> Roger
>>>
>>>
>>>
>>
>>
>


June 30, 2009 | 5:46 pm

running up against this issue again. the problem with the rampsmooth method is that you can’t control the length of the ramp via signals. I want to change the ramp length at each trigger for granular synthesis.

again, what i’m after is a way to create a ramp from 0 to 1 triggered by a signal pulse, as from change~. I may just have to write my own external. ug.


June 30, 2009 | 7:41 pm

zigzag~


July 2, 2009 | 3:28 pm

thanks!!

it looks like if I want to control the ramp time in milliseconds i’ll have to to do some signal division (to convert period to frequency), but this should do the trick perfectly.

thanks again!


Viewing 8 posts - 1 through 8 (of 8 total)