      subroutine hcmbst(xlpt,xinit,a,sr)
c------------------------------------------------
c     xlpt => loop time of the filter in secs
c     xinit  => initialization ? 0 = yes ; 1 = no
c     a      => array
c-------------------------------------------------
      dimension a(1005)
      pi=3.141592654
      w=2.*pi/xlpt
c----------------- tuning filter coefficient
c     n => loop length
      n=aint(xlpt*sr)
c     pc => delay required from the allpass filter
      pc=sr*xlpt-n
c     cc => coefficient of the allpass filter
      cc=sin((w/sr-w/sr*pc)/2.)/sin((w/sr+w/sr*pc)/2.)
c---------------------------------------------------------------        ZZ
      a(1)=10.+n
      if (xinit) 2,1,2
1     le=a(1)
      do 10 l=11,le
      a(l)=0.
10    continue
      a(2)=xlpt
c--------- a(3) =>
      a(3)=0.
c--------- a(4) =>
      a(4)=0.
c--------- a(5) => delay line pointer
      a(5)=10.
c--------- a(6) =>
      a(6)=0.
c--------- a(7) => input delay
      a(7)=0.
c--------- a(8) => output delay
      a(8)=0.
c--------- a(9) => allpass filter coefficient
      a(9)=cc
      a(1) = a(1) - 1
      a(5) = a(5) - 1
c.......adjustments for C
2     return
      end
