home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February / PCWorld_2008-02_cd.bin / audio-video / reaper / reaper2028-install.exe / Effects / Guitar / distortion < prev    next >
Text File  |  2007-12-03  |  757b  |  44 lines

  1. // This effect Copyright (C) 2004 and later Cockos Incorporated
  2. // License: GPL - http://www.gnu.org/licenses/gpl.html
  3.  
  4. desc:(digital) distortion
  5.  
  6. slider1:20<0,50,1>gain (dB)
  7. slider2:6<1,10,1>hardness
  8. slider3:-12<-40,0,1>max volume (dB)
  9. slider4:0<0,2,1{Left,Right,Stereo}>channel mode
  10.  
  11. @init
  12. @slider
  13. preamp=2^(slider1/6);
  14. soft=2^slider2;
  15. maxv=2 ^ (slider3/6);
  16.  
  17. //maxv=0.5 * (soft+maxv - sqrt((soft+maxv)*(soft+maxv)-4*(maxv*(soft-1)-1)));
  18.  
  19. @sample
  20.  
  21. slider4 != 1 ? (
  22. spl0*=preamp;
  23. t=abs(spl0);
  24. t > maxv ? 
  25. (
  26.   s=sign(spl0);
  27.   diff=t-maxv;
  28.   spl0=s*(maxv + diff/(soft+diff));
  29. );
  30.  
  31. );
  32.  
  33. slider4 != 0 ? (
  34. spl1*=preamp;
  35. t=abs(spl1);
  36. t > maxv ? 
  37. (
  38.   s=sign(spl1);
  39.   diff=t-maxv;
  40.   spl1=s*(maxv + diff/(soft+diff));
  41. );
  42.  
  43. );
  44.