Jump to content
IGNORED

New bass approach rediscovered in old song


R0ger

Recommended Posts

So PG just discovered interesting song. Atari song. Old one. 1994.

 

 

And as you might notice, the bass is especially good. Perfectly in tune. Super deep. With perfectly controlled PWM.

And we even have the scope. It's clearly PWM rectangle. So distortion A, 2 channels, filters, 15kHz, and some pretty good skills in controlling it, right ?

But wait ! The other two channels are A too. Nice rectangles. And not 15kHz. They are high notes with vibratos, you can't do that in 15kHz.

So .. how ?

 

Here is SAP converted to xex (credits again go to PG, whose skills in controlling winamp are unmatched, at least by me)

Mental_Age_Demo.xex

 

Little debugging in Altirra showed the secret. It's completely new approach, at least for me.

 

It is normal 64kHz mode. AUDCTL is not touched after the music starts.

Channels 0 and 1 are perfectly normal, updated in VBI.

Channels 3 and 4 however, are joined in 16bit counter. But it is not used to generate sound directly. It is used to generate IRQ.

And the frequency is not set to fixed frequency, like for example in Hardbass approach. It is set exactly for the next edge, and the frequency is changed after each edge.

 

Example: we want to play 100Hz with 40/60 pulse width. That means there is up edge, 0.004s pause, down edge, 0.006s pause. And again.

So as I said, the channel 3+4 are set to trigger IRQ.

 

.. CPU does other stuff ..

IRQ fires. We set the output of channel 3 to direct mode volume 8 (up edge). We set the frequency in channels 3+4 to 1/0.004s. RTI.

.. CPU does other stuff ..

IRQ fires. We set the output of channel 3 to direct mode volume 0 (down edge). We set the frequency in channels 3+4 to 1/0.006s. RTI.

.. CPU does other stuff ..

 

And again, and again.

 

The frequencies are updated in VBI I guess. Didn't dig too deep into that. But the main principle is clear.

 

So let's see the advantages:

- perfect 16bit frequency control, also allowing super deep tones

- PWM possible with basically no limitation

- 2 channels needed with no limitation imposed on other channels

- small CPU usage. It's only used on edges. So for common 100Hz bass the small piece of code is called 4 times per frame.

 

And there are of course disadvantages

- IRQ can and will collide with DLIs.

- suitable only for low frequencies, ie. bass. CPU load rises with frequency.

- it's not easily patched into RMT, nor any other tracker I know of.

 

So .. have you hear about this one ? If so, why the hell didn't nobody tell me ? :-D

 

  • Like 12
  • Thanks 4
Link to comment
Share on other sites

It's a little explored technique - variable pulse for music is usually done at lower frequencies like 70-500 Hz which can be ideal for timer IRQs that only need to change a couple of registers.

The required timer frequency of course is twice the note frequency but doing such trivial operations 140 to 1000 times a second isn't a lot of work, there is still plenty of time to run a tracker and even medium comlex game logic and graphics rendering.

  • Like 1
Link to comment
Share on other sites

Because of this feature I was always thinking that POKEY wasn't created to suit any 8 Bit computer. POKEY works well with a CPU as a driver. A 2nd CPU in an Arcade machine driving POKEY, some high tone filter behind it, to get real great sound experience back in the 70s. In the Atari , as a main sound device, well... you know the limits.

Link to comment
Share on other sites

Our SID players didn't have PW support for bass, but we did use 16bit bass in most emulations.

The other similarity is that only 2x 8-bit channels were left for everything else in these tunes and 8-bit channels aren't enough for accurate lead frequencies.

So that's why you hear similarities I presume. In any case PW support wasn't there in our demos.

Edited by Sandor / HARD
fixed typo
Link to comment
Share on other sites

2 minutes ago, Sandor / HARD said:

Our SID players didn't have PW support for bass, but we did you 16bit bass in most emulations.

The other similarity is that only 2x 8-bit channels were left for everything else in these tunes and 8-bit channels aren't enough for accurate lead frequencies.

So that's why you hear similarities I presume. In any case PW support wasn't there in our demos.

 

Obviously. The PW support costs a lot CPU time, and always different, depending on the played frequency. Not useful for synchronized demo screens.

 

Link to comment
Share on other sites

1 minute ago, emkay said:

 

Obviously. The PW support costs a lot CPU time, and always different, depending on the played frequency. Not useful for synchronized demo screens.

 

I'm not sure costs a lot of CPU time (didn't make calculations), but given that this approach here makes IRQs kick in at virtually random points in your screen, that'd be very challenging to juggle with.

Link to comment
Share on other sites

That sounds fantastic, I thought it was stereo at first too, listening through my surround system. I bet some wonderful stuff could be done with this technique and Stereo Pokey's...

  • Like 1
Link to comment
Share on other sites

About the Demo itself. When I saw it back then, I thought "now they got the right direction for good POKEY music" .... but it had been a dead end, as it seems.

For the "final" Version, one expected to have that great sound in the whole game. But then the "enhanced" Version brought back reality.

That sound could clearly be used in Antic D, and 3D scenes that don't run on every frame.

Link to comment
Share on other sites

I got another idea. This demo uses 2 channels to generate IRQ. For precision, but mostly for range.

What if we used just one channel ? Sure 64kHz/256 is about 250Hz. That's too high for real bass.

But what if we ignore every second, or every 4th IRQ ? That will give us 2 more octaves, with no penalty on precision. And we know the bottom octave of standard A distortion on 64kHz is precise enough. We would get about 10 IRQs per frame, that's the price. But we would gain another channel.

  • Like 5
Link to comment
Share on other sites

16 hours ago, Gunstar said:

That sounds fantastic, I thought it was stereo at first too, listening through my surround system. I bet some wonderful stuff could be done with this technique and Stereo Pokey's...

 

Which is exactly why I lobbied for the second IRQ line to be connected on the Atari 1088XEL/XLD :)

  • Like 2
Link to comment
Share on other sites

Some addition here:

If you have a look at the tune, the 16 bit used for PW basses and high tones. The high tones would do better using "filter" . In short: Even this can be put much further in musically quality. Or , to use the PW only for shorter periods, when high precision timing is needed. There are enough options, to simulate sound without big CPU usage.

 

Remember?

 

 

 

50Hz programming. Deep Bass drum and modulation features...  4 channel btw.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...