Topic: new engine: BetaPhase
In continuation of this discussion, I wrote a new experimental engine based on Shiru's concepts. It's called BetaPhase because, uh, it's unfinished and probably will be in eternal beta status. It's intended more as a test-case rather than something you'd actually use for music production.
The engine may not sound all that impressive, it's more about the magic that's happening code-wise. Anyway, on the front end we've got 2 "simplified" Phaser channels, and one regular square wave channel with fixed 50% duty that can do slides. Phase offset is used to change the duty of the Phaser channels.
Special code features used:
- no use of duty threshold comparison trick (which was my self-set challenge for this engine), phase determines duty
- fast counter updates with 13-bit frequency resolution (bit 12 of the counter determines output state)
- and a little addition to the code discussed earlier: scalers. (zilogat0r proposed those a while back, but I think that's not quite what he meant )
add hl,bc
ex de,hl
nop ;swap with adc hl,bc for duty modulation
add hl,bc
ex de,hl
ld a,h
nop ;pre-scaler, modified with rlca/rrca
xor d
nop ;post-scaler, as above
out (#fe),a
The prescaler can be heard on the bassline in test.tap, and briefly on the arpeggios as well. The post-scaler actually seems unnecessary, 12-bit frequency resolution is sufficient to reach low notes without detuning too much. So it might be more interesting to have two pre-scalers instead.
Also, duty modulation with adc hl,bc is very ineffective, so I might consider removing it. However, modifying it with inc bc is too fast and sounds unpleasant. Still need to find a solution for this. Also, some way to create noise would be nice. So, as I said, the engine is currently quite unfinished.
Anyway, source for the engine is here, feel free to play around with it.
Edit: Counting bits... it's hard, lol. Of course bit 12 of the counter determines the output state, not bit 11. Hence, we've actually got 13-bit frequency resolution. Better than AY