LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT, etc.

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?

Do you like this idea with using of SDL Mixer?

Yes, I like it!
25
93%
No, I don't like this thing.
2
7%
I have another opinion...
0
No votes
 
Total votes: 27
Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT, etc.

Postby Wohlstand » 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:

Code: Select all

/--MyEpisode
-|--Folder of musics
-------musicfile1.mp3
-------musicfile2.ogg
-------musicfile3.mid
-------musicfile4.it
-------...
-------...
----music.ini
----sounds.ini
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
Last edited by Wohlstand on Sun Mar 22, 2015 4:36 pm, edited 12 times in total.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = FLAC,OGG,MOD,XM,IT, etc.

Postby Wohlstand » Mon Jan 05, 2015 8:58 pm

New update is available now!
  • Added sounds and default musics customization: you can use INI-files instead of hacking EXE to redefine paths to your audio files!
  • Added episode specific sounds and musics customization: you can use same sounds.ini and music.ini inside your episode to take able customize EVEN WORLD MAP MUSIC WITHOUT REPLACEMENT OF DEFAULT SMBX's STUFF! Also you can have custom P-Switch musics too!
Main page was updated, added examples of GLOBAL and EPISODE SPECIFIC audio stuff configs.

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby DarkShadeX » Mon Jan 05, 2015 10:37 pm

Thanks for the ini feature wohlstand!

Onule
Spiny
Spiny
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Onule » Tue Jan 06, 2015 10:30 am

Great job, I look forward to use this, although would it be possible to have dynamic music? Example of this would be Binding of Isaac Rebirth.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Tue Jan 06, 2015 4:09 pm

Onule wrote:Great job, I look forward to use this, although would it be possible to have dynamic music? Example of this would be Binding of Isaac Rebirth.
By anyway you have LunaLUA and it's special functions to manipulate with music playback ;)

RzFx
Fighter Fly
Fighter Fly
Posts: 43
Joined: Fri Dec 05, 2014 11:52 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby RzFx » Wed Jan 07, 2015 1:47 pm

For me, some of the default songs have their speed reduced when I play them. And also, some custom musics (mp3) plays with clicks.
Last edited by RzFx on Wed Jan 07, 2015 1:49 pm, edited 1 time in total.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Wed Jan 07, 2015 1:49 pm

RzFx wrote:For me, some of the default songs have their speed reduced when I play them. And also, some custom musics (mp3) plays with clicks (I think the problem is where I get them, because my intro music is from Newgrounds and plays right, when the music that plays with clicks is from YouTube Mp3).
They aren't re-sampled into 44100 Hz. Try to resample them to take normal playback ;)

RzFx
Fighter Fly
Fighter Fly
Posts: 43
Joined: Fri Dec 05, 2014 11:52 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby RzFx » Wed Jan 07, 2015 1:51 pm

Wohlstand wrote:They aren't re-sampled into 44100 Hz. Try to resample them to take normal playback ;)
If I knew how...

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby DarkShadeX » Wed Jan 07, 2015 1:53 pm

Get Audacity then do this:
Spoiler: show
Image

RzFx
Fighter Fly
Fighter Fly
Posts: 43
Joined: Fri Dec 05, 2014 11:52 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby RzFx » Wed Jan 07, 2015 1:53 pm

DarkShadeX wrote:Get Audacity then do this:
Spoiler: show
Image
The problem is I can't get anywhere the plugin to export to mp3.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Wed Jan 07, 2015 1:54 pm

RzFx wrote:
Wohlstand wrote:They aren't re-sampled into 44100 Hz. Try to resample them to take normal playback ;)
If I knew how...
Take already resampled default SMBX's musics:
https://drive.google.com/open?id=0B3QNP ... authuser=0

Feel free to save music into FLAC or OGG format, because SMBX with LunaDLL+SDL supports them. If you need MPEG plugin, I will later send them ;-)

EDIT: DarkShadeX already sent them in next post ;)
Last edited by Wohlstand on Wed Jan 07, 2015 2:21 pm, edited 1 time in total.

DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby DarkShadeX » Wed Jan 07, 2015 1:57 pm

RzFx wrote:
DarkShadeX wrote:Get Audacity then do this:
Spoiler: show
Image
The problem is I can't get anywhere the plugin to export to mp3.
Check this website and scroll down until you find a download link for LAME for Windows:
http://lame.buanzo.org/
Download and install it!
This is made for audacity to export to MP3 ; )

RzFx
Fighter Fly
Fighter Fly
Posts: 43
Joined: Fri Dec 05, 2014 11:52 am

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby RzFx » Wed Jan 07, 2015 2:20 pm

I mean, I can't download it from here. The page never stops loading.
But I found a site that can resample audio files (and also convert to other formats), so my problem is solved.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Wed Jan 07, 2015 2:23 pm

RzFx wrote:I mean, I can't download it from here. The page never stops loading.
But I found a site that can resample audio files (and also convert to other formats), so my problem is solved.
Good! :)

But by anyway, I downloaded it to my server, and this is an alternate link:
http://engine.wohlnet.ru/docs/Software/ ... -2.0.6.exe
and
http://engine.wohlnet.ru/docs/Software/ ... indows.exe
http://engine.wohlnet.ru/docs/Software/ ... -2.2.2.exe
Enjoy ;-)

Onule
Spiny
Spiny
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Onule » Fri Jan 30, 2015 1:26 pm

For some reason, while trying out the playlist level, the entire game's audio dies out when it plays "the_reincarnation_of_yammah.s3m", restarting doesn't fix it.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Fri Jan 30, 2015 1:35 pm

Onule wrote:For some reason, while trying out the playlist level, the entire game's audio dies out when it plays "the_reincarnation_of_yammah.s3m", restarting doesn't fix it.
With bunch of random tests I found ModPlug much more stable than MikMod, I was rebuilt my SDL2_mixer with using of ModPlug.
Download link has been updated, please re-download package, overwrite old stuff and try again.

Onule
Spiny
Spiny
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Onule » Fri Jan 30, 2015 1:58 pm

Overwrote the old files, still doesn't work.
Volume mixer shows there's audio playing but nothing's playing.
Image

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Fri Jan 30, 2015 2:03 pm

Onule wrote:Overwrote the old files, still doesn't work.
Volume mixer shows there's audio playing but nothing's playing.
Image
OOps, just checked: link still have old stuff :P
(now uploading too much updated stuff into google drive and updated SDL mixer stuff in queue waiting to be updated)

Get updated version directly from my server: http://engine.wohlnet.ru/docs/_laborato ... _mixer.zip (it will slow for American continents)
(new version shouldn't have libmikmod DLL)

Onule
Spiny
Spiny
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Onule » Fri Jan 30, 2015 2:30 pm

Got the updated version and deleted libmikmod DLL from the folder, problem still persists.

Wohlstand
Van De Graf
Van De Graf
Posts: 2006
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL+SDL2_Mixer = Customizable SFX, FLAC,OGG,MOD,IT,

Postby Wohlstand » Fri Jan 30, 2015 2:35 pm

Onule wrote:Got the updated version and deleted libmikmod DLL from the folder, problem still persists.
I have no this problem with it, but just in case try this track instead of that: http://engine.wohlnet.ru/docs/_files_fo ... around.s3m


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari