The first example can be done faster with 12-bit counters, at the cost of loosing variable duty:
add hl,de
ld a,h
out (#fe),a
rrca
out (#fe),a
rrca
out (#fe),a
Second example is very powerful. One can create all sorts of waveforms with this, especially if you also play with the distances between the OUT commands. If I understood fourier transformations, I'd have some great fun with this...
My idea was to use a free-running counter. Original idea of an 8-bit counter didn't work, so here is a pretty clumsy version with a 16-bit counter:
ld de,#80
xor a
ld h,a
ld l,a
ld b,a
ld c,a
loop
out (#fe),a ;11__36
add hl,de ;11
inc bc ;6
ld a,h ;4
nop ;4
out (#fe),a ;11__36
add a,b ;4
ld r,a ;9
jr loop ;12
Suprisingly it actually works, but wasting a whole 16-bit reg on this seems rather wasteful. Though on the other hand, one free-running counter can serve multiple channels, so maybe not so bad after all.
Edit: On second thought, that register is maybe not wasted at all... because it might be possible to use the frame length counter for this :D
Edit2: Trying out the idea in BeepModular. The effect is less pronounced here because of the volume difference (48 vs 64t), but generally abusing the timer for this seems like a good idea.