Pfft Max/MSP

download Pfft Max/MSP

of 14

Transcript of Pfft Max/MSP

  • 7/28/2019 Pfft Max/MSP

    1/14

    Tutorial 26: Frequency Domain Signal Processing with pfft~Open the tutorial.

    Working in the Frequency DomainMost digital signal processing of audio occurs in what is known as the time domain. As the otherMSP tutorials show you, many of the most common processes for manipulating audio consist of

    varying samples (or groups of samples) in amplitude (ring modulation, waveshaping, distortion)or time (filters and delays). The Fast Fourier Transform (FFT) allows you to translate audio datafrom the time domain into the frequency domain, where you can directly manipulate thespectrum of a sound (the component frequencies of a slice of audio).

    As we have seen in Tutorial 25, the MSP objectsfft~andifft~allow you to transform signals

    into and out of the frequency domain. Thefft~object takes a a group of samples (commonlycalled a frame) and transforms them into pairs of real and imaginary numbers which containinformation about the amplitude and phase of as many frequencies as there are samples in theframe. These are usually referred to as bins orfrequency bins. (We will see later that the real andimaginary numbers are not themselves the amplitude and phase, but that the amplitude and

    phase can be derived from them.) Theifft~object performs the inverse operation, taking frames

    of frequency-domain samples and converting them back into a time domain audio signal thatyou can listen to or process further. The number of samples in the frame is called theFFT size (orsometimesFFT point size). It must be a power of 2 such as 512, 1024 or 2048 (to give a fewcommonly used values).

    One of the shortcomings of thefft~andifft~objects is that they work on successive frames ofsamples without doing any overlapping or cross-fading between them. For most practicalmusical uses of these objects, we usually need to construct such an overlap and crossfade systemaround them, as shown at the end of Tutorial 25. There are several reasons for needing to createsuch a system when using the Fourier transform to process sound. In FFT analysis there isalways a trade-off between frequency resolution and timing resolution. For example, if your FFTsize is 2048 samples long, the FFT analysis gives you 2048 equally-spaced frequency bins from0 Hz. up to the sampling frequency (only 1024 of these bins are of any use; see Tutorial 25 for

    details). However, any timing resolution that occurs within those 2048 samples will be lost inthe analysis, since all temporal changes are lumped together in a single FFT frame. In addition,if you modify the spectral data after the FFT analysis and before the IFFT resynthesis you can nolonger guarantee that the time domain signal output by the IFFT will match up in successiveframes. If the output time domain vectors don't fit together you will get clicks in your outputsignal. By designing a windowing function in MSP (see below), you can compensate for theseartifacts by having successive frames cross-fade into each other as they overlap. While this willnot compensate for the loss of time resolution, the overlapping of analysis data will help toeliminate the clicks and pops that occurs at the edges of an IFFT frame after resynthesis.This analysis/resynthesis scheme (using overlapping, windowed slices of time with the FFT andIFFT) is usually referred to as a Short Term (orShort Time)Fourier Transform (STFT). An STFT

    can be designed in MSP by creating a patch that uses one or more pairs offft~/ifft~objects with

    the input signal windowed into and out ofthe frequency domain. While this approach worksfairly well, it is somewhat cumbersome to program since every operation performed in the

    frequency domain needs to be duplicated correctly for eachfft~/ifft~pair. The followingsubpatch illustrates how one would window incoming FFT data in this manner:

    http://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.html
  • 7/28/2019 Pfft Max/MSP

    2/14

    How to properly window audio for use with the fft~ objectIn addition to the fact that this approach can often be a challenge to program, there is also thedifficulty of generalizing the patch for multiple combinations of FFT size and overlap. Since the

    arguments tofft~/ifft~for FFT frame size and overlap can't be changed, multiple hand-tweakedversions of each subpatch must be created for different situations. For example, a percussivesound would necessitate an analysis with at least four overlaps, while a reasonably static,harmonically rich sound would call for a very large FFT size.Technical detail: Time vs. Frequency ResolutionThe FFT size we use provides us with a tradeoff; because the Fourier transform mathematicallyconverts a small slice of time into a frozen snapshot representing its spectrum, you might firstthink that it would be beneficial to use small FFT sizes in order to avoid grouping temporal

    changes together in one analysis spectrum. While this is true, an FFT size with a smaller numberof points also means that our spectrum will have a smaller number of frequency bins, whichmeans that the frequency resolution will be lower. Smaller FFT sizes result in better temporalresolution, but at the cost of lower frequency resolution when the sound is modified in thefrequency domain and resynthesized. Conversely, larger FFT sizes give us finer frequency detail,

    but tend to smear temporal changes in the sound. In practice, we therefore need to choose anappropriate FFT size based on the kind of sound we want to process.

    An Introduction to thepfft~ObjectThepfft~object addresses many of the shortcomings of the oldfft~andifft~objects, allowing

    you to create and load special spectral subpatches that manipulate frequency-domain signaldata independently of windowing, overlap and FFT size. A single sub-patch can therefore be

    suitable for multiple applications. Furthermore, thepfft~object manages the overlapping ofFFT frames, handles the windowing functions for you, and eliminates the redundant mirroreddata in the spectrum, making it both more convenient to use and more efficient than the

    traditionalfft~andifft~objects.

    Thepfft~object takes as its argument the name of a specially designed subpatch containing

    thefftin~andfftout~objects (which will be discussed below), a number for the FFT size in

    http://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.html
  • 7/28/2019 Pfft Max/MSP

    3/14

  • 7/28/2019 Pfft Max/MSP

    4/14

    spectrum from 0Hz to the sampling rate. In this case the signal vector size of the spectralsubpatch is the same as the FFT size. This is computationally more expensive, not only becauseof the larger FFT, but because the spectral subpatch will have to process twice the number ofsamples for the same amount of data.)

    Thefftout~object does the reverse, accepting frequency domain signals, converting them backinto a time domain signal, and passing it via an outlet to the parent patch. Both objects take anumbered argument (to specify the inlet or outlet number), and a symbol specifying the windowfunction to use. The available window functions are Hanning (the default if none is specified),Hamming, Blackman, Triangle, and Square. In addition, the symbol can be the name of

    abuffer~object which holds a custom windowing function. Different window functions havedifferent bandwidths and stopband depths for each channel (or bin, as it is sometimes called) ofthe FFT. A good reference on FFT analysis will help you select a window based on the sound youare trying to analyze and what you want to do with it. We recommend The Computer MusicTutorialby Curtis Roads or Computer Music by Charles Dodge and Thomas Jerse. Generally, formusical purposes the default Hanning window works best, as it provides a clean envelope withno amplitude modulation artifacts on output.

    For testing and debugging purposes, there is also a handynofft argument

    tofftin~andfftout~which allows the overlapping time-domain frames to and from thepfft~tobe passed directly to and from the subpatch without applying a window function nor performinga Fourier transform. In this case (because the signal vector size of the spectral subpatch is halfthe FFT size), the time- domain signal is split between the real and imaginary outlets of

    thefftin~andfftout~objects, which may be rather inconvenient when using an overlap of 4 or

    more. Although the nofft option can be used to send signal data from the parent patch into thespectral subpatch and may be useful for debugging subpatches, it is not recommended for most

    practical uses ofpfft~.

    A more complicatedpfft~subpatch might look something like this:

    A simple type of spectral convolution

    This subpatch takes two signal inputs (which would appear as inlets in the parentpfft~object),converts them into the frequency domain, multiplies the real signals with one another and

    multiplies the imaginary signals with one another and outputs the result to anfftout~objectthat converts the frequency domain data into a time domain signal. Multiplication in thefrequency domain is called convolution, and is the basic signal processing procedure used incross synthesis (morphing one sound into another). The result of this algorithm is thatfrequencies from the two analyses which have larger amplitude values will reinforce oneanother, whereas frequency with weaker amplitude values in one analysis will diminish or

    http://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.html
  • 7/28/2019 Pfft Max/MSP

    5/14

    cancel the value from the other, whether strong or weak. Frequency content that the twoincoming signals share will be retained while frequency content that exists in one signal and notthe other will be attenuated or eliminated. This example is not a true convolution, however, asthe multiplication ofcomplex numbers (see below) is not as straightforward as the multiplicationperformed in this example. We'll learn a couple ways of making a correct convolution patchlater in this tutorial.

    You have probably already noticed that there are always two signals to connect whenconnectingfftin~andfftout~, as well as when processing the spectra in-between them. This is

    because the FFT algorithm produces complex numbers numbers that contain a real and an

    imaginary part. The real part is sent out the leftmost outlet offftin~, and the imaginary part is

    sent out its second outlet. The two inlets offftout~also correspond to real and imaginary,respectively. The easiest way to understand complex numbers is to think of them as representinga point on a 2-dimensional plane, where the real part represents the X-axis (horizontal distancefrom zero), and the imaginary part represents the Y-axis (vertical distance from zero). We'lllearn more about what we can do with the real and imaginary parts of the complex numberslater on in this tutorial.

    The Third OutletThefftin~object has a third outlet that puts out a stream of samples corresponding to thecurrent frequency bin index whose data is being sent out the first two outlets (this is analogous

    to the third outlet of thefft~andifft~objects discussed in Tutorial 25). Forfftin~, this outletoutputs a number from 0 to half the FFT size minus 1. You can convert these values intofrequency values (representing the center frequency of each bin) by multiplying the signal(called the sync signal) by the base frequency, or fundamental, of the FFT. The fundamental ofthe FFT is the lowest frequency that the FFT can analyze, and is inversely proportional to thesize of the FFT (i.e. larger FFT sizes yield lower base frequencies). The exact fundamental of the

    FFT can be obtained by dividing the FFT frame size into the sampling rate. Thefftinfo~object,

    when placed into apfft~subpatch, will give you the FFT frame size, the FFT half-frame size (i.e.

    the number of bins actually used inside thepfft~subpatch), and the FFT hop size (the numberof samples of overlap between the windowed frames). You can use this in conjunction with

    thedspstate~object or theadstatusobject with the sr (sampling rate) argument to obtain thebase frequency of the FFT:

    http://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/adstatus.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/adstatus.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/adstatus.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.html
  • 7/28/2019 Pfft Max/MSP

    6/14

    Finding the center frequency of the current analysis bin.

    Note that in the above example thenumber~object is used for the purposes of demonstrationonly in this tutorial. When DSP is turned on, the number displayed in the signal number box willnot appear to change because the signal number box by default displays the first sample in thesignal vector, which in this case will always be 0. To see the center frequency values, you will

    need to use thecapture~object or record this signal into abuffer~.Once you know the frequency of the bins being streamed out offftin~, you can performoperations on the FFT data based on frequency. For example:

    A simple spectral crossover.

    The abovepfft~subpatch, called xover~, takes an input signal and sends the analysis data to one

    of twofftout~objects based on a crossover frequency. The crossover frequency is sent to

    thepfft~subpatch by using the in object, which passes max messages through from the parent

    patch via thepfft~object's right inlet. The center frequency of the current bin determined by

    the sync outlet in conjunction withfftinfo~anddspstate~as we mentioned above iscompared with the crossover frequency.The result of this comparison flips a gate that sends the FFT data to one of the

    twofftout~objects: the part of the spectrum that is lower in pitch than the crossover frequency

    is sent out the left outlet of thepfft~and the part that is higher than the crossover frequency is

    sent out the right. Here is how this subpatcher might be used withpfft~in a patch

    http://www.cycling74.com/docs/max5/refpages/msp-ref/number~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/number~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/number~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/capture~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/capture~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/capture~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/dspstate~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftinfo~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/capture~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/number~.html
  • 7/28/2019 Pfft Max/MSP

    7/14

    :One way of using the xover~ subpatch

    Note that we can send integers, floats, and any other Max message to and from a subpatch

    loaded bypfft~by using theinandoutobjects. (See Tutorial 21, Usingthepoly~andout~currently do not function inside apfft~.)

    Working with Amplitude and PhaseAs we have already learned, the first two outlets offftin~put out a stream of real and imaginary

    numbers for the bin response for each sample of the FFT analysis (similarly,fftout~expectsthese numbers). These are not the amplitude and phase of each bin, but should be thought ofinstead as pairs of Cartesian coordinates, wherexis the real part and y is the imaginary,representing points on a 2-dimensional plane.

    The amplitude and phase of each frequency bin are the polar coordinates of these points, wherethe distance from the origin is the bin amplitude and the angle around the origin is the bin

    phase:

    http://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/in.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/in.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/in.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poly~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poly~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poly~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poly~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/out.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/in.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.html
  • 7/28/2019 Pfft Max/MSP

    8/14

    Unit-circle diagram showing the relationship of FFT real and imaginary values to amplitude and phase

    You can easily convert between real/imaginary pairs and amplitude/phase pairs using the

    objectscartopol~andpoltocar~:

    Cartesian to polar conversion

    Technical detail: The amplitude values output by the left outlet ofcartopol~naturally depend

    on the amplitude of the signal you send to thepfft~object. Nonetheless, the maximumamplitude value for a constant signal of 1.0 will be equal to the sum of the amplitude values ofthe windowing function used. For a Hanning window this is equal to half the FFT size, and for asquare window this is equal to the FFT size. For an oscillation, such as a sine wave, with amaximum amplitude of 1.0 the maximum values obtained from the FFT are one quarter of the

    window size. FFT bins at the extreme low and high ends of the spectrum may have slightlysmaller maximum values, and a DC offset in the sound may slightly increase the maximum

    http://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.html
  • 7/28/2019 Pfft Max/MSP

    9/14

    amplitude values of the FFT analysis. Nonetheless, here is a list of multipliers for variouswindow shapes to find the maximum possible amplitude value of a full-volume sine wave:Hanning: FFTsize * 0.25Hamming: FFTsize * 0.27174Blackman: FFTsize * 0.21Triangle: FFTsize * 0.2495

    Square: FFTsize * 0.5So, for example, when using a 512-point FFT with the default Haning window, a full-volume sine

    wave at half the nyquist frequency will have a value of 128 in the 128th frequency bin (512 *0.25). The same scenario using a Blackman window will provide us with a value of 107.52 in the128th frequency bin (512 * 0.21). Even though these are the theoretical maximum values with asingle sine wave as input, real-world audio signals will generally have significantly lower values,as the energy in complex waveforms is spread over many frequencies.

    The phase values output by the right outlet ofcartopol~will always be between - and .

    You can use this information to create signal processing routines based on amplitude/phasedata. A spectral noise gate would look something like this:

    A spectral noise gate

    By comparing the amplitude output ofcartopol~with the threshold signal sent into inlet 2 of

    thepfft~, each bin is either passed or zeroed by the*~objects. This way only frequency binsthat exceed a certain amplitude are retained in the resynthesis (For information on amplitude

    values inside a spectral subpatch, see the Technical note above.).

    Convolution and Cross SythesisConvolution and cross-synthesis effects commonly use amplitude and phase data for theirprocessing. One of the most basic cross-synthesis effects we could make would use theamplitude spectrum of one sound with the phase spectrum of another. Since the phase spectrumis related to information about the sound's frequency content, this kind of cross synthesis can

    http://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/times~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/times~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/times~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/times~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.html
  • 7/28/2019 Pfft Max/MSP

    10/14

    give us the harmonic content of one sound being played by the spectral envelope of anothersound. Naturally, the success of this type of effect depends heavily on the choice of the twosounds used.

    Here is an example of a spectral subpatch which makes use ofcartopol~andpoltocar~toperform this type of cross-synthesis:

    Simple cross-synthesisThe following subpatch example shows two ways of convolving the amplitude of one input withthe amplitude of another:

    Amplitude-only convolutionYou can readily see on the left-hand side of this subpatch that the amplitude values of the inputsignals are multiplied together. This reinforces amplitudes which are prominent in both sounds

    while attenuating those which are not. The phase response of the first signal is unaffected bycomplex*real multiplication; the phase response of the second signal input is ignored. You willalso notice that the right-hand side of the subpatch is mathematically equivalent to the left, even

    though it uses only onecartopol~object.Toward the beginning of this tutorial, we saw an example of the multiplication of tworeal/imaginary signals to perform a convolution. That example was kept simple for the purposesof explanation but was, in fact, incorrect. If you wondered what a correct multiplication of twocomplex numbers would entail, here is one way to do it:

    http://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.html
  • 7/28/2019 Pfft Max/MSP

    11/14

    The correct method for doing complex convolutionHere's a second and somewhat more clever approach to the same goal:

    A correct and clever way of doing complex convolution

    Time StretchingSubpatchers created for use withpfft~can use the full range of MSP objects, including objects

    that access data stored in abuffer~object. (Although some objects which were designed to deal

    with timing issues may not always behave as initially expected when used inside apfft~.)

    The following example records spectral analysis data into two channels of a stereobuffer~andthen allows you to resynthesize the recording at a different speed without changing its originalpitch. This is known as time-stretching (or time compression when the sound is speeded up),and has been one of the important uses of the STFT since the 1970s.

    http://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.html
  • 7/28/2019 Pfft Max/MSP

    12/14

    Recording and playback in a pfft~ subpatch

    The example subpatcher records spectral data into abuffer~on the left, and reads data from

    thatbuffer~on the right. In the recording portion of the subpatch you will notice that we don't

    just record the amplitude and phase as output fromcartopol~, but instead use

    theframedelta~object to compute the phase difference (sometimes referred to as the phasedeviation, or phase derivative). The phase difference is quite simply the difference in phase

    between equivalent bin locations in successive FFT frames. The output offramedelta~is thenfed into aphasewrap~object to ensure that the data is properly constrained between - and .

    Messages can be sent to therecord~object from the parent patch via thesendobject in order tostart and stop recording and turn on looping.In the playback part of the subpatch we use a non-signal inlet to specify the frame number forthe resynthesis. This number is multiplied by the spectral frame size and added to the output of

    acount~object which counts from 0 to the spectral frame size minus 1 in order to be able to

    recall each frequency bin in the given frame successively usingindex~to read both channels of

    ourbuffer~. (We could also have used the sync outlet of thefftin~object in place ofcount~, butare using the current method for the sake of visually separating the recording and playback parts

    of our subpatch, as well as to give an example of how to make use ofcount~in the context of aspectral subpatch.) You'll notice that we reconstruct the phase using theframeaccum~object,

    which accumulates a running phase value by performing the inverse offramedelta~. We needto do this because we might not be reading the analysis frames successively at the original ratein which they were recorded. The signals are then converted back into real and imaginary values

    forfftout~by thepoltocar~object.This is a simple example of what is known as aphase vocoder. Phase vocoders allow you to time-stretch and compress signals independently of their pitch by manipulating FFT data rather than

    http://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/phasewrap~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/phasewrap~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/phasewrap~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/record~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/record~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/record~.htmlhttp://www.cycling74.com/docs/max5/refpages/max-ref/send.htmlhttp://www.cycling74.com/docs/max5/refpages/max-ref/send.htmlhttp://www.cycling74.com/docs/max5/refpages/max-ref/send.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/index~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/index~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/index~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/frameaccum~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/frameaccum~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/frameaccum~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/poltocar~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftout~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/frameaccum~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fftin~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/index~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/count~.htmlhttp://www.cycling74.com/docs/max5/refpages/max-ref/send.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/record~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/phasewrap~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/framedelta~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/cartopol~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/buffer~.html
  • 7/28/2019 Pfft Max/MSP

    13/14

  • 7/28/2019 Pfft Max/MSP

    14/14

    playback rate. You'll notice that changing the playback rate does notaffect the pitch of thesound, only the speed. You may also notice that at very slow playback rates, certain parts of yoursound (usually note attacks, consonants in speech or other percussive sounds) become rathersmeared and gain an artificial sound quality.

    SummaryUsingpfft~to perform spectral-domain signal processing is generally easier and visually clearerthan using the traditionalfft~andifft~objects, and lets you design patches that can be used at

    varying FFT sizes and overlaps. There are myriad applications ofpfft~for musical signalprocessing, including filtering, cross synthesis and time stretching.

    http://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/ifft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/fft~.htmlhttp://www.cycling74.com/docs/max5/refpages/msp-ref/pfft~.html