Toolbox for generating and simulating patterns for spatial light modulators. This toolbox consists of a collection of algo-rithms commonly used for generating patterns for these devices with a focus. OTSLM is a set of Matlab functions and graphical user interface for generating patterns for phase and amplitude spatial light modulators (SLMs) such as the digital micromirror device (DMD) and liquid crystal type device. Some SLMs are now sold with a dedicated card or can be controlled via USB. If you possess such a device, this tutorial is not for you. Typical examples of SLMs are acousto-optics modulators (AOMs), electro-optic modulators (EOMs) and liquid crystal displays.