Set volume of both sound chips

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Set volume of both sound chips

Post by Miquel » Thu Aug 25, 2016 3:32 pm

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)?
HELP. Spanish TVs are brain washing people to be hostile to me.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Set volume of both sound chips

Post by TmEE co.(TM) » Thu Aug 25, 2016 6:35 pm

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: Set volume of both sound chips

Post by Miquel » Sat Aug 27, 2016 12:08 am

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.
HELP. Spanish TVs are brain washing people to be hostile to me.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Set volume of both sound chips

Post by Sik » Sat Aug 27, 2016 4:07 am

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
Sik is pronounced as "seek", not as "sick".

Post Reply