For my 'reversal' project I am trying to read an audio table containing
several guitar notes. I want to find where a note starts and ends, in
order to copy it reversed to another table. When I execute the following
code, the 'found one' message appears only once.
I realize that a prints at audio rate might be too much. In fact it is k
rate, but with setksmps to 1.
So why does it happen only once and what is the best way to to audio
rate compare? I cannot directly compare an a-rate variable to a value,
so it seems:
atab init 0
isize tableng 1 ;length of table?
andx phasor 1 / (isize / sr)
asig tab andx, 1, 1 ;has a 0 to 1 range for the index
if (abs(asig)>0.1) then ; this gives: error: boolean expression
'>' with arg types ac not found
;if (k(abs(asig))>0.1) then ; this prints only once
prints "found one"