Cannot get correct module input/outputs indexes with sv_get_module_outputs(slot, num_module)
Hi, i've been trying to combine SunVox-Unity with xNode node editor and so far i was able to load a sunvox project into unity using an example provided but i cannot seem to understand how to get correct module inputs and outputs.
I've used methods sv_get_module_outputs(slot, num_module) and sv_get_module_inputs(slot, num_module) but they return way too many indexes and some of them are even negative numbers which is strange to me. I'm sorry i'm not skilled in C/C++ so i don't really know how to handle some stuff but i tried to convert integer numbers returned by sv_get_module_inputs to IntPtr and then read integer values but again, sv_get_module_inputs returns way too many indexes to begin with.
For example i have a Compressor module which has 1 input and 1 output but sv_get_module_inputs returns int[] array with length 10 and 8 outputs. I might be missing some fundamental knowledge so i'm pretty much stuck right now.
I have tried to hack it by using sv_disconnect_module(slot, source, destination) but it always returns 0 (success) even if modules are disconnected
Hi, i've been trying to combine SunVox-Unity with xNode node editor and so far i was able to load a sunvox project into unity using an example provided but i cannot seem to understand how to get correct module inputs and outputs.
I've used methods sv_get_module_outputs(slot, num_module) and sv_get_module_inputs(slot, num_module) but they return way too many indexes and some of them are even negative numbers which is strange to me. I'm sorry i'm not skilled in C/C++ so i don't really know how to handle some stuff but i tried to convert integer numbers returned by sv_get_module_inputs to IntPtr and then read integer values but again, sv_get_module_inputs returns way too many indexes to begin with.
For example i have a Compressor module which has 1 input and 1 output but sv_get_module_inputs returns int[] array with length 10 and 8 outputs. I might be missing some fundamental knowledge so i'm pretty much stuck right now.
Hi! I can't say what could be wrong, you can see the description of SunVox on the documentation page: https://www.warmplace.ru/soft/sunvox/sunvox_lib.php#sv_get_module_inputs
yeah, i was checking the documentation on any possible functions, but there isn't much info
I was able to figure out what the problem was.
Return type of
int[] sv_get_module_outputs( int slot, int mod_num );
int[] sv_get_module_inputs( int slot, int mod_num );
should be int* and not int[] which would require to state these methods as unsafe and mark the project settings with "allow unsafe code"
After that i was able to properly get the module connections slots.