public void release(int x, int y) {
        if (amplitude.isActive()) {
            amplitude.release();
        } else if (period.isActive()) {
            period.release();
        } else if (amplitude2.isActive()) {
            amplitude2.release();
        } else if (period2.isActive()) {
            period2.release();
        }
    }