Phase-averaged acceleration of midges under periodic lighting at frequencies of 0.19 Hz (a), 0.37 Hz (b), 0.72 Hz (c) and 1.39 Hz (d). During the first half of the period, the ambient light was at 2.3lx and at 1.3lx during the second half. Similar to the 0.1 Hz frequency phase average in figure 2b, the swarms show a startle response lasting about 0.3 s independent of frequency after every light switch. The swarm retains a measurable two-level response separated from the startle response as long as the period of the light switches is longer than the startle response. For higher frequencies, as shown in (d), the distinct levels begin to disappear into the startle response. (Online version in colour.)