Friday, July 31, 2009

Sega Master System "Bass Mode" and More Samples

Today I've added two more things to the Sega Master System Interface - a bass mode for channel 3 and more / clearer samples.

Bass Channel
I've added what I'm calling "bass mode" for the third channel.

To understand what this means, I'll briefly explain a little bit about the SN76489 noise generator channel. Basically, the noise generator either gets its frequency either from a division of the master clock, or its clocked directly from the frequency generated by pulse channel three of the SN76489. In other words, it doesn't have its own frequency divider that is set by a data register.

The cool thing about controlling the noise channel from pulse channel 3 is that the output noise frequency is octaves lower than the current pulse three frequency. By changing the frequency of channel three whilst setting the volume of channel four (noise), low bass lines can be written.

The Sega Master System MIDI interface can be set to "bass mode" for channel three via a MIDI CC message. When receiving note data in this mode, it will write data to the frequency of channel three, yet it will control the volume of channel four. Previously, it was possible to do this with my interface, but it was a little cumbersome, having to write notes with a velocity less than 8 on channel three for the pitch, and notes with a velocity greater than 7 on channel four to set the volume of a bass line.

What the bass mode does, is it combines these actions in an easy to use fashion. It's something that I should have implemented a while ago (and I have been meaning to), because it makes things so much easier.

More / Clearer Samples
I've also added more samples to the interface, and the ones that were in there already I've made clearer. There are now twenty samples, including additional kicks and snares, cymbals, bongo and conga hits.

The samples have been made clearer by normalising to 0dB. Previously, I had been normalising to 0dB and then adding between 4.5 and 6 dB of gain, resulting in quite a bit of distortion.

I thought that treating the samples with that much gain would be acceptable - after all, when I make custom LSDJ kits, I always normalise to +6dB, when I make samples for use with Sega Mega Drive I normalise to +8dB and for Atari 2600 it was +6 dB.

It's interesting that I don't like a high-gain outcome when played through a Sega Master System - is there something different about the way that the SN76489 outputs the samples that results in a different sound? Or is it that I have certain expectations of the way that a Sega Master System should sound? I mean, when dealing with Atari 2600 there is of course a perception of low-bit depth when it comes to pitch and to some degree timbre control, so perhaps I expect a distorted result from a 2600 which I would not deem acceptable for a Sega Master System. Perhaps it is a combination of memory, perception and sound reproduction via a method that was not meant for that purpose.

Anyway, the samples sounds acceptable when normalised to 0dB but they are of course very quiet when compared to the rest of the SN76489 PSG. I have added a function whereby all velocities are divided by a third if the sample mode is enabled, thereby balancing out the relative volume levels.

I am hoping that a direct output from the VDP chip will allow for a greater signal to noise ratio for sample playback mode.

Audio Example
Listen to an audio example of what I'm talking about with all of this here.

Video Example

To be the first to know about a release date, please join the Google Announcement Group here:


Rei Yano said...

would it be possible to allow people to adjust the gain on samples? is that even useful?

Sebastian Tomczak said...


Well, the samples are actually set in the ROM, and keep in mind that the samples are 4 bits, so the quality is very low.

Trust me, with this set up you wouldn't want it to be louder at all - it distorts and sounds really terrible, without too much volume gained.

- Seb

Steve said...

that's a nice feature. I guess I'll have to play with it before I understand exactly how it works. Cool stuff =)

Maxim said...

If you're treating a single channel's output as PCM then the main problem is that it's non-linear - successive volume levels are 0.79432823 of the previous value. So this will over-accentuate the upper region of the wave (and under-accentuate the lower part). This will therefore also accentuate any "overdriven" clipped waveform, and at the same time shrink the apparent dynamic range of the wave.

Options available for more volume include:

- PWM (needs more CPU, mostly)
- map your samples onto the logarithmic volume scale
- throw more channels at it (many games used all three)

The first two also get you linear response (sort of).

Sebastian Tomczak said...

Hi Maxim,
The use of all three channels for sample playback is not an option for this - I still need to use the other two channels, as I'm sure you can appreciate.

Epic Jefferson said...

how is it that you where able to add a function that divides the velocities by a third if the sample mode is enabled? that seems like something done using max for live, or at least reprogramming somehow.

I like your projects, but would like to hear you combine more samples from your different sources (including the arduino as a controller), ableton is a great tool for that. Also, it would be very interesting indeed to hear more complex rhythms and harmonies using these sources.

We could collaborate if you're interested.

Sebastian Tomczak said...

I like your projects, but would like to hear you combine more samples from your different sources (including the arduino as a controller), ableton is a great tool for that. Also, it would be very interesting indeed to hear more complex rhythms and harmonies using these sources.

- I agree. These are just demos, they are not supposed to be particularly complex examples.

ufo_61 said...

what apeears on screen when the interface is in use? cos ive got a circuit bent genesis 1 i use to make glitchy vsuals for wen i do sets, its got some of the video chip's pins wired up to a ten point patchbay n a coupla pots. It would be sick if i could use the interface (thru a master system>genesis converter) and also make the visuals at the same time on the same machine. also you going to be selling this interface? and if so would u ship to the uk?