Page 1 of 1

SunVox curve generator (Pixilang script)

Posted: Wed Aug 16, 2017 11:04 am
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

Re: SunVox curve generator (Pixilang script)

Posted: Wed Aug 16, 2017 12:28 pm
by iaon
Thanks NR, gonna try this out later.

Re: SunVox curve generator (Pixilang script)

Posted: Wed Aug 16, 2017 10:33 pm
by vichug
hey, how exactly od you use that script inside those modules ? is there a tuto somewhere ?

Re: SunVox curve generator (Pixilang script)

Posted: Thu Aug 17, 2017 10:41 am
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

Re: SunVox curve generator (Pixilang script)

Posted: Wed Sep 27, 2017 7:28 am
by Keres
Thank you, my Lord.

Re: SunVox curve generator (Pixilang script)

Posted: Wed Oct 11, 2017 9:50 pm
by NightRadio
updated to 1.1

Re: SunVox curve generator (Pixilang script)

Posted: Thu Dec 14, 2017 11:40 pm
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?

Re: SunVox curve generator (Pixilang script)

Posted: Sat Dec 16, 2017 12:57 pm
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 }

Re: SunVox curve generator (Pixilang script)

Posted: Sun Dec 17, 2017 3:47 am
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!

Re: SunVox curve generator (Pixilang script)

Posted: Sun Jan 21, 2018 7:57 pm
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)))

Re: SunVox curve generator (Pixilang script)

Posted: Sun Jan 21, 2018 8:01 pm
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)]