PCM player using SCC

صفحة 12/33
5 | 6 | 7 | 8 | 9 | 10 | 11 | | 13 | 14 | 15 | 16 | 17

بواسطة ARTRAG

Enlighted (6923)

صورة ARTRAG

23-10-2007, 00:12

Well it may be possible to do a more dynamic update knowing where to start doing the updating. I suppose if you update samples up til but exluding the currently played sample in each interrupt. Then just save the location where you should resume the update on the next int.

According to what I understand, you need to store the position of the last sample updated and start the next update from that position on (cyclically in the buffer).

Moreover you should also reset the ch4 by writing its frequency having set bit 5 in the deformation register.
In this way, next time you read ch4, you get again the number to fample to be written fro that position you stored.

بواسطة dvik

Prophet (2200)

صورة dvik

23-10-2007, 00:15

I would avoid resetting ch4. when you do you may loose some fractions of a sample and you'll get out of sync. I think its doable to do without resets. I'm working on it right now. I'll keep you posted.

بواسطة ARTRAG

Enlighted (6923)

صورة ARTRAG

23-10-2007, 00:26

Yes, you do not need to reset ch4: in this case you simply need to update from the last sample you wrote last time up to the current sample in ch4 (mode 32).

بواسطة ARTRAG

Enlighted (6923)

صورة ARTRAG

23-10-2007, 00:41

offtopic
I'm examining the output of your previous player, but I cannot see why is needed the +4 offset.
Waveforms seems correct even without +4
more precisely, comparing the plot of the output with the original, they drift of few samples per sec due to the rounding in Fs, that's all.

بواسطة dvik

Prophet (2200)

صورة dvik

23-10-2007, 01:00

Thats one of the things I mentioned I wasn't sure about. I think that the offset may be needed if you do a quicker update (ldir) instead of the one in the example. Anyways I soon have a dynamic version ready.

بواسطة dvik

Prophet (2200)

صورة dvik

23-10-2007, 01:11

At http://www.bluemsx.com/demos/sccplay.zip you can find a dynamically updating version of the replayer. The ReplayerUpdate method can be placed in an line interrupt handler and it will update as many samples as needed.

I need to test this on a real cart though to see that the offset ARTRAG mentioned earlier is set correct (if it is at all needed).

If placing the replayer in a line interrupt it will use about 25% of the cpu time which means plenty of room for game logic or other stuff :)

بواسطة ARTRAG

Enlighted (6923)

صورة ARTRAG

23-10-2007, 08:38

You'r the master !!
As you say all you need is to call the player once each 32/Fs secs
This should be achieved by having max one extra hint than strictly needed

بواسطة dvik

Prophet (2200)

صورة dvik

23-10-2007, 10:07

Would be nice if someone could try and give feedback on these two roms.

First my favorite: http://www.bluemsx.com/demos/leila.rom
Then, myself 15 years ago: http://www.bluemsx.com/demos/bengan.rom

These are both replayed at 22kHz so quality should be better than previous Handel but I haven't had a chance to try on real MSX yet.

بواسطة ARTRAG

Enlighted (6923)

صورة ARTRAG

23-10-2007, 10:13

Smile
I will receive by mail my SCC megaflash by Manuel in few days (I hope, hi Manuel, nothing received jet here!!)
I eager to test your files and much more Tongue

BTW, it is nice to point out that this technique leaves two SCC channels free for any use !!

One possibility could be to use all the 3 channels for PCM,

The drawback is that all the 3 channels share the same frequency and must be synchronized,
due to the fact that the same counter must be used for all the 3 wave tables (tricky but always
possible).

This implies eg PCM music and two PCM FX at the same time !!!

Big smileBig smileBig smileBig smile

The other possibility, not to disregard, is to use the 2 spare channel -and the PSG-
for SCC music in the standard traditional way we know.

This to reduce the size of the required room in ROM for samples...

I'm dreaming, but this is real !!

بواسطة dvik

Prophet (2200)

صورة dvik

23-10-2007, 10:19

Not too bad huh? At least not in the emus. There are some more noise on the real cart but it may be the electronics in the SCC. I don't have the equipment to sample the real SCC atm so I can't do any analysis of it.

صفحة 12/33
5 | 6 | 7 | 8 | 9 | 10 | 11 | | 13 | 14 | 15 | 16 | 17