Generating/Manipulating LFO shapes in SpinCAD...

Started by Millarman9111993, September 26, 2020, 04:38:56 PM

Previous topic - Next topic

Millarman9111993

Hopefully this is ok to ask here since the Spincad forum doesn't exist anymore.

I've been messing about with the program for a while now and I'm curious if anyone has a good way of creating various waveform shapes (square, triangle etc) from the LFO blocks, I'm looking at messing around with some chorus/vibrato effects (think EQD Aqueduct) using various waveforms.

I'm pretty sure this is all doable in the SpinASM, but I'm not really familiar with how to write that (despite my best efforts trying to understand it), I'm just wondering if something like that can be replaced through Spincad?

So far I've messed around with the Power block coming off of the LFO, which Definitely changes it up a bit, but I'd like to take it a step further and get into squarewaves etc if possible.

Digital Larry

#1
You get a sin/cos LFO block (output selectable -1 to 1 or 0 to 1) and a ramp/tri LFO.  The ramp/tri LFO has an adjustable width which is simply the parameter that gets sent to the RAMP LFO width register.  This is not 0 to 1, I think that RAMP at 4096 goes 0 to 0.25, and TRI is 0 to 0.125.  I kinda forget to be honest. [edit - ramp at 4096 should go 0 - 0.5 and the triangle 0 - 0.25 ]

Anyway, if you wish to boost the width of RAMP or TRI, use the "Gain Boost" block under "wave shapers".  This allows you to adjust a signal in 6 dB steps, equivalent to:

SOF -2.0, 0
SOF -1.0, 0

Something like that.  So to get the TRI to go 0 to 1.0, add 12 dB boost after it.

If you want to generate a PWM signal, send the triangle wave into the SLICER block and modulate the level input.

If you want to warp a signal so that e.g. a sine wave squishes more towards 1 or 0, use the Power block.

One reason to normalize the ramp/tri to 1.0 before doing any warping is to get a consistent effect, which you can SOF afterwards.  You can also take a less than 0 to 1.0 signal and warp THAT with the Power block, but IMO the results are less predictable.  The reason for this is that the Power block maps 0.0 to 0.0 and 1.0 to 1.0, so your output range does not change as long as the input range goes from 1 to 0.  Otherwise you are confronted with having to adjust the output range every time you tweak the power setting.  Of course every approach CAN be valid, but I'm just trying to save you some time.

You might even be able to use the LOG and EXP blocks but I always found those a little baffling.  Once you've got the wave shape you're after, then of course you can use SOF to scale and offset that, for example to provide modulation into the "Servo Delay" block for flanging or chorus.

Let me know if this info is helpful to get you started.

DL
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Millarman9111993

Quote from: Digital Larry on September 26, 2020, 06:15:29 PM
You get a sin/cos LFO block (output selectable -1 to 1 or 0 to 1) and a ramp/tri LFO.  The ramp/tri LFO has an adjustable width which is simply the parameter that gets sent to the RAMP LFO width register.  This is not 0 to 1, I think that RAMP at 4096 goes 0 to 0.25, and TRI is 0 to 0.125.  I kinda forget to be honest.

Anyway, if you wish to boost the width of RAMP or TRI, use the "Gain Boost" block under "wave shapers".  This allows you to adjust a signal in 6 dB steps, equivalent to:

SOF -2.0, 0
SOF -1.0, 0

Something like that.

If you want to generate a PWM signal, send the triangle wave into the SLICER block and modulate the level input.

If you want to warp a signal so that a sine wave squishes more towards 1 or 0, use the Power block.

You might even be able to use the LOG and EXP blocks but I always found those a little baffling.  Once you've got the wave shape you're after, then of course you can use SOF to scale and offset that, for example to provide modulation into the "Servo Delay" block for flanging or chorus.

Let me know if this info is helpful to get you started.

DL

VERY helpful :) thanks!

Digital Larry

#3
Pretty sure this is where the ramp/triangle code came from:

http://spinsemi.com/knowledge_base/coding_examples.html#Generating_triangle_waves

You can use a sine LFO (output range set to 0 - 1) to drive the slicer at 0.5 to create a square wave.

You can use the noise generator with the sample and hold to make a random LFO.

These last two jump around abruptly and I typically would pass them through a smoother (Controls menu) if I'm going to use them for fading, volume, or filters.

You can clip off the top or bottom of a waveform either by adding so much gain that it goes past +/- 1.0 (Clip block) or using the "Maximum" block.
 
You can fold a bipolar signal around zero by using "Absolute Value".  Generally speaking this doubles the frequency and puts a sharp point on one side of the resulting waveform.

Use the "Invert" block to flip a 0 - 1 signal to 1 - 0.

Season to taste.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer