public byte[] getNextFrame(int length) {
        byte[] oscillatorOutput = sourceOsc.getNextFrame(length);
        float envLevel = env.getCurrentLevel();
        if (usePressure) {
            for (int i = 0; i < length; i++) {
                oscillatorOutput[i] = (byte) Math.round(oscillatorOutput[i] * envLevel * velocity);
            }
        } else {
            for (int i = 0; i < length; i++) {
                oscillatorOutput[i] = (byte) Math.round(oscillatorOutput[i] * envLevel);
            }
        }

        return oscillatorOutput;
    }