A method for controlling an enzymatic pre-treatment process, e.g. a mashing process, wherein the method comprises the actions of: a) providing a sample to a system with a tank; b) obtaining a sample mixture by: - adding one or more enzymes to the sample if the sample does not contain one or more enzymes already, or - possibly adding one or more enzymes to the sample already containing one or more enzymes; c) continuously exposing a part of the sample mixture to an infrared spectrometer; d) continuously measuring attenuated total reflectance IR spectra of the sample mixture with the IR spectrometer in real time at wavelengths between 400-3500 cm -1 during the enzymatic pre-treatment process, and e) feeding the measured IR spectra to a calculating unit which: - calculates information relating to specific species present in the sample mixture during the enzymatic pre-treatment process based on the IR spectra, wherein the information relating to the specific species present in the samples mixture is: • the ratio between the different specific species, and/or • the concentration of one or more of the specific species, and/or • the degree of polymerization of one or more of the specific species; and - feeds the information relating to the specific species in the sample mixture back to the user and/or to a tank control system connected to the tank. a) providing a sample to a system with a tank; b) obtaining a sample mixture by: - adding one or more enzymes to the sample if the sample does not contain one or more enzymes already, or - possibly adding one or more enzymes to the sample already containing one or more enzymes; - adding one or more enzymes to the sample if the sample does not contain one or more enzymes already, or - possibly adding one or more enzymes to the sample already containing one or more enzymes; c) continuously exposing a part of the sample mixture to an infrared spectrometer; d) continuously measuring attenuated total reflectance IR spectra of the sample mixture with the IR spectrometer in real time at wavelengths between 400-3500 cm -1 during the enzymatic pre-treatment process, and e) feeding the measured IR spectra to a calculating unit which: - calculates information relating to specific species present in the sample mixture during the enzymatic pre-treatment process based on the IR spectra, wherein the information relating to the specific species present in the samples mixture is: • the ratio between the different specific species, and/or • the concentration of one or more of the specific species, and/or • the degree of polymerization of one or more of the specific species; and - feeds the information relating to the specific species in the sample mixture back to the user and/or to a tank control system connected to the tank. - calculates information relating to specific species present in the sample mixture during the enzymatic pre-treatment process based on the IR spectra, wherein the information relating to the specific species present in the samples mixture is: • the ratio between the different specific species, and/or • the concentration of one or more of the specific species, and/or • the degree of polymerization of one or more of the specific species; and • the ratio between the different specific species, and/or • the concentration of one or more of the specific species, and/or • the degree of polymerization of one or more of the specific species; and - feeds the information relating to the specific species in the sample mixture back to the user and/or to a tank control system connected to the tank.