# When does live coding changes happen in live loops?

**URL:** https://in-thread.sonic-pi.net/t/when-does-live-coding-changes-happen-in-live-loops/7885
**Category:** Support, Help & Resources
**Created:** [June 16, 2023, 2:30pm UTC](https://in-thread.sonic-pi.net/t/when-does-live-coding-changes-happen-in-live-loops/7885 "2023-06-16T14:30:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sdcurtin](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sdcurtin](https://in-thread.sonic-pi.net/u/sdcurtin)
#### Post date: [June 16, 2023, 2:30pm UTC](https://in-thread.sonic-pi.net/t/when-does-live-coding-changes-happen-in-live-loops/7885/1 "2023-06-16T14:30:03Z")

</div>

Hello hive mind, some live coding fundamentals please.  
When I run the following code and make changes to it,  
the sound doesn’t change until I stop and start it, I do remember  
some other examples when pressing play again will.  
In general what kinds of loops allow this?

# Pentatonic Bleeps

live\_loop :bleeps do  
with\_fx :reverb, mix: 0.8, room: 1.0 do  
loop do  
play scale(:Eb2, :major\_pentatonic, num\_octaves: 3).choose, release: 0.1, amp: rand  
sleep 0.2  
end  
end  
end

---

<div class="post-metadata">

### Author: ![R2L](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/r2l/32/2508_2.png) [@R2L](https://in-thread.sonic-pi.net/u/R2L)
#### Post date: [June 16, 2023, 2:34pm UTC](https://in-thread.sonic-pi.net/t/when-does-live-coding-changes-happen-in-live-loops/7885/2 "2023-06-16T14:34:02Z")

</div>

With `live_loop` ou only need to hit start again or use the hotkey for start, the changes will happen in the next iteration of the loop. No need to stop, that’s the point.

You have a `loop do` in there, that’s your problem, it’s an infinite loop so execution gets stuck there.

This works:

```ruby
live_loop :bleeps do
  with_fx :reverb, mix: 0.8, room: 1.0 do
    play scale(:Eb2, :major_pentatonic, num_octaves: 3).choose, release: 0.1, amp: rand
    sleep 0.2
  end
end

```
