Conversion from spatial patterns of activity to sequences of neuronal activations using gate interneurons