Spin Semiconductor Forum Index Spin Semiconductor
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tap tempo snippet
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development
View previous topic :: View next topic  
Author Message
alpignolo



Joined: 27 May 2014
Posts: 14

PostPosted: Fri Jun 27, 2014 2:13 am    Post subject: Reply with quote

slacker wrote:
Hi Slacker, i tried to write a code for control delay time by the taptempo regardless of position of pot1 and change delay time when it is turned back potentiometer.

I replaced this piece of code:

Code:

ldax pot1      ;read pot1
sof 1,-0.05      ;shift down now -0.05 to 0.95
skp neg,DODELAY      ;if negative skip to delay, taptempo mode
ldax pot1      ;else read pot1
sof 1/0.95,-0.05/0.95    ;scale to 0 to 1
wrax taptempo,0      ;and write to taptempo register, pot controls delay time

with this:
Code:

rdax pot1,1
rdax time_pot,-1
skp zro,DODELAY
ldax pot1      ;else read pot1
wrax taptempo,1      ;and write to taptempo register, pot controls delay time
wrax time_pot,0

But it does not work.
Tap tempo works but no pot1.
thanks
Back to top
View user's profile Send private message
musicvoice



Joined: 27 Jun 2011
Posts: 10

PostPosted: Sat Jun 28, 2014 6:05 pm    Post subject: Reply with quote

hi
pot 2 tap input ?
scheamatich please.
best regards.
Back to top
View user's profile Send private message
alpignolo



Joined: 27 May 2014
Posts: 14

PostPosted: Sun Jun 29, 2014 10:29 pm    Post subject: Reply with quote

musicvoice wrote:
hi
pot 2 tap input ?
scheamatich please.
best regards.


yes, pot2 for tap tempo,
i tried the Slacker's code but i would like to use pot1 for delaytime when i turn it and use taptempo when i push momentary switch on pot2.
The schematics for taptempo on pot2 is this:
[img]http://www.spinsemi.com/app_download/GA_DEMO_SKE.pdf[/img]
Back to top
View user's profile Send private message
slacker



Joined: 01 Feb 2011
Posts: 115

PostPosted: Wed Jul 02, 2014 2:29 am    Post subject: Reply with quote

Hi alpignolo

Your code will not do what you want it to. This part of the tap tempo code

Code:

jam rmp0      ;else latch is high, jam rmp0 (reset to 0)
ldax ramp      ;read ramp, will contain last value of rmp0 before latch went high   
wrax taptempo,0      ;write to taptempo


sets taptempo to the last value that was tapped, this will overwrite the value that your code read from pot1, which is why the pot does not work.

In your code if you change wrax taptempo,1 to wrax ramp,1 this will overwrite the tapped tempo with the value from pot1 and it should work.
Back to top
View user's profile Send private message
alpignolo



Joined: 27 May 2014
Posts: 14

PostPosted: Wed Jul 02, 2014 8:08 am    Post subject: Reply with quote

I made a mistake in my previous post, indeed work only pot 1 but not work tapped tempo.
I have tried to change wrax tap tempo,1 with wrax ramp,1 but the result is the same.

This part of the tap tempo code
Code:

jam rmp0      ;else latch is high, jam rmp0 (reset to 0)
ldax ramp      ;read ramp, will contain last value of rmp0 before latch went high   
wrax taptempo,0      ;write to taptempo


should not overwrite the value of pot1 because is before.
The problem in this code
Code:

rdax pot1,0.5
rdax time_pot,-0.5
skp zro,DODELAY 
ldax pot1      ;else read pot1
wrax ramp,1      ;and write to taptempo register, pot controls delay time
wrax time_pot,0

is that the result of subtraction in the first two rows is alway different from zero, then it read always pot1.

I would like that pot1 worked only when it is turned
Back to top
View user's profile Send private message
slacker



Joined: 01 Feb 2011
Posts: 115

PostPosted: Mon Jul 07, 2014 8:38 am    Post subject: Reply with quote

The reason that doesn't work is because there will be some noise on the pot so it won't necessarily read exactly the same value each time. Try this instead

Code:

ldax pot1
and %01111111_00000000_00000000
rdax time_pot,-1
skp zro,DODELAY
ldax pot1      ;else read pot1
and %01111111_00000000_00000000
wrax ramp,1      ;and write to ramp register, pot controls delay time
wrax time_pot,0


This reduces the resolution of the pot reducing or removing the noise so it will read the same value each time if it isn't moved, I tried it and it seems to work fine. It might still be possible to put the pot in a position where it jumps between two values though.

For an explanation of what the "and" commands do have a look here http://www.spinsemi.com/knowledge_base/coding_examples.html#Varying_delays
Back to top
View user's profile Send private message
alpignolo



Joined: 27 May 2014
Posts: 14

PostPosted: Tue Jul 08, 2014 8:07 am    Post subject: Reply with quote

Perfect, now work perfectly!
many
many
thanks
Back to top
View user's profile Send private message
Mcfly



Joined: 08 Mar 2013
Posts: 45
Location: Argentina

PostPosted: Tue Feb 10, 2015 4:48 pm    Post subject: Reply with quote

Hi! Is there a way to use a Sin for controlling the led rate indicator instead of a ramp? The thins is that i need that ramp for another line in the program.
Thanks!

Code:
;Taptempo rate indicator, creates a square wave at the tap tempo rate
sof 0,0.064   
wrax rmp1_rate,0      ;set rmp1 rate to 1Hz
cho rdal,rmp1      ;read value of rmp1
sof -2,0.999      ;level shift to 0 - 1 rising ramp
sof 1,0.001
rdax taptempo,-0.5   ;deduct half of the taptempo value
skp neg,ENDLED      ;if negative skip to ENDLED
jam rmp1      ;else reset ramp1
ldax led         ;and invert value of led register, creates square wave at taptempo rate
sof -1,0
wrax led,1
wrax   dacl,0 
ENDLED:
Back to top
View user's profile Send private message Send e-mail
slacker



Joined: 01 Feb 2011
Posts: 115

PostPosted: Wed Feb 11, 2015 1:00 pm    Post subject: Reply with quote

I don't think there is an easy way to use the sine. It should be possible to replace the ramp with a counter something like this.

Code:

equ ledramp reg11; put this at the top of the code with the others

;Taptempo rate indicator, creates a square wave at the tap tempo rate
ldax ledramp
sof 1,1/32768 ;add 1/32768 will take one second to go from 0 -1 a 1Hz ramp
wrax ledramp,1
rdax taptempo,-0.5   ;deduct half of the taptempo value
skp neg,ENDLED      ;if negative skip to ENDLED
clr
wrax ledramp,0; reset ledramp to 0
ldax led         ;and invert value of led register, creates square wave at taptempo rate
sof -1,0
wrax led,1
wrax   dacl,0
ENDLED:


I think that should work but I haven't tested it and I haven't written any spin asm in a while so there might be some mistakes. Hopefully it gives you the idea.
Back to top
View user's profile Send private message
Mcfly



Joined: 08 Mar 2013
Posts: 45
Location: Argentina

PostPosted: Tue Feb 24, 2015 3:56 pm    Post subject: Reply with quote

Thank you Slacker, i've tried it but i does not work. Led is always on. I'm trying to understand the code but im lost.

slacker wrote:
I don't think there is an easy way to use the sine. It should be possible to replace the ramp with a counter something like this.

Code:

equ ledramp reg11; put this at the top of the code with the others

;Taptempo rate indicator, creates a square wave at the tap tempo rate
ldax ledramp
sof 1,1/32768 ;add 1/32768 will take one second to go from 0 -1 a 1Hz ramp
wrax ledramp,1
rdax taptempo,-0.5   ;deduct half of the taptempo value
skp neg,ENDLED      ;if negative skip to ENDLED
clr
wrax ledramp,0; reset ledramp to 0
ldax led         ;and invert value of led register, creates square wave at taptempo rate
sof -1,0
wrax led,1
wrax   dacl,0
ENDLED:


I think that should work but I haven't tested it and I haven't written any spin asm in a while so there might be some mistakes. Hopefully it gives you the idea.
Back to top
View user's profile Send private message Send e-mail
Herradura



Joined: 22 May 2015
Posts: 2

PostPosted: Fri May 22, 2015 9:05 am    Post subject: tap tempo question Reply with quote

Hi
Read your post with much interest. I guess you chose max delay of 1 second ( if I've read things correctly) as this max delay of fv-1? Very new to this and just about to purchase the Dev board. Can I increase the delay time/drop bandwidth to get slightly longer delays. TryING to make a bass guitar looper where the original loop is repeated infinitely, and the player can play solo cleanly over the top. Could get away with 12 to 15khz bandwidth I guess

Cheers All

H
Back to top
View user's profile Send private message
frank



Joined: 19 Oct 2005
Posts: 958

PostPosted: Fri May 22, 2015 10:09 am    Post subject: Re: tap tempo question Reply with quote

Herradura wrote:
Hi
Read your post with much interest. I guess you chose max delay of 1 second ( if I've read things correctly) as this max delay of fv-1? Very new to this and just about to purchase the Dev board. Can I increase the delay time/drop bandwidth to get slightly longer delays. TryING to make a bass guitar looper where the original loop is repeated infinitely, and the player can play solo cleanly over the top. Could get away with 12 to 15khz bandwidth I guess

Cheers All

H


The FV-1 has a 32768 sample memory so if you use it all for delay you can calculate the time by 32768/sample rate. Sample rate must be 2x bandwidth. For a bass 10KHz bandwidth should be more than enough so a 20KHz sample rate. 32768/20000 = 1.638 seconds. You could argue you can get away with a 6KHz bandwidth, while the bass may generate harmonics above 6K your amp may be bandwidth limited so try a 12K sample rate which will give 2.7 seconds of delay. It may sound just fine and you get more delay.
_________________
Frank Thomson
Experimental Noize
Back to top
View user's profile Send private message Visit poster's website
Herradura



Joined: 22 May 2015
Posts: 2

PostPosted: Fri May 22, 2015 11:32 am    Post subject: tap tempo question Reply with quote

Thanks Frank, I think 12khz will give good quality and enough delay time. I suppose the hard bit is to get the delay to continuously loop, and use the other channel set to a zero delay, split the bass input signal and send it thru a clean channel. This will allow you to play over the top of the loop, without the bass guitar going thru the effects chain. Thus you have a continuous backing loop mixed in with your solo playing
Back to top
View user's profile Send private message
frank



Joined: 19 Oct 2005
Posts: 958

PostPosted: Fri May 22, 2015 6:53 pm    Post subject: Reply with quote

A simple example of a looper is here http://www.spinsemi.com/forum/viewtopic.php?t=20&highlight=record it does both channels but it is easy to remove one channel and use all the memory for just one channel.
_________________
Frank Thomson
Experimental Noize
Back to top
View user's profile Send private message Visit poster's website
Sandrine



Joined: 12 Mar 2015
Posts: 16
Location: BC Canada

PostPosted: Sat Jun 06, 2015 7:11 pm    Post subject: Reply with quote

I have a thought on varying the clock rate on the fly. I've used DDS chips (AD9850 board on ebay cheap) for synths/RF gens etc.

They are dead accurate and range from <.1 hz up to 40MHz. An arduino controlling a DDS would allow switching to all sorts of sample rates.

Here it is in the last synth I made
http://www.freshnelly.com/showbox-mysynth.htm

Cheers!
_________________
Is there a latin word for "Stage Fright"?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group