Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vgm_ptch strip command does not strip individual channels #19

Closed
meyertime opened this issue Apr 1, 2022 · 4 comments
Closed

vgm_ptch strip command does not strip individual channels #19

meyertime opened this issue Apr 1, 2022 · 4 comments

Comments

@meyertime
Copy link
Contributor

Hi, first of all, thanks for these tools! I thought I found the holy grail when I saw that vgm_ptch has a strip command to filter out specific chips and channels. However, when I tried to use it, it will filter out the entire chip, but not individual channels. The .vgm files I am using are for the Genesis, so they have SN76496 and YM2612 data.

Is channel stripping implemented for those chips? If not, could you point me in the right direction in the code?

Ok, so since writing this, I see that vgm_ptch -striplist says that YM2612 does not support channel stripping, but it doesn't say that about SN76496, and when I try it, it doesn't work for either chip. But in any case, if you can offer any insight, it would help me try to add support.

I'm trying to produce a .vgm file for each channel so that I can play them individually on a real Genesis with a flash cartridge and a VGM player ROM. I have already accomplished this with vgm2wav, which was super helpful, but now I want to record it from the real hardware.

@ValleyBell
Copy link
Contributor

ValleyBell commented Apr 1, 2022

The channel stripping code is in chip_strp.c.

sn76496_write handles SN76496 channels ... aaand, actually [the code is broken and only "channel 0" is working.
This bit shift should be >>5 instead of >>1.

ym2612_write handles YM2612 stripping and currently is dummied out using a return true. The rest of the code is leftover stuff from vgm_cmp (chip_cmp.c).
In order to add per-channel stripping support, you need to determine the channel for each register and return false for everything that needs to be trimmed off.

@meyertime
Copy link
Contributor Author

Thanks @ValleyBell, this is really helpful! Do you know if there is any documentation or code I could refer to in order to learn the instructions for the YM2612 chip?

@ValleyBell
Copy link
Contributor

You could look at the YM2612 manual, which should be decent enough to get an idea of how the chip works in general.
vgm2txt (chiptext.c) also has some YM2612 code, which you could use to get an idea of how the register <-> channel assignments work.

@ValleyBell
Copy link
Contributor

solved by #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants