Polyphonic sound chip with software-programmable ADSR envelope generator