Play Midi Notes In SunVox Without UI

Multi-platform modular music creation studio
Post Reply
BastianEmbedMusic
Posts: 8
Joined: Mon Jul 15, 2019 2:10 pm

Play Midi Notes In SunVox Without UI

Post by BastianEmbedMusic »

Hi,
I want to use SunVox in an embed project (running on a raspberry pi zero).
To save computing resources i would like to run SunVox from the terminal without the UI. I already found this video (and there is also a post on this in the forum)
https://www.youtube.com/watch?v=9QP2FGNeSsk&t=1s


My question is: What is the easiest route to load a sunvox project ( i still want to use the UI to create the actuall project / module) and trigger the modules in the project with midi notes. ( I will create the midi notes with a python script based on some other input).

I had a look at the sunvox.dll on github and there are some c/c++ examples in the linux folder. In one of them a .sunvox project is loaded and using sv_send_event() a note on events is send to a specific module. If i understand correctly i could run a c script like in the example (or use cython if i want to call it from python) load a project and use the send events instead of midi. So i can still create the project with the sunvox ui??
I have also seen that there is a python wrapper for the .dll and a python api in the Metrasynth project.

But i was wondering if there is maybe another route, like just running SunVox without the UI but still have it listen to midi inputs. Maybe some one here has done something similar before?

Thanks in advanced for any comments
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Play Midi Notes In SunVox Without UI

Post by NightRadio »

If i understand correctly i could run a c script like in the example (or use cython if i want to call it from python) load a project and use the send events instead of midi. So i can still create the project with the sunvox ui??
Yes. But you also can create the project in code directly, using the following functions: sv_new_module(), sv_remove_module(), sv_connect_module(), sv_disconnect_module(), sv_load_module()

But i was wondering if there is maybe another route, like just running SunVox without the UI but still have it listen to midi inputs.
1) Open SunVox with UI, set midi routing, create some modules, close SunVox.
2) Close X server.
3) Open SunVox in pure text console - it will start without UI, but the previously created project will be fully functional (with active sound, modules and midi).
BastianEmbedMusic
Posts: 8
Joined: Mon Jul 15, 2019 2:10 pm

Re: Play Midi Notes In SunVox Without UI

Post by BastianEmbedMusic »

Hi @NightRadio,
thanks heaps for taking the time to reply to this and for all of your work on SunVox (and your other apps as well). SunVox is amazing app. Plus its cross platform support and the ability to use the .dll in apps are just fantastic :). Just wanted to mention that and say thanks for all of your efforts.

I just run sunvox in terminal without X server and works fine thanks for the tip. I still need to test the midi input but I am still bussy with the python script for that.
BastianEmbedMusic
Posts: 8
Joined: Mon Jul 15, 2019 2:10 pm

Re: Play Midi Notes In SunVox Without UI

Post by BastianEmbedMusic »

So i played around with a python midi library and everything works like a charm when running SunVox in the console.
Even the short keys assigned to midi events are working from the console without the UI which is fantastic.
Thanks heaps for the tip as this is much easier than coding everything out in c.
Post Reply