# WCCC_VoronoiOverLord

# Voronoid

For this week's *Creative Code challenge* by @sableRaph: “Voronoi Overloads“, ***Voronoid*** is coded in **SonicPi, Python & HydraVideoSynth** to represent how a Voronoi may become an Overload

## Poem

```ocaml
Voronoi overlords
The history and information
Is not all on record
With different goals
They still aim towards
The same foundations
In their souls
```

## Video

%[https://youtu.be/PVaxm-ElqNw] 

## Code

### HydraVideoSynth - Various Voronois

```javascript
voronoi([10,5,3],[3,2,1]).blend(voronoi(2).scale(1.15)).
modulateScale(voronoi([4,3,2].smooth().fast(0.04)).colorama([0.1,0.2,0.3].smooth())).
colorama([0.5,0.4,0.3].smooth()).add(voronoi(4)).modulateRotate(voronoi(1,3).
add(voronoi(4).scale(0.58).luma(0.4)).color(0.25,0.41,[0.13,1].smooth())).
modulateKaleid(voronoi([4,5,6,7,8]).scale(0.5).color(1,0,0),9.15).luma(0.5).
repeat(1.2,[0.4,0.6,0.8,1,0.8,0.6,0.4].smooth().fast(0.25)).out()
```

```javascript
voronoi().scrollX([0.25,0-.13,0.01].smooth()).scrollY([0.5,-0.3,0.1,-0.1,0.2].smooth()).
modulateScale(voronoi()).out()
```

```javascript
voronoi().colorama(0.8).repeat(2,2).out()
```

### Python Based Voronois

```python
import numpy as np
import random as rd
from scipy.spatial import Voronoi, voronoi_plot_2d
import matplotlib.pyplot as plt

def Voronoid(lineCount):
    
    counter = 0

    #color effects sequence
    colorlist = ['red','blue','yellow','orange','black','green','purple','gold','grey']
    rd.shuffle(colorlist)

    #line effects sequences
    width = [1,2,3,4,5,6,7,8,9]
    rd.shuffle(width)
    
    sizing = [4,5,6,7]
    rd.shuffle(sizing)
    
    alphaline = [0.6,0.4,0.3,0.1]
    rd.shuffle(alphaline)


    #point to used
    points = np.random.rand(lineCount, 2)  # 35 random points

    #voronoi info
    vord = Voronoi(points)
    
    #graph difference
    if lineCount % 2 == 0:
        fig = voronoi_plot_2d(vord, show_points=True, show_vertices=False, line_colors= colorlist,
                          line_width=width, line_alpha=alphaline[0], point_size=sizing[0])
    if lineCount % 2 == 1:
        fig = voronoi_plot_2d(vord, show_points=True, show_vertices=True, line_colors= colorlist,
                          line_width=width, line_alpha=alphaline[0], point_size=sizing[0])

    plt.axis('off') # Hide all axes
    
    plt.show()
    
    
    if lineCount <= 15:
        return 1
    else:
        return Voronoid(abs(lineCount - rd.randint(-1, 4)))
    
Voronoid(35)
```

### SonicPi

```ruby
#remix of  https://twitter.com/wpgFactoid/status/666692596605976576

# Original Coded by Adrian Cheater

=begin

[1, 3, 6, 4].each do |d|
  (range -3, 3).each do |i|
    play_chord (chord_degree d, :c, :major, 3, invert: i)
    sleep 0.25
  end
=end
  
  
  live_loop :overlord do
    use_random_seed Time.now.to_i / 3
    with_fx :vowel,voice: dice(3), mix: 0.25 do
      with_fx :whammy, mix: [0.25,0.50,0.75].choose do
        use_bpm [30,60,120,240,480,720].choose
        [1, 3, 6, 4, 5, 2,7,4, 2, 1,3,5].each do |d|
          (range -4, 4).each do |i|
            play_chord (chord_degree d, [:c,:a,:e,:g,:Eb3].choose, [:major,:minor].choose, [3,2,1,4].choose, invert: i)
            sleep [0.25,0.5,1].choose
          end
        end
      end
    end
  end
  
  live_loop :overlord2 do
    use_random_seed Time.now.to_i / 5
    with_fx :vowel,voice: dice(3), mix: 0.25 do
      with_fx :whammy, mix: [0.25,0.50,0.75].choose do
        use_bpm [30,60,120,240,480,720].choose
        [2, 3, 6, 4, 5, 2,7,4, 2, 1,3,5].reverse.each do |d|
          (range -4, 4).each do |i|
            play_chord (chord_degree d, [:c,:a,:e,:g,:Eb3].choose, [:major,:minor].choose, [3,2,1,4].choose, invert: i)
            sleep [0.25,0.5,1].choose
          end
        end
      end
    end
  end
```
