-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNDH tracks don't stop playing #21
Comments
The Lines 53 to 54 in d719a9b
Sadly, most SNDH files don’t have it. Most proper tracks, that aren’t sound effects, programmatically play for ever in a loop, and so silence is an unreliable means of track length determination. Many tracks that do have I’ve seen efforts to measure true SNDH track lengths. Maybe someone maintaining the SNDH archive could be convinced it would be worthwhile for an update? Best would be millisecond resolution, to avoid spurious bleeps and hisses at track endings! The % psgplay --info Mad_Max/Last_Ninja.sndh
path Mad_Max/Last_Ninja.sndh
tag field TITL Last Ninja
tag field COMM Mad Max
tag field RIPP Grazey / PHF
tag field CONV Grazey / PHF
tag field FLAG ~ y PSG
tag field TIME 1 208
header size 94
data size 10476 Since |
Hi, sc68 has a database for sndh track length. Lengths are automatically measured using mksc68 time command. I am supposed to update the whole sndh database someday with the duration and FLAG tag updated. Meanwhile the database is hardcoded here.
-- |
Hmm, the
Nice! How are things proceeding? |
The length is the number of frames to run. Hence the duration depends on this value and the replay rate. Like you said most of the time it's a 50hz PAL VBL per frame. A hash code is used to identify the (unpacked) file. The algorithm can be found in the file68.c::isread() function.
Unfortunately I've been slacking on this for quiet sometime now. The thing is I have a completely rewritten version of sc68 in progress more like stalled right now. I've just updated the timedb.inc.h file. |
Is it feasible to add a millisecond resolution (or there about) SNDH tag, that is simple to interpret as track length, for SNDH players?
Oh, how did the desire to rewrite sc68 come about?
As suspected, only track 11 is anywhere near a length of a proper tune. :-) |
It's certainly possible. I don't think Grazey or Evil would mind.The number of frames is the most accurate you can get. sc68 files store the first run length and the loop length (0=non looping). I understand having to do mul/div on somewhat big numbers can be an hassle in 68k/asm
Mainly the STe DMA/LMC simulation really needed work. I was not happy with the m68k simulator compiled code being huge because of generated code. That was fast at the time but useless nowaday. The project need an overall cleaning.
Indeed. One thing I wanted to add with the |
|
Right. I was not sure about that. I remember now |
@chris-y, with commit e6da8e7, the length, if available as a tag in the SNDH, is indicated next to each track. It doesn’t proceed to the next track automatically, yet, but it seems to be a good idea to have it do that. Example:
|
On the command line it should stop at the correct time too? |
Should command mode stop and quit after a track, whereas interactive mode proceeds to the subsequent track? After all, as a command it can easily be scripted, to do other things. |
Yes, I would suggest so. I suppose it could be an option to play through. |
The SNDH format has a default track Line 47 in e6da8e7
and so, unless a track is specified, the command may as well play the last track, if it happens to be the default. Of course, the command could still run through them all, if it plays track 1 after the last track, and then stops at the track preceding the default track. Someone will have to write a good user’s manual for this, I fear... :-) |
There’s also a slight complication in the fact that tracks may be expressly endless Lines 118 to 119 in e6da8e7
meaning it won’t stop, quit or proceed automatically. Perhaps a |
Shouldn't --length=xxxx do this already? |
The |
In the SNDH archive, file
Daglish_Ben/Footballer_of_the_Year_2.sndh
plays a couple of seconds then the rest is silent.In interactive mode it shows that it is still playing track 1 although there is no sound.
Is it possible to get psgplay to move onto the next track when the first one has finished playing?
--stop=auto
isn't working for this particular file.Maybe silence detection is required?
Originally mentioned in #13 (comment)
The text was updated successfully, but these errors were encountered: