Home | Forums | What's new | Resources | |
Project : convert yamaha YMxxx FM to saturn scsp FM |
vbt - Sep 18, 2016 |
1 | 2 | 3 | 4 | Next> |
antime | Sep 20, 2016 | |||
Have you looked at the capabilities of the chips you want to simulate, and how they correspond to the SCSP? |
antime | Sep 25, 2016 | ||||
Basic audio playback isn't too difficult, this is some code I experimented with many years ago. The audio data used 16-bit samples, which is why length/2 is used as the loop end address. For FM sounds I assume the process is similar, except that you have to set up the modulation sources, and that the slots used for modulation aren't connected to a mixer.
Code:
|
vbt | Dec 25, 2016 | |||
adding this nice article : http://nerdnoiseradio.blogspot.fr/2015/04/geekspea... |
vbt | Jan 14, 2018 | |||
well, YMxxxx to SCSP seems to be too complex, so i thought about another way to play sound / music. the mame m1 tool is able to convert all sfx/music to wave. so would it be possible to play the wav/pcm file instead of emulating the sound chip ? but then how to know which soundtrack has to be played ? |
XL2 | Jan 21, 2018 | |||||
Not 100% on topic, but do you know if there is a way to store PCM audio in the audio RAM? I know that there is a buffer area for PCM, but you need to DMA it there each time you play a sound. Not wasting work RAM on audio would be great! |
vbt | Jan 26, 2018 | |||||
i'd say yes, see that : #define PCM_ADDR ((void*)0x25a20000) PCM_PARA_WORK(¶) = (struct PcmWork *)&g_movie_work; PCM_PARA_RING_ADDR(¶) = (Sint8 *)PCM_ADDR+0x40000+(0x4000*(i+1)); PCM_PARA_RING_SIZE(¶) = RING_BUF_SIZE; PCM_PARA_PCM_ADDR(¶) = PCM_ADDR+(0x4000*(i+1)); PCM_PARA_PCM_SIZE(¶) = PCM_SIZE; pcm addr is in soundram and the ring too, just update the pcm addr when needed. |
vbt | Jan 28, 2018 | ||||
would someone know how to hack the sega sound driver to support up to 32 PCMs ? in the sbl, it's easy to remove that limit but not in the sound driver. the other way would be to find a modified driver on a released game.
|
XL2 | Jan 30, 2018 | |||||
So you just send the data to audio RAM and simply make sure you have the right address? Have you ever tried it with SGL functions directly, or do you need to use SBL functions? As far as I know SGL sends the pcm data from work RAM to the audio RAM pcm buffer area during v-blank using the SCU DMA, so I'm not sure if it would create issues (since I'm using Jo Engine functions for audio, I would need to modify them or write my own, which is why I ask first instead of simply trying it right away). Thanks again!
|
antime | Jan 30, 2018 | |||
If you want to use Sega's sound driver, wouldn't you include your sounds in the tone data, and then either trigger sequences or send MIDI commands to play them? |
vbt | Feb 3, 2018 | |||||
do you mean you can play pcm as a sequence ? or thanks to a midi command ? i'm not familiar with midi and sequences, i just play pcm from memory. |
antime | Feb 3, 2018 | |||
The tone definition ("voice") includes waveform data. Play notes using that tone, and the waveform will play. The sound driver includes commands for triggering sequences and for receiving direct MIDI messages. A sequence is basically a MIDI message stream, converted into a more compact format. However if you're not using sequenced music, there's no real point in using the Sega driver either. And if you do want to use it, you run into the usual tool problems. |
vbt | Feb 25, 2018 | |||||||||||
maybe i'll do that, it seems easier than playing pcms, i got the sega sound tools working, i can try. actually, i've merged all sfx into one single file. if (size_write_total > st->pcm_bsize) { // _VTV_PRINTF("\n\nmissed"); st->cnt_load_miss++; // VTV_PRINTF((VTV_s, "P:LMis %d\n buf%X < writ%X\n", // st->cnt_load_miss, st->pcm_bsize, size_write_total)); // VTV_PRINTF((VTV_s, " r%X w%X\n", // (st)->ring_read_offset, (st)->ring_write_offset)); } The sound driver includes commands for triggering sequences and for receiving direct MIDI messages. A sequence is basically a MIDI message stream, converted into a more compact format. [/QUOTE] yes but i heard that vgm/wav conversion to midi will not give a good result.
what's the alternative of the sega driver to play just pcms/wav?? my latest problem is now there, i started to debug the pcm lib, when i loose pcm streaming, i reach this point :
it's something like the pcm lib refuses to play sound when the write size is higher than the block size, i got 16400 VS 16384 |
vbt | Mar 17, 2018 | |||
here is my sound map (no idea what to put there) : unsigned char sound_map[]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x00, 0x00, 0x07, 0x4D, 0x8C, 0xFF, 0xFF }; here is my sound memory map : if someone see something wrong or see something to improve, tell me |
XL2 | Mar 20, 2018 | |||
So you will use PCM if I understand correctly? Is it complicated to convert audio to the tone data? |
vbt | Mar 25, 2018 | |||||
not really, there are multiple ways to do that, i use mainly RB_SaturnPCM.EXE (http://www.rockin-b.de/saturn-tools-pcm.html...) you can try also the sega tone editor, it needs aiff as file source, i didn't use it enough to make a tutorial : |
vbt | Mar 25, 2018 | |||
and about my troubles, i've found something erases the scsp channels setup : |
XL2 | Mar 28, 2018 | |||||
I set up a Mac emulator and loaded the tone editor app, but it seems to have problems loading .aiff files. Did you manage to make it all work? And is there any advantage to go that route instead of just using PCM? Also, the RB Saturn PCM doesn't seem to work well for me, it doesn't change the samplerate and doesn't seem to modify anything even if I use the options. The result being that the audio files are wasting way too much RAM. |
vbt | Apr 1, 2018 | ||||||||||||||
It seems to work but i didn't try yet to use the generated file. I used Gold wave to create aiff and the tone editor took all of them :
no ideai, i tried to use that tool because I had some troubles with PCM & PCM streaming.
In fact i convert files with goldwave (resample + save as signed PCM) then I run the rb tool like this : SaturnPCM 0 51.wav mono 16 7680
Yes actually I use low sample rate to reduce file size, i think the next step is to use the adpcm codec. |
1 | 2 | 3 | 4 | Next> |