Forums > MaxMSP

Mic threshold triggering orchestral playback

February 24, 2008 | 4:26 pm

HELP!!!!

I’m a student doing an MA in music tech and I am building an installation art piece and need advice on setting up a simple MAX MSP patch.

Basically, what i want to happen is for a microphone to pick up sound in a room. When the decibel level in the room reaches a certain threshold, I want to trigger playback of a piece of music.
Simple. I want the playback of the music to last for 3 seconds every time the threshold is reached, but play back constantly if the noise level remains above the threshold.

Please please please can someone who knows how to do this get in touch and help me out, it will only take a moment of your time and will help me out tremendously.

Thanks

Jimi


February 24, 2008 | 6:41 pm

Hi Jimi

I just had to do a similar thing, although I only had to trigger a MIDI note
of a specific duration every time the input reached the threshold.
I’m very new to msp but have used max for some time so i don’t even know how
to play samples yet!

But this little example which I have tried to adjust for your needs could do
the trick, especially if you have a sampler to trigger with a MIDI note…
If not, then, you can combine it with a sampler in MSP.

It delays the flushing of the MIDI note with 3 seconds when the sound goes
below the threshold, in effect holding the note as long as it is over the
threshold and only playing for 3 seconds if the intensity just peaks once.

Just my two cents, hope it helps!

Cheers,
Lasse

max v2;
#N vpatcher 714 169 1581 777;
#P window setfont "Sans Serif" 14.;
#P window linecount 1;
#P newex 456 54 67 9109518 loadbang;
#P newex 530 169 29 9109518 * 2.;
#P newex 470 317 28 9109518 b 1;
#P newex 470 345 78 9109518 delay 3000;
#P message 556 343 44 9109518 61 90;
#P newex 556 375 38 9109518 flush;
#P newex 484 93 56 9109518 metro 3;
#P newex 484 128 39 9109518 avg~;
#P newex 531 242 55 9109518 change;
#P newex 531 271 38 9109518 sel 1;
#P newex 556 420 80 9109518 noteout a 2;
#P flonum 570 125 54 14 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 531 201 40 9109518 > 0.1;
#P user ezadc~ 306 85 350 118 0;
#P comment 635 125 100 9109518 threshold;
#P window linecount 3;
#P comment 608 314 100 9109518 pitch and velocity of MIDI note;
#P connect 6 1 13 0;
#P connect 13 0 12 0;
#P connect 15 0 9 0;
#P connect 9 0 8 0;
#P connect 2 1 8 0;
#P connect 8 0 14 0;
#P connect 14 0 3 0;
#P connect 3 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 11 0;
#P connect 11 0 10 0;
#P connect 12 0 10 0;
#P connect 10 0 5 0;
#P connect 4 0 3 1;
#P connect 10 1 5 1;
#P pop;

On Sun, Feb 24, 2008 at 5:26 PM, Jimi Luckum wrote:

>
> HELP!!!!
>
> I’m a student doing an MA in music tech and I am building an installation
> art piece and need advice on setting up a simple MAX MSP patch.
>
> Basically, what i want to happen is for a microphone to pick up sound in a
> room. When the decibel level in the room reaches a certain threshold, I want
> to trigger playback of a piece of music.
> Simple. I want the playback of the music to last for 3 seconds every time
> the threshold is reached, but play back constantly if the noise level
> remains above the threshold.
>
> Please please please can someone who knows how to do this get in touch and
> help me out, it will only take a moment of your time and will help me out
> tremendously.
>
> Thanks
>
> Jimi
>


April 14, 2009 | 1:34 pm

could someone comment this code so that it is easier to understand what is being done here.

i have a similar project and this would be great information to have.

thanks!!!


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