Author Topic: DOS music and sound effects for Lemmix? an idea.  (Read 13160 times)

0 Members and 2 Guests are viewing this topic.

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #15 on: October 06, 2014, 07:51:00 AM »
May as well be Russian to me... as I said, I don't get C++. I found some code to use a version of the library with Game Maker, but that isn't making much more sense - I can at least get from that, for example, what the interfaces are and how many arguments they take (there again, that's assuming the code isn't modified, which it probably is given Game Maker's stringent requirements for DLL interfaces), but it doesn't really say anything about what the values are supposed to be. (For example, the Init function has a value passed to it, which I have no idea what it's meant to be for.)
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Zaphod77

  • Guest
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #16 on: October 06, 2014, 07:55:30 AM »
ok, i compiled a new one. this one shoudl actually play the YGM files right.  now if I just knew how to test it in Delphi...

Zaphod77

  • Guest
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #17 on: October 06, 2014, 08:15:38 PM »
also i found this little progam..

http://grompe.org.ru/files/opl2wav.zip

an example for inking in an opl2 emulator. sadly it doesn't understand vgm files, though. but it JUST might be helpful. can't vouch for the quality. ther'es supposedly a converter to xm, but well, i don't think it's perfect.

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #18 on: October 07, 2014, 12:38:54 AM »
ok, i compiled a new one. this one shoudl actually play the YGM files right.  now if I just knew how to test it in Delphi...

If you can let me know what it's interfaces are (at least the ones needed to initialize it, play music, stop music and free it from memory - I don't think any others are needed, though volume control might be nice to have too), I can do the testing.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Zaphod77

  • Guest
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #19 on: October 07, 2014, 03:07:30 AM »
i'm still not an expert, but..

i also uploaded what I believe is the right header file, which exposes the interfaces you will need. part of the problem is that one of the parameters for the appropriate functions is a pointer to a class that the library uses.

http://eunich.cochems.com/~zaphod/libgme.dll

perhaps this article will be useful.

http://www.drbob42.com/delphi/headconv.htm

the needed functions are


* Open the file with gme_open_file()
* Start a track with gme_start_track();
* Generate samples as needed with gme_play()
* Play samples through speaker using your operating system
* Delete emulator when done with gme_delete()

the header file has the function definitions. the issue is the gme_t parameter bit, which totally confuses me.

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #20 on: October 07, 2014, 09:20:32 AM »
Where's the header file?
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Zaphod77

  • Guest

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #22 on: October 07, 2014, 04:52:35 PM »
Can't make much sense of that. I sort of get how that works in general, but I'd have to work with raw samples then, which I'd either need to manually process the output (which I have no idea how it's done), or pass it through to Bass.dll (and if I'm going to do that, I may as well just go with the plugin method).

I've had some success with Bass.dll now - I've successfully played an *external* MOD file. Still need to get it playing an internal one; once I can do that, I can try and extend that to VGM support. I'm using the same pointer (which should work) as works perfectly fine with BassMod to refer to the music in memory, so I'm not sure why it's not working. It gives a "cannot open file" error, which suggests maybe it's mistakenly trying to open an actual file even though it's specifically stated that it should be attempting to load from memory. :/
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Zaphod77

  • Guest
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #23 on: October 08, 2014, 02:06:36 AM »
Well, i look forward to this getting worked out. :)  and hope i've been at least some help.

did you look over opl2wav?

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #24 on: October 08, 2014, 02:53:12 AM »
Didn't look at that one yet, must've missed the comment about it.

And you've definitely been some help - if nothing else, you at least pointed me in the right direction of where to *get* the music files themself, as well as pushed me towards being more determined to get it working one way or another.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #25 on: October 08, 2014, 05:56:48 AM »
Progress: The same can now be acheived with an internal BASS.DLL (instead of BASS.DLL having to be seperate from the Lemmix EXE). I'll test if this makes a difference with playing from memory; it's the *one* factor that was different between the two before (apart from whether BassMod or Bass was being used) so while I can't see *why* it would, I'll see if it does.


EDIT: It makes no difference to that, sadly. I'll have to look more into this; but at least I've got BASS.DLL loading from inside the EXE instead of an external file. That's another thing that has to be done anyway for this to eventually work.

EDIT: GOT IT! It appears that unlike BassMod, Bass cannot automatically determine the size of the MOD data, and it instead must be specifically passed to it. Once I adjusted for that, it works perfectly fine!

Now, on to adding VGM support. It appears Bass plugins cannot be loaded from memory, and thus must be a proper external DLL file. I've asked on the Bass forums in case there's a way around this, but it seems the closest workaround might be needing to extract the plugin DLLs at runtime. Alternatively, looped OGGs could be used at this point, it would seem.

OKAY, MAJOR BREAKTHROUGH!
I can load the Winamp Inputs plugin (but not yet in_vgm itself) from memory, and, for the first time, HAVE SUCCESSFULLY PLAYED A VGM AS BACKGROUND MUSIC! However, there are other issues, like not stopping correctly - still need to work on this one. However, it means we're getting closer to it!

Another issue I'll have to look into is that currently, the tracks loop twice then fade out. But that should be a simple fix, just have to find the right configuration option.

EDIT: Fixed the not-stopping-correctly issue. Still need to fix the looping issue.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Zaphod77

  • Guest
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #26 on: October 08, 2014, 08:19:07 AM »
yes, default is to loop twice and fade.

you need to change it to infinite loop. but not sure how to configure a plugin when used with bass

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #27 on: October 08, 2014, 08:45:09 AM »
I found a way around that. But something I've done is now causing heaps of random crashes... not sure why, it was working fine a while ago. I'll have to try and fix it now... >_>
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #28 on: October 08, 2014, 09:25:07 AM »
Alright, at this stage I've got it down to three possible options depending on slight changes, none of which are ideal:

1) The music plays the first time. It'll loop infinitely, but if it's actually stopped (by ending the level or turning music off), no more music will play on future levels / retries / when the music is turned back on.
2) The music plays. Apart from the first time, it glitches, and a crash soon follows.
3) The music doesn't play (but no crashes).
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: DOS music and sound effects for Lemmix? an idea.
« Reply #29 on: October 08, 2014, 09:58:05 AM »
I'm over it. I can't find ANY logical reason why it's giving these problems with VGM, so I'm over trying to make it play them properly.

Instead, I'm now turning my attention to the OGG method, which is working perfectly - and doesn't require any hacky workarounds for saving the DLLs internally (as it only uses BASS.DLL which has no problems). I'm now trying to see what I can do to minimize the size of the OGG files.


At this point, I have OGG files playing completely internally (both the bass.dll and the OGGs themself), as well as being able to combine OGG and IT files in the same player. (Actually, *any* format that BASS supports should work, but it only looks for "IT" or "OGG" extensions - but you could just rename another file to .IT (if it's a MOD-based format) or .OGG (anything else) and it should work.)



Now, earlier I mentioned this would give a huge filesize right? Well there's no way around that apart from killing the quality of the music... so I came up with a kind of workaround to that, too! By default they'll still have the Amiga versions internally. I'll put up a second, optional download, which contains the OGGs of the DOS music packed into one file - drop this file into the same folder, and it'll load the DOS musics from that instead and play those.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)