3.4.3.1 Array oscillator

One way to simplify the combination of "tabread~" and a multiplied "phasor~" signal is "tabosc4~". This reads out an array for the frequency you enter. One limitation of this method is that the size of the array must be a power of two (e.g., 128, 512, 1024) plus three points (here, 1027 = 1024 + 3).

patches/3-4-3-1-arrayoscillator.pd

This touches on "wave shaping", a topic that will be further explained inchapter 3.5. You can draw any wave into an array using the mouse.


3.4.3.2 Array playback

Yet another simplification is "tabplay~"; it simply plays an array back at the original speed (when banged). Conveniently, you can set the start and end points for playback (starting point and duration in samples):

patches/3-4-3-2-simply-play-array.pd


3.4.3.3 Playing back an array in a block

The "tabwrite~" and "tabread~" objects also have another special form: "tabsend~" and "tabreceive~". They write/read an array in sync with the "blocks" (3.1.1.3.2). "tabwrite~" writes each block in an array (of course, these must be the size of a block, which is set to 64 samples by default in Pd). "tabreceive~" reads the array in every block. We will return to this later in the chapter on FFT (3.8).


3.4.3.4 Glissandi of samples

You know that you can play back an array at normal pitch or an octave higher, etc. But what if you want a glissando from the octave to the original pitch? For this, you'll need to subdivide into "main indicator" and "addition". The "main indicator" run at normal speed over the array. Let's use an array with 132300 points as an example, which equals 3000 milliseconds:

Then comes the "addition", which is what makes the glissando. Let's use a glissando that begins five chromatic steps above the original pitch and returns to the original pitch in 500 milliseconds. You need to make "line~" of this in reverse, then square the values:

Above this, you have to determine the factor for the frequencies of the five chromatic steps (cf.3.1.1.4.3)...

...and finally conduct the following calculation:

This is the "addition" that is added to the "main indicator":

patches/3-4-3-4-sample-glissando1.pd

You can use any glissandi to the target pitch that you want; even negative values are possible:

patches/3-4-3-4-sample-glissando2.pd

Conversely, to move away from the original tone:

patches/3-4-3-4-sample-glissando3.pd


3.4.3.5 Additive synthesis with array

As a special function in Pd, you can create a sum of sine tones in an array - i.e., additive synthesis as described in Chapter3.2. This is accomplished using the message "sinesum". The first argument is the (new) array size (should be a power of 2; three points will be added to this number automatically to ensure optimum connection of the beginning and ending of a phase) and also the volume factors for any number of partials:

patches/3-4-3-5-sinesum.pd

Instead of sine waves, you could also use "cosinesum" to work with cosine waves.


3.4.3.6 Latency

Audio delay sometimes occurs when you don't want it to. You can even hear it when you have a microphone connected to a speaker and make an extremely short noise into the microphone, snapping your fingers, for example:

The sound card and especially the operating system determine the length of this "latency". Ideally the latency is so short (under 5 ms) that the human ear cannot perceive the delay. This requires a fast computer processor, a good sound card, and an appropriate operating system. You can set the latency underMediaAudio settings:

In Microsoft Windows, you cannot at the present time (June 2008) achieve a latency of less than 50 ms without causing errors.


3.4.4 For especially interested

3.4.4.1 4-point interpolation

In this example you can see how "tabread4~" interpolation works:

patches/3-4-4-1-four-point-interpolation.pd

The jump from 1 to -1 is 'softened' by a kind of sinusoidal interpolation. As the name implies, four points are used and altered: namely the two directly in front of and the two directly behind the interval that you want to interpolate.


3.4.4.2 Sample-wise delay

One way to delay something by a certain number of samples with "delread~" and "vd~" is by using a subpatch (otherwise the problem of block size, described previously in relation to octave displacement):

patches/3-4-4-2-samplewise-delay.pd

results matching ""

    No results matching ""