I'm unclear with why you need to code up a custom sequencer. And agree with @solitud's comment that it will take away from the music making aspect.
Look into MI's Grids (programmable as well).