## call me   awk -f tones

## Or call me Ishmael, what the hell.

## generate C code for a 636-tone/octave table of strings to specify the
## frequency of the Linux console bell

#Copyright Rick Hohensee 1999
#This file is released for redistribution only as part of an intact entire
#cLIeNUX Core.


BEGIN 	{ 

TOP = 14080
CURRENT = TOP
EXP = (2 ** (1 / 636))

for ( I = 510  ; I ; I --)
	{
	for ( J = 2 ; J ; J -- )
		{ 
		for ( K = 5 ; K ; K --)
			{
			printf "\""int(CURRENT)"\", " 
			CURRENT = CURRENT / EXP
  			L ++
			}

		if (J == 1 )
			printf	"/*  " ( (511 - I )* 10 )  "  */ \n"
		else
			print

		}
	}

print L "   tones"
}
