How to recorder regarding to the input sound level
I’m new to MAX/MSP and I would like to do a command where depending of the sound level, recording will start and stop if the sound go above or under a certain level. Any ideas? Thanks
You have to define a threshold.
Try something like this:
----------begin_max5_patcher---------- 525.3ocuV1saaBCFF9X3pvxZGxprMPMcppR65XpZxAbHtCLnfiV1pZu1m+Ax ZhHJPpCmfk+6yueO9017ZX.bUyddGD7MvO.AAuFFDXaxzPPe8.XMaedEqyNL nporrhCibc0rSUwUp+zxcw.JjJH349dEE1ozr5kuRGlgbWsPpmiMZ39FaYp7 MBY4O2xyUtHcO8NTDHINwTPPCeODacbbKtKPlFeKLz7I51lIoWWlfSd3lkIR 9u0JaPWJ9d6JCYE4uCvCMutQp5D+0ldXhVEmIu6DkRV0no9QwRxpsSA98sB8 3uNnjkY2koKGTx2vjk74BEXjyPDcdeQrugSBBaJRujiI1evQrF7k0Xvi.8pE CTa3R.Z1nZL3jQ7GcvYVhD6NPgwK3Ipd97jlODGdvdAOTjuMOCzAkbCny5pF cPlalqmEydBZk9D33Ggh8NGHNyxEODQ7mIoky9Eqt8Jt50QnQu4MkNSxPtHY RMJAPWv6dYq5d2mOGg7ucgXuyMdNPwNDXkPd5ORYWES6GSptlcayGRuC1dv+ WpBdmRHYJQi7CixbE5GFzFQQA21+.5pEEsM5Wm5UA896R0YBIw8P6CGpAddz czIq1InU57j5mTQoSPQ3EUQ3onHDZQ0zI9mwEU77jzfsJKwTz63LU9r7KkNE wFurD7zcryrultrt+oc6AcYQEE4ey1QRRW4sv+QM44UH -----------end_max5_patcher-----------
This takes a microphone input, takes its absolute value (that’s the general procedure for any amplitude-follower), puts out its peak value every millisecond and checks if it’s above a certain level (in this case 0.2) or below a certain different level (in this case 0.03). Using -two- thresholds like that, in contrast to only one, makes the whole thing "flicker" a bit less. I.e. you need a somewhat higher amplitude to trigger it to ON, after which it stays ON until it actually gets -significantly- quieter.
Often, you’ll also want to expand this a bit, for example you might consider adding a minimum time for the toggle to stay on after it has been activated, before it can be deactivated again. (Again, to reduce possible "flickering" of the toggle when you’re dealing with certain sounds that rise and fall quickly in amplitude.)