For this week's Creative Code Challenge by @sableraph: "Genuary2024",
This sketch has every prompt from Genuary2024 within it. By using a mixture previous Genuary2024 sketches & compositions which can be seen here: https://blog.illestpreacha.com/series/genuary2024 as well as newly coded snippets to bring this into one sketch.
Gen-Chaos is coded in uses LiveCodingYoutube, Hydra & SonicPi
Poem
Brewing all the Codein a PotMightSeemLikeA lot
ResultsMayVaryColors may seem heavy
Sound could be heard a little MessyBut what if, this is the PLOT??
defcircles1(radius,loop)
circumference = 2 * Math::PI * radius
area = Math::PI * (radius ** 2)
live_loop loop do
use_random_seed Math.cbrt(Time.now.to_i)
with_fx :ping_pong,mix:0.75do
with_fx :gverb, damp:0.5do
use_synth :piano
play [circumference,circumference/2], decay: rrand(1,4)
sample [:ambi_drone,:elec_beep,:perc_snap,:perc_swoosh].choose, beat_stretch: area / 80,amp: dice(2)
endend
sleep [0.25,0.5,1,2,4,8].choose
endenddeftriangle(height,base,side1,side2,loop)
perimeter = base + side1 + side2
area = (height * base) /2
live_loop loop do
use_random_seed Time.now.to_i
with_fx :ixi_techno,mix:0.75do
with_fx :vowel, voice: dice(3) + 1do
use_synth [:chipbass,:chipnoise].choose
play [perimeter/2,perimeter/3,perimeter].choose, sustain: dice(3)
sample [:loop_perc1,:elec_blip2,:tabla_ghe2,:elec_wood,:drum_bass_soft].choose, rate: area / 5 + 0.2endend
sleep [0.25,0.5,1,2,4,8].choose
endenddefsquare1(side,loop)
perimeter = 4 * side
area = side ** 2
live_loop loop do
use_random_seed Time.now.to_i
with_fx :ixi_techno,mix:0.75do
with_fx [:ping_pong,:flanger].choose, mix:0.65do
sample [:guit_em9,:tabla_ghe2,:elec_pong,:drum_bass_hard].choose, rate: area / 100, attack: dice(5), amp: dice(2)
endend
sleep [side,perimeter,side/3,Math.cbrt(perimeter)].choose
endend
circles1(1,:cir1)
triangle(10,5,4,3,:tri1)
square1(13,:sq1)
circles1(4,:cir2)
triangle(14,33,10,9,:tri2)
square1(16,:square2)
SonicPi - Square SDF
#getting the sign distance function for squares#Formula = function square(x,y,size) {#dx = abs(x) - size; d1 = max(dx,0);#dy = abs(y) - size; d2 = max(dy,0);# return min(max(dx, dy), 0.0) + hypot(d1,d2);}#which can be written as Math.hypot(x,y)#x,y coordinates and the r for radiusdefSDF_squares(x, y, size)
dx = (x).abs - size
dy = (y).abs - size
d1 = [dx,0].max #finding the max
d2 = [dy,0].max
[[dx,dy].max,0.0].min + Math.hypot(d1,d2) #finding the minend
r = 15
live_loop :soundOfSDFdo#random seed based on time
use_random_seed Time.now.to_i
#point between - 30 & 30
point = rrand_i(-30,30)
x = point
y = point
dist_sdf = SDF_hexagon(x,y,r)
use_bpm (dist_sdf).abs * 10 + 2#if the sign distance value is negative, it plays the disance in prophet#if the sign distance value is positive, it plays the distance in pianoif (dist_sdf < 1)
with_fx [:ping_pong,:flanger].choose, mix: rrand(0.4,0.7) do
use_synth :prophet
play (dist_sdf).abs
sample [:bass_dnb_f,:perc_snap,:perc_swoosh].tick, rate: (r/dist_sdf) if spread(7,12).tick
endelse
with_fx [:ixi_techno,:whammy].choose, mix: rrand(0.1,0.9) do
use_synth :piano
play (dist_sdf)
sample [:drum_bass_hard,:tabla_ghe1].choose, beat_stretch: (r/dist_sdf).abs if spread(5,12).tick
endend
sleep 0.5end