Multi-electrode analysis of pattern generation and its adaptation to reward