tap tempo snippet
Moderator: frank
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
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
I think this will work, change these lines
to this
The sof line could be replaced by something more complicated, maybe a pot skip routine to let you select different divisions.
Code: Select all
ldax taptempo ;read taptempo register
wrax addr_ptr,0 ;write to delay address pointer
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 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.
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.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.
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??.
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??.
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.jovesdies wrote:Can you post the code for POT + TAP control ?
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
Last edited by Sweetalk on Tue Oct 30, 2012 11:53 am, edited 1 time in total.
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 confusingslacker 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.