Max External by C# ?

NK's icon

Has anyone experienced about making max externals by C# ? I found some resources and information from ChatGPT. But it seems all about max-c# external information is not found on webs anymore. Has anyone knows what’s going on?

Jan M's icon

if it's from chatGPT it probably never was online :) this bot is creating texts based on probabilities not content with meaning....

Iain Duncan's icon

C# is not a supported language for externals. They can be made in C (the SDK), C++ (mindev kit), or Java (the mxj object). There have been various other experiments, which might be what you found, but the active options are listed here. https://cycling74.com/products/extendmax

NK's icon

I think that this is a interesting question. I got much web links about max external by C# (from ChatGPT) . But all links were “error 404”…
I even got a demo code like this :
—-
using System;
using System.Collections.Generic;
using System.Text;
using MaxMSP;
using MaxMSP.C74;

namespace MyMaxObjects {
[MaxObject("mydouble", "dsp")]
public class MyDouble : MSPObject {
[MaxInlet]
public void Inlet(float value) {
float output = value * 2;
Outlets[Outlets.Count - 1].Send(output);
}
}
}
—-
Is it possible about licensing issues? So we couldn’t find any resources anymore ?

ecuk's icon

I am in agreement with Jan and Iain on this one: I have never seen anything over the years about writing Max externals using C#, so I am pretty sure this is another example of ChatGPT’s vivid imagination. Bottom line, it never learnt how to say ‘I don’t know’, so it instead makes things up. (I’ve known more than a few humans who are the same way.)

Iain Duncan's icon

I did read ages ago about someone making something to do it, but I think they gave up. You maybe encountered some of their prototype code. It would be a lot of work for questionable gain - you would need to make something to compile C# to linkable code that Max could load (presumably in C or C++). Personally, I just use the C SDK because it is *much* more extensively documented at this stage and figuring out how to do things is the hardest part.

adonfadonf's icon

it's an impossible way

MakePatchesNotWar's icon

Hypothetically speaking i think/assume you can load in the sdk somehow much like how you can also load in c++(/c?) libraries in Java with JNI. I'm sure something like this will exist for c# as well. That being said unless you really know what you're doing i would just use c/c++ and if the desire from using c# comes from being familiar with the syntax just use Mxj and Java since its very similar.

And yeah, Chatgpt is not helping here. What did it say when you asked where you can find "MaxMSP.C74;"? :p

Edit:

"you can load in the sdk somehow much like how you can also load in c++(/c?) libraries in Java with JNI."

Never mind i think this is irrelevant because its the resulting Dll that needs to be read by Max. I don't know if that would work but i assume it won't. Stick with C/C++

Iain Duncan's icon

Yeah that is what I think I remember reading about. And I could be offbase that it got abandoned. I just remember encountering it when I was doing preliminary research around S4M. The fact that it's not listed on the Cycling 74 page of extensions seems to imply it didn't get too far though.