Live coding in Windows 10

Hello, this is my first day trying Sonic Pi and loving it, cannot wait to use it in class.

I feel I must be missing something simple but I cannot get the playing music to update live when the code is edited. I have to click ‘run’ again for any changes to have effect.

I am using Windows 10 and running the program through a shortcut with Administrator privileges.

For example the first piece of sample code in the tutorial is:

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

Only clicking the run button will play any updates I make to the code.

I then jumped to the Live Coding section of the tutorial and tried this sample code:

define :my_sound do
  play 50
  sleep 1

in_thread(name: :looper) do
  loop do

Same thing, changes to the code are only played when the run button is clicked again.

I feel there must be something obvious I am missing, sorry I cannot see anything in the help files or anywhere else that mentions this.

Apologies if this subject has been broached before and I have missed it…


it’s the normal way sonic pi works. You can use the shortcut alt + R instead of clicking on the run button.

Ah! Thank you. Feel daft now - I thought once a line was altered the change was automatically picked up.


do not :slight_smile: and enjoy Sonic Pi and live coding

Hi @Rich,

don’t feel daft at all - it’s a perfectly reasonable assumption to make.

I think the critical thing here is to think about it purely from a teaching perspective - if you’re observing a student writing a sentence, you can’t know for sure that it is completed until the student explicitly tells you it is. It could be in a variety of different states:

  1. Incomplete and clearly broken due to the rules of syntax - obvious missing commas, apostrophes full stops, etc.
  2. Incomplete and broken due to the rules of grammar - word ordering, endings, etc.
  3. Syntactically and grammatically complete yet unfinished (some partial sentences happen to be complete sentences).
  4. Syntactically and grammatically complete but in a draft state - not quite what the student wishes to use to express themselves, but possibly close.
  5. Some combination of the above.

It’s therefore pretty much impossible to know when the sentence is “done” from the perspective of the student. The only really way is to wait for them to say it’s done.

Sonic Pi code is the same. The computer doesn’t try to guess when you might be “done” with your edits - it simply waits for you to be clear and let it know that you’re done by pressing the Run button :slight_smile:

Hope that this helps!