MIDI Control to VST
Using any MIDI synth VST plug-in, you can control MIDI data such as modulation and volume.
Using any MIDI synth VST plug-in, you can control MIDI data such as modulation and volume.
This example shows how to retrieve the total duration in ms of a loaded file in a buffer~, using the info~ object. In fact, because the buffer~ object sends a bang out its right outlet whenever it loads in a sound file, you could use that bang to trigger info~, thus automatically obtaining the duration of any sound file you import.
This example shows how to create a buffer~ that always contains the last ten seconds of audio coming out of and adc~.
This example shows how to isolate a single FFT bin, as opposed to displaying the entire spectrum. The example uses fft~ instead of fftin~, but the principle is the same.
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:
The peakamp~ object can be used to take the amplitude of one signal and have it control the amplitude of another. Peakamp~ takes a low-frequency sample of the peak amplitude of the signal, which is then smoothed by the line~ object. This gives an intuitively much more accurate representation of the audio signal one is envelope-following than does smoothing the audio signal itself, which tends to smooth out — and thus lose — all the more interesting characteristics of the signal. Here’s an example that lets you compare.
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.
What if I want to use a counter to drive a step sequencer and add a palindrome, always counting from 1 to 16, and from 16 to 1 again so that it will be kept in sync.
Some interesting effects can be obtained by feeding the output of a delay line back into itself and adding that to whatever new sound is coming in. The result is delays of delays, echoes of echoes, etc. As was shown in the discussion of Comb filtering, short delays fed back at a specific rate will have a strong resonance effect on the timbre of a sound.
In addition to the delay~ object, another way to implement a circular buffer for audio delay is with the pair of objects called tapin~ and tapout~. Those two objects are always used as a pair; the outlet of a tapin~ object should only be connected to the left inlet of a tapout~ object.