early stage cython wrapper to sunvox lib

Multi-platform modular music creation studio
Post Reply
shakfu
Posts: 3
Joined: Tue Jun 15, 2021 6:29 pm

early stage cython wrapper to sunvox lib

Post by shakfu »

Hi,

I learned about sunvox a couple of days ago and found that the sunvox developer library looked like it was pretty straighforward to wrap in cython.

It's a day or two old, and obviously nothing as mature or complete as Penguinum-tea's Lua wrapper (https://warmplace.ru/forum/viewtopic.php?f=16&t=5633), but I'm finding it's a nice way to learn the very nice sunvox api.

I managed to get it to play modules so you can hear some funky music. Pretty cool so far. :)

see: https://github.com/shakfu/pysunvox

S
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: early stage cython wrapper to sunvox lib

Post by queries »

If you're interested in collaborating, I've been maintaining this one for a few years:

https://github.com/metrasynth/sunvox-dll-python

It also has built-in wrappers for doing multiprocess stuff. I've used it for Discord bots, and I'm currently using it to build a DJ-style project that uses four instances of SunVox (all in separate processes) with audio routed between them. (Two decks, one preview, one master FX)

You might also be interested in Radiant Voices, which provides full read/write capabilities in Python and TypeScript:

https://github.com/metrasynth/radiant-voices
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: early stage cython wrapper to sunvox lib

Post by queries »

By collaboration, what I suppose I'm thinking of is that if you have an interest in cython, there is a potential to improve the performance of existing libraries that are already in use. The sunvox-dll-python wrapper uses ctypes and not cython. And Radiant Voices is pure Python. They are mature and fairly well-documented, but can always stand some improvements.

Of course, this is only if you're interested. There's always room for different approaches to similar problems. :)
shakfu
Posts: 3
Joined: Tue Jun 15, 2021 6:29 pm

Re: early stage cython wrapper to sunvox lib

Post by shakfu »

Hi @queries

Thanks for checking out my cython wrapper and letting me know about your two projects which look quite quite mature.

I briefly scanned through both of them: sunvox-dll-python accesses the sunvox developer library via python+ctypes. It looks pretty comprehensive. I'm speculating that the most relevant part for our discussion is the dll.py file (https://github.com/metrasynth/sunvox-dl ... vox/dll.py) which is the ctypes wrapper / dll-access code.

I''m pretty new to sunvox, just a couple of days, so just getting to know the api... but I think a cython implementation of the sunvox lib api can probably be a drop in replacement for your dll.py ctypes wrapper. my suggestion is to fork my repo and we can work to complete the wrapper and then you can use it directly in your sunvox-dll-python project instead of ctypes. It should be faster than ctypes, but it remains to be seen by how much.

Your radiant voices projects looks like its offline parser / genrator for the sunvox binary format. I have a somewhat similar project for Max/MSP (https://github.com/shakfu/py2max) which uses JSON instead of a binary format. Not sure I can be helpful here given my lack of knowledge of sunvox and binary formats.

S
Post Reply