home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / MISC / SONITICA / EFFECTS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-31  |  2.7 KB  |  69 lines

  1. /* EFFECTS.H */
  2.  
  3. #define chorus(input, width, depth, mix, rate) (1-mix)*input + mix*delay(input, width+depth, wavegen(POS_TRIANGLE, delta(rate))*sec(depth))
  4. #define flange(input, width, depth, mix, rate) (1-mix)*input + mix*delay(-input, width+depth, wavegen(POS_TRIANGLE, delta(rate))*sec(depth))
  5. #define transposeup(input, width, depth, rate) delay(input, width+depth, wavegen(POS_SAWTOOTH, delta(rate))*sec(depth))
  6. #define transposedown(input, width, depth, rate) delay(input, width+depth, -wavegen(POS_SAWTOOTH, delta(rate))*sec(depth))
  7.  
  8. #defblock schorus(input, loutput, routput, width, depth, mix, rate)
  9. delpart = mix*delay(input, width+depth, wavegen(POS_TRIANGLE, delta(rate))*sec(depth));
  10. mixpart = (1-mix)*input;
  11. loutput = mixpart+delpart;
  12. routput = mixpart-delpart;
  13. #enddef
  14.  
  15. #define vibrato(input, depth, rate) chorus(input, 0, depth, 1, rate)
  16.  
  17. #define tremelo(input, depth, rate) input*(1-wavegen(POS_TRIANGLE, delta(rate))*depth)
  18.  
  19. #defblock auto_pan(input, loutput, routput, rate)
  20. mod = wavegen(POS_TRIANGLE, delta(rate));
  21. loutput = input*mod;
  22. routput = input*(1-mod)
  23. #enddef
  24.  
  25. #defblock compress(input, output, filter)
  26. envel = average(input, filter);
  27. output = (1.5-envel)*delay(input, 0.005)
  28. #enddef
  29.  
  30. #define recho(input, time, feedback) (echo=delay(forward echo*feedback+input, time))
  31.  
  32. #define lowpassfilt(input, k, q) ((acc=(input+forward acc*k))*q)
  33.  
  34. #defblock filter(input, lowpass, highpass, bandpass, notch, f, q)
  35. lowpass = forward lowpass + f*forward bandpass3;
  36. highpass = input - lowpass - q*forward bandpass2;
  37. bandpass = f*highpass + forward bandpass;
  38. bandpass2 = bandpass;
  39. bandpass3 = bandpass;
  40. notch = highpass + lowpass
  41. #enddef
  42.  
  43. #defblock sreverb(revbinput, loutput, routput, time, feedback, filter)
  44. prervb = delay(revbinput+forward postrvb*(feedback/16), time);
  45. loutput = average(prervb+prervb[time*0.1872]+prervb[time*0.4423]+
  46.           prervb[time*0.1243]+prervb[time*0.1381]+
  47.           prervb[time*0.5664]+prervb[time*0.3171]+prervb[time*0.7817], filter);
  48. routput = average(prervb+prervb[time*0.1791]+prervb[time*0.4545]+
  49.           prervb[time*0.1193]+prervb[time*0.1441]+
  50.           prervb[time*0.5547]+prervb[time*0.2917]+prervb[time*0.7741], filter);
  51. postrvb = loutput+routput;
  52. #enddef
  53.  
  54. #defblock hallreverb(inp, loutput, routput)
  55. mix1 = recho(inp, 0.0496, 0.75);
  56. mix2 = recho(mix1, 0.03465, 0.72);
  57. mix3 = recho(mix2, 0.02418, 0.691);
  58. mixl1 = recho(mix3, 0.01785, 0.649);
  59. loutput = recho(mixl1, 0.01098, 0.662);
  60. mixr1 = recho(mix3, 0.01801, 0.646);
  61. routput = recho(mixr1, 0.01082, 0.666)
  62. #enddef
  63.  
  64. #defblock noise_gate(input, trigger, output, decaytime, decayrate)
  65. #enddef
  66.  
  67. #define marshall_stack(input, gain) recho(transform(input*(gain/100), "LOGTBL", 14), 0.01, 0.5)
  68.  
  69.