126 (edited by Shiru 2023-01-10 12:48:05)

Re: next gen engine ideas

The idea above gives this simple PWM modulation type for the 16-bit adders system. It takes two 16-bit accumulators but a single adder:

    ld hl,0 ;acc1
    ld de,0 ;acc2
    ld bc,100 ;adder
    
loop

    add hl,bc
    ld a,h
    inc de
    cp d
    sbc a,a
    and 16
    out (#fe),a

    jp loop
website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

127

Re: next gen engine ideas

And if we just drop xor N right before cp d, it gives a quite interesting modulation control!

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

128

Re: next gen engine ideas

Named the second idea ModPhase, implemented both ideas as experimental sub-engines inside the Ear Shaver EX engine - because it blends pretty well with the design.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

129

Re: next gen engine ideas

Nom nom, that CrossPhase has a very satisfying sound. Great discovery.

I've used the idea behind ModPhase (without the xor modulation) a couple of places, BetaPhase for example. The good thing is that it can be done in the outer loop, which also allows for variable speed (by adding a variable amount to DE). In a pinch, one could even abuse the outer length counter for this, hehe.

130 (edited by Shiru 2023-01-13 22:57:32)

Re: next gen engine ideas

Some more cool finds for Phaser4 (currently in development) specifically:

Regular XOR/OR/AND modes in Phaser3 were:

    add hl,bc
    ld a,h
    add ix,sp
    xor/and/or ixh
    rla
    sbc a,a
    and 16
    out (#fe),a

Now, instead of xor ixh:rla we can do more by changing just two bytes - keeping the ix/iy prefix in place:

cp ixh:nop - the CrossPhase
adc a,ixh:add a,h - fat octaving noisy timbre
xor ixh:sub h - more noise in a similar timbre
xor ixh:sub l - very noisy yet still tonal timbre
xor ixl:sub h - periodic noise of one kind
xor ixl:sub l - periodic noise of another kind

And another cool thing is that Phaser3 unrolls the sound loop 4 times for pseudo volume effects. And we're not obliged to use the same 'algorithm' in each iteration, we can mix in any 4, getting even more weird timbres.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

131

Re: next gen engine ideas

Wahoo, now you're on a roll!

Excuse me for having a brain freeze right now, but what is the purpose of the rla in normal phasing mode?

Some tangentially related, inspirational reading: Grayscale on 1-bit LCDs. Would be interesting to try and apply some of the more advanced techniques to 1-bit music. Iirc perevalovds was using error diffusion of sorts for 1-bit sampling.

132 (edited by Shiru 2023-01-14 00:13:41)

Re: next gen engine ideas

RLA gets the topmost bit into the Carry after a logic operation XOR/OR/AND that normally does not affect Carry. Honestly, I forgot that I ever invented this method (perhaps borrowed it from you?).

Oh yeah, dithering applied to the 1-bit sound synthesis may bring some quite interesting results! Cool idea, never thought about that.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

133

Re: next gen engine ideas

Ah, yes, of course. I'm clearly getting senile.

Don't think it was me who invented the rla trick. I'd be a cheap bastard and omit both the rla and the sbc a,a. Doing that could potentially open up a few more possibilities here, but with the unrolled loop, modifying 3 bytes might not be worth it. Even without that, I've got a feeling there are more possibilities hiding in those 2 bytes. I just don't see them right now. #dd 0 0 would give a pin pulse, of course, but that's probably not very useful in this setup. You could also swap bc and sp. Then #dd 0, add b/c would give duty control for example, but we already have that via phase offset, of course.

Re: next gen engine ideas

big_smile

From the article Grayscale on 1-bit LCDs:

"To be honest, I didn’t come to this stage by accident, I have worked with delta-sigma modulators and noise shapers in audio applications before so I know these, and I have been wondering about if they could be applied to driving these LCDs for a long time."

135

Re: next gen engine ideas

Ha, I missed that gem wink

136

Re: next gen engine ideas

Found a new el-cheapo PRNG/noise generator. It's a bit slower than the usual add hl,de; rlc h variations, but needs only 1 register pair instead of 2. It also sounds a bit different.

  ld a,MAGIC_NUM
  add a,e
  rrca
  xor d
  ld e,a
  inc d

For MAGIC_NUM, most values do pretty much the same, except some that are straight metallic beeps and a few that sound more rumbly.
test.tap plays through all possible values.

The main downside is that we can't smc-hotswap this with regular tone channel code. What could work though is to hotswap it on an 8-bit divider and use a separate 8-bit pre-scale on this. Pre-scale would pitch the noise as well. Unfortunately the perceived pitch of the noise is quite a bit lower than using add hl,de; rlc h. Not sure if it's actually much of an improvement over just lazily reading from ROM:

  ld a,(de)
  inc de
Post's attachments

test.tap 197 b, 4 downloads since 2023-10-23 

You don't have the permssions to download the attachments of this post.