#tone.bas # example program for HotPaw Basic # f = 880.0 enb=0 draw -1 form btn 120,40,32,12,"up",1 form btn 120,60,32,12,"Play",1 form btn 120,80,32,12,"down",1 form btn 120,120,32,12,"Stop",1 form fld 40,40,40,12,".06",1 draw "delta", 10,40 draw "freq = ",10,60 while 1 y = asc(inkey$) if y > 16 then end if y > 0 then gosub h1(y) if enb then sound f,500,3 draw a$, 40,60 a$=str$(f,8,2) wend end sub h1(x) d = val(s$(0)) if y=14 then f = f*(1+d) if y=16 then f = f/(1+d) if y=15 then enb = 1 return run