Squiz Wave squeezer. Maybe a kind of pitch shifter.

Squiz.ar(in, pitchratio, zcperchunk, memlen)

A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input.

pitchratio is the ratio by which pitch will be raised (e.g. pitchratio of 2 will raise by one octave). Only upwards pitch-shifts are possible so a value below 1 will have no effect.

The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences imbetween.

zcperchunk indicates how many positive-going zero-crossings are used to delimit a chunk. (Only positive integer values make sense.)

memlen is the amount (in seconds) of memory the unit allocates internally to remember each fragment, i.e. the longest a given fragment can become. The default should be fine for most signals. Raising it higher will use more real-time memory and probably won't sound very different (especially if zcperchunk is low).

All the parameters apart from memlen can be modulated.

This UGen is dedicated to Suburban Base Records. (It doesn't sound like them, but was half-inspired by them.)

Examples

In both these examples, moving the mouse left/right varies pitchratio, while moving it up/down varies zcperchunk. If you watch the scope it illustrates fairly well what's happening.

s = Server.internal;

s.boot;

// On a simple sine wave

x = {Squiz.ar(SinOsc.ar, MouseX.kr(1, 10, 1), zcperchunk: MouseY.kr(1, 10), mul:0.1).dup}.play(s);

x.free;

// Scope is helpful for visualising what's going on

x = {Squiz.ar(SinOsc.ar, MouseX.kr(1, 10, 1), zcperchunk: MouseY.kr(1, 10), mul:0.1).dup}.scope;

x.free;

// On a sample of some sort - choose one...

b = Buffer.read(s,"sounds/a11wlk01.wav");

b = Buffer.read(s,"sounds/amenfast.wav");

(

x = {

var sig;

sig = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum), loop: 1);

Squiz.ar(sig, MouseX.kr(1, 100, 1), zcperchunk: MouseY.kr(1, 10), mul:0.5).dup

}.play(s);

)

x.free;

b.free;