Linear Mapping: can think of a range as having a minimum and a size (100-1,000 has min of 100 and size of 1,000-100=900)
to map into another range, find multiplying factor, so if you were trying to map the above range into range of 60, divide 60 by 900 to find the multiplier--then add the minimum back to it
scale object--type scale 0 127 0. 1.--that's minimum and minimum of input range, and then the minimum and maximum of the output range, and it does all the math for you
can feed scale object into *~ object to scale volume of audio signal--add a plain dial, it'll get really loud for the first half of turning up but not that much difference in second half--scaled linearly not logarithmically
dbtoa object--converts dB to amplitude
atodb object--vice versa
can also say dbtoa~ and atodb~ to convert every sample of a signal, if for some reason you need that
for computers, the reference point for loudness is the loudest thing you'd want to hear, not the quietest thing you'd want to hear--usually 0 dB is the loudest thing your computer can output, so we talk about negative dB--if you set up a dial with a range of 120, then an object that's -120, then dbtoa, it'll tell you how many dB you're at on your slider--but then you can hardly hear it once it's down to about -70 dB in current listening conditions
a good quality CD player will have about an 85 dB range, and then room noise affects it, too
practically speaking, a 70 dB range is good
live.gain~ object--gives you a -69 dB range, plus a little above 0--a useful slider--also shows input monitoring--also has a small linear interpolation time, can choose ramp time in ms, to avoid clicks
mtof object--converts MIDI pitch to frequency
ftom object--converts frequency to MIDI pitch, can give floating point argument 0. to ftom to see fraction of a pitch you'd get with that frequency
If you want to use an exponential curve rather than a line object to change a sound (so it sounds less unnatural), add a live.gain~ object, and then use a line~ object to control the slider on the live.gain~. That way, it'll be linear in terms of frequency. Put a message into line~: initial frequency, final frequency, time to get there. Or, you can throw an mtof~ object between line~ and the live.gain~, which will make the change linear in terms of pitch and logarithmically in terms of frequency.
There is no dedicated log object in Max.
*If you want to synthesize sound in Max, YES, it does recognize "57.3" as a pitch. It only has to be a whole integer if it's for MIDI specifically.
function object--a GUI object, allows you to draw point-and-line diagrams that describe a shape over time--when you bang this object, the 2nd outlet will send information to the line~ object, which will send out a shape that corresponds to shape you've drawn--can specify time scale and amplitude--another way to use function, which is--can send a number in, it will send corresponding number out, so as input goes from 0-1,000, output goes from 0-1--this corresponds to domain as set in inspector--shift click to eliminate a point--can't manipulate function object in unlocked state--it takes input number (in time), looks up corresponding point on graph, outputs result--so a straight line up to 1 gives you exactly the same thing out as you put in--has a "Curve" mode, see the inspector--can option-drag on line to turn it into a curve in Curve mode
pow object--if you type pow 3, it gives you an exponent of 3
note: jit.movie can read still images as well as movies
jit.brcosa--jitter brightness, color, and saturation--can send it brightness messages to change its brightness
Do we perceive brightness linearly or exponentially? it seems a little bit exponentially, from this example--need to make it exponential fading up and logarithmic fading down--maybe?--fading brightness by a power of 2 seems a little better than 3
buffer~ object--give it a name, so "buffer~ MySound"--can send in message "read" or "replace" to fill buffer--creates a space in memory to stash the sound--kind of like sfplay~, but grabs whole sound file, puts it in RAM, but don't have to read through it linearly--very handy
No comments:
Post a Comment