# The Pitch Offset Blocks

These two blocks can be found in the "Pitch" menu. &#x20;

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FTlbU4KGMCBbmaQrpi0Ow%2Fimage.png?alt=media&#x26;token=b4ff1cc3-716b-480c-80bd-07f999832b0f" alt=""><figcaption></figcaption></figure>

These blocks implement the algorithm found [here ](http://spinsemi.com/knowledge_base/effects.html#Pitch_shifting)at the Spin Knowledge Base.  This is something called a "Hilbert Transform" and I don't intuitively understand how it works, or else I'd try explaining it.  As described in the article, a bandpass filtered signal is run through a phase shift and multiplied by a sine and cosine at the pitch offset frequency.  The result is that frequency components are offset by a fixed amount rather than by a percentage as in the traditional pitch shifter which maintains harmonic relationships.

So, supposing the input signal  has components at:

* 100 Hz
* 200 Hz
* 300 Hz

If the pitch offset is 10 Hz, we'll get:

* 110 Hz
* 210 Hz
* 310 Hz

The "3rd harmonic" is 20 Hz flat!  Clearly this is not the effect to use when you are after beauty - or is it?  According to[ the code sample](http://spinsemi.com/knowledge_base/pitch_sft.html), this offsets up or down by up to 370 Hz.

The secret to this block is that "zero" offset occurs with a control input level of 0.5.  Above 0.5 offsets down while below 0.5 offsets upwards. &#x20;

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2F1WR3PXFKznY325pXPQkl%2Fimage.png?alt=media&#x26;token=c197cfb1-c69c-4196-a9d1-f7776f316b46" alt=""><figcaption></figcaption></figure>

Now you can get goofy sci-fi sounds by exploiting the full range directly, or you can put the pitch offset in the feedback loop of a delay, to get a different kind of sci-fi sound.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FpoMnIouFWYWg0oHjrnfp%2Fimage.png?alt=media&#x26;token=d077a576-448c-4bf4-95dc-539ad7baf684" alt=""><figcaption></figcaption></figure>

I discovered that you can also get a beautiful sort of tremolo/chorus sound by scaling the control signal way down so that the variation around 0.5 is very small, i.e. 0.49 to 0.51.   This is easily accomplished by setting the Scale/Offset as shown:

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FWFKcesCIVbsCqmtjBtZM%2Fimage.png?alt=media&#x26;token=33d90aad-bdb8-47a5-b2e5-d4cc441949eb" alt=""><figcaption></figcaption></figure>

You can run this in stereo or summed to mono.  Each one is a unique sound.

One drawback of this block is that it uses a LOT of registers and instructions.  For the dual-output block, I had to have them share the input filter so you can't really get totally separate processing, but you can do things like this:

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2F4m9MgV8dZonVeY6CYmHG%2Fimage.png?alt=media&#x26;token=0c313fe0-211e-43c6-835d-60e43d25c00b" alt=""><figcaption></figcaption></figure>

Check out the linked [SpinCAD Bank file](https://github.com/HolyCityAudio/SpinCAD-Designer/blob/master/patches/pitch-shifter-examples.spbk) for these patches and a few more.  Click on the "Download" button as shown.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2Ft1mmb7n9M4x5QCKleXOn%2Fimage.png?alt=media&#x26;token=1ad043fa-dff4-42af-bb2c-564228963881" alt=""><figcaption></figcaption></figure>

What can you come up with?
