Hello. Use_bpm does not work with this example.
use_bpm = 300
play_pattern_timed [:c4, :b3, :a3, :ab3,
:e4, :d4, :c4, :b3,
[ 1, 1, 1, 1,
1, 1, 1,1,
0.5, 0.5, 2,1,
], pan: -1, amp: 3
It’s almost correct. In Sonic Pi,
use_bpm is a function, and we want to pass the function the value of
300 as the bpm that it will set for us.
However, by using the (Edit - ha. Sam is correct, by using the
= here, we’re actually changing the
use_bpm function itself to 300!
= we in fact tell Sonic Pi to make a new variable called
use_bpm and assign 300 to it)
Just remove the
= from that line and it will work.
Hi @Aleksandr, thanks for your question and welcome to our forums.
The simple answer is that the function
use_bpm is used as follows:
In your example, you’re using the
= assignment operator which is assigning the value
300 to a new variable
use_bpm which isn’t quite what you meant.
Take a look at some of the examples for
use_bpm in the help system:
Thanks! I was inattentive
No worries. We’re all learning