Page 1 of 1

Set volume of both sound chips

Posted: Thu Aug 25, 2016 3:32 pm
by Miquel
I'm working on a game and right now I have two pieces of code: one controls FM music and it runs on TMF modules, done throught TMFmaker and based on Shiru's code to run tfd files. The other controls PSG sound done with Deflemask, and converted to VGM and then to PSG, the code that runs it is done by me (mostly because I don't find any done for the 68000).

What I'm wondering is if there is a way of controlling the volume of those chips at once, or a controlling volume of both chips independently. I know that you can control every channel volume of PSG chip, so I can introduce some code to reduce proportionality each channel volume, if there is no general approach that will do for PSG sound. But I have no idea if there is a master volume for FM chip or I should do the same.

Once you have both implementations running there is a way to control volume of music (FM) and sound (PSG)?

Re: Set volume of both sound chips

Posted: Thu Aug 25, 2016 6:35 pm
by TmEE co.(TM)
There's no master volume anywhere, so you got to play with the volume registers on PSG and TL register on YM.
For YM you have to keep track of current algorithm and adjust TL equally on all output operators. One step is 0.75db on YM and 2db on PSG.

Re: Set volume of both sound chips

Posted: Sat Aug 27, 2016 12:08 am
by Miquel
TmEE co.(TM) wrote:For YM you have to keep track of current algorithm and adjust TL equally on all output operators.
If I have understood you well, that is like simulating the whole chip, it will involve too much computing. Maybe it will be sort of ok if the next note (entry) on each channel will be readjusted in volume instead of current evolution of previous note (Forgive me for complete ignorance of musical language). It will introduce some delay but at least is doable. Please tell me if I am wrong.

Re: Set volume of both sound chips

Posted: Sat Aug 27, 2016 4:07 am
by Sik
Huh, no. The "algorithm" is the arrangement of the operators in a channel and there are only eight possible combinations, and the output operators are those at the end of the chain (i.e. don't feed another operator). That's what he was talking about.

Keeping track of the current algorithm isn't hard, just save it whenever an instrument is loaded into the channel =P