Description: Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.Moderators:Moderators, Semi-moderatos

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)

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!

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!

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 fodlersor you can insert them into your episode (you don't need to customize complete stuff, you can just replace only necessary).

/--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!)

Yes! You can install the BASSMIDI driver which is a midi driver which supports using of any sound fonts. I always use them and I using the Cakewalk Sonar 1.0 with patches which a great and advanced midi editor. (Now newer is Cakewalk SONAR X3 is much better and progressive, but for MIDI editing much better is an old build of Sonar 1.0)

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!

Repost of my Talkhaus post:Good news!I just implemented the new audio API which has 33 API functions to work with sounds and musics!https://github.com/Wohlhabend-Networks/LunaDLL/blob/master/LunaDll/LuaMain/LunaLuaMain.cpp#L235Later there are will be available in next build, now I documenting a new stuff.New stuff uses more useful things of SDL Mixer API, including the looped SFXed with ability to control them! Etc.Also I was implemented the fix of annoy bug with Alt-Tab: It will work, but with new rules:- Set ANY default music into section with LUA-music- Add into onLoad() event the Audio.SeizeStream(xxx) (where XXX - is a section ID from 0...20. If you will write -1 - will be seized ALL sections). This function will seize music stream from SMBX engine and we can freely use music stream with LUA. This also fixing a bug: SMBX think than "Music is playing" and sends "pause" and "resume" commands to play/pause music by alt+tab switching.

Also I fixed bug with playing long SFXes after exiting from level: all custom SFXes and LUA Musics will be aborted when level/world will be closed.

beanluv wrote:Could You make an Update That Supports SEGA Genesis BIN Files? I Noticed There's A SPC Format Supported, Could Ya Make A BIN Player For it?

I'm afraid this is not possible.

Playing a SMD (SG in USA) requires a software synthesizer which emulates the synthesizers employed in SMD, find out how to decode the operators inside and decode the melody. And there aren't any OSS SMD Bin players out there. Althrough I'm sure if Wohl and Kev are skilled enough, they can look at an emulator's source code and grab the soundcard emulation part.

Unlike SNES, which you've got a plenty of open sourced SNES players, and you just need to grab the samples and the melody.

Do you want fries with that?Mal posso esperar para a versão final da engine de Wolhstand!