mathematical expression help plz ?

Nov 27, 2006 at 12:45am

mathematical expression help plz ?

i am curious to know if anyone could lend some help to give me an understanding of how i can create tools to produce irregular sounds (with use of math opcodes like SIN/SINH/ASIN/COS/COSH/TAN/ATAN/ABS/LOG/LOG10/SQRT/etc)

the type of math i seek to build a synth tool with would represent similarly in such programs like syd 1.07 or quack sound studio 4.1

#28899
Nov 27, 2006 at 3:07am

#89114
Nov 28, 2006 at 12:35am

ok …..

i’m looking for any help with math expressional equations that could alter an oscillator to produce irregular sound data (sounds that are not a sine/sawtooth/square/impulse and not in a regulatory flowing pattern that is) with the 2 programs i mentioned earlier. syd 1.07, it has a widget called an expression evaluator and you can click upon it and enter into a text field a certain line of math that,.. the more complex the equation, the more complex the sound rendered will be and i was hoping to emulate that in any way possible. Quack sound studio 4.1 is another type of modular studio like that. and it has a granular, math & a wave module that could accept similar equations as syd can like the ones below:

i’ve tested these equations in syd, they work fine with the ƒ(x)
module

cos(t*156*tan(145*t))

tanh(cos(t*106/cos3(430*t)))

#89115
Nov 28, 2006 at 1:56am

i just got done building a patch that is somewhat close to an expression evaluator (sound mangler) that i would like to create but i would like to rather alter the whole process by entering a singular or group of equations to alter the one or more EXPR objects i have tied into it,… not have to stop all audio just to change the individual EXPR objects to furtherly complex it….

#89116
Nov 28, 2006 at 2:31am

enth lojeek wrote:
> i just got done building a patch that is somewhat close to an expression evaluator (sound mangler) that i would like to create but i would like to rather alter the whole process by entering a singular or group of equations to alter the one or more EXPR objects i have tied into it,… not have to stop all audio just to change the individual EXPR objects to furtherly complex it….

I don’t think this abstraction is what you’re looking for, but maybe
it’s useful. (If you can be a little more clear in your request, if it
is a request, then you should try.) Haven’t used it in a while but it
should be pretty easy to figure out. I call the below patch [xpr]
because I’m super-creative.

I also made a vexpr version and a js version. The js doesn’t need to
interrupt anything, but it’s not as fast IIRC… (The js version is a
cheap arbitrary injected-function grapher that’s supposed to have
universal scaling, but that part is not quite right because I haven’t
put the effort in. It’s also a security nightmare.) Let me know if you
want either of those, or if someone wants to fix the js up properly.

max v2;
#N vpatcher 328 287 1444 687;
#N comlet bang when done init;
#P outlet 794 311 15 0;
#N comlet expression input;
#P inlet 649 40 15 0;
#P objectname in[8];
#N comlet expression input;
#P inlet 621 40 15 0;
#P objectname in[7];
#N comlet expression input;
#P inlet 593 40 15 0;
#P objectname in[6];
#N comlet expression input;
#P inlet 565 40 15 0;
#P objectname in[5];
#N comlet expression input;
#P inlet 537 40 15 0;
#P objectname in[4];
#N comlet expression input;
#P inlet 509 40 15 0;
#P objectname in[3];
#N comlet expression input;
#P inlet 481 40 15 0;
#P objectname in[2];
#N comlet expression input;
#P inlet 453 40 15 0;
#P objectname in[1];
#N comlet output from expression;
#P outlet 428 264 15 0;
#P objectname out1;
#N comlet expression input , “set yourExpression”;
#P inlet 425 40 15 0;
#P window setfont “Sans Serif” 10.;
#N vpatcher 135 503 923 903;
#P window setfont “Sans Serif” 10.;
#P newex 34 317 23 9109514 b 1;
#N comlet messages for thispatcher;
#P outlet 34 353 15 0;
#P newex 162 316 208 9109514 sprintf script connect in[%i] 0 expression %i;
#P newex 168 164 113 9109514 if $i1 > 1 then $i1 else;
#P number 233 229 35 10 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 474 91 23 9109514 b 1;
#P newex 168 198 27 9109514 – 1;
#P newex 168 227 40 9109514 uzi;
#N comlet expr string in here;
#P inlet 474 54 15 0;
#P newex 168 128 33 9109514 zl len;
#P newex 96 100 82 9109514 regexp \\$[ifs]\\d;
#P message 368 140 329 9109514 script connect in[0] 1 expression 0 ,
script connect expression 0 out1 0;
#N comlet messages for thispatcher;
#P outlet 162 353 15 0;
#P comment 8 28 353 9109514 figure out how many inlets the [expr] will
have , and connect accordingly;
#P comment 377 122 101 9109514 basics are obvious…;
#P comment 205 128 109 9109514 = number of variables;
#P fasten 7 0 15 0 479 74 39 74;
#P connect 15 0 14 0;
#P fasten 7 0 5 0 479 78 101 78;
#P connect 8 2 13 0;
#P fasten 4 0 3 0 373 345 167 345;
#P connect 13 0 3 0;
#P connect 5 2 6 0;
#P connect 6 0 12 0;
#P connect 12 0 9 0;
#P connect 9 0 8 0;
#P connect 9 0 11 0;
#P connect 8 2 13 1;
#P fasten 10 0 4 0 479 115 373 115;
#P connect 7 0 10 0;
#P pop;
#P newobj 13 214 56 9109514 p initialize;
#P newex 448 140 36 9109514 expr 1;
#P objectname expression;
#P newex 89 156 23 9109514 b 1;
#P newex 389 64 46 9109514 route set;
#P objectname in[0];
#P newex 89 117 62 9109514 prepend set;
#P window linecount 2;
#P message 158 109 222 9109514 script delete expression , script new
expression newex 400 150 500 9109514 expr;
#P window linecount 1;
#P newex 158 153 43 9109514 append;
#N thispatcher;
#Q end;
#P newobj 59 269 58 9109514 thispatcher;
#P fasten 4 0 7 0 394 90 18 90;
#P fasten 1 0 0 0 163 246 64 246;
#P connect 7 1 0 0;
#P fasten 4 0 3 0 394 97 94 97;
#P connect 3 0 5 0;
#P fasten 5 0 2 0 94 184 154 184 154 102 163 102;
#P fasten 3 0 1 0 94 146 163 146;
#P connect 2 0 1 0;
#P fasten 8 0 4 0 430 59 394 59;
#P fasten 7 0 18 0 18 301 799 301;
#P pop;

#89117
Nov 28, 2006 at 2:37am

#89118
Nov 29, 2006 at 2:20pm

enth lojeek wrote:
> i’ve tested these equations in syd, they work fine with the ƒ(x)
> module
>
> cos(t*156*tan(145*t))
>
> tanh(cos(t*106/cos3(430*t)))

You got at least some math ;-)
The equations look a bit like a waveshaper. You could look into
waveshaping and use the equations for altering the transfer function in
a buffer. I think there are some examples in the examples folder…

If you want to do it directly, beware that MSP rate is fast and these
math functions are expensive. Usually a wavetable is much much much more
effective…

Hope this helps…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#89119

You must be logged in to reply to this topic.