Max

Automate file creation

To automate file creation of similarly named stereo sound files (for example, soundbite1, soundbite 2, etc), this patch allows you to send the desired file name into the left inlet, then a message to start recording into sfrecord~ and a 0 to stop recording. The audio you want to record is expected in the second and third inlets.

MIDI to Frequency

Incoming MIDI control values (0 to 127) from a ctlin object can be scaled with the scale object to cover any desired pitch range (in terms of MIDI pitch number), and that pitch range can then be converted to frequency in Hertz with the mtof MIDI to frequency object.

Representing all decibel values as positive

Is it possible to see decibel values that start at 0 dB so that the values are all positive? Yes, you just need to decide what you want to use as your 0 dB reference amplitude. In digital audio, an amplitude of 1 is used as the 0 dB reference. In measuring real-world sound, the human threshold of hearing at 1 KHz (something like .0002 microbar) is usually used as the 0 dB reference value. Here’s an example using (roughly) the smallest obtainable nonzero amplitude in a 16-bit signal as the reference value, yielding a scale from about 0 to 90 dB.

Remove spaces from list

The regexp object makes a list that expresses rules for text matching and substitution, using a format that is valid in many computer languages. For example, if you have a list of integers that you want to list with no spaces in between, you can use the substitution string %0 to replace the match with an empty string.