Page 1 of 1

16 steps pot

Posted: Fri Nov 20, 2015 5:19 am
by sandromatik
Hi Frank,
I need your help please:

here is a part of a very simple, basic delay program, just to understand how this goes.
delay time control pot is quantized in 16 parts as explained in knowledge base.
Hardware is the evaluation board, not my design.

Code: Select all

rdax pot1, 1
and %01111000_00000000_00000000
wrax addr_ptr, 0
rmpa 1
wrax dout, 1
If you synch a metronome to the 1st step (longest delay setting), when the pot is on the 9th position you don't get exactly half bar notes as expected, they go a bit slower..!
On top of that, the offset goes worst with faster delay settings:

1st step 64BPM 1 bar
9th step 62BPM 1/2 bar
13th step 60BPM 1/4 bar
15th step 58BPM 1/8 bar

how can this be fixed?
thank you very much!

Posted: Fri Nov 20, 2015 10:45 am
by frank
Need to see your full code, in the code you posted you never write to memory.

Posted: Sat Nov 21, 2015 4:29 am
by sandromatik
Thanks for your fast reply,
here is the code:

Code: Select all

mem delay 32767

rdax adcl,1
wra delay,0
rdax pot1,1
and %01111000_00000000_00000000
wrax addr_ptr,0
rmpa 1
wrax dacl,0

the delay time with this code is not exactly divided in 16 equal parts..
with faster delay settings I must compensate with my sequencer tempo down a few BPM to get it in synch again.

Thanks again for your help.

Posted: Sat Nov 21, 2015 9:34 pm
by frank
It looks reasonable, I would check the stability of the clocks on both the FV-1 and the sequencer. What are you using to clock the FV-1?

Posted: Sun Nov 22, 2015 4:34 am
by sandromatik
I am using 2 boards for this test:
-the Official evaluation board
-a board I have designed, clocked with the same crystal used in yours.

The issues I'm reporting here are exactly the same in both board.

Another important detail I forgot to mention is that the maximum delay time within the code I posted is:
-1 second (60 BPM) without pot masking
-a bit less than one second (64BPM) with AND pot masking

Thanks for your help

EDIT: the sequencer clock is not an issue as I leave it always on the same BPM, in synch with the maximum delay time.

Posted: Sun Nov 22, 2015 11:44 am
by frank
Actually, the numbers you are getting make sense. If using the full delay and you are getting 60BPM, then at the 16th setting (POT value of 15) it is 60/(15/16) or 64BPM as you are seeing but as you continue you will get:
POT value BPM
15 64
14 68.57142857
13 73.84615385
12 80
11 87.27272727
etc.

You made the assumption that at max delay with masking you have 1 bar at 64BPM but that is not really correct, it is 15/16 of a bar at 60BPM which happens to be 64BPM. So all your calculations should be based on 60BPM not 64 which explains why you see it as getting slower.

Posted: Sun Nov 22, 2015 1:32 pm
by sandromatik
Fantastic!!
thank you very much Frank
this is the best support forum customers could imagine

I've added SOF 1, 1/16 after pot masking and it works like a clock, full delay time, 1second.. and perfect subdivisions!
great!!

EDIT

I'm wrong again, the SOF 1, 1/16 operation does not make what I want, which is having the longest delay time 1 second as "1 bar" .. it gets pretty close but with fast delay settings it still goes out of synch

Posted: Sun Nov 22, 2015 3:35 pm
by sandromatik
I think I got it now,
1/16 wasn't the right value to sum to the masked pot,
it must be 1/16 of the max pot value isn't it?
It sounds pretty well synched now...

Code: Select all

mem delay 32767 

rdax adcl,1 
wra delay,0 
rdax pot1,1 
and %01111000_00000000_00000000 

sof 1, 0.062375 ;  0.998 pot max value /16

wrax addr_ptr,0 
rmpa 1 
wrax dacl,0 

Posted: Sun Nov 22, 2015 8:17 pm
by frank
You may have to play with where to add the 1/16 (before or after masking or if at all) or read from the delay before writing to it, etc. The answer will depend on what you want as the final result. To use the full delay reading first can be the better choice but it does mean the min delay becomes 1/16 bar and not 0 when masking.

Posted: Mon Nov 23, 2015 9:13 am
by sandromatik
Hi,
it's perfect to have the shortest delay 1/16 instead of 0 for my application,
in this case works perfectly adding it to the masked pot value instead of doing it before masking.

thanks again!!