I have been getting some success downloading eyesy patches on patchstorage.com, not all of them work for me but a few do. I tried to create a patch on Chat GPT, but I can’t get it to work correctly. It is the free version of chat gpt and I have sent it photos of the errors, and described as much as I can. I was curious to see if anyone else has had success making a patch, or coding, with chat gpt. I will share the code it wrote for me and hopefully someone can help me to understand more of what I am missing. I will continue to research, practice, and attempt to code and make cool patches.
import pygame
import pygame.gfxdraw
import random
import math
Initialize parameters
eyes_brightness = 0
mouth_open = 0
background_rotation = 0 # For swirling background
eye_color = [255, 0, 0] # Initial color for eyes
mouth_color = [255, 255, 255] # Initial color for mouth
def setup():
pygame.gfxdraw.filled_rectangle(etc.screen, (0, 0, etc.xres, etc.yres), (0, 0, 0))
def draw():
global eyes_brightness, mouth_open, background_rotation, eye_color, mouth_color
# Analyze audio frequencies
low_freq = etc.audio_in[0] # Low frequencies (mouth)
high_freq = etc.audio_in[2] # High frequencies (eyes)
# Set thresholds for reaction
mouth_open = int(low_freq * 50)
eyes_brightness = int(high_freq * 255)
# Trigger random color change on significant reaction
if eyes_brightness > 200:
eye_color = [random.randint(0, 255) for _ in range(3)]
if mouth_open > 20:
mouth_color = [random.randint(0, 255) for _ in range(3)]
# Draw swirling background
draw_swirl(background_rotation)
background_rotation += 0.05 # Constant rotation speed
# Draw Skull with reactive eyes and mouth
draw_skull(eye_color, eyes_brightness, mouth_color, mouth_open)
def draw_swirl(rotation):
# Draw rotating background pattern
for i in range(10):
color = [(math.sin(rotation + i) * 127 + 128) for _ in range(3)]
swirl_color = (int(color[0]), int(color[1]), int(color[2]))
pygame.gfxdraw.filled_circle(etc.screen, 64, 64, i * 10 + 5, swirl_color)
def draw_skull(eye_color, eyes_brightness, mouth_color, mouth_open):
# Skull outline
pygame.gfxdraw.aacircle(etc.screen, 64, 64, 50, (255, 255, 255)) # Head
# Eyes with reactive color
pygame.gfxdraw.filled_circle(etc.screen, 48, 50, 8, eye_color) # Left eye
pygame.gfxdraw.filled_circle(etc.screen, 80, 50, 8, eye_color) # Right eye
# Mouth with reactive color
pygame.gfxdraw.box(etc.screen, (54, 80, 20, mouth_open), mouth_color) # Mouth opens based on low frequency volume