• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Journey sound sample in mame2003-plus, solved

Scheduled Pinned Locked Moved Help and Support
samplesjourney
86 Posts 7 Posters 14.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    arcadez2003
    last edited by 13 May 2020, 18:16

    Ok good news and bad, firstly the good i have the sample up and running now which is good in the sense at least i know all the code in the driver is good
    however now the bad the sample is playing constantly when it shouldn't be, i know what the problem is just not sure how to go about hacking around it
    im gonna ask dink if he has any suggestions later if not then the samples will have to be updated to support the pause feature.

    And i may as well tell ya now this wont be easy as the sample code from MAME98 is totally different from MAME2003.

    Arcade Addict

    G 1 Reply Last reply 13 May 2020, 19:59 Reply Quote 0
    • G
      grant2258 Banned @arcadez2003
      last edited by 13 May 2020, 19:59

      Is sample stop not working ?

      A 1 Reply Last reply 13 May 2020, 20:25 Reply Quote 0
      • A
        arcadez2003 @grant2258
        last edited by arcadez2003 13 May 2020, 20:25

        @grant2258 said in Journey sound sample in mame:

        Is sample stop not working ?

        It's meant to pause rather than stop per say with the code they added but i think i've got it to start and stop now, certainly i can turn the sample tape on
        and off now in the service mode the only problem now is im not good enough at the game to actually get to the bonus stage where the tape sample
        actually kicks in to see if it'll trigger and then turn off correctly as it's meant to.

        Well it's upto you @mahoneyt944 to test this out with the driver i send ya earlier simply find and then replace with this.............

        static WRITE_HANDLER( journey_sample_select_w )
        {
        if ((data & 1) == 0)
        sample_stop(0);

        else if (!sample_playing(0))
            sample_start(0, 0, 1);
        

        }

        Arcade Addict

        1 Reply Last reply Reply Quote 1
        • G
          grant2258 Banned
          last edited by 13 May 2020, 21:58

          ive not really played that game much it is hard though

          A 1 Reply Last reply 13 May 2020, 22:12 Reply Quote 0
          • A
            arcadez2003 @grant2258
            last edited by arcadez2003 13 May 2020, 22:12

            @grant2258 said in Journey sound sample in mame:

            ive not really played that game much it is hard though

            Aye and the cheats only give ya unlimited lives, cannot die would have been better for testing hopefully @mahoneyt944 will be good at it.??
            i assume so since he noticed the sample doesn't work in the first place he must be able to get to the bonus stage

            Arcade Addict

            1 Reply Last reply Reply Quote 0
            • M
              mahoneyt944
              last edited by 14 May 2020, 00:13

              ill test and report back

              1 Reply Last reply Reply Quote 0
              • M
                mahoneyt944
                last edited by mahoneyt944 14 May 2020, 00:47

                @arcadez2003
                The sample is too large and crashes the mixer....3 minute song. If I cut it to 1:30, it works. Might need to figure out the size limit and expand it to except the whole song

                could probably change the code to this too?

                static WRITE_HANDLER( journey_sample_select_w )
                {
                if ((data & 1) == 0)
                  sample_stop(0);
                
                else
                  sample_start(0, 0, 1);
                }
                
                1 Reply Last reply Reply Quote 0
                • A
                  arcadez2003
                  last edited by arcadez2003 14 May 2020, 12:49

                  Hmm might it be a memory issue with the sample.?? certainly we had to use a sample shrinking program to reduce the Toaplan samples down from 160mb
                  to around 20mb or so for xbox use back in the day as the games could crash due to the 64mb memory limit , as for the handler whatever you think is best
                  i just grabbed it from FBN and reworked it for our codebase...........

                  static void journey_op4_write(UINT8, UINT8 data)
                  {
                  if ((data & 1) == 0) {
                  BurnSampleStop(0);
                  }
                  else if (!BurnSampleGetStatus(0)) {
                  BurnSamplePlay(0);
                  }
                  }

                  static WRITE_HANDLER( journey_sample_select_w )
                  {
                  if ((data & 1) == 0)
                  {
                  sample_stop(0);
                  }
                  else if (!sample_playing(0))
                  {
                  sample_start(0, 0, 1);
                  }
                  }

                  I had it like this before but it seems cleaner the above way

                  /*
                  static int tape_off = 1;
                  int journey_sound_playing = 0;

                  WRITE_HANDLER( journey_sample_select_w )
                  {
                  tape_off = ((~data & 1));

                  if (tape_off)
                  {
                  	if (journey_sound_playing == 1)
                  	{
                      	journey_sound_playing = 0;
                  		sample_stop(0);
                  	}
                  }
                  else
                  {
                  	if (journey_sound_playing == 0)
                  	{
                      	journey_sound_playing = 1;
                      	sample_start(0,0,1);	// tape sample
                  
                  	}
                  }
                  

                  }
                  */

                  Arcade Addict

                  M 1 Reply Last reply 14 May 2020, 12:56 Reply Quote 1
                  • M
                    mahoneyt944 @arcadez2003
                    last edited by mahoneyt944 14 May 2020, 12:56

                    @arcadez2003 yeah I like this way, short and sweet. I'll test the else if statement

                    static WRITE_HANDLER( journey_sample_select_w )
                    {
                    if ((data & 1) == 0)
                      sample_stop(0);
                    
                    else
                      sample_start(0, 0, 1);
                    }
                    

                    The full sample is 15.4MB, cut in half it works. So it's a memory issue. Need to figure that out. Worse case we can link multiple smaller samples

                    It would be cool to get the pause feature added so it's correct though. Plus it would get old always hearing the intro lol.

                    Great step in the right direction 👍

                    1 Reply Last reply Reply Quote 0
                    • M
                      mahoneyt944
                      last edited by mahoneyt944 14 May 2020, 13:30

                      Just tested the smaller sample and there's an issue. The sample starts just before going to the bonus scene then it restarts in the beginning of the bonus scene. I'm guessing this is where the pause feature would need to be working so you don't notice the change. Or maybe it's the else if I removed 😂 I'll test again. Man this game is hard.

                      A 1 Reply Last reply 14 May 2020, 13:45 Reply Quote 0
                      • A
                        arcadez2003 @mahoneyt944
                        last edited by arcadez2003 14 May 2020, 13:45

                        @mahoneyt944 said in Journey sound sample in mame:

                        Just tested the smaller sample and there's an issue. The sample starts just before going to the bonus scene then it restarts in the beginning of the bonus scene. I'm guessing this is where the pause feature would need to be working so you don't notice the change.

                        Try it again with the original handler before you changed it to see if that smooths it out, listen with regards to the sample pause feature apart from not having the time
                        to work on adding support for it now, due to the massive rewrite of every sound core circa MAME93 i dont see any easy way to backport the code for this from MAME98.

                        In a nutshell in MAME2003 our sample handlng is split between samples.c and mixer.c where as in later MAME both of these were combined into one file and the code
                        totally rewritten, it's like chalk and cheese the code is not compatible with our older core, and i dont mind telling ya it might be above my level to create the sample
                        pause code myself totally from scratch, but at least we have the sample playing now which although there are a few niggles here and there is better than no sample at all :)

                        Feel free to study the code and try and add support for the sample pausing yourself if you fancy taking a stab at it sometime.............

                        https://github.com/mamedev/historic-mame/commit/e42683361979f2f2d3e6b0a01e59489218d75543#diff-f010476575c6c2e5b411522da5d08ca1

                        Arcade Addict

                        1 Reply Last reply Reply Quote 0
                        • M
                          mahoneyt944
                          last edited by mahoneyt944 14 May 2020, 14:13

                          @arcadez2003
                          Very valid points... ... Hmmmmm
                          I have an idea, what if we leave the song playing on loop and just mute it instead of stopping it? That way the bonus scene will always have a random sound clip playing. This would be much better than always listening to the same intro on every bonus scene. Our start option will unmute and then play. Stop will just mute but continue playing. If it's already playing just unmute. A pause workaround.

                          Maybe

                          static WRITE_HANDLER( journey_sample_select_w )
                          {
                            if ((data & 1) == 0)
                              sample_set_volume(0,0);
                          
                            else if (!sample_playing(0)) {
                              sample_set_volume(0, 100);
                              sample_start(0, 0, 1);
                            }
                          
                            else sample_set_volume(0, 100);
                          }
                          

                          I'll have to test the volume values.

                          Update this works!, Though it's a little quieter than it should be at 100, this is rock-'n'-roll so it needs to be loud :)

                          Now to fit the whole song :)

                          1 Reply Last reply Reply Quote 0
                          • M
                            mahoneyt944
                            last edited by mahoneyt944 14 May 2020, 15:39

                            I'm pushing 1:50 with some compression audio tricks. Still 1:13 shy. We need to figure out how to expand the memory here like they did in mame2010 or get really good at compressing this sample. I dropped it from 32 float to 16 bit and it's still not enough but saved space for sure. If the memory can't be expanded maybe we can link multiple samples somehow. If that were possible you could have a whole journey album playing at random, which would be pretty awesome.

                            What is default value of "sample_set_volume"? This is basically a pre-mixer amplifier from what I can tell. It doesn't seem to have a cap, well it does technically when you get clipping . I'm using "1500" and it sounds pretty good. "100" just sounds flat to me. I'm guessing "1000" might be default but not sure.

                            1 Reply Last reply Reply Quote 0
                            • A
                              arcadez2003
                              last edited by arcadez2003 14 May 2020, 20:57

                              I used audacity to shrink the Toaplan samples it was so long ago i cant mind the settings i used, but im sure i set it to mono and 8-bit the sample went from
                              160mb down to 20mb or so, what are you using here an Rpi.?? the sample does not crash for me on the xbox and we only have 64mb of memory all in
                              im sure the rpi has more, although it doesn't make sense it would crash in MAME2003 but not MAME2010.

                              With regards to sample set volume default values i dunno much about it really having only set the volume in the main interface
                              btw 25 is the standard volume setting for this game...............

                              struct Samplesinterface journey_samples_interface =
                              {
                              1,
                              25,
                              journey_sample_names
                              };

                              Arcade Addict

                              M 1 Reply Last reply 14 May 2020, 21:25 Reply Quote 0
                              • M
                                mahoneyt944 @arcadez2003
                                last edited by mahoneyt944 14 May 2020, 21:25

                                @arcadez2003 I'm using a rpi3b+, the sample works in 2010 fully. I had to use audacity to cut the sample from 3:03 to 1:50 for it to work in 2003plus. Then saved it as 16 bit mono. It started as 32 float mono. Cutting it down makes it work. If not I get a screech that crashes the emulator.

                                The volume thing is tricky because you have mixer volumes and levels and the sample volume. I'm not sure exactly why but if set to 100, I can hear it but the other game sounds are much louder. If I set it to 10,000 it hits clipping. If I set it to 5000 I get clipping. 2000 is too loud, 1500 is slightly too loud, 1000 is probably just right.

                                1 Reply Last reply Reply Quote 0
                                • G
                                  grant2258 Banned
                                  last edited by 14 May 2020, 21:28

                                  this mame wont use stereo samples only mono you need to save each channel

                                  M 1 Reply Last reply 14 May 2020, 21:32 Reply Quote 0
                                  • M
                                    mahoneyt944 @grant2258
                                    last edited by mahoneyt944 14 May 2020, 21:32

                                    @grant2258 Im pretty sure it's right. I got it from here http://www.progettosnaps.net/samples then I used audacity to cut it down more. The sample won't work in 2003plus if it's 3 minutes long. But it does works at 1:50 just fine (audacity- export wav 16 bit). So it's a space issue I think. 1:55 crashes.

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      grant2258 Banned
                                      last edited by 14 May 2020, 21:54

                                      aarg ive done it now i cant even check the size of the ost samples i forgot to back them up when i updated retropie. I have no idea where to download them now to check the sizes its using

                                      1 Reply Last reply Reply Quote 0
                                      • R
                                        Riverstorm
                                        last edited by Riverstorm 14 May 2020, 22:09

                                        To much quarantine-time...or something...

                                        I was messing with the sepways.wav sample and you can get it pretty small and still keep it sounding decent. It's a mono channel sample. I used Foobar with SoX to resample. I tried it 4 ways.

                                        Samples 2 and 3 I've always struggled to hear the difference depending on the source audio. You're basically trading off the sample rate (44100 Hz) for bits per channel (8/16-bit) as both sound pretty decent but a higher sample rate will have a larger frequency range but less samples which basically translates to more background "noise".

                                        So even though you have a larger frequency range to hit the highs/lows it might sound slightly "muddy". Both sound good but I prefer the 44100Hz/8-bit between the two. Someone with better equipment or ears might hear a difference! =/

                                        Number 4 at under 4MB actually sounds pretty decent but with an ever slight distortion but not bad at all. I can upload them if you want to try a smaller file.

                                        Depending your speakers and hearing frequency range it could make a difference (or none) to what you hear as highs and lows usually go first and we're mainly cutting out the higher frequencies. I'm sure I've done some damage in my early years at concerts but at some point in there I started wearing plugs! ;)

                                        1. 44100 Hz, 16-bit, 1 channel - 15.4MB (Original WAV)
                                        2. 44100 Hz, 8-bit, 1 channel - 7.73MB
                                        3. 22050 Hz, 16-bit, 1 channel - 7.73MB
                                        4. 22050 Hz, 8-bit, 1 channel - 3.86MB
                                        1 Reply Last reply Reply Quote 0
                                        • G
                                          grant2258 Banned
                                          last edited by 14 May 2020, 22:13

                                          i managed to find the ost samples moonwalker has a 24 meg sample and works fine

                                          1 Reply Last reply Reply Quote 0
                                          28 out of 86
                                          • First post
                                            28/86
                                            Last post

                                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                                            This community forum collects and processes your personal information.
                                            consent.not_received