The design of modern scientific experiments requires the control and monitoring of many different data streams. However, the serial execution of programming instructions in a computer makes it a challenge to develop software that can deal with the asynchronous, parallel nature of scientific data. Here we present Bonsai, a modular, high-performance, open-source visual programming framework for the acquisition and online processing of data streams. We describe Bonsai's core principles and architecture and demonstrate how it allows for the rapid and flexible prototyping of integrated experimental designs in neuroscience. We specifically highlight some applications that require the combination of many different hardware and software components, including video tracking of behavior, electrophysiology and closed-loop control of stimulation.
Time is a subjective experience: Time, like space, is one of the fundamental dimensions of all our experiences. However, organisms do not work like clocks, and our judgment about the passage of time is variable, depending on circumstances. Soares et al. systematically investigated midbrain dopaminergic neurons during timing behavior in mice (see the Perspective by Simen and Matell). When measuring and manipulating mouse activity, the authors observed that dopaminergic neurons controlled temporal judgments on a time scale of seconds. Science , this issue p. 1273 ; see also p. 1231