SunVox curve generator (Pixilang script)

Multi-platform modular music creation studio
Post Reply
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

SunVox curve generator (Pixilang script)

Post by NightRadio »

Use this Pixilang script to generate your own curves for the modules like MultiSynth, WaveShaper and MultiCtl.
2017.10.11: v1.1 (fixed bugs; new curve function examples)
2017.08.16: v1.0
Attachments
sunvox_curve_generator-1.1.zip
(1.16 KiB) Downloaded 316 times
iaon
Posts: 236
Joined: Mon Jun 02, 2014 7:56 am

Re: SunVox curve generator (Pixilang script)

Post by iaon »

Thanks NR, gonna try this out later.
vichug
Posts: 18
Joined: Wed Dec 30, 2015 6:02 pm

Re: SunVox curve generator (Pixilang script)

Post by vichug »

hey, how exactly od you use that script inside those modules ? is there a tuto somewhere ?
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: SunVox curve generator (Pixilang script)

Post by NightRadio »

1) Download Pixilang: http://warmplace.ru/soft/pixilang
2) Download Curve generator and unpack it somewhere.
3) Open sunvox_curve_generator.pixi (as simple TXT file) in some text editor.
4) Make changes in the first part (SETUP) of this file: you can change filename, format and curve_function().
5) Launch Pixilang, locate the sunvox_curve_generator.pixi, press OK.
6) File with your curve will be created in the same folder with the sunvox_curve_generator.pixi
User avatar
Keres
Posts: 466
Joined: Mon Mar 21, 2016 9:41 am
Location: N. Tulsa Ok.
Contact:

Re: SunVox curve generator (Pixilang script)

Post by Keres »

Thank you, my Lord.
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: SunVox curve generator (Pixilang script)

Post by NightRadio »

updated to 1.1
User avatar
AJHunter
Posts: 30
Joined: Tue Jul 16, 2013 2:45 am
Location: Michigan
Contact:

Re: SunVox curve generator (Pixilang script)

Post by AJHunter »

I'm having trouble with this. Code isn't my strong suite and I've never used pixilang, but I can generally read things and figure it out. This, though, I'm not sure what's up.

I'm trying to generate a series of curves that allow only single notes across all octaves to be played on multisynths. For example, all the Cs in a curve, all the Ds in a curve, etc. To do this, I think I can check if ($x-offset)%12 is 0, and if it is, set $y to the maximum, but if it isn't set $y to 0.

The script here https://pastebin.com/e6YqJd5i doesn't put out the expected curve though.
This is the curve for an offset of 0, which should allow only Cs through. The only difference between this and the default is that the rightmost value is all the way down:
Image

What am I doing wrong here?
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: SunVox curve generator (Pixilang script)

Post by NightRadio »

To do this, I think I can check if ($x-offset)%12 is 0, and if it is, set $y to the maximum, but if it isn't set $y to 0.
You are very close to the correct solution :)
Range of the X variable is: 0...1
Not 0...128.
Real number of the curve items (X axis) is in the items variable.
So you should change your code to:

Code: Select all

if ($x*items-offset)%12 { $y = 1 } else { $y = 0 }
User avatar
cube48
Posts: 114
Joined: Tue Jun 21, 2011 10:33 am

Re: SunVox curve generator (Pixilang script)

Post by cube48 »

I'd kindly ask for help too. I'm trying to generate series of half-triangle (ramps) and triangle shaped curves for multi-amp crossfading between several sound sources. But my math utterly sucks. I've only managed to create the ramps.
Here are the required shapes:

\__
/\_
_/\
__/

In this example I'd like to crossfade between 4 differently shaped Analog Generators (sort of shape morping). Sources like this one are like reading Chinesse for me and I have no idea how to translate the formula into pixilang syntax.

Any help is appretiated. A variable with value of X axis divisions would be awesome so I could adjust it and generate other curve series for crossfading more inputs. Linear crossfades are fine but 'logarithmic triangles' could be usefull too, i.e. some DJ mixers use different crossfade shapes. Thanks for any push in the right direction!
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: SunVox curve generator (Pixilang script)

Post by queries »

cube48, I don't know yet how this translates into PIxiLang but I've hacked together some math formulae and Python code to generate linear and exponential cross fading for anywhere from 2 to 16 modules.

Later today I'll be posting some empty .sunsynth templates. Here is the snippet of Python code that could possibly be translated to PixiLang though:

https://github.com/metrasynth/gallery/b ... #L254-L259

Code: Select all

    if curve == 'linear':
        def fn(x, pos=pos):
            return int(max(0, min(32768, 32768 - 128 * abs(n * (x - (257 * pos) / n)))))
    elif curve == 'parabolic':
        def fn(x, pos=pos):
            return int(max(0, min(32768, 32768 - (0.707 * (n * (x - (pos * (257 / n))))) ** 2)))
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Re: SunVox curve generator (Pixilang script)

Post by queries »

BTW the curves for 4-channel probably want to look like this instead:

Code: Select all

\__/
/\__
_/\_
__/\
By doing this, it ensures that if you have a sawtooth LFO controlling the mixer position, you get seamless mixing from voice 4 back to voice 1.

In my code I do this to repeat the first one:

Code: Select all

    if pos == 0:  # wrap around from last to first
        mod1.curve.values = [v + fn(x, pos=n) for x, v in enumerate(mod1.curve.values)]
Post Reply