If an oscillating neural circuit is forced by another such circuit via a composite signal, the phase lag induced by the forcing can be changed by changing the relative strengths of components of the coupling. We consider such circuits, with the forced and forcing oscillators receiving signals with some given phase lag. We show how such signals can be transformed into an algorithm that yields connection strengths needed to produce that lag. The algorithm reduces the problem of producing a given phase lag to one of producing a kind of synchrony with a “teaching” signal; the algorithm can be interpreted as maximizing the correlation between voltages of a cell and the teaching signal. We apply these ideas to regulation of phase lags in chains of oscillators associated with undulatory locomotion.