Creating a new pattern using SunVox Lib?

Multi-platform modular music creation studio
Post Reply
turbobasic
Posts: 5
Joined: Fri Dec 06, 2019 5:22 pm

Creating a new pattern using SunVox Lib?

Post by turbobasic » Fri Dec 06, 2019 5:49 pm

<3 sunvox, kudos to NightRadio!

i've been messing around with sunvox lib and unity engine to to create my own realtime looping environment. Modifying existing patterns, changing notes and controllers works fine, however I don't see any way to create a new pattern from code. Am I missing something? Is this feature by any chance coming to future versions?

User avatar
NightRadio
Site Admin
Posts: 3392
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Creating a new pattern using SunVox Lib?

Post by NightRadio » Sun Dec 08, 2019 12:03 pm

Not implemented yet :)
But it may be added in the next updates

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

Re: Creating a new pattern using SunVox Lib?

Post by queries » Sun Dec 08, 2019 10:18 pm

If you are adventurous you can create your own projects with a language of your choice and then load them into slots or as metamodules.

With nightradio's help I have been documenting the file format over the last few years. It's not 100% of the file format but it's about 99% :)

https://radiant-voices.readthedocs.io/e ... ormat.html

Radiant Voices itself is a python package that lets you programmatically construct SunVox modules and projects, including patterns.

Haven't been able to work on it in a while, but I've done lots of neat experiments with it, and I plan to update it for the next release of SunVox once it's available.

turbobasic
Posts: 5
Joined: Fri Dec 06, 2019 5:22 pm

Re: Creating a new pattern using SunVox Lib?

Post by turbobasic » Mon Dec 09, 2019 11:23 pm

@NightRadio: if you come around implementing it, know that you'll have a user :).

I found some ways around the limit - i basicallly create a lot of patterns i my 'template', store all the notes in my own structures and copy them into sunvox patterns only when needed. Not necessarily a nice impementation but it's workable to the point that not being able to create patterns is not an issue.

@queries: thanks for the reference, didn't find it browsing your project before. good stuff!

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

Re: Creating a new pattern using SunVox Lib?

Post by queries » Tue Dec 10, 2019 5:04 am

@turbobasic: Your technique of filling pre-existing patterns is probably the best option for live-looping for now, actually.

Even if you could use the official lib to insert patterns, it might require you to stop playback unless Nightradio significantly changes how patterns are used internally by the SunVox engine. Whenever playback starts, SunVox sorts the patterns in a particular way, presumably to optimize playback and/or to make sure patterns are interpreted in a deterministic way based on their coordinates.

You'll see that SunVox itself won't let you add/remove/realign patterns while playback is occurring.

See also the old SunVox engine code: https://github.com/warmplace/sunvox_sou ... e.cpp#L975

Post Reply