Recent experiments have shown that stereotypical spatiotemporal patterns occur during brief packets of spiking activity in the cortex, and it has been suggested that top-down inputs can modulate these patterns according to the context. We propose a simple model that may explain important features of these experimental observations and is analytically tractable. The key mechanism underlying this model is that context-dependent top-down inputs can modulate the effective connection strengths between neurons because of short-term synaptic depression. As a result, the degree of synchrony and, in turn, the spatiotemporal patterns of spiking activity that occur during packets are modulated by the top-down inputs. This is shown using an analytical framework, based on avalanche dynamics, that allows calculating the probability that a given neuron spikes during a packet and numerical simulations. Finally, we show that the spatiotemporal patterns that replay previously experienced sequential stimuli and their binding with their corresponding context can be learned because of spike-timing-dependent plasticity.