What's the value range of the Ramp LFO, for doing math on it

Software questions and issues with the FV-1

Moderator: frank

Post Reply
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

What's the value range of the Ramp LFO, for doing math on it

Post by Digital Larry »

Looks like when the width is set to 4096, the maximum value is 0.5. So you can double it before it starts clipping.

4096 = 12 bits, one bit of headroom. So what's the mathematical value of the ramp LFO when it's at zero? One of my contributors was trying to trigger something only once per ramp cycle when the LFO value hit zero, but it seems like it never does.

As far as triggering only once per cycle, I figured it would be better to look for the peak value and then do a JAM on that LFO, but I still need to understand how to do it correctly.

I'm clearly off in the weeds trying to understand the relationship of the value returned by

CHO RDAL
vs. SOF processing
vs. SKP decision making

Some clarification would be vastly useful. Thanks!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

I think the problem is you are trying to do a "SKP ZRO, somelabel" and a digital LFO will rarely be exactly 0. You really want to watch for a negative to positive transition to say you "passed through" zero.

As an example, image a 4 bit DLFO, ranges -8 to +7 and you use an increment of 3 to set the desired speed, the sequence will be:
0, 3, 6, -7, -4, -1, 2, 5, -8, -5, -2, 1, 4, 7, -6. -3, 0, 3, ...

As you can see, we "passed through" 0 from -1 to 2 and -2 to 1 but since we did not equal 0 an instruction like "SKP ZRO" would not be triggered. Checking for a - to + sign change would always work.

Same logic for doing it on a peak but watch for the positive to negative transition as the ramp rolls over.
Frank Thomson
Experimental Noize
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

OK, reviewing the SKP instruction, ZRC finds a zero crossing but it could be in either direction, so without other logic that would happen twice per LFO cycle. Which is probably fine - I haven't experimented enough to figure out what the maximum frequency for this application is, but the ramps can be made to go plenty slow.

[edit - shoulda looked a little further, where it says:

Although most of the condition flags are mutually exclusive, SPINAsm allows you to specify more than one condition flag to become evaluated simply by separating multiple predefined symbols by the "|" character. Accordingly "skp ZRC|N, 6" would skip the following six instructions in case of a zero crossing to a negative value. ]

Then the other aspect to keep in mind is the duty cycle - you'd want the ramp to be symmetric around zero to get 50%, while other duty cycles (aka "swing") could be accomplished with other offsets.

thx Frank!

DL
Post Reply