Forums > MaxMSP

trigger question-new try

May 27, 2008 | 8:11 am

hello,
I am trying to trigger samples when I hit a drum.
so when the strokes are coming in in the same timing,
my patch fails to play them back straight, there always
seems to be a latency. here is a simple version of the patch

max v2;
#N vpatcher 477 56 1820 888;
#P origin 182 25;
#P button 489 287 16 0;
#P window setfont "Sans Serif" 9.;
#P number 489 260 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gain~ 559 445 24 100 158 0 1.071519 7.94321 10.;
#P newex 559 612 43 196617 dac~ 2;
#P button 450 115 15 0;
#P hidden number 418 609 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 416 388 14 196617 1;
#P user gain~ 489 445 24 100 158 0 1.071519 7.94321 10.;
#P toggle 468 567 15 0;
#P newex 489 613 40 196617 dac~ 1;
#P newex 489 80 37 196617 r beat;
#P message 536 333 30 196617 open;
#N sfplay~ 1 120960 0 ;
#P newobj 489 404 44 196617 sfplay~;
#P button 133 268 15 0;
#P message 133 338 14 196617 1;
#P button 133 358 15 0;
#P message 150 338 14 196617 0;
#P newex 133 306 61 196617 delay 1000;
#P user gswitch2 172 358 39 32 1 0;
#N vpatcher 206 135 989 773;
#P origin 94 20;
#P outlet 75 491 15 0;
#P toggle 159 104 15 0;
#P window setfont "Sans Serif" 9.;
#P message 175 104 55 196617 logfreq $1;
#P toggle 159 157 15 0;
#P message 174 157 74 196617 numdisplay $1;
#P toggle 159 140 15 0;
#P message 174 140 65 196617 dbdisplay $1;
#P toggle 159 123 15 0;
#P message 174 123 55 196617 logamp $1;
#P hidden newex 294 29 45 196617 loadbang;
#P hidden message 298 59 31 196617 set 1;
#P user umenu 252 104 70 196647 1 64 120 0;
#X add display;
#X add lowpass;
#X add highpass;
#X add bandpass;
#X add bandstop;
#X add peaknotch;
#X add lowshelf;
#X add highshelf;
#X add resonant;
#X add allpass;
#P comment 252 85 67 196617 filter modes:;
#P inlet 89 139 15 0;
#P flonum 258 484 94 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 202 345 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 377 165 35 196617 Q or S;
#P flonum 377 181 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 328 181 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 279 181 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user filtergraph~ 166 207 255 124 3 9 0. 22050. 0.125 8. 1 1 1 0 0 1 1;
#X frgb 193 193 255;
#X brgb 233 233 255;
#X rgb2 0 0 0;
#X rgb3 130 130 130;
#X rgb4 0 0 0;
#X rgb5 118 121 166;
#X rgb6 210 74 54;
#X rgb7 255 22 22;
#X linmarkers 5512.5 11025. 16537.5;
#X logmarkers 10. 100. 1000. 10000.;
#X nfilters 1;
#X setfilter 0 2 0 0 0 606.462891 1. 1.543586 0.0001 22050. 0.0001 16. 0.5
25.;
#X done;
#P comment 279 165 46 196617 freq;
#P comment 328 165 39 196617 gain;
#P user spectroscope~ 27 221 123 95 20 0 1 3 0 1 0 0 0 0 0 0;
#X frgb 224 224 224;
#X brgb 255 255 255;
#X rgb2 0 0 0;
#X rgb3 243 204 204;
#X rgb4 255 0 0;
#X rgb5 184 184 184;
#X rgb6 0 0 0;
#X rgb7 0 0 0;
#X rgb8 255 255 255;
#X rgb9 255 0 0;
#X rgb10 255 191 0;
#X rgb11 0 191 127;
#X rgb12 127 0 127;
#X rgb13 0 0 0;
#X range 0. 1.;
#X domain 0. 22050.;
#X done;
#P user spectroscope~ 258 361 123 95 20 1 1 3 0 1 0 0 0 0 0 0;
#X frgb 224 224 224;
#X brgb 255 255 255;
#X rgb2 0 0 0;
#X rgb3 243 204 204;
#X rgb4 255 0 0;
#X rgb5 184 184 184;
#X rgb6 0 0 0;
#X rgb7 0 0 0;
#X rgb8 255 255 255;
#X rgb9 255 0 0;
#X rgb10 255 191 0;
#X rgb11 0 191 127;
#X rgb12 127 0 127;
#X rgb13 0 0 0;
#X range 0. 1.;
#X domain 0. 22050.;
#X done;
#P number 169 389 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user meter~ 258 465 338 478 50 0 168 0 103 103 103 255 153 0 255 0 0 217
217 0 153 186 0 12 3 3 3 3;
#P newex 168 414 41 196617 *~ 0.9;
#P newex 156 365 79 196617 biquad~;
#P message 132 340 31 196617 clear;
#P outlet 65 241 15 0;
#P connect 17 0 7 0;
#P hidden connect 3 0 30 0;
#P connect 17 0 2 0;
#P hidden connect 1 0 2 0;
#P hidden connect 20 0 29 0;
#P hidden connect 20 0 23 0;
#P hidden connect 20 0 25 0;
#P hidden connect 20 0 27 0;
#P hidden connect 19 1 10 0;
#P hidden connect 22 0 10 0;
#P hidden connect 24 0 10 0;
#P hidden connect 26 0 10 0;
#P hidden connect 28 0 10 0;
#P connect 17 0 10 0;
#P hidden connect 2 0 3 0;
#P hidden connect 10 0 2 1;
#P hidden connect 23 0 22 0;
#P hidden connect 25 0 24 0;
#P hidden connect 27 0 26 0;
#P hidden connect 29 0 28 0;
#P hidden connect 5 0 3 1;
#P hidden connect 10 1 15 0;
#P hidden connect 20 0 19 0;
#P hidden connect 3 0 6 0;
#P hidden connect 3 0 4 0;
#P connect 4 0 16 0;
#P hidden connect 21 0 20 0;
#P hidden connect 11 0 10 5;
#P hidden connect 12 0 10 6;
#P hidden connect 13 0 10 7;
#P pop;
#P newobj 226 55 62 196617 p filterbass;
#P newex 226 83 32 196617 *~ 7;
#P user meter~ 226 114 306 127 50 0 168 0 103 103 103 255 153 0 255 0 0 217
217 0 153 186 0 12 3 3 3 3;
#P window setfont "Sans Serif" 10.;
#P newex 226 25 42 196618 adc~ 2;
#P window setfont "Sans Serif" 9.;
#P newex 226 282 27 196617 f;
#P newex 226 224 96 196617 scale 0.04 2 0 127;
#P newex 226 169 63 196617 split 0.04 2;
#P newex 226 469 37 196617 s beat;
#P button 226 436 15 0;
#P flonum 226 391 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 226 143 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 11 1 16 0;
#P connect 16 0 12 0;
#P connect 12 0 15 0;
#P connect 16 0 13 0;
#P connect 13 0 11 0;
#P connect 15 0 11 0;
#P connect 14 0 11 1;
#P connect 6 0 11 1;
#P connect 7 0 10 0;
#P connect 10 1 9 0;
#P connect 9 0 8 0;
#P connect 8 0 0 0;
#P connect 0 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 11 1 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 29 0 23 0;
#P connect 19 0 25 0;
#P connect 19 0 28 0;
#P connect 28 0 29 0;
#P connect 23 0 17 0;
#P connect 18 0 17 0;
#P connect 17 0 22 0;
#P hidden connect 24 0 22 0;
#P connect 21 0 20 0;
#P connect 22 0 20 0;
#P connect 17 0 27 0;
#P connect 27 0 26 0;
#P pop;

I am using a filtergraph but I dont think it is relevant. tried to turn
overdrive on and off, whithout success.
anybody has a clue? if it is because of the analogue signal, is there any
way to "fake" it, like using a metro
and a bang to trigger the samples which are drumsamples ?


May 27, 2008 | 8:48 am


May 27, 2008 | 9:10 am


May 27, 2008 | 9:45 am

1) put the whole package in:

on a Mac: for Max 4.6
/Applications/MaxMSP 4.6/Cycling ’74/externals/
for Max5
/Applications/Max5/Cycling ’74/max-externals/

or make your own folder next to it (highly recommended)
for Max 4.6
/Applications/MaxMSP 4.6/Cycling ’74/3rdPartyExternals/
for Max5
/Applications/Max5/Cycling ’74/3rdPartyExternals/

2) then restart Max
ready

read the installation instructions in the release notes!

/*j


May 27, 2008 | 10:09 am

thanks. but does it make sense combined with a filtergraph ?

2008/5/27 jasch :

> 1) put the whole package in:
>
> on a Mac: for Max 4.6
> /Applications/MaxMSP 4.6/Cycling ’74/externals/
> for Max5
> /Applications/Max5/Cycling ’74/max-externals/
>
> or make your own folder next to it (highly recommended)
> for Max 4.6
> /Applications/MaxMSP 4.6/Cycling ’74/3rdPartyExternals/
> for Max5
> /Applications/Max5/Cycling ’74/3rdPartyExternals/
>
> 2) then restart Max
> ready
>
> read the installation instructions in the release notes!
>
> /*j
>
>
>


May 27, 2008 | 10:27 am

it works better but still misses some strokes

2008/5/27 henrik wurster :

> thanks. but does it make sense combined with a filtergraph ?
>
> 2008/5/27 jasch :
>
>> 1) put the whole package in:
>>
>>
>> on a Mac: for Max 4.6
>> /Applications/MaxMSP 4.6/Cycling ’74/externals/
>> for Max5
>> /Applications/Max5/Cycling ’74/max-externals/
>>
>> or make your own folder next to it (highly recommended)
>> for Max 4.6
>> /Applications/MaxMSP 4.6/Cycling ’74/3rdPartyExternals/
>> for Max5
>> /Applications/Max5/Cycling ’74/3rdPartyExternals/
>>
>> 2) then restart Max
>> ready
>>
>> read the installation instructions in the release notes!
>>
>> /*j
>>
>>
>>
>
>


May 27, 2008 | 10:34 am

it’s always useful to filter your input signal to analyse only the
frequency-band that you’re interested in. (bass, mid, high or
bassdrum, snare, cymbal etc etc) i would use a bandpass instead of
highpass. that way you can reuse the filter subpatch in parallel to
use other frequencies for additional triggers.

btw. filtergraph is only the frontend for biquad~.
you are filtering the input signal with a 2pole 2 zero filter.

/*j

On 27.05.2008, at 12:09, henrik wurster wrote:

> thanks. but does it make sense combined with a filtergraph ?
>
> 2008/5/27 jasch :
> 1) put the whole package in:
>
> on a Mac: for Max 4.6
> /Applications/MaxMSP 4.6/Cycling ’74/externals/
> for Max5
> /Applications/Max5/Cycling ’74/max-externals/
>
> or make your own folder next to it (highly recommended)
> for Max 4.6
> /Applications/MaxMSP 4.6/Cycling ’74/3rdPartyExternals/
> for Max5
> /Applications/Max5/Cycling ’74/3rdPartyExternals/
>
> 2) then restart Max
> ready
>
> read the installation instructions in the release notes!
>
> /*j
>
>
>


May 27, 2008 | 10:56 am

it’s not a magic cure:
adjust the parameters of the filter, the decay factor and the down
factor of the slide~ filter until the response is what you need.
every system will have different critical settings due to variability
in frequency response of microphone, signal intensity, spectrum of
source etc. etc.

/*j

> it works better but still misses some strokes


May 27, 2008 | 11:28 am

it works better than anything I tried so far ! so when I put the slide value
down, it would theoretically trigger fast ? the slide help object does not
reveal that to me

2008/5/27 jasch :

> it’s not a magic cure:
> adjust the parameters of the filter, the decay factor and the down factor
> of the slide~ filter until the response is what you need.
> every system will have different critical settings due to variability in
> frequency response of microphone, signal intensity, spectrum of source etc.
> etc.
>
> /*j
>
> it works better but still misses some strokes
>>
>
>


May 27, 2008 | 5:14 pm

but unfortunately I have a high and a low pass filter for each adc. I could
not figure out how to have a bandpass patch for both

2008/5/27 henrik wurster :

> it works better than anything I tried so far ! so when I put the slide
> value down, it would theoretically trigger fast ? the slide help object does
> not reveal that to me
>
> 2008/5/27 jasch :
>
>> it’s not a magic cure:
>>
>> adjust the parameters of the filter, the decay factor and the down factor
>> of the slide~ filter until the response is what you need.
>> every system will have different critical settings due to variability in
>> frequency response of microphone, signal intensity, spectrum of source etc.
>> etc.
>>
>> /*j
>>
>> it works better but still misses some strokes
>>>
>>
>>
>
>


May 27, 2008 | 6:08 pm

hello jasch,

this peakfollow solution is really interesting.It is the first thing which
helps me trigger drumsound without delay.but there is one problem: when I
stop playing, it still goes on triggering and playing.how can I stop this?
my slide value is 4, and the signal is really string…I had to multiplay it
like *~ 0.05.
any idea ?thank you

2008/5/27 henrik wurster :

> but unfortunately I have a high and a low pass filter for each adc. I could
> not figure out how to have a bandpass patch for both
>
> 2008/5/27 henrik wurster :
>
>> it works better than anything I tried so far ! so when I put the slide
>> value down, it would theoretically trigger fast ? the slide help object does
>> not reveal that to me
>>
>>
>> 2008/5/27 jasch :
>>
>>> it’s not a magic cure:
>>>
>>> adjust the parameters of the filter, the decay factor and the down factor
>>> of the slide~ filter until the response is what you need.
>>> every system will have different critical settings due to variability in
>>> frequency response of microphone, signal intensity, spectrum of source etc.
>>> etc.
>>>
>>> /*j
>>>
>>> it works better but still misses some strokes
>>>>
>>>
>>>
>>
>>
>


May 29, 2008 | 4:29 pm

I have one question concerning peakfollow…it always seems to loop, never
stops playing or triggering…where could my mistake be ?

2008/5/27 henrik wurster :

> hello jasch,
>
> this peakfollow solution is really interesting.It is the first thing which
> helps me trigger drumsound without delay.but there is one problem: when I
> stop playing, it still goes on triggering and playing.how can I stop this?
> my slide value is 4, and the signal is really string…I had to multiplay
> it like *~ 0.05.
> any idea ?thank you
>
> 2008/5/27 henrik wurster :
>
>> but unfortunately I have a high and a low pass filter for each adc. I
>> could not figure out how to have a bandpass patch for both
>>
>> 2008/5/27 henrik wurster
:
>>
>>> it works better than anything I tried so far ! so when I put the slide
>>> value down, it would theoretically trigger fast ? the slide help object does
>>> not reveal that to me
>>>
>>>
>>> 2008/5/27 jasch :
>>>
>>>> it’s not a magic cure:
>>>>
>>>> adjust the parameters of the filter, the decay factor and the down
>>>> factor of the slide~ filter until the response is what you need.
>>>> every system will have different critical settings due to variability in
>>>> frequency response of microphone, signal intensity, spectrum of source etc.
>>>> etc.
>>>>
>>>> /*j
>>>>
>>>> it works better but still misses some strokes
>>>>>
>>>>
>>>>
>>>
>>>
>>
>


May 29, 2008 | 5:43 pm

On May 29, 2008, at 9:29 AM, henrik wurster wrote:

> I have one question concerning peakfollow…it always seems to loop,
> never stops playing or triggering…where could my mistake be ?

I imagine it’s somewhere in your patch :-)

Seriously, you’re not providing enough information for people to be
very helpful. If I had to guess, I would say that your gain structure
is messed up somewhere, and you’re trying to detect transients down
near the noise floor. Your statement that you are multiplying the
signal by .05 leads me to this conclusion, but it’s not based on much
fact.

-C

Chris Muir
cbm@well.com

http://www.xfade.com


May 29, 2008 | 7:24 pm

thanks.my patch is messy, this is why I rather talk, but might be a mistake.
the gain might be messed, adc1 and and adc 2 are constantly receiving
signals.so I thought peakfollow takes ms decay as an argument, whereas in my
patch it gets the signal from the sensor.

2008/5/29 Chris Muir :

>
> On May 29, 2008, at 9:29 AM, henrik wurster wrote:
>
> I have one question concerning peakfollow…it always seems to loop, never
>> stops playing or triggering…where could my mistake be ?
>>
>
>
> I imagine it’s somewhere in your patch :-)
>
> Seriously, you’re not providing enough information for people to be very
> helpful. If I had to guess, I would say that your gain structure is messed
> up somewhere, and you’re trying to detect transients down near the noise
> floor. Your statement that you are multiplying the signal by .05 leads me to
> this conclusion, but it’s not based on much fact.
>
> -C
>
> Chris Muir
> cbm@well.com
> http://www.xfade.com
>
>
>
>
>
>
>
>


May 29, 2008 | 7:50 pm

On May 29, 2008, at 12:24 PM, henrik wurster wrote:

> thanks.my patch is messy, this is why I rather talk, but might be a
> mistake. the gain might be messed, adc1 and and adc 2 are constantly
> receiving signals.
> so I thought peakfollow takes ms decay as an argument, whereas in my
> patch it gets the signal from the sensor.

Your assumption that your emails are less messy is not correct, IMO. A
patch would be much clearer. Just post the section that you’re having
trouble with.

-C

Chris Muir
cbm@well.com

http://www.xfade.com


May 30, 2008 | 9:10 am

henrik wurster schrieb:
> thanks.my patch is messy, this is why I rather talk, but might be a
> mistake.

Maybe this an occasion to clean up the mess… Often this will point
yourself directly to the problem… If not send the patch…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


May 30, 2008 | 9:28 am

Hello,
Thanks for sending me the Maxmsp mailing list, it’s really useful and
advantageous.
>From 1 June I will be in abroad for meeting and travel, please suspend to
send me the mailing list for one month. Thanks again!

Best regards

Yours
Shing-kwei Tzeng


May 30, 2008 | 10:11 am

hi stefan could you have a look at the patch ? or anybody ?

2008/5/30 Stefan Tiedje :

> henrik wurster schrieb:
>
>> thanks.my patch is messy, this is why I rather talk, but might be a
>> mistake.
>>
>
> Maybe this an occasion to clean up the mess… Often this will point
> yourself directly to the problem… If not send the patch…
>
> Stefan
>
> –
> Stefan Tiedje————x——-
> –_____———–|————–
> –(_|_ —-|—–|—–()——-
> — _|_)—-|—–()————–
> ———-()——–www.ccmix.com
>
>
>


May 31, 2008 | 12:01 am

henrik wurster schrieb:
> hi stefan could you have a look at the patch ? or anybody ?

What I wanted to say, you are the most competent person to clean it up.
After that its easier to find help. While you do this, you might find
the reason for your problem yourself which will teach you more than
anybody could do…
Finding bugs is time consuming, and sometimes its even better to start
all over again, but its part of the game…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


May 31, 2008 | 12:21 am

On May 30, 2008, at 5:01 PM, Stefan Tiedje wrote:
> What I wanted to say, you are the most competent person to clean it
> up. After that its easier to find help. While you do this, you might
> find the reason for your problem yourself which will teach you more
> than anybody could do…

I wholeheartedly agree. I once worked for an obscure analog synth
manufacturer, and around the shop we had an acronym CUTYFI (pronounced
cut-a-fi), which stands for "clean up ’til you find it."

In programming, if you take the clean up process to mean code
commenting, re-factoring, and occasionally optimizing, you will be
much better off after you are done.

-C

Chris Muir
cbm@well.com

http://www.xfade.com


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