write to arbitrary memory address?

Algorithm development and general DSP issues

Moderator: frank

Post Reply
aziltz
Posts: 13
Joined: Mon Feb 04, 2013 12:09 pm
Location: Williamsburg, VA
Contact:

write to arbitrary memory address?

Post by aziltz »

can the wra or wrap instructions be used to write to an arbitrary memory address while reading from the end?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Yes, if you have a circular buffer defined you can read/write anywhere in it.
Frank Thomson
Experimental Noize
aziltz
Posts: 13
Joined: Mon Feb 04, 2013 12:09 pm
Location: Williamsburg, VA
Contact:

Post by aziltz »

ok thanks. nice new website btw.

I was thinking in a delay, if you change the input address and leave the output address constant, you should be able to change the delay time without shifting the pitch of signal already in the buffer.
aziltz
Posts: 13
Joined: Mon Feb 04, 2013 12:09 pm
Location: Williamsburg, VA
Contact:

Post by aziltz »

I'm still having some trouble with this. Is it possible to write to a memory address using a register as the address marker?

I want to do something like this,

Code: Select all

equ length 10000
mem del length
equ dly reg0

...

rdax adcl,1  ;read in input
wra del+dly,0   ;write to delay, where "dly" is derived from length of del, and a pot.
rda del#,1        ;read from end of delay
rdax  dacl,0   ;write to output

Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

aziltz wrote:ok thanks. nice new website btw.

I was thinking in a delay, if you change the input address and leave the output address constant, you should be able to change the delay time without shifting the pitch of signal already in the buffer.
Up early, no coffee, etc. but if you were skipping memory addresses while writing, you'd wind up playing back some samples left over from the previous go-around the buffer, wouldn't you? Might be an interesting effect but I don't think that's what you were trying to accomplish.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

There is no way to do an indirect write like you are trying to do, only an indirect read using RMPA.

But as Digital Larry said doing it this way will not do what you intend. You will either have old data in the buffer or if you add a clearing routine you will have impulses of new data as the POT is turned which will give an un-pleasant and still pitch shifted result. The best solution is to move the read pointer, it only causes shifting while moving.
Frank Thomson
Experimental Noize
aziltz
Posts: 13
Joined: Mon Feb 04, 2013 12:09 pm
Location: Williamsburg, VA
Contact:

Post by aziltz »

frank wrote:There is no way to do an indirect write like you are trying to do, only an indirect read using RMPA.

But as Digital Larry said doing it this way will not do what you intend. You will either have old data in the buffer or if you add a clearing routine you will have impulses of new data as the POT is turned which will give an un-pleasant and still pitch shifted result. The best solution is to move the read pointer, it only causes shifting while moving.
Ok, thanks for the explanation. I DID want to keep the old data in the buffer, and I had some ideas for getting around the problems with changing the POT, but if I can't do the indirect write, it won't work.

I have seen some examples of people using a crossfade when adjusting the pot to eliminate the pitch shift, but I haven't quite figured out how to do that yet. For now I just have a smoothly filtered POT change, thanks to some of Frank's code posted elsewhere.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

If you don't care about the pointer jumping and just want to not have shifting then only use the POT value when it is stable, if it is changing then ignore it and use the old value until it settles again.
Frank Thomson
Experimental Noize
Post Reply