#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN () AS LONG

    'sine 1

    DIM pi AS DOUBLE
    pi = 3.1415926535
    DIM x AS DOUBLE'INTEGER
    DIM a AS INTEGER
    OPEN "SINE.WAVE" FOR BINARY AS #1
    FOR x = 0 TO 255 STEP 0.5
        a= INT(SIN((x/128)*pi)*128+128)
        PRINT a
        PUT$ #1, CHR$(a)
        NEXT x
    CLOSE #1

    WAITKEY$

END FUNCTION
