Explanation of ~*
I am looking for a better explanation of the ~* object than what is contained in the MSP Tutorials. I understand that it can increase and decrease the amplitude of the signal, based on the data it is given. However, I do not understand why one would multiply two signals to get a change in amplitude. Sorry, I did not study electronics or synthesis -- only know what is in the introductory chapters of the MSP Tutorials.
Sorry if this is too basic.
Once sound leaves the instrument/sound making object, it is a pressure wave in some medium, usually air. A transducer, like a microphone, changes the variation in air pressure into variations in analog, electrical voltage. To make that digital, the voltage is sampled very rapidly (44100 times a second for CD's). So, digital sound is a chain of numerical values that are proportional to the amplitude of the air pressure wave that has been sampled. In other words, samples are the amplitude at a discreet moment in time.
These samples are what you can imagine running on MSP patch cords. If you wanted a sound to have double the amplitude, you could multiply those samples by 2. with [*~ 2.0]. At this point, you'd be multiplying the signal by a floating point number. This works fine.
However, if you want a varying amplitude -- an amplitude envelope, for example, -- it is better to multiply signals by signals. Why? Because samples on a signal patch cord are coming very quickly (44100 times a second). Values on data cords (such as the output of line) come less quickly (1000 times a second, or less). This will create a kind of "stepping" that can be audible. Using line~ to control amplitude (or delay time) is preferable, because it outputs new values at the same rate as the signal it is modifying.
Does that help?
mz
David Feldman wrote on Fri, 05 June 2009 00:22I am looking for a better explanation of the ~* object than what is contained in the MSP Tutorials. I understand that it can increase and decrease the amplitude of the signal, based on the data it is given. However, I do not understand why one would multiply two signals to get a change in amplitude. Sorry, I did not study electronics or synthesis -- only know what is in the introductory chapters of the MSP Tutorials.
It's called Ring Modulation. Actually & more generally, Amplitude Modulation.
Both are standard processing techniques. Wikipedia on the terms for more background, although I found the tuts a pretty good start.
For a simple test, hook up a cycle~ with any audible frequency to a scope~, you'll see the full amplitude range of sine-wave there (from -1. to 1.) This represents the total amount of vibration or energy of the wave, and should be right at 0 dB. If you run this through a *~ first, sending a sig~ from 0. to 1. into the other inlet, you'll hear the volume level drop as you go to 0., while seeing the wave height (amplitude) shrink proportionally down to 0. You can try sig~ higher than 1. too, you'll see you get clipping as the digital representation can't go higher than 1. or lower than -1. (which is really the same thing, in a way). Of course, if your original signal peaks out at less than 1., you can use signal *~ higher than 1. to increase it before clipping.
The mention about floats versus signals is important to keep in mind, use signals wherever possible as they are calculated at the same rate as your other audio and will be smoother than floating-point number calculations, which run at the scheduler rate (even with this set very fast, it's still much slower than the signal rate).
Other arithmetic ops work similarly, though +~ and *~ are the most common for signals (when you hook up several signals to a gain~, they automatically add like +~). Like everything else in programming, computers take a long time to evaluate division (/ or /~) so avoid wherever possible. In most cases you can multiply by the reciprocal instead (* 0.5 is much better to use than / 2.) Save your processing for the cool stuff
i would recommend to dive a bit into the ocean of
maxMsp independent DSP-theory.
for example:http://www.redcedar.com/learndsp.htm
Thank you for the information. It makes much more sense now. Also, I noticed later I wrote the symbol wardsback. *~
Thanks for being tolerant of aixelsyd.
PS -- I do know what amplitude modulation is, I just didn't realize that's what was happening. Seems a heady concept for Tutorial 2, but revetahw.
Divad
i want to give a different kind of answer.
it is not important for you to understand why
more power is represented by multiplying a signal on
the digital layer.
it is enough to know it.
-110
I like knowing why (and I appreciate all the explanations). But I think perhaps you're saying it's best not to get too hung up on it and let it hinder your progress in the tutorials, and that's good advice too.