static int OPLOpenTable() {
        int s, t;
        double rate;
        int i, j;
        double pom;

        /* allocate dynamic tables */
        TL_TABLE = new IntSubArray(TL_MAX * 2);
        SIN_TABLE = new IntSubArray[SIN_ENT * 4];
        AMS_TABLE = new IntSubArray(AMS_ENT * 2);
        VIB_TABLE = new IntSubArray(VIB_ENT * 2);
        /* make total level table */
        for (t = 0; t < EG_ENT - 1; t++) {
            rate = ((1 << TL_BITS) - 1) / Math.pow(10, EG_STEP * t / 20);	/* dB . voltage */

            TL_TABLE.write(t, (int) rate);
            TL_TABLE.write(TL_MAX + t, -TL_TABLE.read(t));
            /*Log(LOG_INF,"TotalLevel(%3d) = %x\n",t,TL_TABLE[t]);*/
        }
        /* fill volume off area */
        for (t = EG_ENT - 1; t < TL_MAX; t++) {

            TL_TABLE.write(t, 0);
            TL_TABLE.write(TL_MAX + t, 0);//TL_TABLE[t] = TL_TABLE[TL_MAX + t] = 0;
        }

        /* make sinwave table (total level offet) */
        /* degree 0 = degree 180                   = off */
        SIN_TABLE[0] = SIN_TABLE[SIN_ENT / 2] = new IntSubArray(TL_TABLE, EG_ENT - 1);
        for (s = 1; s <= SIN_ENT / 4; s++) {
            pom = Math.sin(2 * Math.PI * s / SIN_ENT); /* sin     */

            pom = 20 * Math.log10(1 / pom);	   /* decibel */

            j = (int) (pom / EG_STEP);         /* TL_TABLE steps */

            /* degree 0   -  90    , degree 180 -  90 : plus section */
            SIN_TABLE[s] = SIN_TABLE[SIN_ENT / 2 - s] = new IntSubArray(TL_TABLE, j);
            /* degree 180 - 270    , degree 360 - 270 : minus section */
            SIN_TABLE[SIN_ENT / 2 + s] = SIN_TABLE[SIN_ENT - s] = new IntSubArray(TL_TABLE, TL_MAX + j);
            /*		Log(LOG_INF,"sin(%3d) = %f:%f db\n",s,pom,(double)j * EG_STEP);*/
        }
        for (s = 0; s < SIN_ENT; s++) {
            SIN_TABLE[SIN_ENT * 1 + s] = s < (SIN_ENT / 2) ? SIN_TABLE[s] : new IntSubArray(TL_TABLE, EG_ENT);
            SIN_TABLE[SIN_ENT * 2 + s] = SIN_TABLE[s % (SIN_ENT / 2)];
            SIN_TABLE[SIN_ENT * 3 + s] = ((s / (SIN_ENT / 4)) & 1) != 0 ? new IntSubArray(TL_TABLE, EG_ENT) : SIN_TABLE[SIN_ENT * 2 + s];
        }
        /* envelope counter . envelope output table */
        for (i = 0; i < EG_ENT; i++) {
            /* ATTACK curve */
            pom = Math.pow(((double) (EG_ENT - 1 - i) / EG_ENT), 8) * EG_ENT;
            /* if( pom >= EG_ENT ) pom = EG_ENT-1; */
            ENV_CURVE[i] = (int) pom;
            /* DECAY ,RELEASE curve */
            ENV_CURVE[(EG_DST >> ENV_BITS) + i] = i;
        }
        /* off */
        ENV_CURVE[EG_OFF >> ENV_BITS] = EG_ENT - 1;
        /* make LFO ams table */
        for (i = 0; i < AMS_ENT; i++) {
            pom = (1.0 + Math.sin(2 * Math.PI * i / AMS_ENT)) / 2; /* sin */

            AMS_TABLE.write(i, (int) ((1.0 / EG_STEP) * pom)); /* 1dB   */

            AMS_TABLE.write(AMS_ENT + i, (int) ((4.8 / EG_STEP) * pom)); /* 4.8dB */

        }
        /* make LFO vibrate table */
        for (i = 0; i < VIB_ENT; i++) {
            /* 100cent = 1seminote = 6% ?? */
            pom = (double) VIB_RATE * 0.06 * Math.sin(2 * Math.PI * i / VIB_ENT); /* +-100sect step */

            VIB_TABLE.write(i, (int) (VIB_RATE + (pom * 0.07))); /* +- 7cent */

            VIB_TABLE.write(VIB_ENT + i, (int) (VIB_RATE + (pom * 0.14))); /* +-14cent */
            /* Log(LOG_INF,"vib %d=%d\n",i,VIB_TABLE[VIB_ENT+i]); */

        }
        return 1;
    }