Runtime error, live coding tutorial

Hello,

I’ve downloaded Sonic Pi on Windows for the first time, on the bottom of the sonic pi window there’s a tutorial, that prompts me to paste the code into a free buffer, but when I copy this code:

live_loop :flibble do
sample :bd_haus, rate: 1
sleep 0.5
end

I get this error

Runtime Error: [workspace_zero] - Thread death!
 undefined method 'live_loop ' for an instance of SonicPiLang (NoMethodError)
Did you mean?  live_loop
workspace_zero:3:in 'block (2 levels) in SonicPi::RuntimeMethods#__spider_eval'
C:/Program Files/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:955:in 'Kernel#eval'
C:/Program Files/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:955:in 'block (2 levels) in SonicPi::RuntimeMethods#__spider_eval'
C:/Program Files/Sonic Pi/app/server/ruby/lib/sonicpi/runtime.rb:1200:in 'block (2 levels) in SonicPi::RuntimeMethods#__in_thread'

Any idea what’s the issue ? Thank you

Hi @superbot. That code above should absolutely work - no idea what’s happening that it’s not. What version of Sonic Pi are you using?
Any chance of a video of you trying to run this code?

1 Like

Hi

I copied that code from the tutorial and it runs without issue - vers 4.6 Windows 10; what version/OS are you running?

PD-Pi

1 Like

Hello and thanks for the answer !

I’m using version 4.6 on windows 11.

I changed the language from french to english and it worked, then I switched back to french and it seems to still be working

I’m very confused! But I guess the issue solved itself :folded_hands:

Thank you both for the answers I’ll come back here if the issue happens again

2 Likes

Well I’m having the same issue, it was working so I kept following the tutorial, it asked to add another sample, but I got a similar error “undefined sample, do you mean sample”

I’m not sure what information to add, I’m using a bluetooth headset that’s not always connected. But I tried restarting Sonic Pi several times

Now it doesn’t recognize the live_loop again :thinking:

@superbot - can you try switching to English language again briefly and try rewriting the bits that didn’t work this second time? A bit of a stab in the dark but I’m wondering whether it’s definitely something to do with that.

It doesn’t seem to make any difference, what usually works as a fix is restarting the software, it’s kinda random :confused:

Sure. It might not pick up the language change until after the app is restarted anyway…

1 Like

I’ve just done a test by switching my system settings to French in Windows, and telling Sonic Pi to use System Language to match. Can confirm the above issue, and I have my suspicions, though I’m not 100% sure of the exact cause yet. @superbot - can I ask a big favour? are you able to raise this as an official issue on the GitHub page? :folded_hands:

1 Like

Thanks for looking into this Ethan.

One thing that struck me as odd is that it says undefined method ‘live_loop ’ - notice the space at the end of the word. Perhaps there’s an invisible character there that’s being added to the function name and making it not live_loop.

2 Likes

@samaaron I know what the problem is and yes you are correct. Sometime tomorrow I’ll raise an issue if superbot hasn’t already and describe the details. In essence though, it will require handling translations of code examples carefully when copying and pasting in languages other than English.

1 Like

Do you still need me to raise this as an issue on github ? Nice catch anyway! :clap:

I can do it, no problem. Thanks for pointing it out to begin with!

1 Like
1 Like

Great, I’m glad, I’m gonna try to learn the software now :stuck_out_tongue: