Sound analyzer
Moderator: Stef
-
- Very interested
- Posts: 86
- Joined: Fri Sep 25, 2015 4:16 pm
Re: Sound analyzer
If you can read the digital output data, you're still going to have to implement a fast-fourier transform and generate visuals with that. You would be better off reading the registers of the YM2612, and reading the frequency and multipliers of all modulators to determine mathematically the response of different frequencies.
Re: Sound analyzer
I would at least make an analysis of whether there is a signal from generator's or not.
at least make any reaction.
I can't do it at this moment.
I do not know which parameter is to assign a function.
YM2612_read (const u16 port)
port=0,1,2,3 - value return 0
at least make any reaction.
I can't do it at this moment.
I do not know which parameter is to assign a function.
YM2612_read (const u16 port)
port=0,1,2,3 - value return 0
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Sound analyzer
I wrote a XGM player displaying chip state (YM2612 and PSG), the project is in standby currently as i want to deliver a new SGDK version soon but i will bring it back. Still it just display channel / operator state and not directly the output waveform (nor the frequency spectrum which require FFT calculation).
If you really want the sample output level it seems you can read it from the YM2612 using the test register :
viewtopic.php?f=24&t=386&start=705
If you really want the sample output level it seems you can read it from the YM2612 using the test register :
viewtopic.php?f=24&t=386&start=705
Re: Sound analyzer
Not necessary frequency spectrum.
at least something.
even banal check for PSG or FM signal.
https://youtu.be/b-bkMvSSII0?t=281
I just want to synchronize animation with music
at least something.
even banal check for PSG or FM signal.
https://youtu.be/b-bkMvSSII0?t=281
I just want to synchronize animation with music
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Sound analyzer
So maybe trying to read the YM2612 sample out from test register or you need to "simulate" YM state to know its current output level (i'm using the second solution in my XGM player).
Re: Sound analyzer
But I do not know how to read registers.Stef wrote:So maybe trying to read the YM2612 sample out from test register or you need to "simulate" YM state to know its current output level (i'm using the second solution in my XGM player).
What function do it?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Sound analyzer
You have to use YM2612_read(0) as it seems than others ports always return 0.
Then you have to set some special value in test register $21, you can see the description here :
http://www.atkinsoft.com/datasheets/ym2612.txt
Basically you should do something like that :
Note that it won't work on emulator, only on real hardware... I didn't tested the code but it should be close to that :p
Then you have to set some special value in test register $21, you can see the description here :
http://www.atkinsoft.com/datasheets/ym2612.txt
Basically you should do something like that :
Code: Select all
u16 output;
YM2612_write(0, 0x21);
// enable serial data read from status register
YM2612_write(1, 0x40);
// read LSB
output = YM2612_read(0);
YM2612_write(1, 0xC0);
// read MSB
output |= YM2612_read(0) << 8;
// restore default state
YM2612_write(1, 0x00);
Re: Sound analyzer
HI stef,
Have you used your snippet code in your XGM/VGM player demo ?
Can you explain or make a simple code for illustrate ?
Thx
Have you used your snippet code in your XGM/VGM player demo ?
Can you explain or make a simple code for illustrate ?
Thx
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Sound analyzer
No i didn't used that as this method only give you current output level from the YM2612 chip. Also XGM is played from Z80 so unfortunately the 68000 is not aware of the YM2612 and PSG instant state as it does not update them itself. The only thing the 68000 control is how many XGM frame has been done so basically what i'm doing in the XGM player is the following:
- Request Z80 to compute a frame of XGM music.
- Parse the next XGM frame to update a virtual YM2612 (containing current state of the YM chip), do the same with a virtual PSG.
- Update envelop of each YM2612 channel for 1 frame length
- Use current envelop levels and chip states from the virtual YM2612 and PSG to display chips status at bottom.
So definitely not a straightforward method but i don't have the choice if you want an accurate chip state (specially for the YM2612 envelop level).
- Request Z80 to compute a frame of XGM music.
- Parse the next XGM frame to update a virtual YM2612 (containing current state of the YM chip), do the same with a virtual PSG.
- Update envelop of each YM2612 channel for 1 frame length
- Use current envelop levels and chip states from the virtual YM2612 and PSG to display chips status at bottom.
So definitely not a straightforward method but i don't have the choice if you want an accurate chip state (specially for the YM2612 envelop level).