FV-1 style Limiters converted to FX-Core

Post Reply
scmitche
Posts: 12
Joined: Mon Mar 16, 2020 5:28 am

FV-1 style Limiters converted to FX-Core

Post by scmitche »

Hi All,
Help!
Has anyone successfully converted any of the FV-1 Limiters/Compressors to FX-Core, e.g. soft knee, RMS etc.
I can simulate the compression/limiting shapes using LN, EXP and offsets with ease in Excel but am not successful transferring this forward to coding FX-Core.

Regards,
Steve
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: FV-1 style Limiters converted to FX-Core

Post by Frank »

An example would help, what worked in Excel and what you coded it to.

And yes, there are people with working compressors on the FXCore that are based on FV-1 code.
scmitche
Posts: 12
Joined: Mon Mar 16, 2020 5:28 am

Re: FV-1 style Limiters converted to FX-Core

Post by scmitche »

Hi Frank,

We've managed to get the FV-1 -10dB Soft Knee Limiter working now (code below) but so far have not been successful with converting the FV-1 MAXX instruction or getting any other RMS Compressor / Limiter to work in FX-Core due to what appear to be scaling issues. These codes we use in FV-1 to assist emulation of vintage multi-head magnetic tape echo systems. I normally follow the limiter or compressor with a 5.6kHz low pass filter block to reduce any higher order harmonics produced in the limiter or compressor. The oscilloscope traces for the program below look reasonable with evidence of soft clipping starting just above 0.8V p-p sine wave input at 1kHz. When input is raised to 2V p-p the THD is ~19%, below the start of the soft knee ~0.5V p-p input then THD is only 0.3%.

Hope the code makes sense.

Regards,
Steve
Blue Nebula Development Team

;############### approximately 10dB range Soft knee Limiter Converted to FX-Core from FV-1
.rn sigin r0
.rn avg r1
;.rn gain r2 ;not used here as mono
.rn temp r3

cpy_cs acc32,in0
cpy_cc sigin,acc32 ;save input
multrr acc32,sigin ;square input

;rdfx avg,0.001 original FV-1 instruction
cpy_cc temp,acc32 ;save acc32 for a moment to temp r3
subs avg,temp ;avg-acc32 subtract temp from avg
multri acc32,0.001 ;acc32*0.001 now (1-0.001)= 0.999 Need to calculate attack time
adds acc32,temp ;add temp to acc32 which contains result of multri instruction above

;wrax avg,0 Original FV-1 instruction
cpy_cc avg,acc32 ;save acc32 to avg averaging register
xor acc32,acc32 ;clear acc32 for next step
addsi acc32,0.05 ; add an offset value to acc32 was sof 0,0.25 in FV-1

;rdax avg,1 original FV-1 instruction
adds avg,acc32 ;store to avg Register r1

log2 acc32
multri acc32,-0.40 ;coefficient as in FV-1 = -0.4
addsi acc32, -0.035
exp2 acc32

;cpy_cc gain, acc32 ; not needed here
multrr acc32,sigin ;restore gain

cpy_sc out1, acc32 ;send limiter audio out
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: FV-1 style Limiters converted to FX-Core

Post by Frank »

You will have to break out MAXX to multiple instructions in FXCore, basically take the ABS of the two values, then do a subtraction and jump based on sign. Something like (have not run this so may have an typo in it):

; assume R0 and R1 have the ABS of the 2 values
SUBS R0, R1
; if result is negative then R1 > R0 so jump
JNEG ACC32, LOADR1
; if here result was positive so R0 > R1 so put R0 in ACC32
CPY_CC ACC32, R0
JMP DONE
; Put R1 in ACC32
LOADR1: CPY_CC ACC32, R1
; All done
DONE:


LOG alignment is different in FV-1 and FXCore, FV-1 is S4.19 and in FXCore it is S5.26 so you will need to take care with that and adjust accordingly.
scmitche
Posts: 12
Joined: Mon Mar 16, 2020 5:28 am

Re: FV-1 style Limiters converted to FX-Core

Post by scmitche »

Thanks Frank,
I'll try the MAXX substitution. We've already noted the log difference in FX-core.

Kind Regards,
Steve
Post Reply