Revised STOS SNDH Routine, fixed and works

STOS-related stuff in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Revised STOS SNDH Routine, fixed and works

Post by EstTeeEfEm »

This is a revised SNDH routine

There are a couple of pointers though...
Unless you depack the .SND files found in the archive you will need to depack them, I use the missing link extension to do this however if you comment out the "T=DEPACK" line you can load a .SND that has already been unpacked prior to loading it in.

The main fault in the oriignal was the exclusion of DREG(0) Which holds the song number hence why some tracks would play and others not, i found that any tracks with more than 1 song failed but now its fixed, Yay! :P

Code: Select all

10 rem STOS sndh player - wahoo!
20 rem original by gwEm/swe (yay!) for gfa (boo!)
30 rem haxXx0red by ggn - wahay!
40 rem given to you by sh3-rg - 0day kodwarez! ;)
50 rem Bugfixed & DREG(0)/Depack routine added by Black of Relix Games
60 rem NB: MOST, if not ALL SNDH Files are packed
70 rem   : This source requires THE MISSING LINK EXTENSION
80 rem   : However you can unpack the files prior to loading
90 rem   : and just "REM" the code where noted
100 gosub 170 : rem load files
110 gosub 240 : rem start music
120 repeat 
130 M=mouse key
140 until M<>0
150 gosub 300 : rem stop music
160 end 
170 rem                                   load files
180 reserve as work 11,314 : rem make space for inline
190 reserve as work 12,70000 : rem make space for the sndh tune
200 bload "stossndh.bin",start(11) : rem load inline
210 bload "seagulls.snd",start(12) : rem load the sndh tune
220 T=depack(start(12)) : rem Unpack music - You can comment this out tho!
230 return 
240 rem                                   set up & start music
250 dreg(7)=50 : rem 50 for 50Hz, 60 for 60Hz
260 dreg(0)=1 : rem DReg(0) Holds the song number
270 areg(6)=start(12) : rem points to sndh
280 call start(11) : rem start playing tune
290 return 
300 rem                                   stop music
310 call start(11)+4 : rem stop playing tune
320 return 
And the files for this ..
STOSSND2.zip
Much thanks to GWem for the original,
GGN for the hackingness
&
SH3-RG for the original STOS source.

And for those following my threads: this was fixed a LONG time ago but i lost the source, this source comes from an old notepad I dug out while working on Frogger ... ALWAYS back stuff up!!
Enjoy you STOSSERS ;)
You do not have the required permissions to view the files attached to this post.
User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Revised STOS SNDH Routine, fixed and works

Post by exxos »

Cool :) So does that routine work better than the missing link musauto command then ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator
EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by EstTeeEfEm »

It "appears" to play more technical stuff, for instance musauto can linger notes after it stops whereas SNDH.BIN doesnt.. and the SNDH is more resistant to strange music tracks... the seagulls.snd that i added to the ZIP is a good example of this.. digidrums and SID - TAO at his best
If you unpack the music files prior to loading you dont even need TML, the memory footprint of using TML for SNDH is a bit crazy ;)
User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Revised STOS SNDH Routine, fixed and works

Post by exxos »

EstTeeEfEm wrote:It "appears" to play more technical stuff, for instance musauto can linger notes after it stops whereas SNDH.BIN doesnt.. and the SNDH is more resistant to strange music tracks... the seagulls.snd that i added to the ZIP is a good example of this.. digidrums and SID - TAO at his best
If you unpack the music files prior to loading you dont even need TML, the memory footprint of using TML for SNDH is a bit crazy ;)
Cool :) maybe you can do a quick readme file on this and zip it up so I can include it on my extensions page ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator
EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by EstTeeEfEm »

No problems,

I'll redo the code a bit as well, tidy it up and make it generally more pleasing to read lol..
It might be tomorrow though or sometime in the late eve (UK Time)
User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Revised STOS SNDH Routine, fixed and works

Post by exxos »

EstTeeEfEm wrote:No problems,

I'll redo the code a bit as well, tidy it up and make it generally more pleasing to read lol..
It might be tomorrow though or sometime in the late eve (UK Time)
No rush :) I'm not even at home on weekends anyway :)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator
EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by EstTeeEfEm »

Well, glad there isn't a rush lol, I started writing a stand-alone player.. it started to get a little complicated, some of the Tune names: authors, songs and the like are embedded in the .SND music files.. once I get into these I can have a stand-alone player, source and documentation for you..
No point just uploading some source to play it, might as well make something out of it ;)
EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by EstTeeEfEm »

And it even plays TAO's specialist STE SID music :D
User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Revised STOS SNDH Routine, fixed and works

Post by exxos »

Nice :) Yeah its probably good to do a simple routine which is barebones to play them, then people can copy the code into their own programs. If its documented properly then it will save others in the future having the same confusion :)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Sun May 12, 2002 11:53 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by mOa »

Bump!
Thank you for the work but please
I get trouble running Quartet converted SNDH with this routine and TML routine too
I have just changed the file lenght to 250000 b
Maybe it's a newly format?
Thank you
You do not have the required permissions to view the files attached to this post.
User avatar
Mug UK
Administrator
Administrator
Posts: 11539
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: Revised STOS SNDH Routine, fixed and works

Post by Mug UK »

Load the tune into the JAM player (Windows or ST) and it will tell you the Hz that it needs to run at. That is the value that you need to input at the following line:

250 dreg(7)=50 : rem 50 for 50Hz, 60 for 60Hz or 200Hz even

A lot / most digi-based or those using SID effects will need to have the speed set to 200Mhz (from my own GFA testing).
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Sun May 12, 2002 11:53 pm

Re: Revised STOS SNDH Routine, fixed and works

Post by mOa »

Hello Mike. it's been a long time. I hope you're going well. thank for the answer but it doesn't work unfortunately.
It even freezes STOS. Also, there is no reference of the 200Hz in the source so maybe it's not intended to work?
Thank you
Post Reply

Return to “STOS”