# Doodling lissajous

**URL:** <https://in-thread.sonic-pi.net/t/doodling-lissajous/10037>\
**Category:** Creations & Ideas\
**Created:** [August 13, 2026, 11:06pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037 "2026-08-13T23:06:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [August 13, 2026, 11:06pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/1 "2026-08-13T23:06:33Z")

</div>

Using the new feature for generating lissajous figures in SP5 here is a doodle pattern. You can have fun by altering timings, frequencies. phase offsets, even sliding them.

```ruby

#lissajous doodles on Sonic-Pi 5 by Robin Nwman
use_synth :sine
use_random_seed Time.now.to_i#resets seed hence choices each time run.
live_loop :start_new do
  #start two sines panned +/- 1
  p1=play :a3, pan: -1, sustain: 1.8 #you can play with sustain times.
  p2=play :e4, pan: 1, sustain: 3.6 #they are regenerated each time start_new repeats
  live_loop :c1 do
    control p1,note: [:a2,:a3,:a4,:a5].choose #change frequency of p1 every second
    sleep 1
  end
  live_loop :c2 do
    control p2,note: [:a5,:d4,:e4,:a3,:d5,:e5].choose,phase_offset: [0.25,0.5,0.75].choose,phase_offset_slide: [0,0.25,0.5].choose
    sleep 0.25 #this loop runs at 4 times the speed of :c1 loop
  end
  sleep 2 #time before p1,p2 regenerate
end

```

Perhaps I should say select lissajous from the scope options and adjust the size of the scope window to give a reoughoy square shape. Also, you can turn the exteranlal sound volume down ( **not** the built in volume control in prefs) if you find the sound output too loud.

---

<div class="post-metadata">

**Author:** ![aurelien](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@aurelien](https://in-thread.sonic-pi.net/u/aurelien)\
**Post date:** [August 14, 2026, 12:11pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/2 "2026-08-14T12:11:41Z")

</div>

Great sound. Reminds me of the Monome era 🙂

---

<div class="post-metadata">

**Author:** ![technoabu](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/technoabu/32/3101_2.png) [@technoabu](https://in-thread.sonic-pi.net/u/technoabu)\
**Post date:** [August 14, 2026, 3:45pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/3 "2026-08-14T15:45:37Z")

</div>

Very interesting sound, but in my case, with V5 I get a

> Timing Exception: thread got too far behind time error

in the **sleep** of **live\_loop :c2** (although it still plays correctly). This doesn’t happen with V4 (although the resulting sound isn’t exactly the same).

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [August 14, 2026, 4:26pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/4 "2026-08-14T16:26:44Z")

</div>

Not sure why that should be. What hardware are you using to run SP5.0?

I have it running on a mac-mini, but it also runs perfectly on my raspberry pi5

you are using the final release version of version 5.0.0?

---

<div class="post-metadata">

**Author:** ![technoabu](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/technoabu/32/3101_2.png) [@technoabu](https://in-thread.sonic-pi.net/u/technoabu)\
**Post date:** [August 14, 2026, 5:56pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/5 "2026-08-14T17:56:43Z")

</div>

Yes, I’m using the final release (the AppImage) on Ubuntu 22.04 with an i7-1260P processor. I’m not experiencing any CPU performance issues. I also don’t know what the problem could be, but despite the error, the sound is still being generated correctly.

---

<div class="post-metadata">

**Author:** ![technoabu](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/technoabu/32/3101_2.png) [@technoabu](https://in-thread.sonic-pi.net/u/technoabu)\
**Post date:** [August 14, 2026, 6:35pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/6 "2026-08-14T18:35:43Z")

</div>

Values ​​equal to or greater than **sleep 0.35** don’t seem to produce the error. Values ​​below this value do cause the error (the smaller the wait, the sooner the error appears).  
Don’t worry, if I find out the cause, I’ll let you know.

---

<div class="post-metadata">

**Author:** ![technoabu](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/technoabu/32/3101_2.png) [@technoabu](https://in-thread.sonic-pi.net/u/technoabu)\
**Post date:** [August 14, 2026, 8:17pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/7 "2026-08-14T20:17:47Z")

</div>

These two options will fix the error:

- Select **ALSA** as the _Audio device \> Driver_ (instead of **PipeWire** )

- Keep **PipeWire** selected and change the _output_ from **System Default** to **patchby (16ch)**.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [August 16, 2026, 4:49pm UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/8 "2026-08-16T16:49:44Z")

</div>

Thanks for the heads up. This is definitely a bug and I’ll have a fix ready in a couple of weeks when I’m back from my holiday.

---

<div class="post-metadata">

**Author:** ![HelenMarsh](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@HelenMarsh](https://in-thread.sonic-pi.net/u/HelenMarsh)\
**Post date:** [August 18, 2026, 9:37am UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/9 "2026-08-18T09:37:45Z")

</div>

Lovely little patch. One thing that might help anyone else hitting the timing exception in the meantime: the :c2 loop is doing a control plus a choose every 0.25s, which is a fairly tight budget for per-iteration work, so it’s the loop most likely to report falling behind even when the audio still sounds fine. As a workaround while the fix lands, pre-computing the note list outside the loop (a ring, and index it with tick) instead of calling choose each pass shaves off a bit of per-iteration work, and bumping the c2 sleep to 0.5 with two controls per pass gets the same rhythm with half the scheduling overhead.

Worth remembering that “thread got too far behind time” is about the scheduler’s ability to send messages ahead of the deadline, not about the sound itself - so hearing it play correctly while still getting the warning is exactly the expected symptom, and nothing in the audio is being dropped.

On the musical side: since phase\_offset is being chosen from a list, the figure only settles into a stable shape when the two frequencies land on a simple ratio. If you want the shape to visibly rotate rather than jump, sliding the offset with control … phase\_offset\_slide: over a beat or two gives a continuous morph between figures, and matches the “even sliding them” idea nicely. Detuning one voice by a hair also makes the figure drift slowly instead of standing still, which is very satisfying to watch.

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [August 18, 2026, 11:11am UTC](https://in-thread.sonic-pi.net/t/doodling-lissajous/10037/10 "2026-08-18T11:11:51Z")

</div>

I deliberately moved the phase becuase I liked watching the resolution into the stable figure, but nothing is proscribed. It is a great thing to play with and there are many possibilities. Similarly with the refreshing of the loops. you can adjust this so that the sustained note is finishing before the refresh which allows the pattern to collapse inwards.

Previously I played with lissajous figures quite a lot using the modified ssynth defiintiions produced by @emlyn I did some work using TouchOSC to control the synths producing a wide range of patterns. see the thread [here](https://in-thread.sonic-pi.net/t/lissajous-figures-and-harmonographs/6852)

I hope to do something similar with SP5 now that Sam has added the facility to have sine waves with a fixed (although variable) phase difference.
