vgmrips / vgmplay-legacy

VGM file command-line player and Winamp plugin.
http://vgmrips.net
224 stars 54 forks source link

Allow panning even for stereo-capable chips in in_vgm #49

Closed westonlast closed 5 years ago

westonlast commented 5 years ago

Many games only use mono, even though stereo was a feature of the chip, so I'd like to be able to configure my own panning. This would require a check box to first disable any panning that could already be in a song (per-chip), and then allow the user to override. There's already a volume adjustment slider in case certain panning configurations would introduce clipping for any particular song.

superctr commented 5 years ago

I assume you want per-channel panning here? Or the entire chip only?

westonlast commented 5 years ago

Per-channel.

superctr commented 5 years ago

Ok, looking at your commit message again, it seems that you want to really mask out writes to panning registers (for chips that use them) and replace it with your own values.

This approach would however require the custom panning values to be in the exact expected format of the sound chip. This is slightly problematic as some sound chips don't really have a panning register and use left/right volume values instead, or in other cases the panning may be logarithmic and not linear.

westonlast commented 5 years ago

I was thinking the panning would be implemented in the mixer. Chip-agnostic, only caring about any channels given.

superctr commented 5 years ago

That would probably cause performance issues as it means each chip will have to output a stereo stream for each voice. In the case of the OPL4, as it has 42 voices (24 PCM and 18 FM) and thus 84 total channels sent to the mixer. Moving all panning calculations to the mixer would also cause issues as each chip handles panning differently, some have a panpot register, some have separate left/right volume registers and some simply just have a toggle. Not to mention some effects like NukedOPN2's ladder effect which probably can't be emulated properly if each channel is split into its own stream.

westonlast commented 5 years ago

Each channel would be a mono stream. Chip panning would be disabled first in this theoretical feature. Stuff like NukedOPN2's ladder effect would have to be disabled, too, I guess. At least at first. ;)

superctr commented 5 years ago

Well, for now I suppose you can use Multidumper and then open the multitracked recordings in audacity to mess with the panning as much as you want.

ValleyBell commented 5 years ago

The way custom panning works currently is by modifying the specific sound cores.
→ requires moderate effort due to some modifications in the respective cores (which there are lots of)
(The only reason why it works at all with Maxim's SN76489 and EMU2413 is that I ported those sound cores over from Maxim's old in_vgm Winamp plugin and they already had those features patched in.)

Moving panning to the mixer would require major effort for each sound core, because you would need 2 separate rendering routines - one for "normal stereo" and one for "format for manual mixing".
I'm afraid the cost-benefit ratio is too low for be to care about it, as my spare time is a bit more limited these days.