# The habit of regular coding

**URL:** <https://in-thread.sonic-pi.net/t/the-habit-of-regular-coding/9605>\
**Category:** Performances, Streams & Live Coding\
**Created:** [March 27, 2025, 12:03pm UTC](https://in-thread.sonic-pi.net/t/the-habit-of-regular-coding/9605 "2025-03-27T12:03:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kretopi](https://avatars.discourse-cdn.com/v4/letter/k/46a35a/32.png) [@kretopi](https://in-thread.sonic-pi.net/u/kretopi)\
**Post date:** [March 27, 2025, 12:03pm UTC](https://in-thread.sonic-pi.net/t/the-habit-of-regular-coding/9605/1 "2025-03-27T12:03:55Z")

</div>

Hi,  
I want to get into the habit of coding regularly. Sometimes I record the result. Here’s my latest idea:

[![](https://img.youtube.com/vi/3WdW-q377Do/maxresdefault.jpg "26 03 2025 session") ](https://www.youtube.com/watch?v=3WdW-q377Do)

```ruby
live_loop :master do
  set_link_bpm! 50
  set :sc, :minor_pentatonic
  set :ton, :D
  sleep 1
end

live_loop :mel, sync: :master do
  stop
  with_fx :reverb, room: 1 do
    with_fx :panslicer, pulse_width: 0.1 do
      use_synth :rodeo
      tick
      8.times do
        tick(:a)
        mel = [0, 1, [4, 5].choose, 3, 0].look(:a)
        time = [0.5, 0.5, 0.5, 0.5, 2].look(:a)
        play (scale get[:ton], get[:sc])[mel] ,release: [0.1, 0.1, 0.1, 0.1, 0.4].look, sustain: [0.1, 0.1, 0.1, 0.1, 0.2].look, amp: 0.5 if rand < 0.7
        
        sleep time
      end
      
      32.times do
        play (scale get[:ton], get[:sc]).choose, amp: 0.5 if rand < 0.8
        sleep 0.5
      end
      
      8.times do
        tick(:b)
        mel = [6, 3, [4, 5, 6].choose, 2, 0].look(:b)
        time = [0.5, 0.5, 0.5, 0.5, 2].look(:b)
        play (scale get[:ton], get[:sc])[mel] ,release: [0.1, 0.1, 0.1, 0.1, 0.4].look, sustain: [0.1, 0.1, 0.1, 0.1, 0.2].look, amp: 0.5 if rand < 0.7
        
        sleep time
      end
    end
  end
  sleep [16, 8, 4].choose
end

live_loop :bs, sync: :master do
  stop
  use_synth :zawa
  play get[:ton] - 24 , cutoff: 50, amp: rrand(0.5, 1)
  sleep 0.25
end

live_loop :dr, sync: :master do
  stop
  tick
  with_fx :reverb, room: 0.3 do
    with_fx :panslicer do
      8.times do
        use_synth :bass_foundation
        play get[:ton]
        use_synth :sc808_bassdrum
        sample :bass_thick_c, pitch: 2 if spread(3, 10).look
        sample :drum_bass_hard, amp: 5 if spread(1, 8).look and rand < 0.4
        sleep 0.5
      end
    end
  end
end

```

Question: How often do you code? Once a week? Every day?

---

<div class="post-metadata">

**Author:** ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)\
**Post date:** [March 27, 2025, 2:28pm UTC](https://in-thread.sonic-pi.net/t/the-habit-of-regular-coding/9605/2 "2025-03-27T14:28:34Z")

</div>

Sadly not often enough! And you’re sooo right about regular practice

PD-Pi

---

<div class="post-metadata">

**Author:** ![kretopi](https://avatars.discourse-cdn.com/v4/letter/k/46a35a/32.png) [@kretopi](https://in-thread.sonic-pi.net/u/kretopi)\
**Post date:** [March 28, 2025, 10:38pm UTC](https://in-thread.sonic-pi.net/t/the-habit-of-regular-coding/9605/3 "2025-03-28T22:38:35Z")

</div>

Yes, it’s hard to code regularly. I’ll write some code at least once a week. I improvise with the code. Sometimes it’s pretty good, sometimes it’s completely bad, but the good ideas stay. The point is to code anyway and not stop.
