Thanks! It’s looks like you’re pretty close to me.
var volume = mic.getLevel(0.005) * 0.5; // tiempo que tarda en
let amp1 = map(volume, 0, 1, 0, 0.8);
The code sets the variable
volume by calling
mic.getLevel() using smoothing value of
0.005 and multiplying the result with
0.5. That will return a value in the range
0.5. Is that what you want? If so, you should update the
map call to reflect that:
map(volume, 0, 0.5, 0, 0.8).
If you want to apply a noise gate/threshold on the signal, the logic should be like if
volume is less than
0. Now, how to implement that in code? The example you’re linking to shows that, in the first few lines of the