LibSunVox?
LibSunVox?
Since SV modules can be very small, smaller than any .xm/.it/.mod, I wonder if it'd possible (=NR want to do this) make sunvox player library for games/music players/etc. The api would be similar to api of bass.dll.
Could someone do such thing? I know that sources of sunvox player floates somewhere, but I am unable to code it myself.
Could someone do such thing? I know that sources of sunvox player floates somewhere, but I am unable to code it myself.
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
I have such DLL :) But it is only for Win32, Linux and OSX.
I can put it on site, if you need.
I can put it on site, if you need.
Re: LibSunVox?
Since Windows, Linux and OSX are 3 main desktop OSes, it's ok with me. Also if you could make c# wrappers it'd be good since I have friend who need small, but good module format for MMO game (tried used SID, but fortunately I got him not to use it) and his game is in C#. Of course since SunVox can produce such wonderful music maintaining file size under 100kb (more only if you use lot of samples it'd be great for his purposes) it'd be wonderful.
Of course API reference and headers is also needed, but I think, I don't have to tell you about it as you're programmer yourself.
Of course API reference and headers is also needed, but I think, I don't have to tell you about it as you're programmer yourself.
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
Sorry for delay with answer. I will provide this library soon :)
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
ok. Here is the first version of such library:
http://www.warmplace.ru/soft/sunvox/sunvox_dll.zip
.so for Linux
.dll for Win32
.dylib for OSX
http://www.warmplace.ru/soft/sunvox/sunvox_dll.zip
.so for Linux
.dll for Win32
.dylib for OSX
Re: LibSunVox?
hi, thats very funny:
sv_rewind( 0, 0 ); the first parameter ist the slot, the second is ?
i thought, that a sv_stop (0) stoped the play command and the sv_rewind wants to go on play?
thanks and greetings - kmatze
i try to write an extension / wrapper to use the lib in tcl/tk (under windows). To play and stop a file.sunvox is ready, but the function rewind will not go:NightRadio wrote:ok. Here is the first version of such library:
http://www.warmplace.ru/soft/sunvox/sunvox_dll.zip
sv_rewind( 0, 0 ); the first parameter ist the slot, the second is ?
i thought, that a sv_stop (0) stoped the play command and the sv_rewind wants to go on play?
thanks and greetings - kmatze
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
sv_rewind( int slot, int t )
where slot - is the slot number :) 0 in most cases
and t - line number.
For example
sv_rewind( 0, 8 )
will rewind the song to line 8
where slot - is the slot number :) 0 in most cases
and t - line number.
For example
sv_rewind( 0, 8 )
will rewind the song to line 8
Re: LibSunVox?
hello,
thanks for your fast answer
play: sv_play, works
stop: sv_stop, works
pause: ?
resume:?
rewind: sv_rewind, i will test, i understand is a repeat from 0 to t (line number)
thanks and greeting - kmatze
thanks for your fast answer
I want to use the functions of the transport buttonsNightRadio wrote:sv_rewind( int slot, int t )
where slot - is the slot number 0 in most cases
and t - line number.
For example
sv_rewind( 0, 8 )
will rewind the song to line 8
play: sv_play, works
stop: sv_stop, works
pause: ?
resume:?
rewind: sv_rewind, i will test, i understand is a repeat from 0 to t (line number)
thanks and greeting - kmatze
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
pause: sv_stop
resume: sv_play
Hard audio slot pause will be implemented in the next version, i think :)
resume: sv_play
Hard audio slot pause will be implemented in the next version, i think :)
Re: LibSunVox?
Hello,
it works fine, thanks - kmatzeNightRadio wrote:pause: sv_stop
resume: sv_play
Hard audio slot pause will be implemented in the next version, i think
Re: LibSunVox?
I'd appreciate if someone would write Qmmp or Audacious (both are nice Linux equivalents of winamp) plugins.
//edit: Also could you make C# bindings, so my friend, Exe could use sunvox music in his game called Manic Digger?
//edit: Also could you make C# bindings, so my friend, Exe could use sunvox music in his game called Manic Digger?
Re: LibSunVox?
hello "NightRadio"
Is it possible to read general information about the song file, e. g. time length or lines, tempo (bps), how many modules and there names etc.
And is it possible to play from an adressed line?
The play function repeats the play of file.sunvox at the end, is it so right, no automaticaly stop?
Thanks and greetings - kmatze
I try to wrote a tcl/tk frontend with an extension / wrapper to your sunvox.dll. Play, stop, "resume" (=play after stop) works fine.NightRadio wrote:ok. Here is the first version of such library:
http://www.warmplace.ru/soft/sunvox/sunvox_dll.zip
.so for Linux
.dll for Win32
.dylib for OSX
Is it possible to read general information about the song file, e. g. time length or lines, tempo (bps), how many modules and there names etc.
And is it possible to play from an adressed line?
The play function repeats the play of file.sunvox at the end, is it so right, no automaticaly stop?
Thanks and greetings - kmatze
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
sv_rewind( slot, line_number )And is it possible to play from an adressed line?
Not yet, sorry :)no automaticaly stop?
Another features will be available in the next version of library.
Re: LibSunVox?
Hi NightRadio,
I would like to use SV music in my games and demos created in ZGameEditor (ZGE). SunVox is a really nice tool, easy to learn and use, effective, and producing small files. Ideal for creating music for my projects.
ZGE supports loading and usage of external libraries (.dll on Windows and .so on Android), therefore, sunvox.dll would be a natural solution. However, the problem is that the library exports functions with names that do not adhere to the naming syntax of ZGE, for instance, sv_init@16, sv_open_slot@4, sv_load@8, etc., and these functions cannot be called from ZGE code. '@' is the problem. If the dll is used in C code, you initially call the sv_load_dll() function which initializes pointers to these exported functions with "normal" names used then in application code. The problem is that ZGE cannot call sv_load_dll().
My requests:
- It would really help if the sunvox.dll itself exported functions having usual names, such as sv_init, sv_open_slot, sv_load, etc. Would it be possible to create such a version of your dll? (This "name-mangling" can be solved easily, see e.g. this.) Of course I could write a simple facade/wrapper dll, but this would be not so nice, because two dlls should be distributed with one ZGE application/file in this case. A partial help for writing such a wrapper would be to provide also precompiled .lib file for the SV library.
- Next request is about compiling the SV library for Android ARM platform (armeabi) in the form of .so file. Do you plan to provide it as well in future?
- OPTIONAL: Since ZGE produces pretty small executables, .sunvox files are also small, would not be possible also to reduce the size of the sunvox.dll? For instance, bass.dll is about 97KB. (I guess that probably not, because it probably contains the code of all modules, etc.) But would be nice if some size optimizations are made.
My last question is about the SunVox itself, not the library (you were asked it probably many times before): do you plan to provide also export to any of the .xm, .it, .mod, or .s3m formats? This would highly improve interoperability with other tools and therefore also applicability of SunVox.
I would like to use SV music in my games and demos created in ZGameEditor (ZGE). SunVox is a really nice tool, easy to learn and use, effective, and producing small files. Ideal for creating music for my projects.
ZGE supports loading and usage of external libraries (.dll on Windows and .so on Android), therefore, sunvox.dll would be a natural solution. However, the problem is that the library exports functions with names that do not adhere to the naming syntax of ZGE, for instance, sv_init@16, sv_open_slot@4, sv_load@8, etc., and these functions cannot be called from ZGE code. '@' is the problem. If the dll is used in C code, you initially call the sv_load_dll() function which initializes pointers to these exported functions with "normal" names used then in application code. The problem is that ZGE cannot call sv_load_dll().
My requests:
- It would really help if the sunvox.dll itself exported functions having usual names, such as sv_init, sv_open_slot, sv_load, etc. Would it be possible to create such a version of your dll? (This "name-mangling" can be solved easily, see e.g. this.) Of course I could write a simple facade/wrapper dll, but this would be not so nice, because two dlls should be distributed with one ZGE application/file in this case. A partial help for writing such a wrapper would be to provide also precompiled .lib file for the SV library.
- Next request is about compiling the SV library for Android ARM platform (armeabi) in the form of .so file. Do you plan to provide it as well in future?
- OPTIONAL: Since ZGE produces pretty small executables, .sunvox files are also small, would not be possible also to reduce the size of the sunvox.dll? For instance, bass.dll is about 97KB. (I guess that probably not, because it probably contains the code of all modules, etc.) But would be nice if some size optimizations are made.
My last question is about the SunVox itself, not the library (you were asked it probably many times before): do you plan to provide also export to any of the .xm, .it, .mod, or .s3m formats? This would highly improve interoperability with other tools and therefore also applicability of SunVox.
- NightRadio
- Site Admin
- Posts: 3944
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: LibSunVox?
Hello!
Is there some ZGE option to switch between different calling conventions for DLL? For example: stdcall, cdecl.
@16, @4 - it is not my idea :) C++ compiler makes these names, because it is the name-decoration convention for STDCALL functions from Microsoft: http://msdn.microsoft.com/en-us/library ... s.71).aspx
Theoretically, ZGE must add these symbols by himself. You tell him: call stdcall function sv_init(). And ZGE makes a call to sv_init@16
If not - i will try to add the set of functions with normal names to DLL.
Is there some ZGE option to switch between different calling conventions for DLL? For example: stdcall, cdecl.
@16, @4 - it is not my idea :) C++ compiler makes these names, because it is the name-decoration convention for STDCALL functions from Microsoft: http://msdn.microsoft.com/en-us/library ... s.71).aspx
Theoretically, ZGE must add these symbols by himself. You tell him: call stdcall function sv_init(). And ZGE makes a call to sv_init@16
If not - i will try to add the set of functions with normal names to DLL.
Yes, it is in my plans :)Next request is about compiling the SV library for Android ARM platform (armeabi) in the form of .so file. Do you plan to provide it as well in future?
It is already size-optimized :) I use -Os key for compilation.would not be possible also to reduce the size of the sunvox.dll? For instance, bass.dll is about 97KB
I'm afraid it is not possible. XM/IT/MOD are sample-based formats, and they have some pattern limitations.do you plan to provide also export to any of the .xm, .it, .mod, or .s3m formats?