# Slicer and Smoother

Last time I pulled a fast one and used some blocks without fully explaining what they do.  Well there are only so many tangents I can go off on at one time, so I let this one go until now.

**The Slicer Block**

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2F7Eyk0XhmntkKtwQ4UaYY%2Fslicer.png?alt=media&#x26;token=b767efce-a9f6-4b43-8521-d2ac93357a40" alt=""><figcaption></figcaption></figure>

Let's start with the Slicer block.  The most straightforward application of this block is to get a square wave from a sine wave.  Set the **Slice Level** at 50, and the **Slicer Out** goes high when the **Control In** is below this amount (which represents a percent of the maximum).  When the **Control In** is above this threshold, the **Slicer Out** is low.  That may seem a little backwards, but that's how it works today (build 1035).

The value of "low" depends on the combo box setting.

* 0 -> +1 : output goes from 0 (low) to 1.0 (high)
* -1 -> +1: output goes from -1 (low) to 1.0 (high)

I'm just going to use 0->+1 for these examples.

Start with an 8 Hz Sine wave, 0 -> 1.0, going into the Slicer's Control In, with the Slice Level pin unconnected.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FGgNT5lGQfpY08NIUNKmJ%2Fimage.png?alt=media&#x26;token=acae6ea2-c93f-4fd1-b1c5-d1257e6c552a" alt=""><figcaption></figcaption></figure>

![](https://c10.patreonusercontent.com/4/patreon-media/p/post/74196134/08bbb304446848d2846d27cfc4bbeb0a/e30%3D/1.png?token-time=1683676800\&token-hash=38auNOqxRmaAwXi97XU18OviF7fNOeRyQ28bzKPQpjI%3D)

Turn on the Simulator "Scope":

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FcJmXfJK0EeaJDq0a1mSX%2Fenable-scope.png?alt=media&#x26;token=8871ec57-1561-40f5-96ed-431e2303b08a" alt=""><figcaption></figcaption></figure>

**Warning!**

**Sending control signals to the outputs lets you use the scope during development to get a better idea of what is going on.  It also can send full amplitude square waves to your headphones and speakers which can make those items explode along with your eardrums and head.  For this reason, please mute your audio when doing the following tests.**

Now, start the simulator and if needed, adjust the scope display settings to view the waveforms.  We see a square wave that switches in the middle of the transitions of the sine wave.  The high portions of the square wave align with the low portions of the sine wave.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FE208kPKSk8OTyzf9Acki%2Fscope-01.png?alt=media&#x26;token=598f8510-aa6e-440a-bda5-479c9e8368ba" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2Ftf6rrW3AtrBF79CjejKi%2Fscope-02.png?alt=media&#x26;token=034cd8f0-f009-4ad9-991d-938f578a4fe4" alt=""><figcaption></figcaption></figure>

Now set the slice level to 0.95 and restart the simulator.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FLZhXjTt8MhEtzEpOwy3E%2Fslice-0.95.png?alt=media&#x26;token=9566b394-af80-4fbe-8c00-92de56109d57" alt=""><figcaption></figcaption></figure>

Now we are getting a very narrow low going pulse switching near the top of the sine wave.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FvfttThyCbc08ET22Wuwf%2Fscope-03a.png?alt=media&#x26;token=d9a0cf2d-cf40-41d5-886a-130ecd0f95ae" alt=""><figcaption></figcaption></figure>

Add a Pot to the Slice Level input.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2F0KS5tbvCPnPYIc4ypNRU%2Fslicer-with-pot.png?alt=media&#x26;token=6f907bb4-50fd-4b6b-a203-9f3af33774f0" alt=""><figcaption></figcaption></figure>

When the Pot level is varied, the pulse width modulates over its range.  Note that if you set the pot to 0, the pulses will actually stop because the slice level is zero.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FuWovA9XPGxVrFv09vNeP%2Fscope-04.png?alt=media&#x26;token=b9c2a535-bd77-4722-a70c-a6cf1ea85efb" alt=""><figcaption></figcaption></figure>

To set the low range for the pulse width, use a scale/offset block.  The actual "Output Low" value should be set to your taste.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FiTFRptpRbU8JeKya0RTP%2Fslicer-with-pot-and-sof.png?alt=media&#x26;token=d9792efe-12ed-4338-90cc-3cc648d80091" alt=""><figcaption></figcaption></figure>

#### Another application for the Slicer block

In [this patch](https://github.com/HolyCityAudio/SpinCAD-Designer/raw/master/patches/phaser-flanger.spcd), I didn't use a **Smoother** after the Slicer simply because I ran out of instructions.   The **Slicer** output goes to a **Crossfade** which means that it switches from 100% input 1 to 100% input 2. &#x20;

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2Fs1PWxaDu3vgQ9e2g3OdA%2FSnag_5d1b189b.png?alt=media&#x26;token=370cffab-d9ab-42c4-bd30-6bbb989bf372" alt=""><figcaption></figcaption></figure>

On one side, we have a Phaser.  On the other side, a flanger.  Both use the same LFO.  So pot 2 switches suddenly from Phaser to Flanger at the 50% point.&#x20;

On the same pot 2 control, is a **Vee** that independently boosts the feedback signal for the Phaser and Flanger sides.  As you go to 100% on pot 2, the Phaser's feedback is increased.  As you go to 0%, the Flanger's feedback is increased.  Feedback for both Phaser and Flanger goes to 0 when pot 2 is at 50%.

If I were writing this by hand I'd probably use a pot skip because I think it's fewer instructions.

Proposed improvements to the Slicer block

* Add independent sliders to set high and low output levels.  This could eliminate the need for a subsequent Scale/Offset if you don't want a 0 to 1 output swing.
* Remove combo box for fixed output level selections.
* Input low slice threshold could eliminate the overhead of a (likely) separate Scale/Offset block.

**The Smoother Block**

The primary application for the **Smoother** block is to add an exponential decay to sharp transitions, such as those that come out of the **Slicer** block.  The Smoother block is nothing more than a 1-pole low pass filter operating at the extreme low edge of frequency that you can set using a single instruction.  You can get lower frequencies, but you would have to add more instructions, which this block doesn't do.  I don't think it's a big deal because the lowest frequency works pretty well for most applications.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FhPMCYV9p5lpou4n8ExYh%2Fslicer-with-pot-and-sof-smoother.png?alt=media&#x26;token=e995b7fe-77fa-499b-9460-9346604ec653" alt=""><figcaption></figcaption></figure>

The parameter shown is the corner frequency of the low pass filter.  I think that most people would want to conceive of a smoother in terms of its rise time instead, but I have not yet pulled it together to be able to set the coefficient using the rise time for the slider.

I will just show you the effect that the smoother has on the 8 Hz sliced waveform from earlier.  At f = 0.51 Hz:

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FgMyewxSuEnT5BmBaBnJA%2Fscope-05.png?alt=media&#x26;token=57273e79-c463-462f-a8ab-0e3ff8b897b6" alt=""><figcaption></figcaption></figure>

You can see that the Smoother is way slower than the LFO.  This setting totally wipes out the LFO at 8 Hz.  Let's look at the other extreme, 14.79 Hz.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2Fxr3YagyTWyZFpr2ZQZMz%2Fscope-06.png?alt=media&#x26;token=b1433b7a-9fd1-4f16-ab3f-dec03466e0d7" alt=""><figcaption></figcaption></figure>

Change the Time Base to zoom in a bit:

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FptRT2U6tGhIYHX94TiMa%2Fscope-07.png?alt=media&#x26;token=c4725815-0afa-4f76-a0f5-03716506c34f" alt=""><figcaption></figcaption></figure>

Now you can see that the waveform changes from "mostly off" to "mostly on" as the pot slider is moved (well, you have to imagine that part).  I actually think that 14.79 Hz is still too low of a setting.  I'd like to maybe double that and switch the slider to showing rise time instead of frequency.

This makes the basis for a nice tremolo patch ([download it](https://github.com/HolyCityAudio/SpinCAD-Designer/raw/master/patches/slicer-tremolo.spcd)).  The **Tremolizer** Depth value is set to 0.99 which is "full chop".  Set this lower if you are not into full chop.  I will explain the Tremolizer in more detail in a future article!  Notice that if you decrease the frequency on the Smoother, that you also get less chop as the LFO is taking longer to get from one level to the next.

**Note:** You may now return to listening to the simulator output.

<figure><img src="https://4148137667-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvkMElNCYnDaBJfC78R6c%2Fuploads%2FUS7nsfmg0FEo479lsRuC%2Fslicer-tremolo.png?alt=media&#x26;token=eda6ee5d-420a-4b37-90eb-80c0e76e392b" alt=""><figcaption></figcaption></figure>

Proposed improvements to the Smoother block include:

* Increase the top frequency, thereby decreasing the minimum rise time.
* Set the rise time in the dialog rather than the corner frequency.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://holy-city-audio.gitbook.io/spincad-designer/blocks/controls/slicer-and-smoother.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
