tap tempo snippet

Algorithm development and general DSP issues

Moderator: frank

ronaldb
Posts: 19
Joined: Thu Dec 03, 2009 7:49 am

Post by ronaldb »

I found out that i was using the wrong code.
I will be testing your last code today with click trck and post my results.
Thanks for pointing that out Slacker and thanks for this great peace of code :D

Ronaldb
ronaldb
Posts: 19
Joined: Thu Dec 03, 2009 7:49 am

Post by ronaldb »

Hi Slacker,
Checked the code with a click track and works like a charm.
Thank for this great peace of code. Now to add some things :D

Like modulation, pitchshifting and LP and HP filters.
That will be cool.

RonaldB
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

Excellent, glad to hear it works.

I'll be interested to see what cool stuff you do with it :)
ronaldb
Posts: 19
Joined: Thu Dec 03, 2009 7:49 am

Post by ronaldb »

Slacker,
Since you wrote this peace of code can I ask you a question?
The tap tempo is now set to output 1/4 notes but can we make a calculation in here that it will output "dotted eight notes".

We can get these by doing this calculation:
tap tempo result / 4 = 1/16 notes x 3 = dotted eight notes.

Do you see a posobility here to do this in your code?

RonaldB
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

I think this will work, change these lines

Code: Select all

ldax taptempo      ;read taptempo register
wrax addr_ptr,0      ;write to delay address pointer
to this

Code: Select all

ldax taptempo      ;read taptempo register
sof 3/4,0           ;multiply tapped tempo by 3/4 
wrax addr_ptr,0      ;write to delay address pointer
The sof line could be replaced by something more complicated, maybe a pot skip routine to let you select different divisions.
ronaldb
Posts: 19
Joined: Thu Dec 03, 2009 7:49 am

Post by ronaldb »

Thanks i will try this.
RonaldB
ronaldb
Posts: 19
Joined: Thu Dec 03, 2009 7:49 am

Post by ronaldb »

He Slacker,
I tested the code and it works like it should.
Thanks this makes this peace of code more versatle.
I will put up a code to select subdivisions with a potentiometer.

RonaldB
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

It can be used with the tap tempo AND a delay pot at the same time?.
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

The code only gives tap tempo, you would have to modify it if you wanted a delay time pot as well as tap tempo.
You could either use another pot for delay time, with some code to use the pot value or the tap tempo value. Or it should be possible to use the same pot input for tap tempo or delay time, I'll have a think about it.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

slacker wrote:The code only gives tap tempo, you would have to modify it if you wanted a delay time pot as well as tap tempo.
You could either use another pot for delay time, with some code to use the pot value or the tap tempo value. Or it should be possible to use the same pot input for tap tempo or delay time, I'll have a think about it.
I'm working on a pot skip routine that when you have the delay pot on 0 (well, not 0, but close enough for the tap tempo switch to work) uses the tap tempo switch and on the rest of the pot uses the pot to change the delay time.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

Well, with a simple pot skip routine I have working the POT+TAP delay control. I'm using diferent pot inputs on the delay pot and the tap because of the 0 and 1 voltage threshold (for propper detection).

Now I'm working on the LED indicator... first modded the code to show the tempo with the LED when using the pot and the tap, easy... Now I want to use a sin lfo to control the LED for more gradual and smooth operation of the LED. Pure aesthetics. I'm having a little troubles with the sin lfo rate coefficents. The AN-0001 shows an equation for the Kf coef to set the rate at a desired frequency, goes from 0 to 511... How can I adjust it to this code since the sof coef goes just to -2. I'm a little dizzy around here...

The "led" register goes from 0 to 1??.
jovesdies
Posts: 33
Joined: Wed Feb 25, 2009 3:55 am

Post by jovesdies »

Can you post the code for POT + TAP control ?
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

Sweetalk, it might be easier to low pass filter the square wave taptempo signal to get something like a sine wave than try and sync a sine wave LFO to the taptempo.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

jovesdies wrote:Can you post the code for POT + TAP control ?
I just used a simple pot skip routine like the one on the knowledge base and adjusted the pot values with a sof instruction to get max delay on 3/4 of the delay pot.

Code: Select all

clr
rdax	pot2,	1
and   	%01100000_00000000_00000000   	
skp	zro,	POT
sof	1,	-0.25
skp	zro,	POT
sof	1,	-0.25
skp	zro,	POT
clr
skp	zro,	TAP
Just make the labels TAP and POT and the rest of the control for the delay pot or the tap tempo. You can reduce some lines with a sof 1, -0.75.
Last edited by Sweetalk on Tue Oct 30, 2012 11:53 am, edited 1 time in total.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

slacker wrote:Sweetalk, it might be easier to low pass filter the square wave taptempo signal to get something like a sine wave than try and sync a sine wave LFO to the taptempo.
Nice idea, i'll try that. I'm really close to sync the sine but it's really hard to do that and I don't think that I understand really well the coef of the sine lfo that appears on the AN0001. They're really different to the ones on some example codes, it's confusing :roll:
Post Reply