# Genuary2024_Droste+Ascii+Wobbly

# InnerViewScape

The prompt for **Genuary 2024 Day 3** is **Droste Effect**, **Day 9 is ASCII & Day 13 is Wobbly**

To create ***InnerViewScape***, I have coded it in **Python, SonicPi & Hydra**

## Designing the ViewScape

The **Python** code is used to bring the **Ascii** wording that is littered in the background of this sketch.

The ***Droste Effect*** is Coded thru **Hydra,** By placing the webcam on the screen of the code displaying the webcam. This makes the Droste Effect come to life.

The **Wobbly** code provided by Genuary prompt is seen within the **SonicPi Code** through a *random* display of *dice* and other *time* based variables to add variance.

## Poem

```ocaml
The VIew Goes on and on
Randomly spiking
The edges creeping and sliding
Lining and deepening
The Sequencing
In this Phenomenon
```

## Video

<iframe width="560" height="315" src="https://www.youtube.com/embed/u4Z_EL3bOjY?si=nQiKXTdCIOguSrXm"></iframe>

## Code

### Hydra

```javascript
s0.initScreen()
s1.initCam()

src(s0).scale(1.2).colorama(()=>(time % 15 + 1)/20).
blend(src(s0).scale([0.5,1,2,4,8].smooth())).
repeat([1.5,3.5,5.5].smooth(),[1.5,2.5,3,4,0.5]).
add(s1).diff(src(s0).
scale([2.5,1.5,0.5,1.5,2.5].smooth()).colorama(0.5)).
modulateRotate(src(s0).scale(4.5).scroll(4,4),0.7).
modulateRotate(src(s0).scale(0.25).colorama(0.15),2.6).out()

speed = 0.5
```

### SonicPi

```ruby

live_loop :wobbly do
  
  #making more wobbles
  with_fx :wobble, wave: dice(3) do
    #making sure the shuffles are random
    use_random_seed Time.now.to_f
    use_random_seed [Math.cbrt(Time.now.to_f),Math.sqrt(Time.now.to_f)].choose
    
    #variables for the wobbly
    a,b,c,d,e,f,g,h,i,j,k,l,m,n = dice(3),2,rrand_i(3,7),4,5,dice(9),7,8,dice(10),10,rrand(7,12),12,13,rrand(11,14)

    #following the wobbly function
    wobbling = Math.sin(a * b + c + d * Math.sin(e * f + g)) + Math.sin(h * i + j + k * Math.sin(l * m + n))
    
    #print the wobbly function
    puts wobbling
    
    #sounds of the wobbly function
    sample [:loop_breakbeat,:loop_breakbeat,:loop_compus].choose,rate: wobbling
    sample [:ambi_dark_woosh,:tabla_ghe3,:tabla_tun1].choose, rate: (wobbling * wobbling).abs
    sleep [0.5,1,2,2.5,4,8].choose
  end
end
```

### Python

```python
!pip install art

import random as rand
import re
from art import *

'''
#URL text approach, in case you have text you want to play with instead of the user input

import urllib.request
import requests
import urllib
from urllib.request import urlopen
import urllib3

#URL code getter

file_url = 'https://gist.githubusercontent.com/IllestPreacha/fba97ec51cba892638ab5a6d0fab7ca9/raw/2ff5bf0c47e3293d4f88aec3498318c8436237fa/Rubberband.txt'
http     = urllib3.PoolManager()
response = http.request('GET', file_url)
data     = response.data.decode('utf-8')
'''
#Input Information

data = input("Write/Input a Sentence of 8 or More Words: ") #TextInput

print(data)  #printing data

IWTUsed = list(map(str,data.split())) #individuals words 

charCount = len(data) #check how many characters
wordCount = len(IWTUsed) #wordCount



def Randomizer():
    num = rand.randint(0, 27) #randomizer

    #conditionals
    if (num > 0 and num < 3):
        fontType = "cybermedium"
    elif (num > 3 and num < 6):
        fontType = "yellow"
    elif (num > 6 and num < 9):
        fontType = "block"
    elif (num > 9 and num < 12):
        fontType = "red"
    elif (num > 12 and num < 15):
        fontType = "art"
    else:
        fontType = "wizard"


    return fontType #return to use in the Relics_Ascii function


def Divertion_Light():

  #Takes the first letter of a word that doesnt start with P,R,S,T and changes it to the letter X

    text = rand.choice(IWTUsed)

    x = text.startswith(('P', 'R','S','T','U','V'))

    if x :
        print(text)
        return text #return the original text    

    else:
        textList = list(text) #takes the string into a list
        textList[0] = 'X'   #takes the first variable and turns it to the letter x

        newText = ''.join(textList) #Join the two list to get the new word

        return newText #return the updated switch


def Divertion_Extra():

  #Takes the first letter of a word that doesnt start with P,R,S,T and changes it to the letter X

    text = rand.choice(IWTUsed)
    textList = list(text) #takes the string into a list

    if len(text) > 4:
        textList[len(text)-rand.randint(1,4)] = 'Y'
        textList[len(text)-rand.randint(1,4)] = 'Z'
    else:
        textList[len(text)-1] = 'Z' #rakes the last variable and turns it into the letter Z
        textList[len(text)-2] = 'Y'

    newText = ''.join(textList) #Join the two list to get the new word


    new_textList = list(newText) #takes the string into a list
    new_textList[0] = 'Z' #rakes the last variable and turns it into the letter Z

    newerText = ''.join(new_textList) #Join the two list to get the new word

    return newerText #return the updated switch



#Ascii Part
def Relics_Ascii():
    tprint(rand.choice(IWTUsed).upper(),font= Randomizer()) #calling Randomizer
    Block=text2art(rand.choice(IWTUsed),font='block',chr_ignore=True) #code already implemented within the art library
    print(Block + rand.choice(IWTUsed))
    tprint(rand.choice(IWTUsed).upper(),font="cybermedium")
    tprint(Divertion_Light(),font="cybermedium")
    yellowFont=text2art(rand.choice(IWTUsed),font='font="yellow"',chr_ignore=True)
    print(yellowFont)
    tprint(rand.choice(IWTUsed).upper(),font= Randomizer())
    tprint(Divertion_Extra(),font="cyberbig")

if wordCount > 20:
  Relics_Ascii()
  Relics_Ascii()

else:
  Relics_Ascii()
```
