Difference between set and variable assignment

I’m very confused. is there a difference between the set function and a variable? it seems like set lets you change the value of a “Symbol” rather than a variable, but I’m not sure why one would be more useful over the other

@Kavukamari - if you haven’t yet, I definitely recommend reading chapter 10 of the tutorial in the app, (or at https://sonic-pi.net/tutorial#section-10). However, In a nutshell, set (and its counterpart get) are used to store (and retrieve) values in a global memory store, in such a way that if you have multiple threads or live_loops manipulating and accessing these shared values, they will always do so in a reliable, deterministic manner, instead of being affected by race conditions etc. Standard variables have no such guarantee as they are not managed by Sonic Pi’s time-state system.

ok, okay, sorry about that, I was assuming it was much simpler than it actually is, so I never read that chapter, but now I understand why I should read it after all, it’s a lot more complicated to handle these things than I thought

No need to apologise, it’s quite ok. Some of the Sonic Pi concepts might be a little more obscure than others at first glance - but If you do come across similar questions later, then they may well be addressed in the tutorial or language reference - so good to check there - and even if not, there’s always folks hanging around on the forums here happy to explain things :slightly_smiling_face: