Roast my delay

Software questions and issues with the FV-1

Moderator: frank

Post Reply
agsilvio
Posts: 4
Joined: Fri Dec 15, 2023 11:44 am

Roast my delay

Post by agsilvio »

Hi team,
My first hand-coded project is a simple delay. I am very new to DSP programming. I've put the code here. Please, critique it and let me know what best-practices I am missing. I already want to improve it by putting a low-pass filter on the Time adjustment (recently learned in another thread).

Code: Select all

del1	mem	32767

skp 	run,	START

START:

;put pot0 in ADDR_PTR
sof	0,0
RDAX pot0,1
WRAX ADDR_PTR,0

;clear accumulator
sof	0,0

;delay
rdax	adcr,1.0
wra	del1,1.0
RMPA 1
MULX pot2 ; decay remainging volume further based on POT2
wra	del1,1.0 ; write delayed sound to start of delay ram again (repeats)
RMPA 1
MULX pot1 ; set 'volume' of delay signal in ACC based on POT 1



; add original signal at full volume
rdax	adcr,1.0

wrax	dacr,0
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Re: Roast my delay

Post by frank »

OK, I'll start:
agsilvio wrote: Mon Dec 18, 2023 7:53 am

Code: Select all

skp 	run,	START

START:

Waste of an instruction, since you are not doing anything between the "skp' and "START:" there is no need for the skp or the START: label.
Frank Thomson
Experimental Noize
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Re: Roast my delay

Post by Sweetalk »

Code: Select all

WRAX ADDR_PTR,0

;clear accumulator
sof	0,0/code]

This one also is a waste of an instruction, the accumulator is already cleared with the WRAX instruction, so you can delete it from the code. Besides from that the code will work, now you can start adding little things to it, step by step and start experimenting and learning.
smear
Posts: 39
Joined: Fri Jul 01, 2016 9:47 am

Re: Roast my delay

Post by smear »

agsilvio wrote: Mon Dec 18, 2023 7:53 am

Code: Select all

;delay
rdax	adcr,1.0
wra	del1,1.0
RMPA 1
MULX pot2 ; decay remainging volume further based on POT2
wra	del1,1.0 ; write delayed sound to start of delay ram again (repeats)
RMPA 1
MULX pot1 ; set 'volume' of delay signal in ACC based on POT 1
You leave the input signal in the accumulator after writing to the delay for the first time (note the coefficient after del1).
Post Reply