I want a buzzer to beep $X$ times in $t$ seconds, but I don't want it to have a regular interval (something like $t/X$). Instead, I want the interval to linearly decrease, so it "beeps faster" as it approaches the end.
Each beep lasts $b$ seconds.
I think that I need to specify at least one of the intervals, so the last one is $i$.
Ultimately, I wanted to be able to calculate this on the fly on an Arduino, so I don't have to keep a list of all intervals, just those few variables.
I believe this problem is about derivatives, but I'm really struggling to figure out how to apply them to it.
For the exact project I'm working on, the variables would be the following:
$X = 80$
$t = 40s$
$b = 120ms$
$i = 30ms$
So in short, I want 80 beeps of 120ms to play in 40s, with the interval between them linearly decreasing, and the last two ones being 30ms apart.
And I fear this is way simpler than I'm imagining, but I'm struggling a lot with it, so I decided to ask it here.
Edit 01: My progress so far was to think of this problem as a graph of the intervals by the beep number.
That would give me a trapezoid whose area is $t - X * b$, as $t$ also contains the time each beep was playing, not only their intervals, so we subtract that.
The smaller base of the trapezoid (its rightmost side on the graph) would be $i$, and the larger base would be the first interval. Its height (that on the graph would be its base) is $X$.
With that, I believe I can use some basic geometry to get the missing values, and perhaps also come up with a formula that will give me the intervals using just those variables that I've declared.