The fibonacci sequence sounds like a cat with the zoomies on a piano

Cats are perfect

# The fibonacci sequence creates beautiful images
# Does it sound good when applied to equal temperment?
# It sounds like a cat with the zoomies in a room with a piano, so...yes?

# notes
fib = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

# lengths - truncated because, like a hacker in a heist movie, we don't have enough time
fiblen = [1, 1, 2, 3, 5, 8, 13, 21]

# shift to bring notes into audible range - 1 becomes 22, 3 = 25, etc.
aud = 21

use_bpm 233 # also in the sequence

use_synth :piano

with_fx :gverb, amp: 1, room: 233 do
  with_fx :compressor do
    live_loop :loop do
      
      len = choose(fiblen) * 0.5 # reduce time so it doesn't go on forever
      
      play choose(fib)+aud, attack:len * 0.1, decay: len * 0.1, sustain: len * 0.5, amp: 0.5
      play choose(fib)+aud, attack:len * 0.1, decay: len * 0.1, sustain: len * 0.3, amp: 0.5
      play choose(fib)+aud, attack:len * 0.2, decay: len * 0.2, sustain: len * 0.2, amp: 0.5
      play choose(fib)+aud, attack:len * 0.3, decay: len * 0.3, sustain: len * 0.1, amp: 0.5
      play choose(fib)+aud, attack:len * 0.5, decay: len * 0.5, sustain: len * 0.1, amp: 0.5
      
      sleep len
    end
  end
end
2 Likes

Love it! So spooky and haunting.
I tried swapping in other synths, and that’s fun too.

1 Like

Hi @Sunk,
I like your approach to randomizing the sonority of a Fibonacci fragment. On another note, if you’re interested, you can explore over 241 infinite sequences in Sonic Pi by installing the figurate_numbers gem. The documentation is available on GitHub: GitHub - Figurate Numbers
Greetings from Lima!