|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
![]() |
Author | Message |
---|---|
|
Tomy's Sega PSG SN76489 Music + Tutorial
![]() |
Sega PSG SN76489 tutorial by Tomy
--- --- --- --- --- --- --- --- --- --- --- --- --- 4-channel soundchip: CH1: 50% square, 1024 frequencies (108Hz - 110840Hz), 16 volume levels CH2: 50% square, 1024 frequencies (108Hz - 110840Hz), 16 volume levels CH3: 50% square, 1024 frequencies (108Hz - 110840Hz), 16 volume levels You can use CH4 freely with the 3 preset frequencies provided: CH4: 6.25% square / White noise, 3 frequencies (108Hz, 216Hz & 434Hz), 16 volume levels When following CH3 frequency data it will unlock all the possible frequencies: CH4: 6.25% square / White noise, 1024 frequencies (7Hz - 6928Hz), 16 volume levels Note that these are all PAL values as that's what I work with. With this tutorial I want to share all the possible tricks I've found working with this soundchip. A guide to the "Tomy sound", if there is such a thing? I personally like to think of the Sega PSG as a 3 channel soundchip, sacrificing the third channel completely to make the fourth channel capable of so much more. So for me it's 2 channels of 50% squares and 1 channel of 6.25% squares / white noise without any restrictions. Let's begin with the 50% squares, I tried to think about what I like to do with them: - Melodic leads. - Echo, play around with the delay and volume to get a different style of echo. Detune the echo from the main melody, I like to detune it down by 1 step. This makes it so that they never clash when playing the same note, but instead produce a soft phasing which is more pleasant. - Snare low-end. Mix with white noise to get a fuller snare sound. - Volume pluck. Make it louder at the very beginning of a note then quickly drop down to the desired volume to hold / decay. - Note cut off. Have enough time before a new note is played. This is completely how you prefer it to sound, but I like the subtle staccato it creates. - Take advantage of any silent gaps. The note cut offs and pauses in melody create silent parts. No matter if there is 1 frame or 50 frames of silence, you can make use of it. Let's say both channels are playing, if there is a silence in the first channel I will copy whatever the second channel is playing at that moment there and make sure it is detuned from anything else playing at the same time and even more quiet on volume than the echoes. This creates a tiny subtle phasing effect. The more silent gaps a melody has the more you can utilize this trick to get depth to the sound far from what a simple melody with an echo sounds. - Variable vibrato rate. When a new note is on, I let it play for a short amount of time without vibrato then I add vibrato and the longer the note is held the faster the vibrato rate gets. - Tremolo to fine control volume. For me when part of a melody goes higher it can easily start sounding piercing. If I reduce the volume by 1 step it can be too much, but instead I alter between that and the original volume to fake a volume between the 2 values. Remember to leave gaps for the volume value changes so as to not sound too distorted. - Mixing the 2 channels together. You can get a different flavour to the sound playing the same note an octave apart for example. I like to play the same note and then detune the other channel by 1 or more steps. It creates a pleasing phasing effect, similar to pulse-width modulation. Alter the volume too between the channels, at the same volume the effect is the most powerful and if you reduce the volume of the other channel the effect gets more subtle. 6.25% square: - Bassline. - Volume pluck. - Variable volume. I like to use octave basslines but this should work with any kind of bassline. What I do is play the low notes at a higher volume than the high notes. High 6.25% squares are not as pleasant as the lower ones for me, this way I don't have to make the whole bassline quieter, losing some of it's power. White noise: - Drums - Attack sound for bassline. You can insert 1 frame of white noise at the beginning of a note and then immediately change it to 6.25% square. This gives basslines more presence. - Bass drum. You can get a powerful kick with the white noise. The trick is in combining different frequencies together. Put it simply if we can afford 3 frames for the bassdrum you experiment and mix together 3 frequencies to create the sound. When you change the frequency of a sound it will continue from the old value to the new one. It doesn't reset and start over. My bass drums have the attack part in higher frequency to give it that texture and then it changes to a lower one that hits that 50Hz - 60Hz area. This was the one discovery about the Sega PSG I'm most proud of - to get actual bass drums out of it. You really need to leave some power in volume for it though, it's the only instrument in my music that is at full volume. - Snare drum. Possible to do with white noise only. Same technique as with the bass drum. The way I do it is so that the first frame is silent, giving the sound the desired frequency I want it to start from, then change to low-end for the body and then quickly to high-end to give it that brightness. - Hi-hat. Usually when 6.25% square is used simultaneously there is only time for 1 frame hi-hats. The noise with SMS PSG tends to have a percussive attack so these 1 frame instruments easily sound piercing. What I do is add one frame prior to that frame where you want the sound. Make that first frame a silent one and then push up the volume on the second frame. It gets rid of the percussive part of the sound. Here's something cool: Make it so that the actual sound part (second frame) is a certain frequency you want and then change the silent frame frequency, the resulting sound will vary depending on the frequency the sound will start from. As it will "blend" from the first frame to the second. This way you can get so many subtle variations to these sounds. The Sega PSG initial frequency when powered on is the highest frequency it can produce. It means that it will be the "starting frequency" of anything that comes after it - as in the first sound any channel makes. This affects most noticeably CH4. If the first sound is a bassdrum, it won't sound like it's supposed to because the frequency has to quickly come down to where I want it to start from. It messes up the first sound in this situation. I insert a silent frame at the beginning of my track where I duplicate the first frame / frequency of the bassdrum but silenced so that the PSG can start it from the frequency it's supposed to start from. Regarding hardware many consoles suffer from flattened volume output of the higher levels. The 3 highest volume levels are more like a duplicate of the fourth highest level. These faulty levels really hurt making music with any bass in it, you really need that maximum volume, especially for the bass drum as mentioned before. Regarding trackers I'm surprised that for a chip seemingly so painfully simple, no tracker seems to get it just right. Mod2PSG2 messes up advanced noise drums, Deflemask is missing 6 high frequencies that are important for hi-hats and snare drums, VGM Music Maker is missing the highest 2 frequencies and has a very awkward editor for PSG, Sneventracker has all of the functionality but no proper VGM export making it not user-friendly. --- --- --- --- --- --- --- --- --- --- --- --- --- I've got requests to write a guide / tutorial for the Sega PSG, so here it finally is. It's done from my point of view. I use PAL timing, VGM Music Maker and record from hardware. I tried to think of every trick I use to help someone looking to make something more out of his / her PSG music. The soundchip is definitely not as bad as people claim it to be, for me it has an awesome raw ice-cold 8-bit sound. The noise channel is one of the best in my opinion, capable of so much. Please throw away those preset frequencies... ;) |
|
![]() ![]() ![]() |
|
|
![]() |
I also want to share my music in this thread. I record every channel individually from hardware and make oscilloscope view videos. Here's one I just uploaded:
I was smiling like a madman when I made that part from 1:09 onwards. Not something you'd expect from Master System? :D |
|
![]() ![]() ![]() |
|
|
![]() |
PURE GOLD! Thank you so much for sharing this! | |
![]() ![]() ![]() |
|
|
![]() |
Very nice, TomyS :) Thank you! | |
![]() ![]() |
|
|
![]() |
Brilliant. Thank you. | |
![]() ![]() |
|
|
![]() |
Technically, the white noise is a random number generator but it has a fixed sequence. Every time you write to the frequency control for the noise channel, the sequence is reset - but if you are letting it follow the frequency of tone channel 3, it won’t reset when that changes. The random number sequence acts a lot like a noise sample. This sequence/sample is more percussive at the start on the Sega PSG compared to the SN76489. By using this trick to play the first frame of noise silently, you effectively are able to seek within the sequence to skip the percussive start and pick the bit you want for the following frames. Very clever! | |
![]() ![]() ![]() |
|
|
![]() |
You said it well, this is exactly what I've found out by my own trial and error. If you have frames to spare you really can pick the exact part of the sequence you want in the following frames. I'm sure there are still surprises to be found from the Sega PSG, someone just needs to find the right frequencies. I personally searched through thousands of combinations for my drums.. it's crazy I know. I literally recorded all of them and went through them with a frequency analyzer to find the best bass drums and snare drums. I wanted to have real punch in my drums and they also needed to be "stable". Some other combinations sounded fine too but they were unstable when played together with all of the other instruments. What I have for bass drum for example now always hits 50Hz - 60Hz no matter what's happening around it. Thank you all very much. I'm happy if anyone finds some help from my tips. |
|
![]() ![]() ![]() |
|
|
![]() |
Follow-up question: how do you achieve that with an SN76489? It offers only a single pin for audio out, having already internally mixed the audio. Do you play them one at a time for video and then all together for audio? Re: the random noise generator, the LFSR for the standard version is well known; Sega's reimplementation is similar but uses a 16-bit shifter and taps bit 4 instead of bit 1. So: output_level = shifter & 1; int new_bit = (shifter & 1) ^ ((shifter >> 3) & 1); shifter = (shifter >> 1) | (new_bit << 15); |
|
![]() ![]() ![]() |
|
|
![]() |
I prepare 3 different VGM files for the 3 channels to be played back alone and record them for the video. Then I'll mix the full recording of the track with the video. |
|
![]() ![]() ![]() |
|
|
![]() |
Are the default tone values good enough for the 6.25% square Bass line?
Or do you need to tune (some of) them? And does it differ between trackers? |
|
![]() ![]() |
|
|
![]() |
I can only talk about VGM Music Maker tracker. Starting from around note C3 (note C6 in VGMMM) I feel the frequencies start to lose their precision so I tune some of the following higher notes differently. I listened by ear what sounds best for me. |
|
![]() ![]() ![]() |
|
|
![]() |
Do I remember it wrong or did you use Deflemask (and NTSC timing) for Weka Invaders' music? Was is because it better exports to VGM? |
|
![]() ![]() ![]() |
|
|
![]() |
I used VGM Music Maker, I've only ever tried out other trackers never finished any tracks in them. We had to work around the export problem by making the music in NTSC but exporting in PAL. VGMMM is a really powerful tracker for Sega FM + PSG, sadly there are some problems that prevent it from being perfect. |
|
![]() ![]() ![]() |
|
|
![]() |
Oh right I had totally forgot that! That's a nice workaround and -if the target is PSGlib- that will work as PSG files are frame sync'ed. |
|
![]() ![]() ![]() |
|
|
![]() |
Hi Tomy, Deflemask noob here, I'm finding this all very helpful! When you say 'frames', are you referring to horizontal rows within the tracker itself, or do mean individual vertical sections within the instrument design macro? Or neither? |
|
![]() ![]() |
|
|
![]() |
A frame is a TV screen frame, 1/60th or 1/50th of a second. One horizontal row can be any whole number of frames, you can set it freely and even change that while the tune is playing. Vertical sections within the instrument design should be frames too, anyway. |
|
![]() ![]() ![]() |
|
|
![]() |
I refer to the horizontal rows within the tracker at 50 / 60 frames per second tracking speed. But I think those vertical sections in Deflemask instrument design macro works just like that too. Should work the same defining a 2 frame (or vertical section) hihat instrument with the first part silent and second part audible, for example. |
|
![]() ![]() ![]() |
|
|
![]() |
Meidän Pieni Salaisuus (Our Little Secret). A slower moody piece.
Fallopian Tubes. Super hihat action. |
|
![]() ![]() ![]() |
|
|
![]() |
Out of slightly biased interest, what software are you using for the oscilloscope view videos? It seems to desync a bit on the low notes. Also, the sound capture seems very clean - how are you achieving that? (Having said that, I only ever captured over RF back in the day - which may explain a lot.) Are you also avoiding the volume level squashing? | |
![]() ![]() ![]() |
|
|
![]() |
I believe it's your program I'm using, SidWizPlus, hope it's OK? You're right seems to be little bit of desync on low notes, but it's not too bad. Some of the "wandering" notes are because I use quick white noise to make a percussive start on all bass notes. I record straight from the A/V Out using RCA cables. That's one thing people rarely mention, that the Master System has brilliant sound quality out of the box. It's crystal clear. Not like Mega Drive where the sound is so badly filtered that I can't believe it. Not sure if you mean the faulty volume levels on some SMS models or the clipping of the sound waves due to too high volume levels? I can answer both. I use an old model 1 Master System which has the correct volume levels and make full use of the sound capabilities. On faulty systems the bassdrum, snare and some of the bassline wouldn't be as audible. You'd lose the power of the drums / bass. Of course I also always take care that my recordings do not clip the waves. |
|
![]() ![]() ![]() |
|
|
![]() |
Happy my program is in use :) for the low frequency periodic noise you can increase the look ahead on the noise channel, you especially need this when frequencies go below the frame rate. This has the downside that it will show audio one frame early sometimes, but aesthetically I think it’s preferable.
I was referring to the system’s own clipping. I think especially when you have notes starting loud with a mid level sustain, you need the headroom, also as you say to boost the noise volume. |
|
![]() ![]() ![]() |
|
|
![]() |
Thanks Maxim! I uploaded another video with increased look ahead on the noise channel and it's great now. |
|
![]() ![]() ![]() |
|
|
![]() |
First Kiss. This is it. I gave everything I had on this track. There's so many different things going on at the same time that if I look at the tracker data I don't know what is what anymore.
|
|
![]() ![]() ![]() |
|
|
![]() |
Wow, I'm listening to these on my nice 2.1 speakers and I can't believe the kick drums have so much thump! *holds my SMS on my shoulder like a boombox* Awesome work! | |
![]() ![]() |
|
|
![]() |
Thanks Centrale, I love that. :) Uploaded a new one, Ice-Cool Hero. Relentlessly happy and fast. You might recognize this one from the Weka Invaders homebrew game. |
|
![]() ![]() ![]() |
|
|
![]() |
Sorry to drag this one up again --- nine months isn't necro, isn't it? --- but could you go into more detail as to precisely how the bass sounds work?
I'm working with a BBC Micro, which uses the same SN76489 sound chip, but configured a bit differently; it runs at 4MHz and the noise channel uses a 15-bit divider rather than a 16-bit one, which means that the periodic noise mode is constantly out of tune with the tone channels. (I made a tracker for it if anyone's interested. I can't post a link yet but search for 'cowlark btracker'.) Using a 1/50th of a second frame rate I've tried various combinations of a high and low noise plus various forms of tuned noise, and while I can get a decent low-pitched percussive hit I don't get anything like the sustained low bass drum sound that are in the videos. However, I don't have real hardware, and I have no idea whether this is an emulator limitation or I'm just doing it wrong; the BBC Micro doesn't have much of a music scene! |
|
![]() ![]() ![]() |
|
|
![]() |
The Sega PSG has a very different noise pattern to the SN76489 - more percussive, I’d say. Tomy’s tricks here are more to get past the percussive sound into the sustained hiss. | |
![]() ![]() ![]() |
|
|
![]() |
Maybe it's just that because the BBC Micro's chip is clocked faster, the low notes aren't as low...
My tracker actually runs with a 200Hz clock tick. I've experimented with rapidly modulating the volume to try and fake low frequency noise on top of the noise channel; changing the volume every two clock ticks should produce a 50Hz tone. This works, the result sounds kinda terrible, but it might be worth more experimenting... |
|
![]() ![]() ![]() |
|
|
![]() |
VGMPlay supports channel muting if you take a look at the .ini. You can also write to .wav in its settings too. |
|
![]() ![]() |
|
|
![]() |
They play the .vgm files on actual Master System hardware, no use of an emulator. |
|
![]() ![]() ![]() |
|
|
![]() |
This is an excellent overview. I've always enjoyed your tracks, and that snare above all else is so satisfying to listen to. I've been thinking about this "hiding the initial part of the noise" trick, and I'm sure a sound engine programmed to do this automatically would make it a lot more painless. But what if you try a noise reset on purpose? I've experimented with it before and it can produce some interesting electric sounds, kind of like the "looped" mode on the NES or Gameboy. | |
![]() ![]() ![]() |
|
|
![]() |
Asterix and the Great Rescue resets the noise on every frame, although I don't think it was on purpose...
|
|
![]() ![]() ![]() |
|
|
![]() |
It's been a long time since my last post but I've been working on some new tracks!
Some of the old videos I had to re-upload because they had a problem with desyncing on the low notes. The latest is Prenkkamylly (how can I translate this... Repeating Grinder?) The Sega PSG taking no prisoners. |
|
![]() ![]() ![]() |
|
|
![]() |
Dark Side Of Love.
|
|
![]() ![]() ![]() |
|
|
![]() |
Amazing :) | |
![]() ![]() ![]() |
![]() |