LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT, etc.
Posted: Thu Jan 01, 2015 7:36 am
Hello! I wanna present a some special thing: We with Kevsoft made a hook to the MCI call and we was got able to replace music/sound playback machine.
This this a build of LunaDLL which will completely replace SMBX's audio engine with SDL2_mixer. SDL2_mixer will give more, faster and flexible audio playback and more supported built-in formats! Also, SDL will play MIDI's correctly unlike default MCI, and will play traker music formats like .MOD, .IT, .XM, .S3M, etc... (you can create them through Mod Plug Tracker with or without using of MIDI-files as sources and with your samples, for example, which you used to build your own .SPC files)
Default MCI:
- Floods system tray with codec icons
- Loading slow
- Between loops you will hear clicks
- Supported formats: MP3, WAV and buggy playback of MID
SDL2_Mixer:
- Supported built-in formats: MP3, WAV, MID, OGG, FLAC, MOD, IT, XX, S3M, etc...
- Will prevent flood of system tray because SDL Mixer play all sounds and musics with built-in decoders!
- Almost instant music/sound loading!
- Faster and better sound playback
- Starting of music playback is faster!
- True and clean loop: you will don't hear clicks between loops if your sound have connected waves on edges
- We have able to implement customization of sounds and musics stuff through LunaDLL without replacing of default content and without re-hexing of smbx.exe!
- SMBX summary will starts FASTER!
Download level file from this video with used musics:
https://drive.google.com/open?id=0B3QNP ... authuser=0
Restrictions:
========================================================================================
- You should convert all .MP3 sound effects into .OGG format (put your .ogg files into /sounds dir of SMBX, you can remove old .mp3 stuff, but save them just in case. LunaDLL+SDL will play .OGG sounds instead of original .MP3's).
- All your musics should have 44100 sample rate or you will hear dirty noise. You should re-sample your musics into 44100 Hz. (SDL's real-time re-sampler is buggy yet.). Why? Because SDL mixer plays all sounds and musics in the united stream and all tracks should have a uniform sample rate (SDL trying to re-sample them if they have sample rate which is not equal to sample rate of stream, but this is not giving guaranties for good playback).
How to use:
========================================================================================
Simple and easy: just unpack contents of archive and replace LunaDLL.dll with new (smbx.exe should be hexed with LunaDLL!) and your SMBX will have able to play more music formats! If you will don't use autocode or lua scripts, all SMBX's sounds and musics will be played through SDL anyway! You will take able put your .OGG, .FLAC or any tracker musics (.IT, .MOD, XT, etc...) into your "custom" music field and enjoy
But if you wish to use SDL with scripts, you now have a way to play multiple custom musics at one section!
Download official LunaLUA (Already includes SDL2_mixer)
_____________________________________________________________________________________________________
Useful stuff and examples
Download OGG stuff for SMBX 1.3.0.1
https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
Download OGG stuff for A2MBXT
https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX/A2MBXT directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
LUA Example 1 - multiple custom musics in one section!
https://drive.google.com/open?id=0B3QNP ... authuser=0
(You have able use ANY files with formats: WAV, MP3, OGG, MID, IT, MOD, XM, S3M, etc...)
LUA Example 2 - Random music switch and panning stereo SFX loop effects!
https://drive.google.com/open?id=0B3QNP ... authuser=0
Custom sound pack example
https://drive.google.com/open?id=0B3QNP ... authuser=0
Unpack them into root of any your episode and try to play it!
P.S> PGE uses SDL2_mixer to play musics and sounds!
Also:
Download software MIDI-driver which plays MIDI like SB16 on Windows 95/95: http://engine.wohlnet.ru/docs/Sounds/SM ... 3synth.zip
Driver for Windows XP/Vista/7/8. If you have Windows Vista/7/8 You will need a tool which giving able switch MIDI playback device
(I recommends a BASSMIDI http://www.kode54.net/bassmididrv/ ). In the Windows XP you can switch your MIDI device in the "Control Panel" / "Sounds and Audio Devices"
Customization of default sounds and musics WITHOUT replacing! (sounds.ini and music.ini)
========================================================================================
There are a special files which redefining music and sounds paths. You can just put them into SMBX root with sound and music fodlers
or you can insert them into your episode (you don't need to customize complete stuff, you can just replace only necessary).
Episode tree:
In the INI-file all path relative to EPISODE ROOT: If put musics into subfolder "My Music", you should define paths:
....
file="My Music/myfile.ogg"
....
Same rule for sounds.ini!
In the "_ini_examples" folder you can take examples of INI-files redefinign of music and sounds stuff.
You have able use ANY music in next formats: MP3, OGG, FLAC, WAV, MID, IT, XM, MOD, S3M, (and other tracker music formats...).
You have able use ANY sounds in next formats: OGG, FLAC, WAV (Note: sounds in MP3 format will NOT work with SDL Mixer!)
SDL Mixer specific LUA API:
========================================================================================
Read official LunaLUA references
This this a build of LunaDLL which will completely replace SMBX's audio engine with SDL2_mixer. SDL2_mixer will give more, faster and flexible audio playback and more supported built-in formats! Also, SDL will play MIDI's correctly unlike default MCI, and will play traker music formats like .MOD, .IT, .XM, .S3M, etc... (you can create them through Mod Plug Tracker with or without using of MIDI-files as sources and with your samples, for example, which you used to build your own .SPC files)
Default MCI:
- Floods system tray with codec icons
- Loading slow
- Between loops you will hear clicks
- Supported formats: MP3, WAV and buggy playback of MID
SDL2_Mixer:
- Supported built-in formats: MP3, WAV, MID, OGG, FLAC, MOD, IT, XX, S3M, etc...
- Will prevent flood of system tray because SDL Mixer play all sounds and musics with built-in decoders!
- Almost instant music/sound loading!
- Faster and better sound playback
- Starting of music playback is faster!
- True and clean loop: you will don't hear clicks between loops if your sound have connected waves on edges
- We have able to implement customization of sounds and musics stuff through LunaDLL without replacing of default content and without re-hexing of smbx.exe!
- SMBX summary will starts FASTER!
Download level file from this video with used musics:
https://drive.google.com/open?id=0B3QNP ... authuser=0
Restrictions:
========================================================================================
- You should convert all .MP3 sound effects into .OGG format (put your .ogg files into /sounds dir of SMBX, you can remove old .mp3 stuff, but save them just in case. LunaDLL+SDL will play .OGG sounds instead of original .MP3's).
- All your musics should have 44100 sample rate or you will hear dirty noise. You should re-sample your musics into 44100 Hz. (SDL's real-time re-sampler is buggy yet.). Why? Because SDL mixer plays all sounds and musics in the united stream and all tracks should have a uniform sample rate (SDL trying to re-sample them if they have sample rate which is not equal to sample rate of stream, but this is not giving guaranties for good playback).
How to use:
========================================================================================
Simple and easy: just unpack contents of archive and replace LunaDLL.dll with new (smbx.exe should be hexed with LunaDLL!) and your SMBX will have able to play more music formats! If you will don't use autocode or lua scripts, all SMBX's sounds and musics will be played through SDL anyway! You will take able put your .OGG, .FLAC or any tracker musics (.IT, .MOD, XT, etc...) into your "custom" music field and enjoy

But if you wish to use SDL with scripts, you now have a way to play multiple custom musics at one section!
Download official LunaLUA (Already includes SDL2_mixer)
_____________________________________________________________________________________________________
Useful stuff and examples
Download OGG stuff for SMBX 1.3.0.1
https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
Download OGG stuff for A2MBXT
https://drive.google.com/open?id=0B3QNP ... authuser=0
To take effects, unpack archive into your SMBX/A2MBXT directory (sounds.ini and musics.ini - definition of standard musics and sounds, you can edit them instead of hack EXE!)
LUA Example 1 - multiple custom musics in one section!
https://drive.google.com/open?id=0B3QNP ... authuser=0
(You have able use ANY files with formats: WAV, MP3, OGG, MID, IT, MOD, XM, S3M, etc...)
LUA Example 2 - Random music switch and panning stereo SFX loop effects!
https://drive.google.com/open?id=0B3QNP ... authuser=0
Custom sound pack example
https://drive.google.com/open?id=0B3QNP ... authuser=0
Unpack them into root of any your episode and try to play it!
P.S> PGE uses SDL2_mixer to play musics and sounds!
Also:
Download software MIDI-driver which plays MIDI like SB16 on Windows 95/95: http://engine.wohlnet.ru/docs/Sounds/SM ... 3synth.zip
Driver for Windows XP/Vista/7/8. If you have Windows Vista/7/8 You will need a tool which giving able switch MIDI playback device
(I recommends a BASSMIDI http://www.kode54.net/bassmididrv/ ). In the Windows XP you can switch your MIDI device in the "Control Panel" / "Sounds and Audio Devices"
Customization of default sounds and musics WITHOUT replacing! (sounds.ini and music.ini)
========================================================================================
There are a special files which redefining music and sounds paths. You can just put them into SMBX root with sound and music fodlers
or you can insert them into your episode (you don't need to customize complete stuff, you can just replace only necessary).
Episode tree:
Code: Select all
/--MyEpisode
-|--Folder of musics
-------musicfile1.mp3
-------musicfile2.ogg
-------musicfile3.mid
-------musicfile4.it
-------...
-------...
----music.ini
----sounds.ini
....
file="My Music/myfile.ogg"
....
Same rule for sounds.ini!
In the "_ini_examples" folder you can take examples of INI-files redefinign of music and sounds stuff.
You have able use ANY music in next formats: MP3, OGG, FLAC, WAV, MID, IT, XM, MOD, S3M, (and other tracker music formats...).
You have able use ANY sounds in next formats: OGG, FLAC, WAV (Note: sounds in MP3 format will NOT work with SDL Mixer!)
SDL Mixer specific LUA API:
========================================================================================
Read official LunaLUA references