Anyone ever use the T/X block in SpinCAD?

Digital Larry

Active member
The T/X block was supposedly based on this Spin Knowledge Base article which shows how to get a smooth overdrive.


I've never really used it myself as I never thought distortion was the FV-1's strong suit. The other day I decided I'd try to see how it worked on the built-in scope and was really surprised by what I found. With the low-pass filter as high as it will go (about 5 kHz) and taking a full -1 to + 1 sine wave in at 105 Hz, there's very little visible distortion at all. Top trace is input to ToverX, bottom trace is output.

1735235285986.png

Now with the input level reduced to about 18%, all of a sudden there is some really nasty crossover distortion going on.

1735235392517.png

Much below this (about 10%) it seems to go away almost completely, at least on this scope (which is linear and doesn't have great resolution). Listening to the simulator with my standard clean guitar loop (which I think is normalized at - 12 dB), hardly anything happens. With 6 dB of gain it starts sound gated and spitty. With 12 dB of gain, it sounds like clean overlaid with a raspy fuzz.

1735235543394.png

I looked into the generated code and am pretty sure I located a coding error. This is totally not what the intention of the original algorithm was but I'm trying to figure out whether to just try fixing this, or to keep it as something separate, in which case what to call it? Anybody ever used this one intentionally?

- DL
 
Last edited:
I'd never really noticed it till you just mentioned it. So, I took it for a spin. (No pun intended, but I'll take it.)
But itself, (with just the IN & OUT blocks added, it sux. I added some other blocks and got something a little more workable out of it.

My_Fuzz_03_SpinCAD.png

Before adding the Distortion block, I noticed a considerable drop in output volume in the middle of Pot0's travel, sounding louder towards the min & max extremes.

Is there a "Sustain" block anywhere?
 
LOL thanks CC, I think I am just going to try to fix the T/X block in place. As far as a "sustain" block, maybe there's a compressor with a control (or controls) at mstratman's Github repo, perhaps one of these days I can see about adding that, as long as I do not have to think too hard. There are a few limiter blocks under "dynamics".

Cheers, DL
 
LOL thanks CC, I think I am just going to try to fix the T/X block in place. As far as a "sustain" block, maybe there's a compressor with a control (or controls) at mstratman's Github repo, perhaps one of these days I can see about adding that, as long as I do not have to think too hard. There are a few limiter blocks under "dynamics".

Cheers, DL
Thanks DL. I saw the compressor blocks in SpinCAD but haven't futzed with them yet to see/hear how they behave with regard to sustain. Definitely worth a look.
 
Thanks DL. I saw the compressor blocks in SpinCAD but haven't futzed with them yet to see/hear how they behave with regard to sustain. Definitely worth a look.
The 3 dynamics blocks (they are described as limiters) in SpinCAD were taken straight out of Spin's free programs and don't represent a deep understanding of the subject on my part. There's actually a fairly decent section in the Spin Knowledge Base about making an adjustable dynamics processor, but as with much of those docs, the theory section is in one place and the code examples are in another place. I have used some decent digital compressors although right now I have 2 analog ones. I'll (perhaps) see if one is in mstratman's collection as I'm getting ready to redo the programs in my "Easy Spin" pedal that the guys at AudioFab were kind enough to send me.
 
Last edited:
Before adding the Distortion block, I noticed a considerable drop in output volume in the middle of Pot0's travel, sounding louder towards the min & max extremes.
What you've done there is to replicate the MO of the crossfade 1 block. It has a 6 dB dip in the middle assuming you put the same signal in both sides. Crossfade 2 has a 6 dB bump in the middle. Crossfade 3, which I finally got working earlier this year, gets to 0 dB at the middle and ends, with varying amounts of discrepancy at other points. A true equal-power crossfade would use sin and cos signals (since sin(x)^2 + cos(x)^2 = 1) but the FV-1 doesn't have a lookup table function for such a thing. So the Crossfade 2 and 3 are 2-segment implementations with the center gain of Crossfade 3 = 0.707 which you will recognize as sqrt(2)/2.
 
OK my curiosity got the best of me here. I went back to the original Spin Knowledge Base articles about the "T Over X" distortion (linked above in previous post). I took the SpinCAD block back to just one of these (as implemented, it was 4 in a row). I auditioned it in SpinCAD Designer and it sounded like kay-arr-ay-pee. Not remotely smooth. Then made 4 examples, with 1, 2, 3, 4 in a row and exported to Spin ASM whereupon I loaded them into the Easy-Spin pedal. These SPN files are attached in a ZIP. Pot0 is pre-gain and pot1 is output level. These sound much better. 1 is like a soft clipping and 4 is fairly crunchy but I wouldn't call it high-gain. The leads me to believe that there is STILL some issue with the LOG/EXP simulation in SpinCAD. I'm not going to make excuses, I didn't write the simulator part originally so really don't know how well shaken out it was. I did make some changes to Log/Exp simulation code when I was working on the "ratio" block as some things didn't make sense. But, I'm not super motivated to spend a lot of time fixing it at the moment. In any case you can now hear what the "T Over X" sounds like using the attached SPN files.

Please note, the attachment is a ZIP. So rename it to give it a ZIP extension at which point you should be able to extract it.

Conclusion - there IS a coding error in the T/X block in current SpinCAD, as well as a simulation error with log and/or exp instructions somewhere.

DL
 

Attachments

Last edited:
I spent a bit more time looking at this last week, and improved the T/X block to behave the way it is described in the Spin Knowledge base (i.e. not filtering the final stage). I also added more detail to the "Wave Shaper" block descriptions at Gitbook (the help pages). Started trying to figure out why simulation of the T/X specifically has this issue where, when the signal amplitude coming in is relatively low, say -20 dB FS, you start getting this crossover distortion. Yesterday I finally found my way to the simulation code and remembered how Java works (I don't use it other than with SpinCAD which I hardly ever look at). While I was at it I added the "noise gate" from the Spin Knowledge base. As usual I wanted to make it adjustable but the single thing you can adjust, which is called the "threshold", does not behave simply as a threshold. If you make it 0.001 rather than the default 0.02 then it starts fading in the beginning of your notes, sort of like a "slow gear". I'll probably make a release with the fixed/new blocks and don't know when/if I'll figure out why the T/X simulation bug is happening. Fortunately the generated code works as expected.

DL
 
OK, this is somewhat embarrassing, although it doesn't sound like anyone else figured it out either. The "Distortion" program in the free programs area is actually based on this "T over X" concept. This is discussed/implemented in 3 different places on the Spin website with no explicit links between them, leaving connecting the dots to some drooling obsessive such as myself over the course of a dozen years!


is just a code fragment of what is implemented in:


that is further discussed over here:


No wonder it didn't work!

So, ultimately the existing "Distortion" block will get updated to allow 1-4 stages with the variable filtering applied between each stage and omitted on the last. The "T/X" will disappear because it's not really the full thing!

Maybe if I ever recover from this, I'll think about how to make the threshold adjustable and even individually adjustable for + and - halves which would create asymmetrical clipping, aka "warm" "Class A" "even harmonics" cough cough cough!
 
Back
Top