Pure Data is a free graphical programming language that has shared origins with MAX/MSP (a commercial program.)
It is powerful tool for audio processiing, midi decoding and generation and open GL graphics.
You’ll want to install Pd extended.
Here are a few links:
Online book by Miller Puckette: Theory and Technique of Electronic Music
Example screenshot of code to read midi input from a Korg NanoControl.

I’ll write a post soon about my initial experiments with the Korg Nano controllers.
Craig