 |
Spin Semiconductor Support forum
|
| View previous topic :: View next topic |
| Author |
Message |
Mel
Joined: 06 Mar 2010 Posts: 3
|
Posted: Sat Mar 06, 2010 11:42 am Post subject: slow gear |
|
|
Hey, Just got into programming the FV-1 and I'm looking for advice
on how to implement a swell/slow gear effect
the general idea is to trigger a ramp envelope when a certain
input threshold is reached?
thnx |
|
| Back to top |
|
 |
livingston
Joined: 15 Nov 2009 Posts: 108 Location: New Orleans, LA US
|
Posted: Sat Mar 06, 2010 2:28 pm Post subject: |
|
|
If you search the forum for envelope detection (or check out the Knowledge Base on the main site) you'll see some code examples to find the input envelope. Once you have that you can use something like SOF 1.9,-1 to make the envelope go from -1 to 1, then use SKP NEG to find when the input goes above zero. Within the skipped area, you can initialize the ramp and then MULX your input signal with the ramp.
Or, one thing I thought about but haven't tried is to just take the input envelope, SOF -1,.999 so that you have backwards envelope and just MULX your input signal with the backwards envelope. This way, when you play hard, the output envelope is brought to zero, and as your guitar note fades it rises in volume. |
|
| Back to top |
|
 |
B.C.
Joined: 06 Mar 2010 Posts: 29
|
Posted: Sat Mar 06, 2010 4:32 pm Post subject: |
|
|
I can get a pretty good slow gear impression by using a regular reverb with increasing tap coeff.  |
|
| Back to top |
|
 |
Mel
Joined: 06 Mar 2010 Posts: 3
|
Posted: Mon Mar 08, 2010 12:52 pm Post subject: not easy being a newbie |
|
|
So, I tried something like this but I'm pretty stuck at this point since
It really does nothing:
______________________________
fil equ reg0
inverse equ reg1
rdax adcl,1.0
ABSA
RDFX fil,1
WRLX fil,1
SOF -1,0.999
wrax inverse ,0
rdax adcl,1.0 ; Read ADC left
mulx inverse
wrax dacl,0 ; write to DAC left |
|
| Back to top |
|
 |
livingston
Joined: 15 Nov 2009 Posts: 108 Location: New Orleans, LA US
|
Posted: Mon Mar 08, 2010 1:42 pm Post subject: Re: not easy being a newbie |
|
|
| Mel wrote: | So, I tried something like this but I'm pretty stuck at this point since
It really does nothing:
______________________________
fil equ reg0
inverse equ reg1
rdax adcl,1.0
ABSA
RDFX fil,1
WRLX fil,1
SOF -1,0.999
wrax inverse ,0
rdax adcl,1.0 ; Read ADC left
mulx inverse
wrax dacl,0 ; write to DAC left |
The lines in red are a problem. The coefficients are wrong. The RDFX is way too big and the WRLX needs a negative number in my experience. I have used this as an envelope detector with success:
rdax adcr,1
absa
RDFX envfil,0.001 ;use LPF opcode for filtering
WRLX envfil,-1 ;infinite shelf LPF (could have used WRAX avgfil,1)
wrax env,0
Try those numbers in your program and see what happens. If it doesn't work, describe what exactly happens, like whether you just get your regular instrument sound out of the output or if no sound appears at the output. |
|
| Back to top |
|
 |
donstavely
Joined: 07 Jan 2010 Posts: 36 Location: Windsor, Colorado
|
Posted: Mon Mar 08, 2010 2:06 pm Post subject: |
|
|
Here is a different approach you could consider. I have been working on a note detector triggering a ramp generator for another project. Just using a pot to adjust the ramp rate, and then multiplying the input signal by this ramp gives you a slow note attack.
This code may be useful for many kinds of projects. I offer it to the forum hoping that others will use it, improve on it, and post post it back.
| Code: |
;
equ in reg0
equ lopass reg1
equ envlop reg2
equ peak reg3
equ trig reg4
equ timer reg5
equ ramp reg6
;
delayd mem 256 ; Short delay to match the note detect delay
;
; Read A/D's, save input, and put in delay memory
;
rdax adcl, 0.5 ; read and scale left A/D
rdax adcr, 0.5 ; read and scale right A/D
wrax in, 1 ; save input for later, leave in ACC
wra delayd, 1 ; put in delay memory, leave in ACC
;
; Note trigger and timer ramp
;
maxx envlop, 0.9999 ; full-wave rectify w/ long decay
wrax envlop, 1 ; envelope filter, leave in ACC
;
rdfx peak, 0.002 ; high-pass filter to get peaks
wrhx peak, -1 ; no shelf
;
skp gez, 1 ; only positive peaks for note-on
clr ; neg transients set to zero
;
rdfx lopass, 0.002 ; smooth out ripple
wrlx lopass, -1 ; no shelf
;
log 1.999, 0.5 ; convert to dB for wide range
wrax trig, 0 ; save it
;
; Reset timer on leading edge of trigger
;
sof 0, -0.99 ; close to -1
rdax timer, 1 ; add timer
skp neg, NoTrig ; is timer expired?
sof 0, 0.4 ; yes, get trigger threshold
rdax trig, 1 ; compare to trigger
skp neg, NoTrig ; is trigger above it?
clr ; yes
wrax timer, 0 ; clear timer once
wrax ramp, 0 ; clear ramp a well
NoTrig:
sof 0, 0.001 ; small increment
sof 0.157, 0 ; makes ramp take 200mS
rdax timer, 1 ; add it to timer
wrax timer, 0 ; save it, clear ACC
;
; Generate attack ramp
;
rdax pot1, -.001 ; pot1 is attack speed
sof .99, .001 ; turning up means smaller
rdax ramp, 1 ; integrate from 0 to 1
wrax ramp, 0
;
; Use timer to modulate delayed signal
;
rda delayd+100, 1 ; get delayed input to miss transient
mulx ramp ; multiply by ramp
mulx ramp ; twice to get nonlinear volume
;
; Write D/A's with final mixed output
;
wrax dacr, 0 ; write output to right side
;
rdax ramp, 0.9 ; write ramp to left side for debug
wrax dacl, 0 |
_________________ Don Stavely |
|
| Back to top |
|
 |
Mel
Joined: 06 Mar 2010 Posts: 3
|
Posted: Mon Mar 08, 2010 2:54 pm Post subject: |
|
|
thnx guys(!!!),
livingston, tried using your coefficients but as far as can Tell what
i get is the regular instrument sound
donstavely, im afraid your code is beyond my level of understanding right now so sadly i plan to keep on struggling with something simpler  |
|
| Back to top |
|
 |
livingston
Joined: 15 Nov 2009 Posts: 108 Location: New Orleans, LA US
|
Posted: Mon Mar 08, 2010 7:57 pm Post subject: |
|
|
Hmm, if I get a chance I'll try the code above and see what I can make of it. As I said, I hadn't ever tried that concept, but I think it should work if we can get the code together.
One thing you might try is amplifying your instrument, either in analog before the FV-1, or by putting several "SOF -2,0" statements in a row (always use an even number of these). The problem could be that your instrument isn't loud enough to create a big enough envelope. Also try playing with the WRLX coef. |
|
| Back to top |
|
 |
patb
Joined: 13 Apr 2010 Posts: 2 Location: plymouth uk
|
Posted: Sat Apr 17, 2010 3:24 am Post subject: |
|
|
Great slow gear program, nice one
never could get mine to work properly !
Try this though:-
; Note trigger and timer ramp
maxx envlop,0.9995
wrax envlop,1 ; envelope filter, leave in ACC
rdfx peak,0.002 ; high-pass filter to differentiate
wrhx peak, -1 ; no shelf
rdfx peak,0.002
wrhx peak, -1
rdfx peak,0.002
wrhx peak, -1
rdfx peak,0.002
wrhx peak, -1
;
skp gez,1
clr
log 1.999,0.5
wrax trig,0 |
|
| Back to top |
|
 |
|
|
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
|