# The code is not updating in real time

**URL:** <https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160>\
**Category:** Support, Help & Resources\
**Created:** [July 3, 2020, 12:41pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160 "2020-07-03T12:41:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carloseduardo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/carloseduardo/32/1509_2.png) [@carloseduardo](https://in-thread.sonic-pi.net/u/carloseduardo)\
**Post date:** [July 3, 2020, 12:41pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/1 "2020-07-03T12:41:56Z")

</div>

I have often noticed that I can no longer apply changes in real time.

When I press command + R, it is no longer updated, nor when I press the Run button.

The changes only work when I click STOP, then RUN.

Any suggestion? In the code below I am changing the mix: from 0 to 1, and it has no effect, until I stop and run again.

```
with_fx :ping_pong, mix: 0 do
  live_loop :base do
    use_synth :chipbass
    use_random_seed 30
    notes = (scale :e4, :minor_pentatonic).shuffle.reverse
    co = (line 70, 130, steps: 8).tick
    
    8.times do
      play notes.tick, release: 0.2, amp: 0.5 , cutoff: 130 #if one_in(2)
      sleep 0.5
    end
  end
end
```

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [July 3, 2020, 1:05pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/2 "2020-07-03T13:05:08Z")

</div>

Hello @carloseduardo 🙂  
What you are noticing is actually behaving that way by design at the moment. See [https://github.com/sonic-pi-net/sonic-pi/issues/794](https://github.com/sonic-pi-net/sonic-pi/issues/794) for details and discussion surrounding this.

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [July 3, 2020, 1:10pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/3 "2020-07-03T13:10:31Z")

</div>

> This is intended. The definition of the live loop is modified at runtime, so changing an effect only works inside the loop.

good to know ! as it’s recommended to use `with_fx` outside live\_loops to consumme less ressources.  
Right ?

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [July 3, 2020, 1:15pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/4 "2020-07-03T13:15:23Z")

</div>

Correct. It’s best to do it that way when system resources are scarce.  
@samaaron has said that he is still interested in designing a system that lets you modify fx outside of live\_loops, though that may be a while off.

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [July 3, 2020, 1:50pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/5 "2020-07-03T13:50:28Z")

</div>

> [@ethancrawford](#):
>
> scarce

learn a new english word 🙂 – scarse, short resources

---

<div class="post-metadata">

**Author:** ![carloseduardo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/carloseduardo/32/1509_2.png) [@carloseduardo](https://in-thread.sonic-pi.net/u/carloseduardo)\
**Post date:** [July 3, 2020, 2:26pm UTC](https://in-thread.sonic-pi.net/t/the-code-is-not-updating-in-real-time/4160/6 "2020-07-03T14:26:10Z")

</div>

😅 corret!
