Hello. Use_bpm does not work with this example.
use_bpm = 300
play_pattern_timed [:c4, :b3, :a3, :ab3,
:a3,:e3,
:e4, :d4, :c4, :b3,
:c4,:a3,
:f4,:e4,:d4,:c4,
:b3,:c4,:d4,:f4,
],
[ 1, 1, 1, 1,
3,1,
1, 1, 1,1,
3,1,
1.5,0.5,1.5,0.5,
0.5, 0.5, 2,1,
], pan: -1, amp: 3
Welcome @Aleksandr!
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 =
here, we’re actually changing the use_bpm
function itself to 300! (Edit - ha. Sam is correct, by using the =
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.
1 Like
Hi @Aleksandr, thanks for your question and welcome to our forums.
The simple answer is that the function use_bpm
is used as follows:
use_bpm 300
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:
1 Like
Thanks! I was inattentive
No worries. We’re all learning