Genuary2023_Shadows

Genuary2023_Shadows

The prompt for Genuary 2023 Day 22 is

Shadows

  • Going to represent the shadow realm through Hydra

  • Updating my **SonicPi *"***Shadow Math" code from the Color Palette Prompt

Celestial Shadows
As they lurk while they roam
As they search while they glow
As they weave in out while they flow
To shine
To the rhythm of time
As they illuminate
But also evaporate
To let the negativity escape
Even though the shadows roam
This is the realm that is considered Home
The inner core remains to glow
Remains to be
Remains to be a presence
On the intergalactic scene
As this is a gift, its own present

Hydra Code

 pattern = () => osc(4,1,1).color(0.203,0.023,0.203).kaleid(5).scale(()=> (time % 5 + 1 )/10, 0.4) 

pattern()
  .scrollX([0.1,0.3], [0.01,-1])
  .mult(pattern().kaleid([7,5,3,5,7].smooth()))
.blend(pattern())
.diff(pattern().kaleid(9))
  .out(o0)


noise(()=> {
  let noisey = 8
  const t = time % 30 + 1
  if( t < 10 ) 
    noisey = 0.5
  else if( t < 20 && t > 10) 
    noisey = 1
  else if( t > 20 )
    noisey = 2

  return noisey
},()=> {
  let noiser = 5
  const t = time % 20 + 1
  if( t < 5 ) 
    noiser = 0.5
  else if( t < 10 && t > 5) 
    noiser = 1
  else if( t > 10 )
    noiser = 2 + Math.sin(time)

  return noiser}, 1
).modulateKaleid(src(o0).scale([0.5,1,2,1,0.5])).out(o1)

src(o1).repeat(()=> (time % 10 + 1)/3).scale(()=> (time % 10 + 1)/4).out()

speed = 0.0824

Sonic Pi Code

#Color +Shadows
#RGB Values
#shadow length equation is Length = height / tan(angle)

#Due to High Pitches, will divide the numbers by 3

def color(hue,loop,synth,effect)
  with_fx effect do
    live_loop loop do
      i = 0 #counter to iterate between the 3 values
      use_synth synth
      play hue[i]/3 ,release: 2
      sleep [0.5,1,2].choose
      if i < 4
        i+= 1
      end
    end
  end
end

#shadow length component
#adding a decay to the shadow portion
def shadowColor(hue,loop,synth,effect)
  with_fx effect do
    live_loop loop do
      i = 0 #counter to iterate between the 3 values
      use_synth synth
      play (hue[i]/Math.tan(70)) / 3 #,attack: dice(2)
      play ((hue[i]/Math.tan(40)).abs)/3 #,#decay: dice(2)
      sleep [0.25,0.5,1,2].choose
      if i < 4
        i+= 1
      end
    end
  end
end

#taking in the hue,loop name and attached synth, effect
def colorpalette1

  #colorpalette1
  stromboli =  [44,70,66]
  hampton = [230,209,169]
  teak = [180,150,109]


  color(stromboli, :stromboli,:chipbass,:ixi_techno)
  shadowColor(stromboli,:strombolishadow,:chipbass,:whammy)

  color(hampton,:hampton,:chipbass,:whammy)
  shadowColor(hampton,:hamptonshadow,:chipbass,:flanger)

  color(teak,:teak,:chipbass,:flanger)
  shadowColor(teak,:teakshadow,:chipbass,:ixi_techno)
end

def colorpalette2

  #colorpalette2
  summerGreen = [144,180,172]
  muleFawn = [143,63,43]
  sorrellBrown = [197,168,131]

  color(summerGreen,:summerGreen,:piano,:vowel)
  shadowColor(summerGreen,:summerGreenshadow,:piano,:flanger)

  color(muleFawn,:muleFawn,:piano,:pingpong)
  shadowColor(muleFawn,:muleFawnshadow,:piano,:pingpong)

  color(sorrellBrown,:sorrellBrown,:piano,:pingpong)
  shadowColor(sorrellBrown,:sorrellBrownshadow,:piano,:pingpong)
end

def colorpalette3


  #colorpalette3
  ecruWhite = [243,242,226]
  paleOyster = [149,144,129]
  capePalliser = [147,113,73]


  color(ecruWhite,:ecruWhite,:hollow,:vowel)
  shadowColor(ecruWhite,:ecruWhiteshadow,:hollow,:flanger)

  color(paleOyster ,:paleOyster,:hollow,:pingpong)
  shadowColor(paleOyster ,:paleOystershadow,:hollow,:pingpong)

  color(capePalliser,:capePalliser,:piano,:pingpong)
  shadowColor(capePalliser,:capePallisershadow,:hollow,:pingpong)
end

live_loop :coloring do

  counter = (0..25).to_a.shuffle()

  if counter[dice(25)] % 3 == 0 #if the number is divisible by 3
    colorpalette1()
  elsif counter[dice(25)] % 2 == 0   #if the number is divisible by 2
    colorpalette2()
  else
    colorpalette3()
  end


  sleep [1,2,4].choose
end