Journey sound sample in mame2003-plus, solved
-
Is sample stop not working ?
-
@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);
}
-
ive not really played that game much it is hard though
-
@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 -
ill test and report back
-
@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 songcould 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); }
-
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 } }
}
*/ -
@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 š
-
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.
-
@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.............
-
@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 :)
-
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.
-
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
}; -
@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.
-
this mame wont use stereo samples only mono you need to save each channel
-
@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.
-
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
-
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! ;)
- 44100 Hz, 16-bit, 1 channel - 15.4MB (Original WAV)
- 44100 Hz, 8-bit, 1 channel - 7.73MB
- 22050 Hz, 16-bit, 1 channel - 7.73MB
- 22050 Hz, 8-bit, 1 channel - 3.86MB
-
i managed to find the ost samples moonwalker has a 24 meg sample and works fine
-
@grant2258 - Then size doesn't matter...the samples! ;)
I think some of these OST's are much larger than they should be and look to have been up-converted. It could be the actual OST CD's were a poor quality source. You just never know these days. Some of these commercial sites sell up-converted low quality FLAC's as lossless.
Looking at the Moonwalker samples. Bad-01.wav (49.6MB) shows as 44100 Hz 16-bit. Basically CD quality audio but when you look at the spectrogram below it's more like a 128kbps MP3 even though it's the size of a lossless audio WAV.
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.