Curious SpinCAD behavior - possible bug?

Started by bean, October 15, 2020, 10:39:18 PM

Previous topic - Next topic

bean

Been trying to solve this for days now.
Setting up a typical "Shimmer" type reverb.
Pot0 - reverb amount
Pot1 - blends b/w no octave/single octave/multiple octaves via feedback utilizing the TwoStage block.

Issue: octaves always present in Pot0 control and cannot be turned off. This happens no matter how I set up the octaves (separate Pot controls instead of the TwoStage block, using different mixing blocks to separate the shimmer effect, putting the octave before the reverb block, using just the Left output for reverb and octaves OR separating b/w Left and Right reverb outputs, putting the internal Reverb and Pitch LFOs on different settings, etc). No matter what, the octave feedback comes through in Pot1. BTW: this does NOT happen in simulation (it works normally). Issue only shows up after the PIC has been programmed and installed in a test circuit. I know the test circuit is good b/c I have 7 other patches running with no issues at all. It only happens with this particular patch. Basically, no matter how I hook everything up in SpinCAD once I program the PIC the problem persists. So, assuming my algorithm idea is sound maybe there is some issue when exporting the patch for programming? I just don't know.

I'm using SpinCAD v.1026 so I may go back to an earlier version to see if that eliminates the issue. I just can't wrap my head around the problem (signal flow seems logical to me as is).

Ex of one version shown below with settings and the ASM code output from SpinCAD.

; ShimmerTest.spcd
; Patch saved from SpinCAD Designer version 1026
; Pot 0:
; Pot 1:
; Pot 2:
;
;
; ----------------------------
;------ Input
;------ Pot 0
;------ Reverb
RDAX POT0,1.0000000000
SOF 0.5500000000,0.3000000000
WRAX REG3,0.0000000000
RDAX ADCL,0.7079457844
RDA 7260,0.5
WRAP 7104,-0.5
RDA 7484,0.5
WRAP 7261,-0.5
RDA 7817,0.5
WRAP 7485,-0.5
RDA 8266,0.5
WRAP 7818,-0.5
WRAX REG4,0.0000000000
RDA 7103,1.0
MULX REG3
RDAX REG4,1.0000000000
RDA 12656,0.6
WRAP 11213,-0.6
RDA 14000,0.6
WRAP 12657,-0.6
WRAX REG2,1.0000000000
RDFX REG7,0.4000000000
WRLX REG7,-1.0000000000
RDFX REG6,0.0100000000
WRHX REG6,-1.0000000000
RDAX REG2,-1.0000000000
RDAX REG2,1.0000000000
WRA 8267,0.0
RDA 11212,1.0
MULX REG3
RDAX REG4,1.0000000000
RDA 19560,0.6
WRAP 17978,-0.6
RDA 21542,0.6
WRAP 19561,-0.6
WRAX REG2,1.0000000000
RDFX REG9,0.4000000000
WRLX REG9,-1.0000000000
RDFX REG8,0.0100000000
WRHX REG8,-1.0000000000
RDAX REG2,-1.0000000000
RDAX REG2,1.0000000000
WRA 14001,0.0
RDA 17977,1.0
MULX REG3
RDAX REG4,1.0000000000
RDA 1274,0.6
WRAP 0,-0.6
RDA 2657,0.6
WRAP 1275,-0.6
WRAX REG2,1.0000000000
RDFX REG1,0.4000000000
WRLX REG1,-1.0000000000
RDFX REG0,0.0100000000
WRHX REG0,-1.0000000000
RDAX REG2,-1.0000000000
RDAX REG2,1.0000000000
WRA 2658,0.0
RDA 2658,0.8
RDA 10143,1.5
RDA 16094,1.1
RDA 5451,1.0
WRAX REG5,0.0000000000
RDA 2658,0.8
RDA 9190,1.5
RDA 15235,1.1
RDA 4925,1.0
WRAX REG10,0.0000000000
SKP RUN ,1
WLDS 0,20,50
CHO RDA,0,COS  | COMPC,11263
CHO RDA,0,COS ,11264
WRA 11313,0.0
CHO RDA,0,REG | COMPC,18028
CHO RDA,0,0,18029
WRA 18078,0.0
CHO RDA,0,COS  | COMPC,50
CHO RDA,0,COS ,51
WRA 100,0.0
;------ Pot 1
;------ Feedback Output
;------ Two Stage
RDAX POT1,-1.0000000000
SOF -2.0000000000,0.0000000000
WRAX REG12,0.0000000000
SOF 0.0000000000,0.9990200000
RDAX POT1,-0.9990200000
SOF -1.9980400000,0.9990200000
SKP GEZ,1
CLR
WRAX REG13,0.0000000000
;------ LPF 1P
RDAX REG11,1.0000000000
RDFX REG15,0.1474204033
WRAX REG15,0.0000000000
;------ Mixer 2:1
RDAX REG10,1.0000000000
WRAX REG16,0.0000000000
RDAX REG15,0.6309573445
MULX REG13
RDAX REG16,1.0000000000
WRAX REG16,0.0000000000
;------ Pitch Shift 0
SKP RUN ,1
WLDR 1, 16384, 4096
LDAX REG16
WRA 21543,0.0
CHO RDA,3,REG | COMPC,21543
CHO RDA,3,0,21544
WRA 25640,0.0
CHO RDA,3,COMPC | RPTR2,21543
CHO RDA,3,RPTR2,21544
CHO SOF,3,COMPC | NA,0.0
CHO RDA,3,NA,25640
WRAX REG21,0.0000000000
;------ LPF 1P
RDAX REG21,1.0000000000
RDFX REG23,0.1022176380
WRAX REG23,0.0000000000
;------ Mixer 2:1
RDAX REG5,1.0000000000
WRAX REG24,0.0000000000
RDAX REG23,1.0000000000
MULX REG12
RDAX REG24,1.0000000000
WRAX REG24,0.0000000000
;------ Output
RDAX REG24,1.0000000000
WRAX DACL,1.0000000000
WRAX DACR,0.0000000000
;------ FB In 1
RDAX REG23,1.0000000000
WRAX REG11,0.0000000000







Digital Larry

#1
I seem to remember that some reverb block had a hardwired pot control in it.

If you can narrow it down to a problem in a specific block I might be convinced to take a look at it, but if it simulates correctly... ???

I haven't looked at SpinCAD code in 2 or 3 years.

Couple things come to mind though.
a) I think there is a problem with Delay Stages = 3.  I never bothered to figure it out but I think there's maybe a phase flip that results in less reverb with 3 stages than either 2 or 4.  If you look at Spin supplied reverbs IIRC they either have 2 or 4 delay lines, never 3.
b) Your pitch shifter feeds right back on itself.  Other shimmers I looked at, I seem to recall that the feedback loop went through the reverb.  I also did some stuff with a multi-tap delay.

Another strategy is simply to debug the Spin ASM.  This is the sort of thing people used to contact me about and when I told them how much I charge for this sort of thing, I'd never hear from them again.  I don't mean to be a jerk about it, just that it would take me several hours that I don't really have to even set up the development environment.  Everything's in Github for the enterprising individual.  Good luck!
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

bean

Thanks for chiming in DL. To be clear: wasn't expecting anyone to solve this for me but hoped someone might see something obvious I've overlooked. I appreciate your input. I think I'll try reducing the reverb stages first and see what happens. I did also try it with the pitch shift feeding back through the reverb (actually, I've tried it every way one can hook these blocks together) with the same result. JIC, I'll probably burn a new chip on the outside chance something is wrong with the one I've been using (although that seems unlikely).

I'll report back if I find anything. Really I just need to buckle down and learn to code all this stuff. I've really enjoyed SpinCAD but I've kinda let it be a shortcut to not actually learning to hand code my own patches :)

niektb

#3
Don't you need a delay tap in the feedback loop? Or does the feedback block already take care of that?

What's the two stage block for? Can't you directly connect the output of Pot 0 to both mixer inputs?

bean

Quote from: niektb on October 16, 2020, 09:51:47 AM
Don't you need a delay tap in the feedback loop? Or does the feedback block already take care of that?

What's the two stage block for? Can't you directly connect the output of Pot 0 to both mixer inputs?

This is a simplified example so I didn't include a delay tap for the feedback loop (although I think it sounds better with one since it creates more of a "pad"). I have also tried it with the delay tap and the behavior is unchanged.

The TwoStage lets you pan between the outputs. So, in this example when POT1 is full CCW there is no pitch shift in the mix. As you turn it CW it adds the first octave from the lower MIX block. As you continue turning up POT1 it adds the feedback loop from the upper MIX block. The difference being that w/out the TwoStage block both MIX blocks would be added to the output equally instead of sequentially. At least, that's how I understand it.

bean

Okay, just checked and DigitalLarry was bang-on. Reducing the reverb block from 3 to 2 stages solved the issue. Actually, I prefer the 2 stage setting - it sounds better/cleaner to my ears.

Thanks a bunch!

Digital Larry

#6
Wow, glad to hear it.  That was unexpected.

Two stage, I initially forgot what it does, but IIRC, between 0 and 50% on the control input, output 1 goes linearly from 0 to 1 while output 2 stays at 0.  Then from 50% to 100% on the control input, output 1 stays at 100% while output 2 goes from 0 to 100%.

So it's a way with just one pot to turn one thing up from 0 to 1 in the first half, and another thing from 0 to 1 in the second half.

In general I think the feedback loop introduces 1 sample delay although I don't know if this is always the case.  Considering that I mostly used it for delays, I did not think it was worth worrying about.

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