Idea for generating a lower octave.
Moderator: frank
Idea for generating a lower octave.
Take input. Determine envelope voltage. Add half the envelope voltage to the input so its always positive. Take the square root of it. Invert at each zero crossing to get the lower octave. Filter out any transients. Now just turning it into code.
Code.
equ input reg0
equ ef reg1 ;Set up registry
ldax adcl ;read input into acc
wrax input, 1 ;write input for later use
absa ;take absolute value
rdfx ef, .001
wrlx ef, 1 ; low pass filter
ldax ef
mulx 0.5 ; take half envelope
rdax input, 1 ; add input
log 0.5, 0
exp 1,0 ; take the square root
From here on I don't know how to write the code.
equ ef reg1 ;Set up registry
ldax adcl ;read input into acc
wrax input, 1 ;write input for later use
absa ;take absolute value
rdfx ef, .001
wrlx ef, 1 ; low pass filter
ldax ef
mulx 0.5 ; take half envelope
rdax input, 1 ; add input
log 0.5, 0
exp 1,0 ; take the square root
From here on I don't know how to write the code.
Well, I think there is an error in the logic, looking at the theory:
See this thread on doing an octave down using zero crossing detection
http://www.spinsemi.com/forum/viewtopic.php?t=185
I believe that is incorrect. Imagine a constant amplitude sin wave that goes +1 to -1, taking the absolute value and finding the envelope give an envelope voltage of 1, adding 1/2 of that to the input results in a signal that goes from -0.5 to +1.5, not always positive. This is what your code appears to do (I haven't run it)Take input. Determine envelope voltage. Add half the envelope voltage to the input so its always positive.
See this thread on doing an octave down using zero crossing detection
http://www.spinsemi.com/forum/viewtopic.php?t=185
Frank Thomson
Experimental Noize
Experimental Noize