#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Algorithmic generator

in General
Could you maybe give me an example of how I'm supposed to enter in the algorithms thanks

• edited May 2

Yep!

First look at line 139, void algo. The block of code there is divided in four different "cases", like so:

``````    case 0:
sample = t*(t>>parameters) ^ (t<<parameters ^ t); // 14-8-1
t = t + parameters;
break;
``````

There, (on any of these "cases"), you can replace the code after sample = with your own algorithm.

Most important thing to remember with respect to examples you'll find online is that you must keep multiplications to a minimum and completely avoid divisions. Instead, use bit shifts (either << or >>), which are equivalent to multiplying or dividing by powers of two but don't take nearly as much computing power.

Also notice that I use parameters, parameters, and parameters. These are the three parameters you can change in real time with the knob, with ranges from 0 to 15.

So, first you write something like this:

`````` case 0:
sample = t*(t>>14) ^ (t<<8 ^ t);
t = t + 1;
break;
``````

Then you decide which of those numbers you want to change with the knob, and also their initial values -that's how you end up with

`````` sample = t*(t>>parameters) ^ (t<<parameters ^ t); // 14-8-1
t = t + parameters;
``````

(Notice that I took note of the initial values as a comment, after //)

Finally, in the block of code starting in line 166, void initializeAlgoParameters, search for the same "case" you replaced, and change the values of the three parameters to the values you want.

``````  case 0:
parameters = 14;
parameters = 8;
parameters = 1;
break;
``````

That's it! I hope it doesn't sound too hard -it's not, really ^_^´

• thanx man...that helps a lot