# WCCChallenge_Succulent

# CactiInChaos

For this week's Creative Code Challenge by @sableraph : ***Succulent***, I decided to make **CactiInChaos.** This week the languages used are **Locomotion** for the Visuals, **Hydra** for the visual effects and **SonicPi** for the sound.

## Design Process

Cacti are part of the succulent family, so I choreographed the cacti avatars embedded in the **Locomotion** language. The different movements seen are motion captured and are differentiated by the **animation** function. The numbers associated with the function represent a different move performed for that avatar, in this case: ***Cactus***.

The code for Locomotion can be copied and pasted into the following URL to be live coded: [https://dktr0.github.io/LocoMotion/](https://dktr0.github.io/LocoMotion/)

The visuals are layered to bring a sense of chaos. Aided by the **SonicPi** sounds to reinforce the chaotic rhythm of the choreography that clashes quite often.

Oil Paint Filter added once again

## Poem

```ocaml
Cacti Roaming Free
Cacti Dancing to the chaos beneath
Cacti Prancing to the layers of their leaves
Cacti Floating to the Breeze
As the breeze passes by
Acknowledging the movements of each Cacti
```

## Video

<iframe width="560" height="315" src="https://www.youtube.com/embed/IQ5eq89GOwI"></iframe>

## Code

### Locomotion

```haskell
--front row cacti
dancer { url="cactus.glb",animation = 7, size = 4.5, x = range 5 -5 (osc 0.5), y = -11 };
dancer { url="cactus.glb",animation = 5, size = 4.5, x = range 5 -5 (osc 0.25), y = -11 };
dancer { url="cactus.glb",animation = 4, size = 4.5, x = range 5 -5 (osc 0.45), y = -11 };

--back row enlarged
dancer { url="cactus.glb",animation = 3, size = 1.5, x = 3 };
dancer { url="cactus.glb",animation = 5, size = 1.5, x = -3 };
dancer { url="cactus.glb",animation = 7, size = 1.5, x = -6 };

--left size oves
dancer { url="cactus.glb",animation = 4, size = 3.5, x = -2, ly = range -3 3 (osc 2), size= 0.5, lz = range -3 3 (osc 2), size= 0.5};
dancer { url="cactus.glb",animation = 3, x = -2, z = -2,rz = range -5 5 (osc 0.2), ry = range -5 5 (osc 0.5), ly = range -3 3 (osc 2), size= 0.5 };

-- right side moves
dancer { url="cactus.glb",animation = 7, size = 3.5, x = 5, ly = range -3 3 (osc 2), size= 0.5, lz = range -3 3 (osc 2), size= 0.5};
dancer { url="cactus.glb",animation = 6, x = -2, z = 5,rz = range -5 5 (osc 0.2), ry = range -5 5 (osc 0.5), ly = range -3 3 (osc 2), size= 0.5 }
```

### Hydra - Modulation 1

```javascript
s0.initScreen()

src(s0).scale(0.5).scrollX([0.5,0.4,-0.3,-0.2,0.1,0.2,-0.4]).
rotate(0.5,5).out()

speed = 0.05
```

### Hydra-Modulation 2

```javascript
s0.initScreen()

src(s0).scale(0.5).scrollX([0.5,0.4,-0.3,-0.2,0.1,0.2,-0.4]).
kaleid([3,4,5]).rotate(0.5,5).out()

speed = 0.075
```

### SonicPi - Glitchy Sounds

```ruby
mag = [3,21,7,13,22,19]
win = [20,5,10,7,14,32]
ooo = [7,12,3,15,21,7]


i = 5

live_loop :drone1  do
  use_bpm 180
  
  with_fx :gverb, mix: 0.4, decay: 0.6 do
    sample [:guit_e_fifths,:ambi_choir].choose, pitch: (mag[i] - win[i]).abs, beat_stretch: mag[i]
  end
  
  puts mag[i]
  sleep mag[i]
  i -= 1
  if i < 0
    i = 5
  end
end


live_loop :drone2  do
  use_bpm 180
  with_fx [:reverb,:ping_pong].tick, mix: 0.6 do
    sample [:loop_electric,:ambi_drone].choose, beat_stretch: win[i]
  end
  puts win[i]
  sleep win[i]
  i -= 1
  if i < 0
    i = 5
  end
end


live_loop :drone3  do
  Effects_Swap1 = [:ixitechno, :reverb, :panslicer]
  
  use_bpm 180
  
  with_fx Effects_Swap1[rand(4)] do
    sample [:perc_swoosh,:perc_bell,:perc_snap].choose, beat_stretch: ooo[i]
  end
  
  puts ooo[i]
  sleep ooo[i]
  i -= 1
  if i < 0
    i = 5
  end
end


live_loop :moredrums do
  use_bpm 180
  with_fx :echo, mix: 0.7, amp: 3 do
    sample :drum_tom_mid_soft, beat_stretch: (win[i] - ooo[i]).abs
    puts (win[i] - ooo[i]).abs
    sleep (win[i] - ooo[i]).abs
    i -= 1
    if i < 0
      i = 5
      
    end
  end
end

live_loop :synths do
  use_bpm 120
  if one_in(2)
    sample :bd_haus
    use_synth [:prophet,:piano,:piano].tick
    play (knit :e2, 24, :c2, 8).tick, sustain: dice((win[i] - ooo[i]-mag[i]).abs)
    sleep [0.5,1,2,4].choose
  end
  sleep [0.5,1,2,4].choose
end
```

### SonicPi - Beep Sounds

```ruby
  with_fx :ixi_techno do
    live_loop :commencing do
      use_bpm 10
      sample :drum_snare_soft if spread(7,12).tick
      sleep (1.0/24)
    end
  end
end

with_fx :ixi_techno, mix: 0.7, phase: 0.5 do
  live_loop :riddimsection do
    use_bpm 20
    sample :elec_beep if spread(7,12).tick
    sleep(1.0/24)
  end
end

with_fx :ixi_techno, mix: 0.4 do
  live_loop :newlayer do
    use_bpm 10
    sample :drum_bass_soft if spread(5,12).tick
    sleep(1.0/24)
  end
end
```
