View Single Post
Old 08-26-2008, 11:06 AM   #7
LOSER
Human being with feelings
 
Join Date: May 2006
Posts: 2,373
Default

Okay tweaked my old algo a bit and now it also detects Schwa's sample fine .

Code:
desc:Transient Detector (NOT AN FX!!!)

@init
db = 8.685889638;
idb = 0.115129254;

@slider

rel = 120/srate;

tblock = 18/1000 * srate;

trigFactdB = 2;


//reset
env = 0;
env_sum = 0;
env_sum_old = 0;
pos = 0;
t = 0;

@sample

in = max( log( abs(spl0) ) * db , -280);

env = in > env ? in : max(env - rel, in);

env_sum += env;
(pos+=1) >= tblock ?
(
  pos = 0;
  env_sum /= tblock;
  t = env_sum > env_sum_old+trigFactdB;
  env_sum_old = env_sum;
  env_sum = 0;
);

spl1 = spl0 = t;
Yeah I put it into the public domain so anyone can use it and expand it, so it doesn't suck any more.
LOSER is offline   Reply With Quote