Skip to content

Instantly share code, notes, and snippets.

View bryceklund's full-sized avatar
🆒
chilling

Bryce Eklund bryceklund

🆒
chilling
View GitHub Profile
@bryceklund
bryceklund / generate_delay_settings.py
Created May 13, 2025 16:18
Maps the fibonacci numbers onto delay time and feedback parameters to create a cascading effect with a nice ratio
def generate_settings(quantity, time_max, time_min):
print(f"Generating settings for {quantity} devices, delay time range: {time_min}s - {time_max}s\n---")
fib_nums = build_fibs(quantity)
for n in range(quantity):
percentage = fib_nums[n] / fib_nums[quantity - 1]
time = round(percentage * (time_max - time_min) + time_min, 2)
feedback = round(95 - (95 * percentage))
print(f"Delay {n + 1} ({round(percentage * 100, 2)}%) - Feedback: {feedback}%, time: {time}s")