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 

Audio input as delay modulation source?

 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development
View previous topic :: View next topic  
Author Message
knutolai



Joined: 23 Nov 2016
Posts: 32
Location: Bergen, Norway

PostPosted: Thu Mar 23, 2017 5:34 am    Post subject: Audio input as delay modulation source? Reply with quote

Hi

So I'm trying to use the incoming audio signal to modulate a vibrato effect (instead of using an LFO).

My idea was to set sin0 to 0Hz, write the audio to sin0_range and use the cosine (max at zero?) as the modulation source for the vibrato (delay).

My code does not create any vibrato, but here it is anyways:
Code:
; Self modulation FM
;
; Pot0 = SMOD Level

; Memory declarations:
mem    chodel    1024

; Registers:
equ   temp   reg0   ; Temporary value reg

skp    run,    START
;   lfo   freq   amp
wlds   SIN0,   0,   0   ; Write & Load sin0 at 0Hz
START:

; Input to chorus:
ldax    adcl      ; Read left input
wra   chodel, 1      ; Write to head of chorus delay line, keep value in acc

; Prepare modulation source:
sof   -2, 0      ; compress and (potentially) clip signal
sof   0.03, 0.5   ; Range 0.5 +/- 0.03
mulx   pot0      ; Add depth ctrl
mulx   pot0      ; Square depth ctrl
wrax   sin0_range, 0   ; Load into sin0 range register, clear ACC
wrax   sin0_rate, 0   ; Load 0 into sin0 rate reg, clear ACC

; Do chorus lines:
cho   rda, SIN0, COS|REG|COMPC, chodel^    
cho   rda, SIN0, COS, chodel^+1    
      
wrax   dacl, 0       ; Write result to left output


In not at all sure where to go from here as I can't seem to find any resources on modulating the delay directly.

Any suggestions?
Back to top
View user's profile Send private message
knutolai



Joined: 23 Nov 2016
Posts: 32
Location: Bergen, Norway

PostPosted: Thu Mar 23, 2017 6:12 am    Post subject: Reply with quote

From another thread (http://www.spinsemi.com/forum/viewtopic.php?t=469&sid=7a1901be706a4942ea82947d36b046d4)

Code:
RDA 14444,1.0
WRAX 57,0.0
RDA 28594,1.0
WRAX 58,0.0


Could I perform modulation through direct delay ram addreess readouts like this?

http://www.spinsemi.com/Products/datasheets/spn1001-dev/SPINAsmUserManual.pdf

Page 21 and 45 seems to be relevant. Still a little hard to grasp
Back to top
View user's profile Send private message
ice-nine



Joined: 24 May 2012
Posts: 125

PostPosted: Thu Mar 23, 2017 6:47 am    Post subject: Reply with quote

I tried to compile the code you posted above but it had errors and would not compile, this could be as copy/paste added lots of spaces in the code.

I edited the code on my pc and recompiled it, it sort of works but I don't think it does exactly what you are expecting, it does now have vibrato.

you are also clearing the acc after writing the sin0 range so I have changed that to keep the value in the acc for the next line to write to the sin0 rate.

I have pasted the code below, give it a try as a starting point.
use pot 0 at minimum first as it get wild very quickly.

Basically all I have changed is not to clear the acc after the sin0 range line.


Code:

; Self modulation FM
 
; Pot0 = SMOD Level

; Memory declarations
 
  mem   chodel   1024

; Registers
 
 equ   temp   reg0         ;Temporary value reg

 skp   run,   START       ;lfo   freq   amp
 wlds   SIN0,   0,   0      ; Write & Load sin0 at 0Hz
 
START:

; Input to chorus
 
  ldax   adcl               ; Read left input
  wra   chodel,1            ; Write to head of chorus delay line, keep value in acc

; Prepare modulation source

 sof   -2, 0            ; compress and (potentially) clip signal
 sof   0.03,0.5         ; Range 0.5 +/- 0.03
 mulx   pot0               ; Add depth ctrl
 mulx   pot0               ; Square depth ctrl
 wrax   sin0_range, 1         ; Load into sin0 range register, keep in ACC
 wrax   sin0_rate, 0         ; Load 0 into sin0 rate reg, clear ACC

; Do chorus lines
 
 cho   rda,SIN0,COS|REG|COMPC,chodel^    
 cho   rda,SIN0,COS,chodel^+1    
      
 wrax   dacl, 0             ; Write result to left output
 

_________________
www.stanleyfx.co.uk
"It's fairly straight forward, if you want to start it press start, you can work out the rest of the controls yourself."
Back to top
View user's profile Send private message Visit poster's website
knutolai



Joined: 23 Nov 2016
Posts: 32
Location: Bergen, Norway

PostPosted: Thu Mar 23, 2017 7:23 am    Post subject: Reply with quote

Thank you for looking it over! Yes I think the errors are due to the copy/paste. Compiled without trouble on my pc (clean, unaltered output)

Quote:
you are also clearing the acc after writing the sin0 range so I have changed that to keep the value in the acc for the next line to write to the sin0 rate.


The rate is intentionally set to 0. My guess was that COS would write out the max. positive amplitude when rate = 0. So if I left the rate at 0 and modulated the amplitude I would in essence bypass the LFO (modulating the static LFO max amplitude), but keep the "cho rda"-method. All just wild guesswork on my end. Including the code in my post was probably more confusing than helpful Laughing

Tried your modified code. Quite interesting at higher pot0 settings! But not what I'm after.

The goal is to use the audio input signal itself to modulate the vibrato instead of a sinewave LFO. The modulation "rate"/"shape" would be equal to the complex shape of the guitar signal and the "depth" would be dependent on the playing dynamics + pot0.

I've achieved the effect in an analog circuit. It's quite pleasing in a squirmy, parasitic fashion Twisted Evil
Back to top
View user's profile Send private message
ice-nine



Joined: 24 May 2012
Posts: 125

PostPosted: Thu Mar 23, 2017 7:30 am    Post subject: Reply with quote

knutolai wrote:


The goal is to use the audio input signal itself to modulate the vibrato instead of a sinewave LFO. The modulation "rate" would be equal to the complex shape of the guitar signal and the "depth" would be dependent on the playing dynamics + pot0.

I've achieved the effect in an analog circuit. It's quite pleasing in a squirmy, parasitic fashion Twisted Evil


I guess you are looking to achiever a dyna vibrato effect, for this part you may need to rectify the guitar signal to achieve the dynamic part , i'm pretty sure one of the spin examples does exactly this in the reverb/vibrato effect. I will have a look to see if I can find the code example I am thinking of. I'm pretty sure this will get you closer to what you are aiming for.
_________________
www.stanleyfx.co.uk
"It's fairly straight forward, if you want to start it press start, you can work out the rest of the controls yourself."
Back to top
View user's profile Send private message Visit poster's website
knutolai



Joined: 23 Nov 2016
Posts: 32
Location: Bergen, Norway

PostPosted: Thu Mar 23, 2017 8:16 am    Post subject: Reply with quote

Maybe I could use the servo technique to perform the modulation instead of "cho rda"-statements?

http://www.spinsemi.com/knowledge_base/coding_examples.html#Servo_technique

Code:

skp   run,1   ;only establish the LFO on the first sample pass
wldr   rmp0,0,4096   ;set rmp0 to its widest range

cho   rdal,rmp0   ;load in the current RMP0 pointer
rdax   mpos,-1   ;subtract the desired position
wrax   rmp0_rate,0   ;write the position error to the ramp rate register


Not quite sure how this works, but will read over the LFO app-note.

http://www.spinsemi.com/Products/appnotes/spn1001/AN-0001.pdf
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development All times are GMT - 8 Hours
Page 1 of 1

 
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