# MinaCoding2025_RandomPatterns

# AudioPatternings

For ***MinaCoding2025* Prompt 4 & 18:** *Random & Patterns,* ***AudioPatternings*** is a combination of sounds attempting to make a pattern through randomness as seen in the **SonicPi** code.

## Poetry

```ocaml
What Pitch
Fits this scenario?
When inspecting this audio,
Does it mirror what we think
Does aspects have an ability to mimic,
Or does it propose a switch?
```

## Audio

<iframe width="100%" height="300" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/2121176148&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>

[IllestPreacha](https://soundcloud.com/llestreacha) · [AudioPatternings](https://soundcloud.com/llestreacha/audiopatternings)

## SonicPi Code

```ruby
live_loop :bassflow do
  with_fx [:reverb,:echo].tick, mix: [0.6,0.4,0.2,0.1].tick do
    use_random_seed Time.now.to_i / 2
    use_bpm [120,30].choose
    if one_in(2)
      sample [:tabla_dhec,:tabla_tas3,:tabla_re].tick , rate: [0.5,1,-0.87,0.25].tick, amp: dice(3)+ 1
      sleep [0.5,1,2].choose
    else
      use_bpm [120,75,40].choose
      sample [:drum_bass_soft,:ambi_drone,:ambi_piano].choose, amp: [1.5,2.5,0.75].choose
      sleep [0.25,0.5,1,4].tick
    end
  end
end

live_loop :heavydrum do
  with_fx :ixi_techno, mix: [0.75,0.5,0.625].choose do
    use_random_seed Time.now.to_i / 4
    if one_in(2)
      use_bpm [120,180,240].choose
      sample :drum_cymbal_closed,rate: [0.5,1,-1,-0.5,2,-2].choose
      sleep 0.5
    else
      use_bpm [120].choose
      sample [:drum_heavy_kick,:elec_snare,:elec_blip2].choose
      sleep 0.25
    end
  end
end




live_loop :heavydrum1 do
  with_fx :ixi_techno, mix: ((use_random_seed Time.now.to_i / 10) % 10 + 1)/11 , phase: dice(3) do
    use_random_seed Time.now.to_i / 3
    if one_in(2)
      use_bpm [120,60].choose
      sample :drum_cymbal_closed, beat_stretch: dice(5)+2
      sleep [0.5,0.75,1,2,4].tick
    else
      use_bpm [120,60].choose
      sample :drum_heavy_kick, rate: [0.5,1,-1,-0.5,2,-2].choose
      sleep [0.25,0.5,2,4].choose
    end
  end
end

live_loop :drumming do
  use_bpm [120,60].choose
  use_random_seed Time.now.to_i / 2
  sample [:drum_cymbal_pedal,:ambi_soft_buzz].choose
  sample :drum_splash_hard
  sleep [4,8,2].choose
end




live_loop :moredrums do
  use_bpm [120,60,30].choose
  with_fx [:flanger,:ping_pong].tick, mix: ((use_random_seed Time.now.to_i * 2) % 10 + 1)/11  do
    with_fx :echo, mix: rrand(0.1,0.7), amp: dice(4) do
      sample [:drum_tom_mid_soft,:perc_snap2,:drum_roll,:elec_plip].choose
      sleep [1,2,4,8].choose
    end
  end
end
```
