#include<stdio.h>
#include<X11/Xlib.h>


extern Display *Disp;
extern int FixedVol;

void beep( int p,int l,int vol )
{
  XKeyboardControl v;

  v.bell_pitch = p;
  v.bell_duration = l;

  XChangeKeyboardControl( Disp,KBBellPitch | KBBellDuration,&v );

  if( FixedVol )
    vol = 0;
  else
    vol = (vol - 8)*12 - 4;

  XBell( Disp,vol );
}
