Some config of sv_init in sunvox.dll doesn't work

Multi-platform modular music creation studio
Post Reply
Bariyan
Posts: 8
Joined: Wed Sep 30, 2020 4:57 pm
Location: Nara, Japan

Some config of sv_init in sunvox.dll doesn't work

Post by Bariyan »

Please help me.

I'm using sunbox.so 1.9.5 with sunbox-dll-python on Raspberry Pi Zero.
(For this, I modified some parts of dll.py)

I desired to enjoy SunVox with EWI-USB, so I tried sunvox.dll.init (in sunvox.dll, sv_init) using config string as 'midi_kbd="EWI-USB MIDI 1"|midi_kbd_ch=1', but it's not work. Using config string as "audiodriver=alsa", it's work fine.

Is not sunbox.so 1.9.5 implemented 'midi_kbd’ and 'midi_kbd_ch' ?
What can I do to use 'midi_kbd' and 'midi_kbd_ch'?
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: Some config of sv_init in sunvox.dll doesn't work

Post by queries »

I am not sure if the SunVox library supports MIDI yet.

In the meantime you might consider using something like https://pypi.org/project/mido/ in your project. You would basically do your own listening for MIDI messages, and then translate them to SunVox function calls however you would like to.

For example, this code illustrates capturing MIDI messages and converts them into Qt signals, filtering those and translating them into noteOn/noteOff signals that round-robin between 16 tracks, and finally calling SunVox library functions to turn notes on/off:

https://github.com/metrasynth/solar-sai ... istener.py
https://github.com/metrasynth/solar-sai ... eplayer.py
https://github.com/metrasynth/solar-sai ... #L426-L436

If you have made some useful patches to the sunvox-dll-python wrapper please consider making a pull request, I'd be happy to review & merge it!
Bariyan
Posts: 8
Joined: Wed Sep 30, 2020 4:57 pm
Location: Nara, Japan

Re: Some config of sv_init in sunvox.dll doesn't work

Post by Bariyan »

Mmm, I just took a look at it, It seems that can be usable about note on/off, but how to pass the control-change messages may be an issue...

I can't find in modules function, sv_get_module_*, about MIDI IN item in the Controller properties window. So I think even as the script gets CC messages, can't recognize which module effects do it wants to control :sorry:

To enjoy wind-instrument-like timbre With EWI(Electronic Wind Instrument), Synths have to get breath control(CC2) and convert to volume or effects. Unless there is such a function about MIDI, it seems difficult to implement.

Thank you for your reply.
User avatar
NightRadio
Site Admin
Posts: 3955
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some config of sv_init in sunvox.dll doesn't work

Post by NightRadio »

MIDI in/out is not implemented in the current version of SunVox library.

how to pass the control-change messages may be an issue...
sv_send_event( slot, 0, 0, 0, module + 1, controller << 8, controller_value );

Synths have to get breath control(CC2) and convert to volume or effects
You can translate CC commands to any SunVox controllers using the above command.
MIDI input -> your own MIDI command handler -> sv_send_event()
Bariyan
Posts: 8
Joined: Wed Sep 30, 2020 4:57 pm
Location: Nara, Japan

Re: Some config of sv_init in sunvox.dll doesn't work

Post by Bariyan »

Thank you, NightRadio. Thank you for developing a great application.
sv_send_event( slot, 0, 0, 0, module + 1, controller << 8, controller_value );
I know this function, I tried to use this, but I can't find out which module set to receive MIDI CC messages when the script reload a .sunvox file into a slot...
User avatar
NightRadio
Site Admin
Posts: 3955
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some config of sv_init in sunvox.dll doesn't work

Post by NightRadio »

but I can't find out which module set to receive MIDI CC messages when the script reload a .sunvox file into a slot...
But this depends on the project and its modules. There is no universal way for any projects.
For example, if your project contain the Filter, and you want to map some MIDI CC to the Filter frequency:

Code: Select all

int module = sv_find_module( slot, "Filter" );
int controller = 2; //Frequency
sv_send_event( slot, 0, 0, 0, module + 1, controller << 8, controller_value );
Bariyan
Posts: 8
Joined: Wed Sep 30, 2020 4:57 pm
Location: Nara, Japan

Re: Some config of sv_init in sunvox.dll doesn't work

Post by Bariyan »

I understand the target module should be fixed, but it would restrict tone-editing. That's not the way I want it.

I patiently wait the day comes to see the dll, implemented MIDI, similar to the app.
Please don't go out of your way for me. Thank you :)
Post Reply