# chatGPT whoa

**URL:** <https://forum.critterandguitari.com/t/chatgpt-whoa/9233>\
**Category:** EYESY\
**Created:** [February 18, 2023, 9:04pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233 "2023-02-18T21:04:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlumWrinkles](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PlumWrinkles](https://forum.critterandguitari.com/u/PlumWrinkles)\
**Post date:** [February 18, 2023, 9:04pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233/1 "2023-02-18T21:04:28Z")

</div>

i just asked chatGPT: “can you write me a code for eyesy video synthesizer that is audio reactive and creates psychedelic images?”

i don’t have my eyesy with me at present so i can’t see what i’ve just had it do, but i’ll try to copy/paste it here so maybe one of y’all can run it.

anyway… just kinda seems like a breakthrough way to interact with Eyesy… (for me at least)

#include “ofMain.h”  
#include “ofxMaxim.h”

class ofApp : public ofBaseApp {  
public:  
void setup() {  
ofSetBackgroundColor(0);  
ofSetFrameRate(60);  
ofEnableAlphaBlending();

```
    // Initialize audio input
    audioInput.setup(0, 2, 44100, 512, 3);
    audioInput.setOutputVolume(0);
    audioInput.setUseTexture(false);

    // Set up the audio analyzer
    analyzer.setup(512, 256, 0);
    analyzer.setAverages(8, 3);

    // Set up the visualizer
    visualizer.setup(ofGetWidth(), ofGetHeight());
}

void update() {
    // Get the audio data
    audioInput.getNextBuffer(audioBuffer, 512, 2);

    // Analyze the audio
    analyzer.calculate(audioBuffer);

    // Map the audio data to visual parameters
    float hue = ofMap(analyzer.getAverage(0), 0, 0.1, 0, 255);
    float saturation = ofMap(analyzer.getAverage(1), 0, 0.1, 0, 255);
    float brightness = ofMap(analyzer.getAverage(2), 0, 0.1, 0, 255);
    float speed = ofMap(analyzer.getAverage(3), 0, 0.1, 0, 5);

    // Update the visualizer
    visualizer.update(hue, saturation, brightness, speed);
}

void draw() {
    // Draw the visualizer
    visualizer.draw();
}

```

private:  
ofxMaxiMix audioInput;  
float audioBuffer[512 \* 2];  
ofxMaxiFFT analyzer;  
ofxMaxiFFTOctaveAnalyzer octaveAnalyzer;  
Visualizer visualizer;  
};

class Visualizer {  
public:  
void setup(int width, int height) {  
ofSeedRandom(42);  
mesh.setMode(OF\_PRIMITIVE\_TRIANGLES);  
for (int i = 0; i \< 1000; i++) {  
mesh.addVertex(ofVec3f(ofRandom(width), ofRandom(height)));  
mesh.addColor(ofColor(0, 0, 0, 0));  
}  
for (int i = 0; i \< 2000; i++) {  
mesh.addIndex(ofRandom(1000));  
mesh.addIndex(ofRandom(1000));  
mesh.addIndex(ofRandom(1000));  
}  
}

```
void update(float hue, float saturation, float brightness, float speed) {
    for (int i = 0; i < mesh.getNumVertices(); i++) {
        ofVec3f& vertex = mesh.getVertices()[i];
        ofColor& color = mesh.getColors()[i];

        vertex.x += ofSignedNoise(vertex.x / 100.0, vertex.y / 100.0, ofGetElapsedTimef() * speed) * 5;
        vertex.y += ofSignedNoise(vertex.x / 100.0, vertex.y / 100.0, (ofGetElapsedTimef() * speed) + 1000) * 5;

        float alpha = ofMap(ofDist(vertex.x, vertex.y, ofGetWidth() / 2, ofGetHeight() / 2), 0, ofDist(0, 0, ofGetWidth() / 2, ofGetHeight() / 2), 255, 0);
        color.setHsb(hue, saturation, brightness,

```

maybe it’s cool. maybe it’s junk.

cheers

---

<div class="post-metadata">

**Author:** ![PlumWrinkles](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PlumWrinkles](https://forum.critterandguitari.com/u/PlumWrinkles)\
**Post date:** [February 18, 2023, 9:09pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233/2 "2023-02-18T21:09:14Z")

</div>

not sure why the formatting of the copy/paste looks like that with some in a gray box and some not, but that’s what pasted when i clicked ‘copy code’

---

<div class="post-metadata">

**Author:** ![darkestwonder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/darkestwonder/32/5319_2.png) [@darkestwonder](https://forum.critterandguitari.com/u/darkestwonder)\
**Post date:** [February 19, 2023, 4:37pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233/3 "2023-02-19T16:37:05Z")

</div>

Def great thinking to ask ChatGPT! I’m gonna try this one, and will update with some feedback. Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![\_kd](https://avatars.discourse-cdn.com/v4/letter/_/b5e925/32.png) [@\_kd](https://forum.critterandguitari.com/u/_kd)\
**Post date:** [February 19, 2023, 9:47pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233/4 "2023-02-19T21:47:20Z")

</div>

I did something similar recently - got chat GPT to code me some c code for a sampler/LFO thing I had in mind. The attempt looks credible but I’m yet to test it.

---

<div class="post-metadata">

**Author:** ![twang69](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/twang69/32/5278_2.png) [@twang69](https://forum.critterandguitari.com/u/twang69)\
**Post date:** [February 20, 2023, 3:53pm UTC](https://forum.critterandguitari.com/t/chatgpt-whoa/9233/5 "2023-02-20T15:53:02Z")

</div>

ChatGPT is also a great help with licensing - it just generated my CC-BY 4.0 license template for my latest patch before. It’s able to create Pure Data examples too but I didn’t go too deep on this yet.
