SoundPlayer for Saturn + 2 tools

RockinB

Established Member
Here is my SoundPlayer for SEGA Saturn :party .

[attachmentid=1040]

Loads .wav .pcm and .snd files from CD and plays them.

Sample sounds and complete ISO included. For own sound stuff, you'll need mkisofs.exe and Cygwin1.dll for ISO creation.

It performs the same conversion on wave files like

RB_SaturnPCM.EXE :bounce , my bugfixed improvement of the former SSwavetools for .wav <-> .pcm sound file conversion.

Furthermore, here is my DXF converter RB_SaturnDXF.EXE :bounce I've been writing about in another topic. It's stable, but an early work. Nevertheless, I managed to get my 3D model for the SoundPlayer done, so will you.
 

Attachments

  • SoundPlayer_1.png
    SoundPlayer_1.png
    11.8 KB · Views: 177
  • SoundPlayer_1.png
    SoundPlayer_1.png
    11.8 KB · Views: 163
  • SoundPlayer_1.png
    SoundPlayer_1.png
    11.8 KB · Views: 165
Great stuff as usual Rockin' B :thumbs-up:

Too bad that Dracula X pcm files need something more than your converter to be audible ... :(
 
Originally posted by SeGaFrEaK_NL+Thu, 2005-02-10 @ 08:05 PM--><div class='quotetop'>QUOTE(SeGaFrEaK_NL @ Thu, 2005-02-10 @ 08:05 PM)</div><div class='quotemain'>Cool. I wouldn't use it myself, but still *thumbs up*

[post=129430]Quoted post[/post]​
[/b]


You are on Deza, right? I should play it again.

<!--QuoteBegin-Runik
@Thu, 2005-02-10 @ 08:14 PM

Too bad that Dracula X pcm files need something more than your converter to be audible ... :(
[post=129431]Quoted post[/post]​
[/quote]

Yeah, some encoded files still got .PCM extension.

Example: Road Rash got ADPCM encoded files with .PCM extension (instead of .ADP)

BTW: a screenshot

[attachmentid=1040]
 
Good work. Two questions:

- does the 512 kByte limitation mean that you play the sound from the main memory ?

- why don't you provide the sources by now ? This sound player is useless for me, but its code is not.
 
Thank you, guys!

Originally posted by vreuzon@Fri, 2005-02-11 @ 11:05 AM

- does the 512 kByte limitation mean that you play the sound from the main memory ?

- why don't you provide the sources by now ? This sound player is useless for me, but its code is not.

[post=129480]Quoted post[/post]​


Yes, it's memory playback from high work RAM. The SBL supports PCM streaming, but my focus was only PCM playback with SGL, which only supports memory playback. I will add support for playback from low work RAM, too(you know, the sound file itself must be modified for that).

Source is not released yet, because without my libs which aren't released, it can't be compiled. Furthermore the SoundPlayer is not complete. I will hurry up a bit with that. :)

Vreuzon, you are very experienced with Saturn coding. How could this help you, as there is nothing special about it. PCM playback with SGL is very simple.

Note: the old SSwavetools contain the sourcecode of a PCM pitch test, because pitch computation has been very difficult.
 
Originally posted by Rockin'-B@Thu, 2005-02-10 @ 07:24 PM



Furthermore, here is my DXF converter RB_SaturnDXF.EXE :bounce I've been writing about in another topic. It's stable, but an early work. Nevertheless, I managed to get my 3D model for the SoundPlayer done, so will you.

[post=129420]Quoted post[/post]​


great job, I haven't tested it yet, would it work with the SGL driving sample ?I got many problems when I tried to replace the track(a long time ago).
 
Vreuzon, you are very experienced with Saturn coding. How could this help you, as there is nothing special about it. PCM playback with SGL is very simple.


I'm interested in a clean cd access library. The one I use (modified version of some vbt code) is buggy.

For pcm playback, mygoal is to use sound synthesis for sound effects; it needs pcm streaming. I wonder how fast it can be.

(I'll give a try to your pcm pitch test.)
 
Originally posted by vbt+Sun, 2005-02-13 @ 04:02 PM--><div class='quotetop'>QUOTE(vbt @ Sun, 2005-02-13 @ 04:02 PM)</div><div class='quotemain'>...would it work with the SGL driving sample ?I got many problems when I tried to replace the track(a long time ago).

[post=129629]Quoted post[/post]​

[/b]


It should be possible. The 3D world consists of a 32x32 map of polygon data and a corresponding map of collision data. Collision data seems to be generated with an unknown tool, maybe the files MITI.POL and ATA.POL have something to do with that.

I would start replacing a polygon tile with an object of my choice and don't care about collision for now.

<!--QuoteBegin-vreuzon
@Mon, 2005-02-14 @ 11:43 AM

I'm interested in a clean cd access library. The one I use (modified version of some vbt code) is buggy.

[post=129687]Quoted post[/post]​

[/quote]

Yeah, you're speaking about the file.c topic. As I said there, keep the lib work global, it IS NEEDED AFTER INITIALISATION.

Furthermore, you don't need the for(){} loops there. Guess it's to handle read errors, but that's not neccessary . The number of read retry is set to default values by GFS init.
 
Yeah, you're speaking about the file.c topic. As I said there, keep the lib work global, it IS NEEDED AFTER INITIALISATION.[...]


Thanks.

Taking the initial vbt code, making the lib_work global and not using the for (i<10) loop will make it work fine ? So what about the filesize problems ?
 
Originally posted by vreuzon@Wed, 2005-02-16 @ 12:39 PM

So what about the filesize problems ?

[post=129808]Quoted post[/post]​


It's just like I wrote in that topic.

But I prefer another way, since the directory data

(for GFS_init(); with GFS_DIRTBL_TYPE(&gfsDirTbl) = GFS_DIR_NAME;

it's GfsDirName gfsDirName[DIR_MAX]; )

is always available after GFS_init().

You don't need to open a file just to get it's size, instead do this:

size = GFS_DIR_SIZE(&gfsDirName[fileid]);

and other data is also there like

name = GFS_DIR_NAME(&gfsDirName[fileid]);
 
I made some nice progress on the SoundPlayer, but I do have some problems:

I'm trying to play AIFF and ADPCM files from CD with SBL's PCM lib.

At first, the Saturn freezed, but that's fixed now.

It seems to play, but I cannot hear anything :( .

Anyone ever tried that out?

In that scope: does slIntFunction() register a function to vblank-in or to vblank-out?

Anyone knows why PCM playback mutes when changing parameters with slPCMParmChange()?

The function is supposed to apply the change to a playing PCM.

If I restart playing with changed parameters, sound works.
 
Ladies and gentleman, :banana

I finally managed to play Sonic Jam's .AIF and .ADP sound files from the CD using SBL's PCM lib with file playback.

But I experienced little issues that need to be fixed.

Originally posted by Rockin'-B@Fri, 2005-02-18 @ 06:20 PM

In that scope: does slIntFunction() register a function to vblank-in or to vblank-out?

[post=129999]Quoted post[/post]​


vblank-in, see INT.TXT
 
Originally posted by Rockin'-B@Tue, 2005-03-08 @ 05:57 PM

I finally managed to play Sonic Jam's .AIF and .ADP sound files from the CD using SBL's PCM lib with file playback.


good. What is the problem ?
 
Originally posted by vreuzon@Wed, 2005-03-09 @ 12:39 PM

good. What is the problem ?

[post=131114]Quoted post[/post]​


ADP playback got glitches sometimes, decoding makes a heavy load on the CPU.

-> call PCM_Task() more often

Pressing stop or play when playing disables AIF/ADP playback

-> check if already playing, before starting playback

-> destroy PCM and GFS handle when stoping

But in general CD access seems impossible to other applications, after a CD file has been played.

-> solution unknown, maybe a side effect of above bugs

I'm running out of CD-R's....
 
How do you explain the heavy load ?

Originally posted by Rockin'-B@Wed, 2005-03-09 @ 07:20 PM

I'm running out of CD-R's....


Use cdrw. I use it myself and it does not seem to be harmful for the saturn.

I had a link on the ssmtf web site detailing the operation that must be done on the cd lens to enable cdrw reading, but the link is dead. If someone knows where i can find this file, he tells me.
 
The updated SoundPlayer is released.

Get it from my page The Rockin'-B:

Code:
  + plays CDDA

  + plays .AIF and .ADP (ADPCM compressed) files directly from CD

    (file playback)

    (find them on Sonic Jam, E0, ..)

  + plays .WAV and raw PCM from Saturn game CD's

    (memory playback)

    (find them on Burning Rangers, Panzer Dragoon Saga, ...)

  + extended CD swap support:

    (by CD stop and rescan buttons)

    (!! even without pressing the CD door switch !!)

    - swap-in Saturn game CD

    - swap-in audio CD

    - swap-in CD-R

  + playing multiple sounds at once:

    with new sound slot system:

    - 1 file slot

    - 2 memory slots(1 MByte and 256 kByte)

    additionally CDDA(untested)

  + sound attribute adjustments:

    - samplerate(and OCT/FNS to generate pitch value for devvers)

    - pan

    - mono/stereo

    - 8/16 bit resolution

  + sound file playing controls:

    - play / repeat / stop

  + CDDA additional playing control:

    - fast forward, rewind, pause, track change

  + realtime gouraud 3D model

  ? hidden 3D debug menu (activated by holding a certain button at startup)

  + improved CD browser with CD swap support

  - only wave files with PCM chunk supported

   no sound compression/encoding playable

Playing with the CD swap support was a pain, I got 0 CD-R's left and almost threw my Saturn out of the window, today.

It's been 4 years ago that I thought about having a more memory efficient algorithm for wav->pcm conversion.

Recently I made 3 or 4 different approaches and succeeded with one, such that files of up to 1MByte can be loaded to low mem.

Originally posted by vreuzon@Thu, 2005-03-10 @ 10:15 AM

How do you explain the heavy load ?

Use cdrw. I use it myself and it does not seem to be harmful for the saturn.

[post=131166]Quoted post[/post]​


ADPCM decoding takes quite some power on Saturn.

The PCM manual says: "Call PCM_Task() more frequently than the vblank frequency".

Maybe if you don't, the PCM_VblIn() performs too much work.

I use realtime gourad, this may take it's CPU time, too.

I tried CD-RW some time ago, did'nt work. My CD-RW's are old, maybe I'll try with new ones on different Saturns.
 
I used your RB_SaturnPCM converter for WAV to C array conversion wich is very convenient. Here is some feedback.

- bytes 0x0 to 0x2C of the resulting array are bad. Try to convert a silent file and you'll see these first bytes aren't 0x00 as expected. At runtime, this results in a clic at the begining of the sound. If you begin to read the array with a 0x2C offset, sounds are played ok. (I don't know if the last bytes are ok).

- the saturn refuses to read pcm if their size is < 0x900, so it would be good to have a padding option in the converter (ie : if the sound is smaller than this size, add zeros).

- and a little detail : I think it would be better for the resulting array to be Sint8 than char

thanks for your usefull work.
 
Originally posted by vreuzon+Tue, 2005-09-27 @ 11:12 AM--><div class='quotetop'>QUOTE(vreuzon @ Tue, 2005-09-27 @ 11:12 AM)</div><div class='quotemain'>I used your RB_SaturnPCM converter for WAV to C array conversion wich is very convenient. Here is some feedback.

- bytes 0x0 to 0x2C of the resulting array are bad. Try to convert a silent file and you'll see these first bytes aren't 0x00 as expected. At runtime, this results in a clic at the begining of the sound. If you begin to read the array with a 0x2C offset, sounds are played ok. (I don't know if the last bytes are ok).

[post=139984]Quoted post[/post]​

[/b]


Maybe these bytes are the wav header. I think I had a similar problem in the SoundPlayer, which uses wav-> pcm conversion, too.

Have you used the updated version RB_SaturnPCM-050311.rar?

Because I made several file comparisons with source files and converted files and somehow I have the feeling that I already removed such a bug...

...must have been removed, because I updated RB_SaturnPCM the same day I released the 2nd SoundPlayer version.

Originally posted by vreuzon@Tue, 2005-09-27 @ 11:12 AM

- the saturn refuses to read pcm if their size is < 0x900, so it would be good to have a padding option in the converter (ie : if the sound is smaller than this size, add zeros).

[post=139984]Quoted post[/post]​


I remember in my MineSweeper I couldn't use a very short "click" sound. Is that size (0x900) exact or is it a guess?

<!--QuoteBegin-vreuzon
@Tue, 2005-09-27 @ 11:12 AM

- and a little detail : I think it would be better for the resulting array to be Sint8 than char

[post=139984]Quoted post[/post]​

[/quote]

Thanks for your feedback!

BTW: recently I got to know the reason for a bug in SoundPlayer, which freezes the app sometimes when using the high work RAM slot. If I don't forget it...
 
Back
Top