Tweetable, One Loop, One Function, Simple Arduino Music. I wanted to explore this in software – specifically, using an table-based oscillator. You can download the Max patch here.
Basically, there is an index of an oscillator buffer. This index is generated by the uzi 8192 object, and is sent to an expr object. The expr then calculates an output sample value for every buffer index, based on the function (expression) object. Finally, every sample value is loaded into the buffer~ object, whereby these samples are linked to an oscillator (i.e. cycle~).