Synchronize an LFO to a note onset with phasor~
To sync an LFO to the onset of a note, drive it with a phasor~ object. Send a phase value of "0" into the right inlet of phasor~ when the note starts, as seen in this example.
To sync an LFO to the onset of a note, drive it with a phasor~ object. Send a phase value of "0" into the right inlet of phasor~ when the note starts, as seen in this example.
This patch allows you to see how the phase relationship between two sine waves will affect the shape of the waveform when the two are mixed together. Initially, it shows a 4-Hz sinusoid and an 8-Hz sinusoid that are one-half cycle out of phase with each other. If you change the phase offset of one of the oscillators, you can see that the waves interfere differently, thus changing the shape of the waveform. However, as listeners we're not very sensitive to such changes in phase relationships, except in certain cases where waves cancel each other in extreme ways.
The cycle~ object allows you to read from a stored cosine function (use a phase offset of 0.75 to get a sine phase), and does high-quality interpolation to give you excellent resolution even though it only uses a 512-sample table. (See MSP Tutorial chapters 1-3).
But if you want to put a sine wave into a buffer~, here’s a way:
In this patch the zmap object changes the scale of the incoming number stream from the ctlin object from the standard range of MIDI (0-127) – the 0 is bypassed so that it is translated properly once the range is mapped back to linear amplitude – to a specified range in decibels – in the case of the example from -63 to 0 dB.
This patch shows one possible implementation of a tremolo effect as a Max for Live (M4L) device.
A sinusoid added to a delayed version of itself will result in a sinusoid of the same frequency but with its amplitude altered. The amount of amplitude change will depend on the phase relationship between the original sinusoid and its delayed copy. The two sinusoids will interfere with each other either constructively (reinforcing each other) or destructively (tending to cancel each other).
The matrix~ object is a multichannel audio mixer. It’s useful as a mixer of sounds, and also as an audio switcher/router, because you can route any input to any output, with built-in interpolation for smooth, click-free amplitude changes.
Will need to download the pan~ abstraction found here.
For this example to work properly, you must first download "Abstraction for mixing or crossfading two audio signals" and save it with the name xfade~.maxpat. Then you must ensure that your xfade~.maxpat file is in the Max search path, or you must save this example patch in the same folder as the xfade~.maxpat file and reopen it, so that this patch can find the xfade~ object.