
  uses minwin
  uses waves.h
  uses waves.inc
  '
  '
  WaveOut w
  '
  w.WavoStart 
  '
  single a,amp,freq,phase
  single reverba,nreverba,filt,filtpr,filtba
  sys b,bufo,d1,d2,p,q,decay,reverbt
  '
  reverba=.25
  nreverba=.75
  reverbt=0.3*88200 'max buffersize 64k
  '
  'note: pitch,volume,phase,envelopes

  amp=0
  freq=200
  filtba=1
  do
    sleep 5
    if GetAsyncKeyState 27 then exit do
    p=w.wavopos
    if p+2000>q then 'ahead ~1/40 sec

  '
  'ENVELOPE
  int i
  for i=1 to 1000
  if amp>=1000 then decay=1
  if decay then
    'amp*=.9995
    if amp then amp-=.5
  else
    amp+=10
  end if
  '
  phase=frac(freq*q*ipuls)
  a+=sawtooth(phase)
  'a+=amp*triangle(phase)
  a+=amp*square(phase)
  'a+=amp*square(phase*1.5)
  'a+=amp*sin(pi2*phase) 'sine wave
  'a+=amp*sin(pi2*phase*1.25) 'harmonic
  'a+=amp*sin(pi2*phase*1.5) 'harmonic
  'a+=amp*sin(pi2*phase*3) 'harmonic
  '
  'FILTER
  '
  filtpr=.1
  filt=filt*(1-filtpr)+a*filtpr
  single lp=filt       'low pass
  single hp=a-filt     'high pass
  a=lp*filtba + hp*(1-filtba) 'moving filter mix
  a*=2 'boost
  '
  'POST WITH REVERB
  '
  SendToBuffer 'macro
  a=0
  '
  next

  if ++d1=20 then
    d1=0
    freq*=1.25
    decay=0
    amp=0
    if ++d2=8 then
      d2=0
      freq=200
      filtba-=.1
      if filtba<=0 then exit do
    end if
  end if

  end if

  enddo
  '
  w.WavoEnd

   
