Author Topic: SpinCAD chorus issue  (Read 2460 times)

Hoffmann

SpinCAD chorus issue
« on: January 31, 2020, 12:50:47 PM »
Hi guys,

I've been using SpinCAD ver. 893 for quite some time but since it lacks some useful blocks from the updated editions I used latest version 1027 to build some sort of chorus. However, I noticed audible glitches with LFO Chorus block that is quite annoying. :( I am posting Spin ASM patch from the SpinCAD ver 893 that is glitches-free and this one from ver. 1027 if somebody more skillful could take a look and give some input?  :)

;  Program: Render Block exported from SpinCAD Designer 893
;------ Input
;------ Pot 0
;------ Pot 1
;------ Chorus
SKP RUN ,1
WLDS 0,50,64
RDAX POT1,0.0023436070
WRAX SIN0_RANGE,0.0000000000
RDAX POT0,0.0391389432
WRAX SIN0_RATE,0.0000000000
LDAX 20
WRA 0,0.0
CHO RDA,0,REG | COMPC,257
CHO RDA,0,0,258
WRAX REG0,0.0000000000
;------ Output
RDAX REG0,1.0000000000
WRAX DACL,0.0000000000
RDAX REG0,1.0000000000
WRAX DACR,0.0000000000


SpinCAD Designer 1027

; Untitled
; null
; Pot 0:
; Pot 1:
; Pot 2:
;
;
; ----------------------------
;------ Input
;------ Pot 0
;------ Pot 1
;------ Chorus
SKP RUN ,1
WLDS 0,50,64
RDAX POT1,0.0023436070
WRAX SIN0_RANGE,0.0000000000
RDAX POT0,0.0391389432
WRAX SIN0_RATE,0.0000000000
LDAX ADCL
WRA 0,0.0
CHO RDA,0,REG | COMPC,257
CHO RDA,0,0,258
WRAX REG0,0.0000000000
;------ Output
RDAX REG0,1.0000000000
WRAX DACL,0.0000000000
RDAX REG0,1.0000000000
WRAX DACR,0.0000000000


Another thing came to my mind when designing chorus - it might be cool to build Chorus block (flagner too) to be able to use external LFO so it would be possible to drive multiple chorus blocks with Sin/Cos LFO oscillator (phase shifted differently)... What do you think?

Digital Larry

Re: SpinCAD chorus issue
« Reply #1 on: January 31, 2020, 03:03:53 PM »
I don't see any relevant difference in the code.

One has:

LDAX ADCL

and the other has:

LDAX 20

which should be the same thing.

Are you having this problem on a real FV-1 or using the simulator?

For the second problem, there is a block under modulation called (I believe) "Servo Flanger".  This is a short modulatable interpolated delay line based on the "Servo Delay" example in Spin's Knowledge Base.  It uses a RAMP LFO internally instead of the SIN/COS LFO.  You can of course give it a SIN LFO as the LFO input.  Interesting results can be obtained by using the Power control block to warp any given LFO signal to one side or the other.

If all you're interested in is phase shifting a SIN chorus LFO, this is already possible with the 4-voice chorus.  If you use all 4 voices then you get 4 LFOs to use at 0, 90, 180, 270.  To selectively use just a couple you'd probably wind up hand commenting out the ones you don't want to use.
« Last Edit: January 31, 2020, 03:14:12 PM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

Hoffmann

Re: SpinCAD chorus issue
« Reply #2 on: February 09, 2020, 04:59:26 PM »
Thank you DL for your input. I never tried it on real FV-1, only using simulator. I will give it a try on a real thing and reply here.
So you say 4-voice chorus has the following taps: 1st - 0 , 2nd, 90 , 3rd tap 180 and 4th 270 degree LFO modulated delay, right? If that is correct, it's great indeed.


ElectricDruid

Re: SpinCAD chorus issue
« Reply #3 on: February 09, 2020, 05:57:23 PM »
So you say 4-voice chorus has the following taps: 1st - 0 , 2nd, 90 , 3rd tap 180 and 4th 270 degree LFO modulated delay, right? If that is correct, it's great indeed.

That's *one* perfectly valid way to do four-voice chorus. There are a million other options. Whether they offer genuine improvements is an open question. With multi-voice chorus I reckon there's point of "diminishing returns" where everything just starts to be "lush" and exactly how that is achieved isn't actually that important any more...

Digital Larry

Re: SpinCAD chorus issue
« Reply #4 on: February 10, 2020, 12:33:42 PM »
Thank you DL for your input. I never tried it on real FV-1, only using simulator. I will give it a try on a real thing and reply here.
So you say 4-voice chorus has the following taps: 1st - 0 , 2nd, 90 , 3rd tap 180 and 4th 270 degree LFO modulated delay, right? If that is correct, it's great indeed.
The 4-voice chorus is based on the chorus examples at the Spin Knowledge base.  They even suggest that you can get an 8-voice chorus by using the approach with both SIN LFOs.

See: http://www.spinsemi.com/knowledge_base/coding_examples.html#Chorus

The simulator in SpinCAD is based on the original code from ElmGen (which I didn't write).  Parts of this code were incomplete, especially in the chorus area.  I did my best to get those working and it's possible there is a difference between the earlier and current version.  You'd have to look into the checkin history at Github.  Take a look at this IF YOU DARE:

https://github.com/HolyCityAudio/SpinCAD-Designer/blob/master/src/org/andrewkilpatrick/elmGen/instructions/ChorusReadDelay.java

and others in that same folder.

At this point I have no plans to do anything else with SpinCAD development.  I'm not trying to be mean or anything, but I worked on it as a hobby for a good 4 or 5 years and have gone on to other things.  As I'm fond of saying, it is open source.  Anyone can get in there and fix it if they are highly motivated.

DL
« Last Edit: February 11, 2020, 12:53:41 AM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

dubspecialist

Re: SpinCAD chorus issue
« Reply #5 on: September 22, 2021, 07:43:22 AM »
Sorry to dredge up an old thread but I'm curious to know if anyone got to the bottom of the noise/digital artefacts heard in the 'LFO Chorus' block within SpinCAD and if it can in fact be heard in 'real world' applications when tested through the FV-1 chip?

I have been experimenting with the chorus block in a variety of different patches and am hearing these artefacts in all instances unless I filter it out with an LPF.

Thanks in advance  :)


Digital Larry

Re: SpinCAD chorus issue
« Reply #6 on: September 22, 2021, 01:34:12 PM »
It's possible there's some issue with the chorus LFO simulation code.  I didn't write that part completely.  It was sort of halfway done when I got the ElmGen library opened up.  I thought I fixed it but who knows?

Now what you should be able to do is to capture the simulator output to a WAV file, then open it up in Audacity or whatever and look for anything that would cause what you are hearing.  The best test signal for this is a sine wave; say 200 Hz would probably be good.

The other question is how hot is your simulator file? 

DL
« Last Edit: September 22, 2021, 01:45:20 PM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

dubspecialist

Re: SpinCAD chorus issue
« Reply #7 on: September 22, 2021, 07:24:30 PM »
OK interesting!

I'll be happy to test this with a sine wave source file, will just need to generate it. I have a dev board so will also be happy to test it in actual FV-1 application but I was waiting to generate a few patches before burning to the eeprom. Would be great to know if this chorus block is usable, I have noticed the same occuring with the 4 voice chorus too.

I'd have to double check my source file but it is clean guitar, recorded into logic, approaching 0db but certainly not clipping. There is no compression or limiting on the file. I haven't noticed these artefacts on any other blocks yet.

Digital Larry

Re: SpinCAD chorus issue
« Reply #8 on: September 23, 2021, 09:01:26 AM »
The chorus block takes in your signal and delays it.  Assuming that you just mix that straight back together with dry, you now lost some headroom.  Trouble with this concept sometimes is that parts of the signal are in phase and parts are out of phase so I can't say "it increased the level 6 dB".  I'd recommend 12 to 18 dB of headroom on your simulator source signal. 

4-voice chorus is even worse.  There is no headroom compensation.  You have to understand that and deal with it yourself.  Some of the reverb blocks may also require input gain adjustment to prevent overload.

Audacity is free and can easily generate these WAV files.

The chorus block is super straightforward.  If you like, go ahead and create a chorus from scratch in Spin ASM.  It will look a lot like the one generated by SpinCAD although it will be more efficient in its use of registers.
« Last Edit: September 23, 2021, 09:03:50 AM by Digital Larry »
Digital Larry
DSP tinkerer and former transistor twister

dubspecialist

Re: SpinCAD chorus issue
« Reply #9 on: September 23, 2021, 10:17:41 AM »
Hey DL! Thanks for yet another response :)

Yep, I'm realising what is happening here is an issue of gain staging. It's most noticeable when I use a resonant filter ahead of the chorus (Q controlled by an LFO) or use a feedback loop etc etc. I guess there are several ways of compensating for this - input gain staging is one but I can also use the limiter module in select places in the signal chain. I appreciate I can generate my own chorus in SpinASM but it's the ability to experiment and receive such immediate feedback that makes your SpinCAD so damn fun!

I am curious to see how the applications of these SpinCAD patches translate in the 'real world' FV-1 chip... these chorus blocks and the associated gain staging is of real interest. I will get to that next week :)

Plenty of ways to generate a sine tone - personally I'd just do it in Logic or Renoise but yes, Audacity works.