As for the mappings, this would be the easy solution changing the BPM every millisecond:
Code:
00 GLOB RAND ---- > GLOB TMPO ---- Global random value (0 - 4095/FFF) routed (and scaled) to the Tempo 1-500 (BPM)
That is of course too fast. You want slower updates of the BPM. Use a counter that counts to whatever is in variable B for example. Knowing that the mappings are executed every millisecond, you would need to count to 1000 to reach 1 second.
You would use variable A to count. And you would put 1000 into variable B which is the value you want to count to. And you want to repeat this endlessly.
Code:
00 VAR # B #3E8 > ---- ---- ---- (set variable B to 3E8hex which is 1000 decimal) That is the value you want to count to
01 CALC ADD =1VA > SET V A SRC (Add 1 to variable A and set the result back into variable A)
02 SKIP 02 < VAVB > ---- ---- ---- (skip (do not execute) the next 2 rows if variable A is smaller than variable B)
In fact the next 2 rows would only be executed if variable A reaches the value 1000 or higher.
03 VAR # A #000 > ---- ---- ---- (This resets the Variable A to 0 again so it can begin again to start counting)
04 GLOB RAND ---- > GLOB TMPO ---- (And since this row is also being executed only once a second caused by the counting, the tempo changes only every second
This expample would change the BPM every second to any value between 1 and 500 bpm because that is the range of the BPM. It is also scaled so a source value between 0 and 4095 would generate a bpm destination between 1 and 500.
If you want to reduce this to a certain range, lets say you only want to get BPM between 80 and 130 BPM then you would advance the mapping a bit:
Code:
00 VAR # B #3E8 > ---- ---- ---- (same as before)
01 CALC ADD =1VA > SET V A SRC (Same as before)
02 SKIP 03 < VAVB > ---- ---- ---- (Now skip 3 rows instead of 2)
03 VAR # A #000 > ---- ---- ---- (Same as before)
04 GLOB RAND ---- > ---- ---- ---- (Just generate a random value between 0 and 4095, the result will be saved in row 04 just like a variable)
05 CALC RNGE VCVD > GLOB TMPO ---- (Range/scale the former row (04) to a value between Variable C and Variable D and send the result to the Tempo)
Now you could either manually set the minimum value of Variable C and the maximum value of variable D to the min/max BPM setting, and keep in mind that you need to calculate the values you need (4095 / 500 * wanted BPM)
Variable C would be 28Fhex/655 dec for 80 BPM and Variable D would be 428hex/1064dec for 130 bpm
Manually changing of the variables can be done in the variable screen (toggle the PATCH button in the Mapping screen)
Instead of manually you can also set the minimum and maximum in the mapping rows
Code:
06 VAR # C #28F > ---- ---- ---- (which is 655 decimal and scaled from 4095 to 500 it is 80 which is then your minimum bpm)
07 VAR # D #428 > ---- ---- ---- (which is 1094 decimal and scaled from 4095 to 500 it is 130 which is then your maximum bpm)
In the end this would be one of the many possible solutions if you want to change the BPM with a fixed interval.
You could enhance/change this by adding rules that would change the BPM only on every 16th step etc instead. Or only when you fire a trigger onto the CV input...or whatever.
And if you want to change the BPM only with every new pattern then the random FX and putting the BPM FX in the first pattern row is the better and easier solution of course.