Posted August 06, 2025 by Glitch Labs
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:
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!