## 2 Experimental Setup  
Our two-wavelength optogenetic illumination setup is built around two ferroelectric liquid-crystal spatial light modulators (QXGA-3 DM M175 and QXGA-R9, both by Forth Dimension Displays). Both offer an active area of 2048 \(\times\) 1536 pixels at a maximum frame rate of up to 1.7 kHz, which is especially important for stimulating neurons on the time scale of their activity. High frame rates also allow for the implementation of feedback-based control loops for the analysis and manipulation of fast propagating signals in neuronal networks of tightly connected cardiomyocyte cultures. Our setup consists of two similar parts whose beam paths are marked in blue and yellow in Figure 1. Both consist of a laser source (Coherent OBIS 488 nm LS FP 80 mW, 488 nm, 80 mW; MPB 2 RU-VFL-P-200-589-B1R, 589 nm, 200 mW) connected to a fiber coupler FC and lenses L to ensure a more homogeneous collimated illumination of the ferroelectric spatial light modulator (SLM). Half-wave plates (\(\lambda/2\)) and non-polarizing 50:50 beam splitters (BS) allow for a tuning of laser light polarization to the modulator's preferential axis. A linear polarizer (LP) ensures binary phase modulation [38]. Both beam paths are collinearly combined using a dichroic mirror (DM); the combined beam path is marked in green in Figure 1. The collinearly superposed beams are directed onto the sample (S), which is placed in a microscope (stylized here by the microscope objective (MO) and the microscope tube lens (TL)) using two mirrors (M) to align the controlled illumination with the microscope beam path. A further lens (L), from here on called Fourier lens, between the microscope and polarizer makes this into a setup requiring computer-generated Fourier holograms. The focal length of this last lens is chosen so that the short axis of the SLMs is demagnified to match the back aperture of the microscope objective, overfilling it. A camera (C) allows for the observation of created light patterns or sample fluorescence. The maximal field of view for illumination in this configuration is determined by the microscope objective and the modulator specifications:  
\[X_{max}=\frac{f\lambda}{2d}.\frac{f_{fourier}}{f_{tube}}. \tag{1}\]  
Figure 1: Schematic of the two-wavelength holographic optogenetic illumination platform. It consists of two similar holographic light projection paths marked in blue and yellow, one with a wavelength tuned to activating opsins (488 nm) and one for inhibiting opsins (589 nm). Each path consists of a solid-state laser source, beam-conditioning lenses and a fast ferroelectric spatial light modulator for wavefront shaping, pattern generation and temporal modulation. The shaped beams of the two paths are collinearly superposed by a dichroic mirror (beam path marked green), coupled into an inverted microscope and directed onto the cell sample. For further explanations, see text. FC—fiber coupler, \(\lambda/2\)—half-wave plate, L—lens, BS—non-polarizing beam splitter, SLM—ferroelectric liquid-crystal spatial light modulator, DM—dichroic mirror, LP—linear polarizer, M—mirror, TL—tube lens, MO—microscope objective, S—sample, C—camera. Without loss of generality, \(X_{max}\) is the maximum deviation of a focus from the center on the sample plane with respect to one modulator axis, \(f\) is the focal length of the microscope objective, \(\lambda\) the laser wavelength, \(d\) the pixel pitch of the SLM and \(f_{fourier}\) and \(f_{tube}\) the focal lengths of the Fourier and tube lenses, respectively. In the case of \(f_{fourier}=f_{tube}\) and \(f=45\) mm (4x Objective, Olympus), the maximum field of view in the case of binary phase modulation is (\(1.34\times 1.34\)) mm\({}^{2}\), in range of the active area of modern multielectrode arrays (MEAs). The SLMs are rotated slightly so that a beam deflected to \(X_{max}/2\) passes along the optical axis of the setup. Using this relation, binary Fourier holograms for a point \(P_{xy^{\prime}}=\left( \begin{array}{c}P_{x^{\prime}}\\ P_{y^{\prime}}\end{array}