Author Topic: Sonic Z-Treme  (Read 32443 times)

itsstillthinking1999

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #180 on: March 27, 2018, 01:34:39 am »
How's development going?
(On a little side note im not sure why but the video you and i did jumped around 2000 views in the past two days, not sure why but lets hope if helps give your project more attention!)

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #181 on: March 30, 2018, 05:22:56 pm »
I recently restarted working on Sonic Z-Treme, but I'm slowly transitionning to the newer version of the Z-Treme engine.
I pretty much need to discard almost everything I did with Sonic Z-Treme and restart, but it also forced me to make the engine more modular, which is good for future projects.
Right now I'm mainly working on implementing new audio functions to stop using PCM streams and properly use the Saturn's sound CPUs, but I haven't made much progress yet.
I probably won't be showing anything about Sonic Z-Treme until Sage 2018.

itsstillthinking1999

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #182 on: March 31, 2018, 06:05:37 am »
No problem, keep up the good work!

corvusd

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +8/-0
    • View Profile
    • Personal Web Portfolio
Re: Sonic Z-Treme
« Reply #183 on: April 03, 2018, 09:34:10 pm »
I recently restarted working on Sonic Z-Treme, but I'm slowly transitionning to the newer version of the Z-Treme engine.
I pretty much need to discard almost everything I did with Sonic Z-Treme and restart, but it also forced me to make the engine more modular, which is good for future projects.
Right now I'm mainly working on implementing new audio functions to stop using PCM streams and properly use the Saturn's sound CPUs, but I haven't made much progress yet.
I probably won't be showing anything about Sonic Z-Treme until Sage 2018.

Really good news!

Natural next step in your progress.

It would very interesting, that you can use at last one ADPCM channel for a BGM/Speech, very long sounds. And up 4 PCM sounds for all rest FX, at low quality. The ADPCM it can be read on the fly and stream form CD, and not use a lot of RAM o Sound RAM. And the PCM FX, shorts sound can be save in the RAM to mix in real time. Ideally, to put at maxium of fx similar to a Sonic Game. It should be use FM sound FX, more small sounds and similar to Sonic Games.

The SGL library an SBL, can be good start to find proper functions to fit in your engine.

Greetings!
David Gámiz Jiménez

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #184 on: April 03, 2018, 09:46:19 pm »
Yes, but sadly it's really not as easy as it seems.

All the apps to create sequences and tones are Mac-based (6800K cpu).
The only way to use them is either to buy an old mac or to use an emulator.

While using PCM on the main RAM is very easy, you are limited to low quality (for RAM) and it's hogging the B-Bus since you need to DMA data each time you play a file (CPU overhead).
And it's very complicated to use the sound RAM  : Using the PCM functions within the sound RAM doesn't work properly as Sega probably thought everybody would use sequences, but PCM streams are much easier to deal with.

I've been using a Mac emulator, so compatibility isn't that great and I have no Saturn Sound box which was needed to create some of the needed files.
So you need to create the tone data, then setup the sequences (which is where I'm stuck) and make a DSP program (if needed, but it can allow extra effects such as echo).

The SBL library is hard to use for that since the documentation is mostly in japanese and the code isn't really easy to read/understand.
Plus the demos just don't work in emulators for some reasons.

So in other words I'm not sure if I'll find a solution to these issues.

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #185 on: April 04, 2018, 08:27:27 pm »
Ok, using SBL and the Tone Editor on my Mac emulator, I got audio played from Audio RAM working.
You need to create a bank with the "voices" you want (using AIFF PCM files) and create a map file.

On the Saturn, you load the sound driver and the map data.

For the map file :
Byte 0 : MSB at 0 = used, bits 6,5 and 4 are for the type, with 0 being tone data, 1 for a sequence. The next 4 bits are the bank ID number (so 0 to 15).
Bytes 1, 2, 3 : Last 4 bits of byte 1 and the remaining bits are for the adress of the tone in memory.
Byte 4 : MSB is 0, the rest seems unused.
Bytes 5 to 7 : size of the tone data.
You then need to use end codes for the area map and for the global map : so 0xff and another 0xff.
You could put a couple of map info for more than 1 bank.


Code: [Select]
char sound_map[]= {0x00,
0x00, 0xb0, 0x00, //Start adress
0x00, //except for the MSB, seems unused
0x05, 0x61, 0x22, //size of the tone data
0xff, 0xff //end code
};

That means my sound data takes 352 546 bytes (all at 11,025 khz, mono, 16 bits - using 8 bits would halve that).
The map can include sequences, but I couldn't get the tools working on the Mac emulator, so I use Midi direct commands to the sound driver.

You need to load your tone data in the sound RAM using the offset 0xb000.

Now, to playback the audio, here is the function I wrote :

Code: [Select]
void TEST_AUDIO(Uint8 nb)  //Nb = number, both for voice and channel
{
   SND_CtrlDirMidi(0x02, 0x00, 0x03, nb, 0x20, 0x00);  //Bank change. Not needed if you have only 1 bank
   SND_CtrlDirMidi(0x02, 0x00, 0x04, nb, nb, 0x00);  //Voice change. That's the sound you want to play (16 values max)
   SND_CtrlDirMidi(0x02, 0x00, 0x00, nb, 60, 127); //Stop playing the previous sound on the passed channel. It will stop playing at the end anyway, BUT that channel will remain flagged as used if you don't clear it)
   SND_CtrlDirMidi(0x02, 0x00, 0x01, nb, 60, 127); //Start playing the current sound on the passed channel
}


Sadly it would take a while to study the tone data file in order to recreate a tool on PC to do all that.
The tone data includes stuff like the pitch and loop data.
For the pitch, I put it at 84 (for 11,025 khz) on the tone editor, so I put it at 60 (44,1 khz) for the Midi direct command so that it plays it at the correct speed.

I could probably also check at v-blank which channels are done playing the sound to clear them, it would make it easier to manage the channels.

corvusd

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +8/-0
    • View Profile
    • Personal Web Portfolio
Re: Sonic Z-Treme
« Reply #186 on: April 04, 2018, 09:45:21 pm »
Good work! :D

SS not is the 32bit “easy machine” but in other way, it is a constant give challenges to a clever brain! ;)

I think that issues: “the CPU overhead” and “a little Sound memory”. In count part to PSX, for me is very similar situation. Is true that PSX is capable of use ADPCM, and have more sounds or more quality, or medium sound and quality. But in SDK PSX the sound program have CPU overhead, the access to DMA same situation. And the dev should fight whit this little memory to read on fly ADPCM track or mix ADPCM sound in Memory. In conclusion, for SS is very similar situation, but whit more processor run at same time. In this path the key is a good control of the all flow program bucle data management. Nothing that you not know. XD

For me the big problem, is the need it of specialize hardware to create sound or music in SS. More to load DSP program like, reverb, echoes, surround like or Qsound, 3D Qsound o Yahama 3D. And more, whit a MAC machine?? More good software and without extra hardware, It could been a better situation to compete whit PSX SDK, and sure make easy the life to de devs :)

Ideally, for your project and/or jo-engine in this area is build tools like you said. A tone editor for a modern PC. And we will can get: audio program bank, sequencer or DSP programs, and finally compile sounds in SS format like. I prefer that all this tools develop it whit toolkit open source and multi-platform, to guarantee the long life and maintained. But that you decide this aspect, is your project. ;)

Greetings!
« Last Edit: April 04, 2018, 09:48:41 pm by corvusd »
David Gámiz Jiménez

LackofTrack

  • Newbie
  • *
  • Posts: 25
  • Karma: +6/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #187 on: April 05, 2018, 12:19:28 am »
Good Job on figuring out how to use the Audio Ram and Tone Editor XL2!

For the music are you going to try to use SBL PCM-ADPCM Library to play back AIFF files or perhaps encode your audio to use XA ADPCM instead? Or will you just stick to CD Audio?

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #188 on: April 05, 2018, 12:29:35 am »
Yes, I will mix both.
So for menus or title screen, I might use ADPCM to allow loading in the background and keep some space on cd.
I will use normal  cd audio for ingame for now, but using midi audio would be nice as well.

LackofTrack

  • Newbie
  • *
  • Posts: 25
  • Karma: +6/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #189 on: April 05, 2018, 12:35:50 am »
Using Midi Audio would definitely be nice indeed but, don't you need an actual development kit for that?

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #190 on: April 05, 2018, 12:41:09 am »
Yes, but the idea would be to write an app to do this. I would certainly take a while, but on another forum someone sent me an app that converts sequences to midi, so I would need to do the opposite.

LackofTrack

  • Newbie
  • *
  • Posts: 25
  • Karma: +6/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #191 on: April 05, 2018, 12:47:34 am »
Ah. Gotcha. Well I hope you succeed in doing so. It would be really impressive for a Saturn homebrew to feature sequences.
I don't think that's ever been accomplished before. Good Luck!

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Sonic Z-Treme
« Reply #192 on: April 05, 2018, 05:02:18 am »
Thanks.
But if anyone wants to do it, it would be more than welcome for the whole community!
I need to finish the model converter I promised and continue working on the engine for a long overdue update.

Edit : Just added an image of PCM-ADPCM CPU overhead. Note that playing small sounds from memory is less expensive since you don't need to transfer data from the CD, but it still requires DMA and hogs the B-Bus.

« Last Edit: April 05, 2018, 02:54:42 pm by XL2 »

corvusd

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +8/-0
    • View Profile
    • Personal Web Portfolio
Re: Sonic Z-Treme
« Reply #193 on: April 05, 2018, 06:40:12 pm »
Thanks.
But if anyone wants to do it, it would be more than welcome for the whole community!
I need to finish the model converter I promised and continue working on the engine for a long overdue update.

Edit : Just added an image of PCM-ADPCM CPU overhead. Note that playing small sounds from memory is less expensive since you don't need to transfer data from the CD, but it still requires DMA and hogs the B-Bus.

I know this table data. :)

But I have a doubt. The overhead are for 1x SH2, for 2x. For the M68000? For all?

And more. The formula use it to calculate this value % is this: R = (100 X Ttask) / Tplay

Whit this, really not know, which CPU refer, or quantity of cycles used for DMA transfers or decompress the ADPCM data... And another doubt is, use it DMA transfers via SCU or directly SH2 to 68EC000 or SCSP. Or both.

Last. ADX form CRI, is possible better implementation of ADPCM for SS. Burning Rangers or Deep Fear, play BGM all time, and use it also for speech or dialogues. I don’t know if is possible play more than one stream or more, play directly from RAM and mix "like" PSX. I cant find the SS library functions form ADX in the web.

Greetings!
« Last Edit: April 05, 2018, 07:03:31 pm by corvusd »
David Gámiz Jiménez

ponut64

  • Full Member
  • ***
  • Posts: 182
  • Karma: +13/-0
    • View Profile
Re: Sonic Z-Treme
« Reply #194 on: April 05, 2018, 08:47:07 pm »
Burning Rangers does clearly play multiple CD Audio tracks at once, and I am not sure how it does that.

Maybe I am being fooled, and what they are doing is reading & playing one word at a time, so the voice data stream only consumes as much as the biggest word. Who knows. It's "Redbook Audio" quality, that /e is completely wrong and I am glad there are more educated people in here.
« Last Edit: April 06, 2018, 05:17:36 am by ponut64 »

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk