SunVox for ZGE
Moderator: Moderators
SunVox for ZGE
I'm pleased to announce that ZGE can play SunVox files from now as an alternative to tracker files (.XM, .IT, .S3M, .MOD, ...) played by the Bass library.
SunVox is an excellent free tracker with modular synthesizer. It produces pretty small files, smaller than obvious tracker files - SunVox files usually do not contain samples, all sounds are generated in runtime. BTW I tried several trackers, loopers, and various music production SW, but SunVox is one of the most easy-to-learn and productive tools.
The SunVox Dynamic Library DLL can be downloaded from here. Please note, this is not the "official" DLL (yet), and it was produced by NightRadio (author of SunVox) specially for ZGE on my request. The library is larger than bass.dll, but it can be compensated by small music files. So, it is up to you which music player you choose for your projects. The library is provided just for Win32, Linux and OSX at the moment, however, there are plans also for Android.
Attached, you can find a simple demo project showing you a basic usage of the library. You need to download the DLL and copy it to the same directory.
The SunVox dll was more-or-less an experimental software up to now, used freely by people. Anyway, I asked for licensing and still waiting for the answer. I hope it's free and allowed to be used in our ZGE projects. (SunVox itself is distributed under the BSD license.)
Ville, if you think it's appropriate, you can put the SunVox external library to the distributed ZGE's Lib files and also to the "Add from library..." menu.
SunVox is an excellent free tracker with modular synthesizer. It produces pretty small files, smaller than obvious tracker files - SunVox files usually do not contain samples, all sounds are generated in runtime. BTW I tried several trackers, loopers, and various music production SW, but SunVox is one of the most easy-to-learn and productive tools.
The SunVox Dynamic Library DLL can be downloaded from here. Please note, this is not the "official" DLL (yet), and it was produced by NightRadio (author of SunVox) specially for ZGE on my request. The library is larger than bass.dll, but it can be compensated by small music files. So, it is up to you which music player you choose for your projects. The library is provided just for Win32, Linux and OSX at the moment, however, there are plans also for Android.
Attached, you can find a simple demo project showing you a basic usage of the library. You need to download the DLL and copy it to the same directory.
The SunVox dll was more-or-less an experimental software up to now, used freely by people. Anyway, I asked for licensing and still waiting for the answer. I hope it's free and allowed to be used in our ZGE projects. (SunVox itself is distributed under the BSD license.)
Ville, if you think it's appropriate, you can put the SunVox external library to the distributed ZGE's Lib files and also to the "Add from library..." menu.
- Attachments
-
- SunVoxDemo.zip
- SunVox demo project
- (6.16 KiB) Downloaded 1472 times
Last edited by Rado1 on Fri Aug 31, 2012 6:08 pm, edited 1 time in total.
Sure, runtime generation of sounds is always more processor-consuming than playing samples.Kjell wrote:Even though you lose a bit of performance compared to traditional MOD players.
FYI here's the answer regarding to licensing and usage of the sunvox library: "Yes, you can use it freely. Only one requirement - mention about sunvox library somewhere in app description / about window." Good.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
yup,. this is very cool,. Thanks so much for pulling this together Rado1!
Let us know if/when you are able to get Android support as well, as I am for the most part focusing on getting some more stuff into the the Play Store. SunVox will indeed get a nice logo/link placement in any game I make using it.
Just purchased SunVox for android to compose with,. and also to support Alexander Zolotov.
Let us know if/when you are able to get Android support as well, as I am for the most part focusing on getting some more stuff into the the Play Store. SunVox will indeed get a nice logo/link placement in any game I make using it.
Just purchased SunVox for android to compose with,. and also to support Alexander Zolotov.
iterationGAMES.com
Good work Rado1, I'm glad you could convince them to release another version of the DLL. Hope they make it that way from now on because it should be more easily to use from more languages if the function names are unmangled. And it would be cool if we could add support for the Android version later.
I'll add the external lib to ZGE library of course!
I'll add the external lib to ZGE library of course!
FYI the official distribution of the SunVox library has been extended by unmangled version of the dll used in ZGE, see the windows/lib_x86 directory. It's recommended to use this stable version in ZGE for future.
The dll has been updated with new release of SunVox 1.7.2 coming with some improvements of the engine. BTW Also the licensing conditions have been added.
Ville - could you please update the SV init constant section of the external library to the following:
It seems that SV engine supports either single- or multi-threded execution now.
The dll has been updated with new release of SunVox 1.7.2 coming with some improvements of the engine. BTW Also the licensing conditions have been added.
Ville - could you please update the SV init constant section of the external library to the following:
Code: Select all
const int SV_INIT_FLAG_NO_DEBUG_OUTPUT = 1 << 0;
const int SV_INIT_FLAG_USER_AUDIO_CALLBACK = 1 << 1;
const int SV_INIT_FLAG_AUDIO_INT16 = 1 << 2;
const int SV_INIT_FLAG_AUDIO_FLOAT32 = 1 << 3;
const int SV_INIT_FLAG_ONE_THREAD = 1 << 4;
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
multi-threaded = nice! So how can we set the dll to run on a separate thread from the game? That would allow near limitlessly complex moduals to play,. or just keep more reasonable music tracks from sucking cpu form the game.
I noticed the; sv_send_event() function and this seems to make using single sounds from Sunvox as game effects possible,. i will build an example of that.
what does sv_get_module_flags() return? I am interested in getting some pattern data out for the possibility of synchronizing to game events,. music linked gameplay?
also I see that the dll offers; get_module_scope() I imagine that is the wave data shown on the modules in the tracker,. this could be interesting for music visualizations,. etc. any way to dump the data into an array in zge?
again, thanks for setting this up Rado1, as you can see it inspires me! (hoping for android support soon!!) also hoping NightRadio will add more pattern manipulation functions to the dll,. so the game can switch looping patterns or pattern blocks.
I noticed the; sv_send_event() function and this seems to make using single sounds from Sunvox as game effects possible,. i will build an example of that.
what does sv_get_module_flags() return? I am interested in getting some pattern data out for the possibility of synchronizing to game events,. music linked gameplay?
also I see that the dll offers; get_module_scope() I imagine that is the wave data shown on the modules in the tracker,. this could be interesting for music visualizations,. etc. any way to dump the data into an array in zge?
again, thanks for setting this up Rado1, as you can see it inspires me! (hoping for android support soon!!) also hoping NightRadio will add more pattern manipulation functions to the dll,. so the game can switch looping patterns or pattern blocks.
iterationGAMES.com
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Ok, here is a tests setup for using the SV sound as game effects,. one strangeness I found is that the module called is one number higher than in the SV file. Any idea why?
I think some rather interesting sounds will now be possible using the SV generators and effects (building our own networks) with the ability to modify the modules on the fly using this sv_send_event() function. Interesting stuff!
I think some rather interesting sounds will now be possible using the SV generators and effects (building our own networks) with the ability to modify the modules on the fly using this sv_send_event() function. Interesting stuff!
- Attachments
-
- SunVox_FX_test.zip
- a .sunvox and a .zgeproj
- (2.74 KiB) Downloaded 1401 times
iterationGAMES.com
Is not the sunvox.dll running always in a separate thread? I checked it by process explorer, but I can be wrong, having no experience with windows threads. I also tried to experiment with the SV_INIT_FLAG_ONE_THREAD but no observable difference when used or not. I actually do not know what's its meaning.jph_wacheski wrote:multi-threaded = nice! So how can we set the dll to run on a separate thread from the game? That would allow near limitlessly complex moduals to play,. or just keep more reasonable music tracks from sucking cpu form the game.
One of the following flags:jph_wacheski wrote:what does sv_get_module_flags() return? I am interested in getting some pattern data out for the possibility of synchronizing to game events,. music linked gameplay?
Code: Select all
const int SV_MODULE_FLAG_EXISTS = 1;
const int SV_MODULE_FLAG_EFFECT = 2;
const int SV_MODULE_INPUTS_OFF = 16;
const int SV_MODULE_INPUTS_MASK = 255 << SV_MODULE_INPUTS_OFF;
const int SV_MODULE_OUTPUTS_OFF = 16 + 8;
const int SV_MODULE_OUTPUTS_MASK = 255 << SV_MODULE_OUTPUTS_OFF;
Aha, I was not sure about its semantic. If you are right, then it would be interesting to have this information. However, I do not know how to translatejph_wacheski wrote:also I see that the dll offers; get_module_scope() I imagine that is the wave data shown on the modules in the tracker,. this could be interesting for music visualizations,. etc. any way to dump the data into an array in zge?
void* tsv_get_module_scope(int slot, int mod_num, int channel, int* offset, int* size)
to ZGE. What to do with void* and int*?
I hope so.jph_wacheski wrote:(hoping for android support soon!!) also hoping NightRadio will add more pattern manipulation functions to the dll,. so the game can switch looping patterns or pattern blocks.
Jph - really cool. I tested your demo with different instruments (eg. DrumSynth) and effects and I had a lot of fun. No clue why this +1 numbering.jph_wacheski wrote:Ok, here is a tests setup for using the SV sound as game effects,. one strangeness I found is that the module called is one number higher than in the SV file. Any idea why?
Hi Rado,
K
Use a xptr parameter in your ZLibrary. However, you can't use this as return type ( atm ), so you'd need to write a small wrapper for those functions. For example "void* foo(int bar, int* zed)" becomes "void fooWrapper(int bar, int* zed, void* data)".Rado1 wrote:What to do with void* and int*?
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Hi Jph,
it has not been released yet, AKAIK I tried to support also LibModPlug in ZGE, but has not obtained a clear definition of API, so after several unsuccessful trials I stopped this effort. We definitely need to find a library for playing mod files in our paid games (we can use bass only for free games). Any ideas?jph_wacheski wrote:has the Android .so for this been released yet?
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Android .so is now ready!
And there was much rejoicing,. .
http://www.warmplace.ru/
I will attempt after I dig out from under all this snow!
http://www.warmplace.ru/
First one to posts a working sample .zgeproj gets a cookie! (or a pat on the head)25th December 2012]
[Site news : SunVox development]
SunVox Dynamic Library for developers has been updated to v1.7.3. You can use this library to play SunVox songs in your Windows/Linux/OSX/Android applications.
What is new:
-added Android version (but now only tested with Pixilang applications);
-new functions: sv_lock_slot(), sv_unlock_slot(), sv_pattern_mute();
-some bugs fixed.
I will attempt after I dig out from under all this snow!
iterationGAMES.com