Adding new sounds [coders needed]
Moderator: TTDPatch Moderators
- Sanchimaru
- Tycoon
- Posts: 1542
- Joined: 05 Feb 2004 22:39
- Location: Kobe, Japan
- Contact:
Thanks Csaboka; don't worry for the edit, I think you did it well (^_')b
However the problem with the sounds seems to be, indeed harder than it sounds (totally idiot joke, I know) since it's not something that can easily be added through a GRF file; but a modification to the program's CAT file.
I have another idea, then:
Since editing sounds is so complex we can't do it just the way we are used to (via GRF) and it would be hard that each one had their own sound files:
What about deciding a set of default sonds to be added to the existing ones? We will not have such a great customization option as we do with the sprites, but the limitation would be upgraded a little bit.
For example, we can have typical industries sounds; seagulls voices for the fishing grounds, and maybe new sounds for harbors, etc.
I don't have a clear idea of what would be needed, but I think that we all together could agree on what new sounds could be added to the CAT file.
However the problem with the sounds seems to be, indeed harder than it sounds (totally idiot joke, I know) since it's not something that can easily be added through a GRF file; but a modification to the program's CAT file.
I have another idea, then:
Since editing sounds is so complex we can't do it just the way we are used to (via GRF) and it would be hard that each one had their own sound files:
What about deciding a set of default sonds to be added to the existing ones? We will not have such a great customization option as we do with the sprites, but the limitation would be upgraded a little bit.
For example, we can have typical industries sounds; seagulls voices for the fishing grounds, and maybe new sounds for harbors, etc.
I don't have a clear idea of what would be needed, but I think that we all together could agree on what new sounds could be added to the CAT file.
-
- Tycoon
- Posts: 14275
- Joined: 09 Jan 2003 08:37
I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? if some devs will want to "translate" it to DOS it is fine, but if you can to make it just for WIN version it is great !
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
what are you looking at? it's a signature!
We could make it so that the Patch, when loading a GRF file, also looks to see if there's a CAT file of the same name, and if so, concatenates it to the end of the existing one. But that still would require a change in the sound handler, because the length of the CAT file is hard coded, I understand.Sanchimaru wrote: However the problem with the sounds seems to be, indeed harder than it sounds (totally idiot joke, I know) since it's not something that can easily be added through a GRF file; but a modification to the program's CAT file.
Also, I agree with Shadow.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
That´s just plain ignorance.SHADOW-XIII wrote:I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? [...]
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
- firstly, there are many people out there using the DOS version, not because their PCs are outdated but because the DOS version has indeed its advantages,
- secondly, a good percent of the developers are using the DOS version,
- thirdly, what would you say if I´d stop developing for Windows because I´d prefer DOS?
- fourthly, Csaba had already stated that it seems to be possible to do it explicitly for the DOS version.
I won´t going to do it myself, but I´m very much sure that the DOS version will be patchable as easy as the win version regarding that sound issue. Csaba stated already that there´s no DOS sound drivers involved needed to be patched.
O/c there´s a layer between the sound drivers and TTDLX. CS is a professional programmer and all the talk about "sound drivers" is crap. Learn to read.
regards
Michael
It seems it would be possible to add new samples to sample.cat without modifying the driver, but loading samples from different files would need a rewrite.
Meanwhile, I found the source of SOUNDRV.COM. It's a third-party sound driver called DigPak, I've found some documentation for it as well. This means the person who wants to rewrite SOUND.COM can have a full documentation about how to use the actual sound driver.
Michael: The DOS version won't be as easy to change as the Windows version, this is sure. TTD runs in protected mode while SOUND.COM and DigPak run in real mode. Interfacing between the two is complicated, not to mention the good old 640K limit which prevents SOUND.COM from having all its samples loaded into the memory. The Windows sound driver runs in protected mode (as any Windows program does), even in the same address space, so exchanging data can be done by simply passing pointers.
Meanwhile, I found the source of SOUNDRV.COM. It's a third-party sound driver called DigPak, I've found some documentation for it as well. This means the person who wants to rewrite SOUND.COM can have a full documentation about how to use the actual sound driver.
Michael: The DOS version won't be as easy to change as the Windows version, this is sure. TTD runs in protected mode while SOUND.COM and DigPak run in real mode. Interfacing between the two is complicated, not to mention the good old 640K limit which prevents SOUND.COM from having all its samples loaded into the memory. The Windows sound driver runs in protected mode (as any Windows program does), even in the same address space, so exchanging data can be done by simply passing pointers.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
-
- Tycoon
- Posts: 14275
- Joined: 09 Jan 2003 08:37
Micheal I know there are people who are using DOS version and certainly I know that developer use DOS version to find & test some things, I see no problem with that, it is just that if something is really difficult to implement in DOS then why bring down whole idea ?michael blunck wrote:That´s just plain ignorance.SHADOW-XIII wrote:I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? [...]
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
- firstly, there are many people out there using the DOS version, not because their PCs are outdated but because the DOS version has indeed its advantages,
- secondly, a good percent of the developers are using the DOS version,
- thirdly, what would you say if I´d stop developing for Windows because I´d prefer DOS?
- fourthly, Csaba had already stated that it seems to be possible to do it explicitly for the DOS version.
btw. there was once a poll that people voted which version do then use, it was more than 70% of WIN version
what are you looking at? it's a signature!
- stevenh
- TTDPatch Developer
- Posts: 759
- Joined: 24 Jul 2005 05:07
- Location: Canberra, Australia
- Contact:
MPSSND_C.DLL Recreated!
Folks, I've been reading these forums now for a while and realised it was time to contribute.
For those Windows users out there, backup your current MPSSND_C.DLL file in your TTD directories and replace it with the one I'm providing here.
I've recreated the Library that sits between TTD and DirectSound and now am able to do whatever the hell I want with it!
Talking to Csaboka, We've been scheming up a way to use it to add new sounds. I've created the necessary framework to play raw wave data from somewhere else (other than in my DLL), and therefore WAVE files can be loaded from the GRFs and just played.
Of course, it's now off the the TTDPatch side of things to get the other side of this written.... Right now, this is what it can do:
Panning, Volume and Frequency are all working (all 73 sounds are loaded from sample.cat). They now play at what they're encoded at (ie. what the individual headers state in the wave chunks in the file).
Some things just sound weird, others sound cool.... I probably should end up limiting all the sounds to the normal frequency... either way...
Tell me what you think!
-----------------------------------------------------------------------------------------
BTW: DOS Users, don't despair. I intend on recreating the DOS version as well... Just understand that this may take a little more than 48 hours 
For those Windows users out there, backup your current MPSSND_C.DLL file in your TTD directories and replace it with the one I'm providing here.
I've recreated the Library that sits between TTD and DirectSound and now am able to do whatever the hell I want with it!
Talking to Csaboka, We've been scheming up a way to use it to add new sounds. I've created the necessary framework to play raw wave data from somewhere else (other than in my DLL), and therefore WAVE files can be loaded from the GRFs and just played.
Of course, it's now off the the TTDPatch side of things to get the other side of this written.... Right now, this is what it can do:
Panning, Volume and Frequency are all working (all 73 sounds are loaded from sample.cat). They now play at what they're encoded at (ie. what the individual headers state in the wave chunks in the file).
Some things just sound weird, others sound cool.... I probably should end up limiting all the sounds to the normal frequency... either way...
Tell me what you think!
-----------------------------------------------------------------------------------------



- Attachments
-
- mpssnd_c.zip
- Update: 21/08/2005... no more massive log file... not that anyone noticed :p
- (20.07 KiB) Downloaded 119 times
Last edited by stevenh on 21 Aug 2005 09:30, edited 2 times in total.
Rawr! Aussie TTD'ers taking over!
Excellent work Steveh. Big thanks to you.
Excellent work Steveh. Big thanks to you.
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
- stevenh
- TTDPatch Developer
- Posts: 759
- Joined: 24 Jul 2005 05:07
- Location: Canberra, Australia
- Contact:
The startup sound is my 2c
... Clapping on one channel, Cheering on the other.
The different sounds you hear in the game are actually the REAL samples.
In sample.cat, each sound has it's own header information, which includes the speed the sample is played at.
Now, TTD just blatantly limits all sounds to 'single speed' sound (11025Hz) whereas some sounds in there are encoded at 'double speed' (22050Hz)... So the effects you are hearing are actually mistakes by Fish!UK or Microprose.
Glad to see it's working.... Still having issues with Windows9X.
[BTW, if someone running Windows 95.98.ME could try this DLL, it'd be greatly appreciated.]

The different sounds you hear in the game are actually the REAL samples.
In sample.cat, each sound has it's own header information, which includes the speed the sample is played at.
Now, TTD just blatantly limits all sounds to 'single speed' sound (11025Hz) whereas some sounds in there are encoded at 'double speed' (22050Hz)... So the effects you are hearing are actually mistakes by Fish!UK or Microprose.
Glad to see it's working.... Still having issues with Windows9X.
[BTW, if someone running Windows 95.98.ME could try this DLL, it'd be greatly appreciated.]
Steven ... I just tried your new file from this morning ... still not working for me and still no log but TTDX's own version still works fine.
I'm using TTDX windows version with the Fish(UK) screen so I know I'm not using the DOS version.
My system is Win98SE
My DirectX is 8.1 and sounds test good.
Device: AWE64 Direct Sound Driver[220]
Driver: SB16.VXD
I don't think its your compile ... any other possibilities?
I'm using TTDX windows version with the Fish(UK) screen so I know I'm not using the DOS version.
My system is Win98SE
My DirectX is 8.1 and sounds test good.
Device: AWE64 Direct Sound Driver[220]
Driver: SB16.VXD
I don't think its your compile ... any other possibilities?
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
Akalamanaia: It turns out that the cash-in sound was a bug all along. The headers of that sound say that it's to be played at 22050 Hz, but TTD just ignores the header and plays it at 11025 Hz. The new sound driver respects the header and plays the sound file as originally intended.
Of course, the question arises: should we keep the old buggy behavior because people got used to it, or should we fix it so it works as originally intended?
Of course, the question arises: should we keep the old buggy behavior because people got used to it, or should we fix it so it works as originally intended?
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
This is indeed fascinating! I'm sure we'll find lots of interesting things to do with it.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
- Born Acorn
- Tycoon
- Posts: 7596
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
I'm not really sure whether loop sounds would be a good idea. I think it'd be annoying. Also, I think it still would be able to play only one sound at a time, so the loop sound would cut off when some other sound-triggering event took place, then start up again abruptly once the other sound ended? Or just block any other sounds from taking place? Either way, probably better not to do that. TTD has fairly short sound clips, and I think that's wise.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Well, the number of sounds played simultaneously can be set between 1 and 8 in DOS TTD (default is 4), and I think there's no limit in Win TTD.
Still, looping sounds would be difficult to do, especially if they should change position during playback. (For example, the sound of a train going across the screen should change its panning constantly).
Still, looping sounds would be difficult to do, especially if they should change position during playback. (For example, the sound of a train going across the screen should change its panning constantly).
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
Who is online
Users browsing this forum: No registered users and 10 guests