🔊
SpinCAD Designer
  • Welcome to SpinCAD Designer!
  • Tutorials
    • Getting Started
    • The User Interface
    • Creating a patch
  • Menus
    • File
    • Edit
    • Loop
  • Blocks
    • I/O Mix
    • Wave Shaper
    • Dynamics
      • RMS Lim/Exp
    • Controls
      • Introduction to control signals and blocks
      • Two-stage
      • Invert, Power, Two-Stage, and Vee
      • Ratio
      • Scale/Offset
      • Clip and Tremolizer
      • Envelope
      • Slicer and Smoother
      • Tap Tempo
    • Pitch
      • The Pitch Offset Blocks
  • Design Concepts
    • Basic LFOs in SpinCAD Designer
    • Deep dive into the Three-Tap Delay block
      • Deep dive into the ThreeTap Delay, part 1
      • Deep dive into the ThreeTap delay, part 2
      • Deep dive into the ThreeTap Delay, part 3
    • Analyzing the Spin auto-wah peak detector
      • The Spin auto-wah peak detector, part I
      • The Spin auto-wah peak detector, part II
      • The Spin auto-wah peak detector, part III
    • Intro to the "Dattorro" reverb structure
    • Analyzing the Spin Mini Reverb
      • Analyzing the Spin "Mini Reverb" part 1
      • Analyzing the Spin "Mini Reverb" part 2
      • Analyzing the Spin "Mini Reverb" part 3
  • Patches
    • Making a tremolo patch
    • Making a vibrato/chorus patch
    • Making a pitch shifting delay
    • Multi-head "drum/tape" delay
    • 4-phase LFO driven mixer
  • Tips and Tricks
    • Editing tips for fast patch creation
    • Programming the FV-1 EEPROM with your code
    • Optimizing FV-1 assembly code generated by SpinCAD Designer
  • Beneath the Hood
    • How SpinCAD Builder works
    • Analyzing a simple SpinCAD Builder file
Powered by GitBook
On this page
  1. Blocks
  2. Controls

Ratio

The ratio control is handy to use when you want two things to be inversely proportional to each other. As one goes up, the other goes down.

PreviousInvert, Power, Two-Stage, and VeeNextScale/Offset

Last updated 1 year ago

Sometimes you want a single pot to control two things. Not only that, you'd like one of the things to go up when you rotate the pot, while the other one should go down. Not only that, but you'd like the values of the two things to remain balanced over the full sweep of the pot.

One example is a chorus with independent knobs for the LFO speed and width. If you control both of these directly, you will find that the amount of detuning increases with both LFO frequency and width if you keep the other parameter constant. Wouldn't it be great to easily make them track together properly so that the amount of detuning remained fixed regardless of the speed?

First, let's take a look at what happens to a chorus where we increase the LFO frequency and keep the width constant.

Notice that the vertical width of the horizontal line is showing the amount of pitch bending the 1324 Hz sine wave experiences. As the frequency of the LFO increases, so does the amount of pitch bending. The "Width" setting was not adjusted during this test. I'm not trying to blow your eyes out; these were the default colors in Audacity's Spectrogram view!

Next, let's use the Ratio block to lower the width as the rate increases (and raise the width as the rate decreases).

Looking at the spectrogram of the recorded output, you can see that the width of the pitch shifting from the chorus block stays much more consistent as the LFO rate changes.

Here I've added a multiplier with POT 1 to allow me to decrease the LFO width (which still stays consistent over the rotation of POT 0).

Let's look at the math involved, I can hear you all screaming vigorously. Okay, okay, just calm down.

This function starts at 1/ratio when x = 0 and ramps linearly to 1 when x = 1. y = 1/ratio + (ratio -1) * x/ratio. Slope = (ratio - 1)/ratio and the y-intercept (when x = 0) is 1/ratio. We don't go all the way to zero. Also, we are really only interested in signals between 0 and 1 because those are the only signals that the FV-1 can actually process.

This function starts at 1 when x = 1/ratio and decreases to y = 1/ratio at x = 1.0. When x is below 1/ratio, the value of y saturates at 1.0. Or it would, but this is not what we really want. We want the "ratio" output to go from 1.0 at x = 0 to 1/ratio at x = 1.0. In order to do this, we feed the linear output value to the 1/(ratio * x) function instead of the POT output. So, the lowest that value ever gets is 1/ratio which is the point at which the curve crosses the y = 1 line. What we get then is the 1/(ratio * x) curve, but stretched to the left to intersect with (0,1). This is expressed as: y = 1/(1 + (ratio - 1) * x). When x = 0, y = 1. When x = 1, y = 1/ratio.

Multiply these together, and the product works out to be the constant value 1/ratio. Note that for each similarly colored curve, the linear curve intersects the y-axis (x = 0) at the same value as the ratio curve intersects the x = 1 line.

Chorus patch with proportional width control
y = (1 + (ratio - 1) * x )/ratio
y = 1/(ratio * x)
Warped ratio function