Now the three main patches are some what complete and working, it was time to conjoined them all into one major Max patch. The screen capture uploaded with this post shows this.
There were a few simple re-patches, and a few additions.
The addition of a spectroscope~ was an arrangement made so that a quick check of the signal path between each of the three sections were working correctly. The adjustment of the background and foreground colour were made just for aesthetics.
The introduction of a dac~ was made too. The dac~ followed by the series of “1 2 3 4 5 6” etc means that a certain number of outputs can be made. I opted for 6, which when a multi-output sound card is used, will give me a 6 audio outputs into the multi-surround speaker array.
Please note that in the screen capture, everything is patched into channels 1 and 2 due to the fact that I and only using a 2 channel output sound card, once the installation is complete, a simple re-patch will be done, for 6 outputs.
I opted for 6 outputs, these will be configured and patched this way;
output 1: input source signal
output 2: recorded input signal
output 3: kslider vocoder output 1
output 4: kslider vocoder output 2
output 5: kslider vocoder output 3
output 6: loop output
With these configured, it will mean that there will be a surround sound mix of the Max patch.
Reflecting back on patch number two, I have made a few additions that I deemed necessary.
1. I have added a loop message, so that a drum loop can be looped over and over.
2. I have added two kslider’s, so that a chord can be produced in the vocoder effect. As you can see in the uploaded screen capture, the kslider’s (shown as three user graphical keyboards) are playing a C major chord.
Max Patch Three.
As you can see in the uploaded screen capture, I have created a third patch to include in the final project patch session. This patch was created to record and play back sampled audio from the user via the in-built mic of the Macbook.
Here is a rundown of what was used in the patch and how it all works together.
Input signal path: Recording audio
ezdac~
The ezdac~ works as a user interface version of the adc~ object. It appears as a button which can be clicked with the mouse to turn input audio on or off.
buffer~
This objects stores the recorded input as samples into the computer’s buffer memory or RAM. In my patches’ case, the buffer memory is set at 4000, which means it records around four seconds of audio input. This number can be adjusted accordingly at a later date.
record~
The record~ object simply records a signal into the buffer~. Up to four channels can be recorded by specifying the optional argument. The recording stops when the buffer~ is filled.
Message “delay”
The delay message of 4000ms sends a band message to turn the toggle off. Which in turn, switches the record on and off for the pre-determined duration.
Audio path two: recorded audio playback
ezdac~
This object works as a user interface version of the dac~ object. It appears as a button which can be clicked with the mouse to turn audio on or off.
groove~
This object is a variable-rate, looping, sample-playback object which reference the audio information stored in the buffer~ object.
sig~
This object converts regular number messages into audio signals. Above the sig~ object is a flonum, where the number 1 plays the recorded sample at normal speed, and the number -1 plays the recorded sample backwards. The “loop” message is patched into the groove~ object, so that a toggle can be turned on or off to loop the recorded sample over.
As you can see in the screen capture, the ezadc~ and the ezdac~ are patched together, so that a round trip of audio occurs.
Anti-Aliasing
As highlighted in the previous post, the saw~ object creates a sawtooth wave that is anti-aliased. Here is a short definition of anti-aliasing, and how an anti-aliasing filter is a necessity when working with digital audio, and the conversion process.
An anti-aliasing filter is a filter used before a signal sampler, to restrict the bandwidth of a signal to approximately satisfy the sampling theorem. Since the theorem states that unambiguous interpretation of the signal from its samples is possible when the power of frequencies above the Nyquist frequency is zero, a real anti-aliasing filter can generally not completely satisfy the theorem. A realizable anti-aliasing filter will typically permit some aliasing to occur; the amount of aliasing that does occur depends on how good the filter is and what the frequency content of the input signal is.
Anti-aliasing filters are commonly used at the input of digital signal processing systems, for example in sound digitization systems; similar filters are used as reconstruction filters at the output of such systems, for example in music players. In the latter case, the filter is to prevent aliasing in the conversion of samples back to a continuous signal, where again perfect stop-band rejection would be required to guarantee zero aliasing.
The theoretical impossibility of realizing perfect filters is not much of an impediment in practice, though practical considerations do lead to system design choices such as oversampling to make it easier to realize “good enough” anti-aliasing filters.
Often, an anti-aliasing filter is a low-pass filter; however, this is not a requirement. Generalizations of the Nyquist–Shannon sampling theorem allow sampling of other band-limited passband signals instead of baseband signals – see undersampling.
For signals that are bandwidth limited, but not centered at zero, a band-pass filter can be used as an anti-aliasing filter. For example, this could be done with a single-sideband modulated or frequency modulated signal. If one desired to sample an FM radio broadcast centered at 87.9 MHz and bandlimited to a 200 kHz band, then an appropriate anti-alias filter would be centered on 87.9 MHz with 200 kHz bandwidth (or pass-band of 87.8 MHz to 88.0 MHz), and the sampling rate would be no less than 400 kHz, but should also satisfy other constraints to prevent aliasing.
It is very important to avoid input signal overload when using an anti-aliasing filter. If the signal is strong enough, it can cause clipping at the analog-to-digital converter, even after filtering. When distortion due to clipping occurs after the anti-aliasing filter, it can create components outside the passband of the anti-aliasing filter; these components can then alias, causing the reproduction of other non-harmonically-related frequencies. In digital audio, the resulting aliased distorted signal of “digital clipping” has a characteristic sound that can be easily recognized.


