Threshold/Gate opening a microphone
Hello!
I'm an absolute beginner w/ Max and am working on a patch for an installation.
In the patch attached I'm just trying to open a microphone when one of the samples are triggered similar to how a gate would work - I understand that this would have something to do with the thresh~ object I'm just a tad confused where to place it as my initial thoughts have failed. Hoping someone could guide me in the right direction.
Thankyou In advance!
1- there is no trace of mic or any other audio input in that patch
2- to activate mic input when sample is triggered is a simple thing,
but you don't mention if you also want to close it eventually ?
based on what - when sample playback stops ?
or if playback level drops ?
in case of playback start stop - it is clear = open on playback start,
close on playback end.
in case of playback level, you could measure playback output level and set
threshold to open or close the mic input.
use meter~ to measure,
use > 0.1 or so to set the threshold
and user that to control input level.
There are many object that can control audio level in max
simplest is *~ signal multiplier,
but that one will produce clicks when switched,
and for that reason you could use number~ which ramps
when setting multiply factor

Hey Thankyou so much for your reply!
your patch was very succinct and helpful - my problem with threshold was when I set the values to below 0 it meant that when a sample wasn't playing the trigger would be left on as the value was 1 and if it was above zero the triggering was too rapid. it was almost as though i needed a range but Thresh~ object wouldn't allow me. (sorry I had copied the wrong patch too you)
I appreciate your help, thankyou!