How about :
IoannisCode:if signal>(0.6*prev_signal) then gosub attenuation
thanks Ioannis
I'll not get a chance to try that until tomorrow evening now (Saturday evening) - but to my very untrained eye, it looks like that setup is saying ...
if the present incoming signal (ie sample) is greater than 60% of the previous signal (sample), then blah blah
??
If so, then what I actually need is this type of condition ....
"if the present signal (ie sample) is 40% greater than the previous signal (sample), then blah blah?
By the way - what's the best way to do percentages in PICBASIC? (if it helps, I can dispense with the floating point - which I'm presuming the PIC just does away with ...eg 40.4% becomes 40%)
PBP does not do floating of course. you have to multiply the variable by 10 or 100 or even 1000 to get the "floating" digits in the integer part of the number.
Ioannis
I skimmed over this thread... maybe you need a simple frequency to voltage converter... this was used in some of the first guitar synth's... there are discrete as well as monolithic devices (still) available...
Mike Tripoli
Bookmarks