Offline
FRANCE

Simple proof of concept that we can add the "SID" sound feature to a simple SN76489 PSG tone channel...
I have tested the Z80 Hblank interrupt and use it as a Timer to write Volume data to the PSG register at audio rate...
As far as the pitch resolution goes (HBlank is nearly 64µs) we can synchronize the Tone period in near 1 useful octave range for NTSC or PAL and 2 octave for a discrete down clocked SN76489.
Or we can also use the Timer waveform alone to play below the 10bit frequency limitation of the PSG (109Hz for NTSC, 108 for PAL)
As for any clocked frequency method the pitch resolution increase as you increase the wave period. good for bass!

Anyway, this feature will be available on my upcoming Super PSG Vsti smile

Here is a test on emulator then on the Sega Megadrive PSG:
Only 1 channel is used.

Last edited by Aly James (Nov 19, 2013 5:13 pm)

Offline
Dallas, Texas

What cart was used for the megadrive?

Offline
.FILTHadelphia

Whoa. Awesome.

Are you selling this separately from FMdrive?

Offline
Nomad's Land

Absolutely awesome. Congratulations.

Offline
Tokyo, Japan

Didn't hally do something similar to this on master system?

Absolutely brilliant t work btw!

Offline
FRANCE
defiantsystems wrote:

Whoa. Awesome.

Are you selling this separately from FMdrive?

It is a totally different/separate Vsti totally dedicated to the PSG smile so yeah, should be out before the end of September!

Basically the main features of SPSG are:
SN76489 Sega Master System/ Genesis Version Emulation

-NO aliasing on the tone channels at high frequencies!
-Master clock setting : NTSC, PAL, 1Mhz, 4Mhz or anything in between (can be modulated in realtime)
-1 to 64 Steps envelope from Amplitude and Pitch, with delay, clock speed, loop, ping pong etc...
-2 modes arpegiattor (programmable or MIDI controlled)
-8 memory slots per envelope, arp and advanced waveforms than can be internaly sequenced at any available clock speed
-Z80 Timer Pulse Width emulation (SID) Sound or custom waveforms
-Optional AY3-8910 Envelope Buzzers (not available on the real chip but nice to have smile )
-PWM sample import/play
-Each envelope clock master speed can be syncronized or independent
-Noise channel LFSR extended feature: tweakable in realtime (tapped bit masks and feedback bit)
etc...
A PSG envelope logging feature might be added allowing to save the envelope instrument data to later import it in some MD music engine like echo for example...
Works with GenMDM however very high speed are not supported and the current Volume data in GenMDM PSG is tied to velocity only witch is not desirable in this case(might be better with Scale's SMS interface as there is a separate CC for volume..)
EDIT: GenMDM accept CC11 as Volume Control! tested and works super fine smile
However I will try to make something out of his open source SN76489 interface at some point in the future to support Timer stuff smile

That is for the main features, I will make a proper thread when it is out anyway.
Snippet, here of the Timer PWM feature

Last edited by Aly James (Sep 15, 2013 1:14 am)

Offline
FRANCE
TylerBarnes wrote:

What cart was used for the megadrive?

Not sure what you mean...but if you want to know what is running on the MD, it is a custom made rom I made for testing the timer feature, loaded in an everdrive card smile

Offline
Dallas, Texas

Everdrive, cool. Yeah that's all I meant. I was inquiring as to the kinda flashcart/customcart you were using for it..

Offline

This is very cool, so does GENMDM already support this sort of HBlank trick to reproduce this effect?

Last edited by metropeak (Sep 13, 2013 6:18 pm)

Offline
Earth

Amazeful work. Man that UI is smooth cool.

Offline
Underneath Sega documentation

So good to see that there are more people taking some serious interest in the capabilities of the MD in terms of sound. Been a bit lonely in the MD scene to see everyone using the same drivers and never try new stuff with the hardware, and I applaud your efforts.

I am curious, though: Why did you choose to use the HBlank for timing? Could instead use one of the YM2612's internal timers to provide a much more flexible berth for timing than the HBlank's rigid timing.

Last edited by LazloPsylus (Sep 13, 2013 8:12 pm)

Offline
Sweeeeeeden

I'm working on... something like this... for the Gameboy and I'm wondering if there aren't more flexible timers than HBlank on the MD Z80? Also, does the HBlank interrupt keep triggering during the VBlank period?

Offline
FRANCE
metropeak wrote:

This is very cool, so does GENMDM already support this sort of HBlank trick to reproduce this effect?

AFAIK, no.
but I think it could be implemented directly in the firmware smile
You can still make this kind of PWM with two PSG channel slightly detuned.

Offline
FRANCE
LazloPsylus wrote:

So good to see that there are more people taking some serious interest in the capabilities of the MD in terms of sound. Been a bit lonely in the MD scene to see everyone using the same drivers and never try new stuff with the hardware, and I applaud your efforts.

I am curious, though: Why did you choose to use the HBlank for timing? Could instead use one of the YM2612's internal timers to provide a much more flexible berth for timing than the HBlank's rigid timing.

First reason is because I tried to emulate the Master System features smile
However AFAIK, YM2612 Timers do not cause interrupts and we must check the counting elsewhere.
Timer A is the only one fast enough, it is 10bits and goes as fast as 18µs at 1111111111 but only goes down to 54Hz at 0000000000
slightly better then Hblank 64µs.
Timer A can also be in use by the CSM mode witch screw up the ability to have both.

Keep in mind that my aim here was to check what could be done on the real thing before integrating the feature in my Super PSG Vsti.
I am in no way an expert on the Z80 side and if someone got a better way to increase the artificial waveform pitch resolution, let me know smile

Offline
FRANCE
nitro2k01 wrote:

I'm working on... something like this... for the Gameboy and I'm wondering if there aren't more flexible timers than HBlank on the MD Z80? Also, does the HBlank interrupt keep triggering during the VBlank period?

VBlank happens 50 times per second (for PAL)
HBlank happens 15625 times per second
So it should keep triggering

I have read that the Master System often use the Interrupt mode 1, meaning that when an interrupt occurs the Z80's PC register is set to $0038.
As you get only one entry, you have to choose whether you want VBlank or Hblank...

Offline
Underneath Sega documentation

Just making sure. As a guy working on a sound driver (or three) and enjoys doing research on the MD and co., I've been more than a little surprised at how few people are even remotely familiar with the YM2612's timers, so I'm glad you're familiar with them and at least made an informed design decision.

I'll probably chime in again if I find something useful to contribute. Otherwise, good luck on your project.