something like (completely untested, and possibly wrong!)
const SPECWIDTH=640
const SPECHEIGHT=480
dim fft#(1024)
dim specbuf(SPECWIDTH*SPECHEIGHT)
specpos%=0
'this function should be called regularly from a timer, don't know what rate though
Function UpdateSpectrum()
'don't know how to convert this line
'read the data from the mixer from channel 'chan' to array fft
BASS_ChannelGetData(chan,fft,BASS_DATA_FFT2048);
if specmode% = 0 then
'this code is for one type of equalizer
for x% = 0 To SPECWIDTH*SPECHEIGHT-1
specbuf(x) = 0
next
'for half the screen width
for x=0 to SPECWIDTH/2-1
y% = sqrt (fft(x+1))*3*SPECHEIGHT-4
if y > SPECHEIGHT y = SPECHEIGHT
if x > 0 then
y1% = (y + y1) / 2
for i% = y1-1 to 0 step -1
specbuf(i*SPECWIDTH+x*2-1)=i+1
next
end if
y1 = y
for i = y-1 to 0 step -1
specbuf(i*SPECWIDTH+x*2-1)=i+1
next
next
else
'this code is for a different type of equalizer
for x=0 to SPECHEIGHT-1
y = sqrt(fft(x+1))*3*127
if y>127 y=127
specbuf[x*SPECWIDTH+specpos]=128+y
next
end if
'wrap round
specpos = (specpos+1) Mod SPECWIDTH
'draw a vertical line at x=specpos
for x=0 to SPECHEIGHT-1
specbuf(x*SPECWIDTH+specpos) = 255
next
End Function