NoizBox - Source code
The NoizBox software is fairly simple - it turns the gate on when it gets a Note On message and turns the gate off when the corresponding number of Note Off messages have been received. It also responds to All Sound Off and All Notes Off messages. Here is the source code:
noizbox_source.zip
It was developed in MPLAB IDE and will compile using the MPASM Assembler. The clock crystal I had lying around was 20MHz but this is much faster than needed, so any other crystal could be substituted if you change the USART baud rate configuration accordingly (at line 106 in 'main.asm').
If you don't have a PIC programmer you can buy a PIC pre-programmed.
More ..