ChatGPT Max scripts don't work. Why ?

cahen's icon

ChatGPT proposes Max Script in response to prompts such as : Can you write a MaxMSP script to generate a sinusoidal oscillator ? but they don't work. They are either totally blank when copied into max, or uncomplete or crash ?

Are there main reasons with easy corrections, or is it still not (yet) good enough?

R.C.

👽'tW∆s ∆lienz👽's icon

still not yet good enough, but also... it's the current premise that ChatGPT is based on which makes it so that it might not be for a long time: we need AI trained on the internet to understand computer languages differently than human languages. we have internet sites that explain C and C++ with plenty of human language explanations added, commenting line for line, so ChatGPT can understand these a little better, but most of the functional Max stuff explained on the internet comes in the form of youtube videos and articles which show the visuals of patching without including the text/code versions explained in parallel, line-by-line. people don't really write the code out for visual patching in Max, they visually patch, and then the code for a patch is generated from that to be pasted online to share with others. this leaves most of the patches you'd copy from the text version, then pasted into a visual form, completely void of any human language explanation of what the text version means. furthermore, ChatGPT will be confused between the two types of text-pasting that happens with Max patches: CopyCompressed, and regular JSON-like tables(it needs to find human language explaining what the JSON means, specific to Max, and possibly how the encryption/compression algorithm works for CopyCompressed too; you might have better luck asking ChatGPT for code to paste into the js or mxj objects within Max, because java and javascript are explained all over the internet in human languages).

tl;dr - ChatGPT is trained on human language based text all over the internet, not starting from a point where it understands programming code, just by itself. this is what keeps it so 'chat-friendly', hence the name. you need an AI that's more 'code-friendly'...
but, then again, much like human developers who write code, such an AI might be far less sociable ;D

similar thread here, in case it helps:

Shakeeb Alireza's icon

An alternative is have ChatGPT generate python scripts which then generate (offline) Max patches. My py2max library may be helpful here: https://github.com/shakfu/py2max

Randall Packer's icon

After several unsuccessful attempts to get ChatGPT 4o Canvas to help with a SPAT project, I simply asked it what it would need to learn Max. I am curious if anyone has actually tried to train ChatGPT in Max programming: Here is the suggestion from ChatGPT:

What Could Help Me Learn Max More Effectively?

  1. Documentation and Object Descriptions:

    • Provide detailed reference material for Max objects, including spat5 and other commonly used objects.

    • Share examples that demonstrate syntax, arguments, and object-specific rules.

  2. Annotated Patch Examples:

    • Share well-annotated text versions of Max patches, including object definitions, connections, and attributes.

    • For each example, explain what is happening step by step, so I can better infer patterns and rules.

  3. Feedback on Attempts:

    • Share the output when you test patches I create. If there's an error, describe the specific issues so I can refine my logic for generating Max-compatible code.

  4. Broad Context for Objects:

    • Explain the relationships between objects, e.g., why and how metro connects to a toggle or how spat5.oper interacts with spat5.spat~.

    • Detail how arguments and attributes modify object behavior, including edge cases.

  5. Iterative Building Blocks:

    • Start with simpler patches (e.g., a single metro object or a few basic connections).

    • Progressively increase complexity by adding more objects and functionality.

  6. Access to Tools:

    • If I could interact directly with a Max-like testing environment (e.g., exporting my generated patches into a tool for automated verification), I could more reliably create compatible patches.

Wil's icon

AI is now built in to Mac OS Sequoia 15.2

I already notice minor problems going away.

Just a matter of time before is starts slithering around in 'our' home spaces...

//

Actually what I just said is bullshit - maybe

Best solution: Keep everything important on an external drive and only plug it in when disconnected from the internet.

Roman Thilenius's icon

that´s why apple put the power button on the bottom, so that you can no longer turn it off.

next step is terms of use where you have to agree that everything you create is theirs.

Randall Packer's icon

This thread has been for those who are interested in discussing the use of AI to write Max patches. Perhaps you might have something to add to the conversation?

Wil's icon

Yes - I especially like its Capabilities category -!

AI is a broad field that encompasses many types of technologies, while ChatGPT is a specific type of AI that's designed for conversational interactions

  • AI

    Artificial intelligence is the ability of a computer system to simulate human-level intelligence. 

  • ChatGPT

    ChatGPT is a type of generative AI that's trained to generate human-like responses in conversations. ChatGPT is a specialized tool within the AI toolkit that's designed to generate natural language text. 

Here are some other differences between AI and ChatGPT:

  • Generative AI

    Generative AI is a broader field that includes AI systems that create new content, such as writing articles, composing music, and generating images. 

  • Machine learning

    Machine learning is a computer system's ability to learn from human input to perform complex tasks. ChatGPT uses machine learning to develop accurate and consistent styles. 

  • Applications

    ChatGPT is good for interactive conversations and exchanging information. Other AI tools, like Google AI, are better for machine learning, data analysis, and broader AI tasks. 

  • Capabilities

    ChatGPT can perform a variety of tasks, including composing essays, doing math, and coding. However, ChatGPT can sometimes "hallucinate" and make up answers and references. 

//

Chat GPT is essentially AI to a lesser extent - so I stand by my previous comment - just give it time

it will find a way in like virus that cannot be removed

//

Then this comment turns highly critical - which is necessary in a democracy

You are still going to have to find the center point of the room (or listener) and measure with tape measure to each speaker to set optimal reverb and surround which basically what spat is.

//

Sounds like you just want to ultimately have Chat GPT to make patch.

//

I studied with Michael Daugherty.

We had an exchange of words

He told to cut the meandering in my music and get to the meat of it

I told him I am would rather hike 4 hours to the waterfall - he wants to take a helicopter.

//

Chat GPT undoes the hike

Roman Thilenius's icon
Perhaps you might have something to add to the conversation?

not neccessary... there are already 5 other threads about that topic.

one has to accept that you can not let an AI program do stuff for you which it has never been trained to them. and i dont need to you tell you that, chatGPT altready correctly explained the requirements to you.

the pure existance of huge companies scraping the web to make use of other people´s work is at the same time the reason for why it will never happen, because that makes people stop sharing patches and releated documentations finally.

not to speak of sharing patches in the machine-readable json format... nobody does that.

Rob Ramirez's icon

using thispatcher scripting commands write a MaxMSP script to generate generate a sinusoidal oscillator. insert commas between the scripting commands.

Randall Packer's icon

Thanks Rob! Have you actually been able to get a working patch out of ChatGPT?