Externals for Max5 and Max6

Pierre Guillot's icon

Hi,

I've made MSP externals for Max5 and Max6 with the SDK of Max 6. With Max 6, everything is working perfectly but I've a problem with Max 5. Max 5 can't load the external because it doesn't find gensym_tr in the MaxAPI library. It's seems that I'm not the only one :
https://cycling74.com/forums/note-for-max
https://cycling74.com/forums/jit-desktop-object
Instead of my objects, simplemsp~ is working fine on both versions, I don't know why. If someone got a solution, I will be pleased to know it, I don't want to create an object for each Max.

Thanks

Emmanuel Jourdan's icon

You need to compile using the 5.x SDK in order to have the external working in both Max 5 and Max 6.

Pierre Guillot's icon

It works, but perhaps it's better to have 2 externals for the durability (if I want to use buffer). And I still can't figure out, why does the simplemsp~ example of Max 6 SDK work in both Max 5 and Max 6? (because the project is very simple?...).
Anyway, thanks a lot. I'm working on the FFT analysis and your project "zsa.descriptor" helped me a lot to understand.
If you want to have a look : http://pierreguillot.github.com/MaxObjects/

Best,

Pierre

Pierre Guillot's icon

Yep, I found the bad function....

[simplemsp~] don't use CLASS_ATTR_LABEL ! The definition has changed :

Max 6 :
#define CLASS_ATTR_LABEL(c,attrname,flags,labelstr)
    CLASS_ATTR_ATTR_FORMAT(c,attrname,"label",USESYM(symbol),flags,"s",gensym_tr(labelstr))

Max 5 :
#define CLASS_ATTR_LABEL(c,attrname,flags,labelstr)
    CLASS_ATTR_ATTR_FORMAT(c,attrname,"label",USESYM(symbol),flags,"s",gensym(labelstr))

Small differences that matter!

andrea agostini's icon

... and what is gensym_tr ???
aa

andrea agostini's icon

Hi Nicolas.
Yes, I have read the doc about gensym_tr... but in fact I was wondering what "translated" means!
Anyone else?
aa

Pierre Guillot's icon

Hi,

@Nicolas
No I didn't try and I've find another translated function str_tr called by one of my object but I don't where. I don't know if it's possible to force gensym instead of gensym_tr. We have only the prototype of the function, I don't know how to do this, if you have any suggestion...

@Andrea
I've try with a french word to see if it will be translated in english but that didn't work... .In fact, with translated the character don't need to be a constante, but I still don't know the differences...

Timothy Place's icon

Yes, "translated" is indeed referring to other languages for which Max may be localized. There will be more information about this in the future.

If you want to build for Max 5 and 6 you really should heed EJ's advice and build against the Max 5 SDK. There are many subtle differences and many opportunities for your code to fail at runtime if you fail to heed this advice.

Cheers,
Tim