Controlling random deviation


The random deviation simply ensures your notes are a bit 'scattered' from the beginning. These lines here dictate just how different they are from one another:



Let's break this down for everybody as simply as we can!

random.randint is simply giving us an integer value between 1 and 100 0 and 99 per note / knob. So, every time we load the script or hit 'compile / reset', we end up with each knob set to a random default value in this range. Therefore, if you wanted them to only potentially deviate by about 20 integers, you would write:

randomDeviation = random.randint(0, 20)

Last but not least, the offset is additive, so it's just adding this number to the final result of the random operation. You can direct all of the pitches in one direction (or another by using a negative value like -20) here to get your notes into a more comfortable range.

Let me know if you experience any other hiccups and I hope you have fun with it!

Get Polyphonic Note Generator for FL Studio

Buy Now$9.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.