# WCCC_BasedOnASong

# SonicPlayDom

For this week's Creative Code challenge by @[@sableRaph](@sableRalph)[:](https://hashnode.com/@sableRalph)***"Based on a Song",*** SonicPlayDom is coded in ***LiveCodeLab & SonicPi.***

Where the visuals coded in ***LiveCodeLab*** are mirroring the chaotic feeling of the coded composition.

## **Audio Design**

For the 22nd day of **MinaCoding2024 : *"Play Alone",* PieingtheSonic3** takes **PieingtheSonic** with the aid of **SonicPi** and track layering, to play around with it to bring it to this coded composition.

## Video

%[https://youtu.be/gXkYb1eam3A] 

## Poetry

```ruby
Imitation
Inspiration
Indention
When they merge
And the thoughts finally diverges
What outcome emerges?
```

## Video

## Code

### LiveCodeLab

```javascript
scale ((time % 12) + 1)/16

ball sin(time)+2,wave(abs(Math.pow(tan(time),sin(time)-1.5))+1),1+abs(Math.hypot(sin(time)/3+0.1,cos(time)/3 + 0.1))

ball cos(time),cos(wave(time)),cos(wave(time %9))

ball Math.tan(time), Math.tan(wave(time))

box Math.sin(wave(time)), Math.sin(wave(time))

peg Math.cos(time), Math.cos(wave(time))
```

### SonicPi

```ruby

def sounds (bpm,loop,sample1,timer)
  #array of notes
  x = [[:D4,:Gs5, :D1],[:A4,:Cs5, :E1] ,[:B4,:Ds2, :B3], [:A3,:Cs2,:Cs4],[:F3,:Ds2,:Bs4],[:C4,:A3,:A2]]
  use_bpm bpm
  live_loop loop do
    counter = x.choose #counter
    use_random_seed (Time.now.to_i)/timer #random seed
    with_fx [:level,:whammy,:vowel].choose, mix: rrand(0.2,0.7) do #effects
      use_synth [:prophet,:piano,:piano].choose #synth
      play :Cs2 # note
      sample sample1, beat_stretch: timer / 3 + 0.2
      sleep [0.25,0.5,1].choose
      play choose(counter) ,amp: rrand(0.2,2)#, sustain: dice(2), decay: dice(2) #notes,
      sleep [0.25,0.5,0.75,1].choose
    end
  end
end

sounds([15,30].tick,:berdy,:guit_e_slide,2)
sounds([15,60].tick,:birdy,:ambi_piano,3)
sounds([60,30].tick,:bordy,:elec_bong,4)
sounds([30,60].tick,:bardy,:ambi_piano,5)
```
