Pulse Density Modulation

A cleaner, better way to do software power regulation, gives even power distribution and makes the most of the available time resolution. Also happens to be much more readable code :)
https://en.wikipedia.org/wiki/Pulse-density_modulation