Rough specs
- 3 channels with hard mix Left = A + 1/2 B , Right = 1/2 B + C
- 3 channels are time-multiplexed, SRAM is accessed in sequence
- all sound generation is produced by reading PCM samples from SRAM into a DAC
- all samples are 256-byte long and looped (but one channel can stop after one run)
- low 8 bits of sample address are generated by a 8-bit address counter clocked by pitch timer/counter 82c54
- upper 8 bits of a sample are defined by writing 8 bits to ports A, B, C of 82c55
- the pitch clock is generated by 82c54, master clock 8MHz (possibly 10, but not every 82c54 can do that)
Sound generation principle by example
Play a pitch (256 different timbres)
- Generate a waveform sample (e.g. sawtooth) and write it to SRAM at addresses $0000.$00FF. It can be one period or a multiple. I think a 8x or 16x multiple would give better pitch control considering that we only divide a 8MHz master clock.
- Optionally fill entire SRAM, making up 256 waveform samples
- Set note pitch as a divider for 82c54
- Set MSB in 82c55 = sample number
Create dynamics
Generate waveform samples for 16 volumes. Timbre 1 would occupy addresses $0000..$00FF, $0100..$01FF, ..., $0F00..0FFF. Same for other waveforms. Now MSB in 82c55 also selects modulated volume.
It can be seen that there is no strict rule regarding how many levels per timbre there should be, it's all on the programmer's side. We can have 1 or 3 or 256 volume levels, or one timbre can have 3 levels and other 13.
One-shots
Channel B (centre) can optionally stop after playing one loop. This should help adding basic percussion sounds.
Notes
Of blinkenlightenings see audio level meter