Giter Club home page Giter Club logo

max-sdk's People

Contributors

diablodale avatar emmanueljourdan avatar hiddedejong avatar isabelgk avatar jcelerier avatar jeremybernstein avatar leico avatar robtherich avatar rsr-ableton avatar tap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

max-sdk's Issues

lores~ confusing comment

in lores_new(), the comment about the 3 inlets follows the call setting that up, which is counter-intuitive and confusing if you're new to the craft, since the following 3 lines, which would ordinarily be referenced in the comment, don't set up 3 inlets.

WIN32 defined for 64-bit build

Hi,

in the preprocessor definitions of dummy.vcxproj, WIN32 is defined for x64 as well. I haven't looked at other projects, but I suspect it's there. I see that the C74_X64 macro is based upon _WIN64 (with the underscore), but this seems to suggest it should be based upon WIN64 (no underscore) instead, if I understand correctly: https://stackoverflow.com/questions/17380340/win32-preprocessor-definition-in-64bit-windows-platform

I'm not going to change this in my own projects as everything seems to be working ok, but I'm curious whether it's intentional or not...

Best,
andrea

proxy discussion

It would be useful if there were some additional discussion about proxies, and an example (e.g. degrade~) demonstrating their usage, particularly with an MSP object, where it's really not clear how to add non-signal outlets.

object_attr_getdump() causes undesired output

When object_attr_getdump() is called in my code, the output on dumpout is wrong.
Another user also saw this https://cycling74.com/forums/topic/max-6-0-4-sdk/#post-223112

SDK 6.1.4
VS 2015 community
Windows 10 x64

My attribute is a long, data stored in my object struct, and defined with custom getter/setter like:

attr = attr_offset_new("register", _sym_long, ATTR_GET_DEFER_LOW | ATTR_SET_USURP_LOW,
        (method)max_dp_kinect_register_get, (method)max_dp_kinect_register_set, calcoffset(t_max_dp_kinect2, ob));
        object_addattr_parse(attr, "label", _sym_symbol, 0, "\"registration valid\"");
        object_addattr_parse(attr, "category", _sym_symbol, 0, "\"Kinect Registration\"");
        max_jit_class_addattr(max_class, attr);

All features of Max function as expected...until
object_attr_getdump(x, _sym_register, 0, nullptr);

The output sent from dumpout is
ister

Doc request, add attr_args_process to narrative pages

Hi C74 folks, it would be great if the narrative sdk pages on attributes mentioned the attr_args_process function to let folks know that that is necessary in order to get your attributes filled in from @ args in the object box. Right now, that function is only in the api ref docs, and it took me a while to figure out that that's what I was missing, though I eventually I found it in the examples. If this is something I can do somehow, please let me know. (I'm not clear whether public pull requests are accepted for those sorts of things) thanks!

search box in top right fails

Repro:

Use Chrome
Visit https://cycling74.com/sdk/MaxSDK-7.0.3/html/index.html
In the top right search box type:  standalone

Result
Nothing happens.

Expected:
Search results matching the text "standlone"

Continued repro
3. Press ctrl+shift+I

Result:
Two errors are shown

Uncaught ReferenceError: NAVTREE is not definedinitNavTree @ navtree.js:472(anonymous function) @ index.html:68b.Callbacks.e @ jquery.js:16b.Callbacks.bD.fireWith @ jquery.js:16bF.extend.ready @ jquery.js:16e @ jquery.js:16

2search.js:323 Uncaught ReferenceError: indexSectionsWithContent is not definedSearchBox.Search @ search.js:323(anonymous function) @ VM570:1

symbols not exported in jgraphics.h

the functions:

jgraphics_lines_intersect()
jgraphics_line_intersects_rect()

declared in "jgraphics.h"

are not exported from the kernel.
On Mac, Xcode complains with an "Undefined symbol" error.

Feature Request : buffer_setsize() or any other good name, provide change buffer size function

Hello and Happy new year C74 Dev team.
First, I want to tell thank you, I appreciate your great jobs.

In this issue I would like to talk a above feature. Now I am creating a external object. It manipulate buffer~, I would like to implement a feature like std :: vector. I implemented like :

...
err = buffer_unlock( buffer_obj );
if( err != MAX_ERR_NONE ) //exception routine

object_method( buffer_obj, gensym("sizeinsamps"), samples * 2);

err = buffer_lock( buffer_obj );
if( err != MAX_ERR_NONE ) //exception routine
...

I guessed need to unlock a critical section to use buffer~ 's "sizeinsamps" message. But it allowed to interrupt other thread. This code may safe about multi thread process, but it can not guarantee data integrity.

If can change size without unlock, buffer manipulation is going to more useful I guess.

On the other hands, yes you can tell It doesn't need, or It is not supported.

Thanks to read.

proxy_delete documentation?

Hi,

The only documentation I see for proxy_delete

void proxy_delete(void *xx); // calls inlet_delete()

After some trial and error I discovered you should not call object_free after proxy_delete.

I cannot find this function in max_api generaded docs. Is it safe for me to use this function in combinations with proxy_new & proxy_getinlet?

object_attr_setobj() doesn't return error when used on unsettable attributes

In the following code

if (MAX_ERR_NONE == object_attr_setobj(myjbox, _sym_object, (t_object *)0x123123llu))
{
    cpost("object value set");
    t_object *objectcheck = jbox_get_object(myjbox);
    cpost("objectcheck=%Ix", objectcheck);
}

The output will be the unexpected

object value set
objectcheck=18180d20     <-- this can vary, the good thing is that it is not 0x123123

Expected is no output at all.
Since the attribute "object" is an unsettable attribute, then an error should be returned causing the if statement to skip output. Instead, object_attr_setobj() silently fails.

atom_setfloat() lacks 32-bit floats, corrupts data on Max 32-bit, not consistent with other float atom APIs

I request an API, macro, etc. that allows setting a 32-bit float into an atom.
While a dev can use atom_setfloat() by casting the float param up to a double, it is less performing plus results in erroneous results.

Accepting a double implies a 64-bit float. However, atoms on 32-bit Max are restricted to 32-bit values/floats. Therefore, corrupting the data if a dev sends a double into this API.

It can't make a roundtrip of atom_setfloat() -> atom_getfloat(). The values will not be the same.

The lack of a t_max_err atom_setfloat(t_atom *a, float b) doesn't match the pattern of the other atom APIs like:
atom_setfloat_array
atom_setdouble_array

Perhaps this API can be adjusted to be
t_max_err atom_setfloat(t_atom *a, t_atom_float b)

or creating two new APIs like
t_max_err atom_setfloatEx(t_atom *a, float b)
t_max_err atom_setdouble(t_atom *a, double b)

A_DEFER_LOW

I'm trying to use A_DEFER_LOW in the class_addmethod declaration. This is how it is defied in the ext_mess.h file:
A_DEFER_LOW = 0x43, ///< A special signature for declaring methods. This is like A_GIMME, but the call is deferref [sic] to the back of the queue.

This is how I used it:
class_addmethod(p_iclass, (method) pFpu_msg_set_pos, "pos_", A_DEFER_LOW, 0);

This is how my function is prototyped:
void pFpu_msg_set_pos(pt_patch_mxa p_pmxa, t_symbol *s, long argc, t_atom *argv);

This is what I get when the "pos_" message is sent to the external, which is a UI object.
unknown message argument type
patchUtils: bad arguments for message "pos_"

What am I doing wrong? (I also tried A_DEFER with the same result.)
I tried fixing the misspelling of deferred (from deferref) but without change :)

error in simplejit example ?

Only char type seems to be working properly.

I am sending a matrix from jit.noise to jit.simple (with autoadapt=1) and when I change the jit.noise matrix type to other than char I get incorrect values after jit.simple. Here's what is happening:
char: correct values
long: wrong values
float32: always gives "0."
float64: always gives "0."

unresolved external symbols

unresolved external symbol patcherview_screen_to_canvas,
unresolved external symbol jbox_get_presentation

At least on Windows

Audio externals: Wrong path to MaxAudioAPI.framework

In the Xcode project of source code for audio externals such as times~ the relative path to MaxAudioAPI.framework is provided as:

../../../c74support/msp-includes/MaxAudioAPI.framework

The correct should be

../../c74support/msp-includes/MaxAudioAPI.framework

locatefile_extended() documentation need more numtypes param usage

locatefile_extended() documentation in pdf/html needs additional info on the usage of numtypes=-1

When -1 is passed as the value of numtypes, the API will search for all filetypes and not limit it by the filetypelist param.

Typical usage is:
locatefile_extended(filename,&vol,&type,&type,-1)

names of objects

Hi,

No big deal I'm somehow bugged by the fact that building objects included in the Max distribution causes warnings to show up in the Max console, as two copies of them are found. This applies to the respective help files as well, aggravated by the fact that they're there even if I don't build the objects.

Would it be possible to name differently all the objects in the sdk, for example with a prefix? (say, sdk.lores~ or something?)

Of course the issue is only cosmetic, but I see no downsides to it and it probably can be done with just a textual find and replace through the whole package.

Best,
andrea

error in plussz2 example

In the plussz2 example in the SDK, class_new declares an A_GIMME
signature, but plussz_new is declared with a long parameter.

opinion on const for common (t_object *x, ...) or (void *x, ...) or (... t_class *c ...)

Throughout the SDK, a pointer to an instantiated class, object, or a class itself is needed. The SDK is built with the concept of having a pointer to an object and then manipulating the deferenced object. Any change involving this core concept is pervasive. Hence, my inquiry.

I suggest that in the majority of the cases, pointers to these three "objects" can be const or const-to-const to increase type-safety. In addition, use of const provides hints to the compiler which may improve speed and/or size.

Opinions, cautions?

The reasoning is that code shouldn't alter the pointer to the object on which the code is manipulating. Code can dereference the pointer and operate on the object itself...but not alter the pointer to the object. Altering the pointer to the object risks loosing access to the object, memory/security exceptions, and other negative situations. For the very few cases in which a coder needs to manipulate the pointer itself, they can copy/cast it into a mutable form.

Examples of API calls (original and const'd)

t_max_err class_register(t_symbol *name_space, t_class *c);
t_max_err class_register(const t_symbol * const name_space, t_class * const c);

t_max_err object_method_typed(void *x, t_symbol *s, long ac, t_atom *av, t_atom *rv);
t_max_err object_method_typed(void * const x, const t_symbol * const s, const long ac, const t_atom * const av, t_atom * const rv);

t_max_err object_attach_byptr(void *x, void *registeredobject);
t_max_err object_attach_byptr(void * const x, void * const registeredobject);

t_max_err object_notify(void *x, t_symbol *s, void *data);
t_max_err object_notify(void * const x, const t_symbol * const s, void * const data);

attr_args_process(void *x, short ac, t_atom *av);
attr_args_process(void * const x, const short ac, const t_atom * const av);

t_max_err object_attr_setfloat_array(void *x, t_symbol *s, long count, float *vals);
t_max_err object_attr_setfloat_array(void * const x, const t_symbol * const s, const long count, const float * const vals);

t_max_err class_addattr(t_class *c,t_object *attr);
t_max_err class_addattr(t_class * const c, t_object * const attr);

Examples of callbacks

(method) a core typdef defined in the headers as typedef void *(*method)(void *, ...); is one source of these non-const pointers with callbacks.

max_jit_class_addmethod_usurp_low(max_class, (method)max_myfunc, "doit");
void max_myfunc(t_max_my_obj *x, t_symbol *s, long argc, t_atom *argv)
 ↓ ↓ ↓ ↓ ↓
typedef void *(*method)(void * const, ...);
max_jit_class_addmethod_usurp_low(max_class, (method)max_myfunc, "doit");
void max_myfunc(t_max_my_obj * const x, const t_symbol * const s, const long argc, const t_atom * const argv)

or

t_max_err max_my_custom_setter(t_max_my_obj * const x, t_object * const attr, const long argc, const t_atom * const argv)

However, when (method) is used for some callbacks, it doesn't have a strong const intention. For example, the fun() callback for schedule() passes any void *ob as the first param to fun(). This param doesn't have to be one of the three "objects" above; though it probably is. There may be a slightly larger set of scenarios here than in the message/attribute callbacks above; though, I believe it is still rare.

void schedule(void *ob, method fun, long when, t_symbol *sym, short argc, t_atom *argv);
              ↑↑↑↑↑↑↑↑↑
              In a radical scenario, fun() wants to alter its copy of pointer.

Notes

For greatest overall improvements, the static/dynamic libraries for Max would need to be re-compiled with the const changes. I consider this outside the scope of this issue report, yet worth mentioning.

_clock_gettime defined in SDK MaxAPI but not in official Max/MSP MaxAPIImpl

I'd wager that the reason is that the API version is built against the 10.11 sdk, but the official version (I checked 8.1) is built against 10.13 sdk, and this symbol appeared in 10.12.

Problem is that an external which calls clock_gettime will resolve to the one which used to be provided by MaxAPI and then won't be able to find it when running in Max.

simpletext bug

Hi,
the simpletext example is buggy:

  • Build simpletext, run Max, instantiate in a patch
  • Double click on the simpletext object, the editor opens
  • Type some text in the editor
  • Close the editor
  • Double click again, the editor opens
  • Without closing the editor, delete the simpletext object in the Max patcher
  • Hover the mouse on the editor window
    Result: sometimes error messages in the Max console, sometimes crash.

I assume this is because the editor should be destroyed in simpletext_free(). Will do some testing.

Cheers,
andrea

doc missing for class_new() style APIs

The SDK doc is missing documentation for the class_new() style APIs. Instead, the SDK doc continues to have only the old deprecated setup() style APIs.

Two things are needed:

  1. end usage of the deprecated setup() style APIs throughout the doc
  2. document the new class_new() style APIs

Examples:

  1. max_jit_obex_free() is used in code at 20.1, 20.5, etc.
  2. There is no doc for max_jit_object_alloc()
  3. There is no doc for max_jit_object_free().
  4. No doc for class_extra_store(), class_extra_storeflags(), class_mess() in ext_obex.h
  5. No doc on how to use enum e_max_class_flags. Personally, I want to use CLASS_FLAG_DO_NOT_ZERO but I can't find any API in any header file that takes e_max_class_flags as a param
  6. conflict in the doc for object_free() in the extproto.h, PDF, and ext_obex.h. The first forward-references in freeobject() that "object_free() checkes to make sure the pointer is not NULL before trying to free it". However, the latter two have no notes that it does the NULL check. This is important to know for proper code and its optimization.

The SDK specifically deprecates max_jit_obex_free() and compiler warnings appear. However, there is no documentation to teach a dev what is the replacement.
WIth trial and error I was able to discover max_jit_object_free(x). However, I do not know if this API frees only the memory associated with the obex on x -or- if it free the obex memory and frees the memory block of x itself. I...think...that is only frees the obex memory.

exploit about a buffer~ : a object can manipulate locked buffer~

Hello C74 Dev team.

In this time, I would like to talk about:

float *buffer_locksamples(t_buffer_obj *buffer_object);

float *b_samples; ///< stored with interleaved channels if multi-channel

buffer_locksamples returned raw pointer. Also t_buffer_info.b_samplesis same. If a object keep this address, object can manipulate buffer~ at any time. Those are sample code.
https://gist.github.com/leico/c98e1f23a9e6969bdd550dd32238af71

I have two solutions. First, write more document, above pointer would may handled so carefully. This way would be the fastest.
Second, manipulate with t_buffer_ref and checking permission, like

t_max_err buffer_ref_read(t_buffer_ref *buffer_reference, float* data_array, const size_t size);
t_max_err buffer_ref_write(t_buffer_ref * buffer_reference, const float* data_array, const size_t size);
t_max_err buffer_ref_read(t_buffer_ref *buffer_reference, float* data_array, const_size_t size){

  if (buffer_reference == NULL )
    return MAX_ERR_GENERIC;
  if( _accessing_buffer_ref != NULL && _accessing_buffer_ref != buffer_reference )
    return MAX_ERR_GENERIC;

  ......

It is little bit speed down but stable.

Thanks to read.

Add gemfile?

I see that the test package depends on the sqlite3 gem. Would it be an idea to add a Gemfile so that Bundler could be used to maintain gems for the package?

Floating point formats generate random strings

Using any floating-point format (%e, %E, %f, %F, %g, or %G) in one of the Max-supplied output routines (snprintf_zero, post, cpost, et cetera) generates random output, usually zero.
Using sprintf or snprintf, from the C/C++ library, does work.
E.g.

double number = 42.34;
char  buffer[SUGGESTED_BUFFER_SIZE_];

snprintf(buffer, sizeof(buffer), "%g", number);

works, while

snprintf_zero(buffer, sizeof(buffer), "%g", number);

doesn't.

object_method_direct wrong in c++

Hi,

the provided example of the object_method_direct macro doesn't compile if built as c++, since casting implicitly the void* return value of object_method_getobject() to object*, for use as the first parameter of the returned method, is illegal.

I suggest to either change the example to

t_jrgba result = object_method_direct(t_jrgba, (void *, double, double), pwindow, gensym("getcolorat"), x, y);

or, probably better, to change the macro to

#define object_method_direct(rt, sig, x, s, ...) ((rt(*)sig)object_method_direct_getmethod((t_object *)x, s))((t_object*)object_method_direct_getobject((t_object *)x, s), __VA_ARGS__)

or even, if possible, to change the return value of object_method_direct_getobject() to t_object* .

Thanks for considering,
andrea

max text editor file type setting?

I have an object I am working on that works with lua files, and I notice that when I open the file in the text editor, the filename and title are set with the .lua extension, but text is all grey --

but then if I save the file, the syntax highlighting is automatically enabled, which is really useful.

Is there a filetype attribute or object_method I can call so that the "jed" object knows to use syntax highlighting when the file is first opened?

Here is my dbclick function:

void oluajit_dblclick(t_oluajit *x)
{
    if (x->t_editor)
        object_attr_setchar(x->t_editor, gensym("visible"), 1);
    else
    {
        x->t_editor = (t_object *)object_new(CLASS_NOBOX, gensym("jed"), x, 0);

        if( x->filename != "" ){
            object_method(x->t_editor, gensym("settext"), *(x->t_text), gensym("utf-8"));
            object_method(x->t_editor, gensym("filename"), x->filename.c_str(), x->pathID );
            object_attr_setsym(x->t_editor, gensym("title"), gensym(x->filename.c_str()) );
            object_attr_setchar(x->t_editor, gensym("scratch"), 0);
        }
        else
        {
            object_attr_setsym(x->t_editor, gensym("title"), gensym("untitled.lua"));
            object_attr_setchar(x->t_editor, gensym("scratch"), 1);
        }
        
        object_method(x->t_editor, gensym("openwindow"));
    }
}

small thing

the readme has Max7 packages in the title.

missing ext_database.c ?

The MaxAPI.pdf states:

ext_database.c is located in the 'common' folder inside of the 'max-includes' folder. If you use any of the functions defined ext_database.h, you will need to add ext_database.c to your project.

But I cannot find ext_database.c anywhere in the SDK.

call graph link fails, likely due to missing toggleVisibility()

Repro:

Use Chrome (or offline docs)
Visit https://cycling74.com/sdk/MaxSDK-7.0.3/html/group__class.html#ga2fa22e46d14006d0de5cde70af1f6221
In the section for ext_main() click on the "Here is the call graph for this function"

Result
Nothing happens. No graph is shown.

Continued repro
3. Press ctrl+shift+I

Result:
Two errors are shown

Uncaught ReferenceError: NAVTREE is not definedinitNavTree @ navtree.js:472(anonymous function) @ group__class.html:68b.Callbacks.e @ jquery.js:16b.Callbacks.bD.fireWith @ jquery.js:16bF.extend.ready @ jquery.js:16e @ jquery.js:16

Uncaught ReferenceError: toggleVisibility is not definedonclick @ group__class.html:872

path_toabsolutesystempath() doesn't return path on Windows ready for libraries

The SDK 6.1.4 documentation writes that path_toabsolutesystempath()

Translates a Max path+filename combo into a correct absolutepath that can be used to pass to libraries expecting system-native paths

Unfortunately, on Windows it does not. Instead it returns a path that uses forward slashes to separate directories. This reproduces on Max 6.1.9 and Max 7.0.6 both x86 and x64 using SDK 6.1.4.

To make a path that is ready "to pass to libraries" a backslash needs to be used to separate directories. This errant behavior does have a workaround. One can do the following:

path_toabsolutesystempath(pathid, "", filestring);
path_nameconform(filestring, sNativeQualifiedPathname, PATH_STYLE_NATIVE, PATH_TYPE_PATH);

dbviewer: memory leak

it appears that either dbviewer.mxo has a memory leak, or the db query mechanism itself has some kind of leak:

  1. new patcher with patcher below
  2. loadbang
  3. start metro
  4. open activity monitor and watch Max process

Realmem usage rapidly climbs.

Patch:

----------begin_max5_patcher----------
908.3ocyXt0aZCCEG+Y3SgUdAooLTbR3R2TenasSqRqaRcSaOrVgbRbA2Ero
IF5M0u6y9XRIEBWFkjwKA4iMG9e9cN9XGdrdMq.wczTKz6P+FUq1i0qUCLoM
Ta53ZVCI2EFSRgkYwo2JBt1x1LkjdmDLmRiQXjSl8QDY3.FueuDZnz3dOeml
N1HLFq+vus9oqxD5xoemqDbYJ6Apd4XW0zFy7wCY7XpD948lYTLVNuUVDnEk
9dKFakysbxPvsVGkvHwYyX7f79QTiBsBH79V1y9zBcodkOUut9g8qiPwBRjw
wKEQtNsZ1xF0B.UKfP3CVFgbJlP3BIDt.B4THg9IMIhvIqlQaEWjh98ioquB
oqaVowbEHiHIJUJoI8nbRPLnnWGCb6rz3jwkkUX5f0YY+pKLwkPXtjp7aTJO
QnhwU1Jnc2Y04cLcBvKqN2q35b2MNG6rscB1JtLjllR5SW.Lu+hD05PQAMIQ
QJHQhHRBxAyN6ziO8CjTVXJBPEMAII8QZyYNIlwoghwbY9.u.t561xzasKfz
oaj9W6frwjs6V0.oJv5eHOHD6Jb500C3no6T4gyN6s3LkdCRoPEXd0rz2vRW
b4xx1UHKCECGRU.XdVpHHJULjhdliRAhvyHIiijCnH8DAjTpsZpHikfIL5sn
aYwwHE.orITDAwER1UrPhjI3vRIikhgpggj336QiGobjxIxAiSMCT7Om6nIM
KLk4s1TlqOzMwyAxb572VcejqR5G.mjkeY4RhNKlDOXkIwRupOPjnLtip6Mz
y0qjaI2ZOnGxMioI2itv56m7kS93OlBvdZwXCeYafte57uc1rcF+5ymb9IHX
5CanXcCzQe8XXuwgMzXuwEVq5dyFHi6BUp9c8gQcJKH6WgPNa2alaCEwhDiG
gVnu3QtqPt.iLW1xEa1L2tC7JF5xwm+REtsERlfR1ooSqM9pqYqLqOILSudJ
H0JJnWu+O0zu4kw6JKNwGXJNa00TiVxEmd6Ac.xxUnEySKsxLiOS2JWZ7wcG
vGPYvQ.y8Wm.Qm19KgVpXbRXlqxdgLzr.LhlpNtFNZO2hzu3RtEMfEEQ44Op
Lhkpe+PH1bJL8so5YtepknmNUld72.4fqL03sWoF2Mo1AWg5YuhNPfiWib7q
V4rN53UcxYOae9lomsTNltzjQilPSRm5RPIpCwt1bIp11vPF2LD7nUBcBKa8
cpq81S0+KH5eEVM
-----------end_max5_patcher-----------

unable to detect collective as documented in patcher attributes section 13.4.1

In doc section 13.4.1 is written that a patcher has a "collective" object attribute and returns it with object_attr_getobj(). That if an object is returned on that API call, that means the patcher is inside a collective.

This fails in Max 7.0.6 x86 and x64. No object is returned when it actually is part of a collective.

I have potentially found a workaround to detect a collective. Pseudocode...

object_obex_lookup(x, gensym("#P"), &patcher);
while (NULL != patcher)
{
    filename = object_attr_getsym(patcher, _sym_filename);
    filepath = object_attr_getsym(patcher, _sym_filepath);
    patcher = jpatcher_get_parentpatcher(patcher);
}
hack1 = (_sym_nothing != filename) && (filename == filepath);
short pathid = 0;
locatefile_extended(filestring, &pathid, &outtype, &outtype, -1);
hack2 = pathid > 0;    // This was discovered in the 1st paragraph of Chapter 12
if (hack1 && hack2) cpost("I am in a collective");   // may not need both checks...just being extra sure

simplemax.c doesn't use an external editor

simplemax.c example could be updated to show sending the 'openwindow' message to the jed, which should make it compatible with using an external editor. Something like:

void simpletext_dblclick(t_simpletext *x)
{
	if (x->t_editor)
		object_attr_setchar(x->t_editor, gensym("visible"), 1);
	else {
		x->t_editor = object_new(CLASS_NOBOX, gensym("jed"), x, 0);
		object_method(x->t_editor, gensym("settext"), *x->t_text, gensym("utf-8"));
		object_attr_setchar(x->t_editor, gensym("scratch"), 1);
		object_attr_setsym(x->t_editor, gensym("title"), gensym("simpletext"));
	}
	object_method(x->t_editor, gensym("openwindow"));
}

STATIC_ATTR_LONG() static attribute function failures

I am encountering the same failure as experienced by someone in a 2012 Max Forum post at https://cycling74.com/forums/topic/shared-staticglobal-attributes/

The STATIC_ATTR_LONG macros->functions don't work. No attribute appears in inspector or in other Max UI. My primary test case is using them on a Max MOP wrapper class.

No known workaround.
It is possible to create a non-static attribute and do custom get/sets to emulate some of the functionality.

Example objects do not build in the Max 7 SDK

There is a bug in the 'build.rb' script that is used to build the example objects in the Max 7 SDK.

Details:
Steps to reproduce:

  1. install the SDK In the recommended location ($HOME/Documents/Max 7/Packages/).
  2. cd $HOME/Documents/Max 7/Packages/max-sdk/source
  3. type 'ruby build.rb' and watch all the build failures...

To fix - the line 'result = cd...' needs to be fixed to allow spaces in the directory path.
build.rb.patch.txt

C2118 - negative subscript

CLASS_ATTR_FLOAT(c, "middle_c", ATTR_FLAGS_NONE, t_scl2list, t_sclMiddleC);
and
CLASS_ATTR_FLOAT_ARRAY(c, "scl2list", ATTR_FLAGS_NONE, t_scl2list, t_sclMappingValues,1024);
generates compiler error C2118 on VS 2022.
it was working with sdk 8.0.3

Best regards
Klaus

outlet_list(): subtle documentation mistake?

Hi,

the documentation for outlet_list() states that the second argument can be either NULL or gensym("list"), but if I set it to NULL and subsequently watch the message in the Max debugger I see in the "Message" column. Apart from this, the message appears to be correct.

I suggest to change the documentation, stating that the second argument must be the "list" symbol.

Cheers,
andrea

max_jit_class_wrap_addmethods() -or- exposing jitter methods to max wrapper (late stage)

What is the behavior of max_jit_class_wrap_addmethods()?
Can I call it multiple times with no harm?

My need is to add methods to a jitter object that is exposed to Max via a max wrapper object. And these methods are to be added after the call to max_jit_class_wrap_standard()

Trial/error/reading header files I found max_jit_class_wrap_addmethods() and it seems to do what I want. Though I am unclear as to its full behavior and if there are negative sideaffects if called multiple times; once after each time I add a method to the jitter class.

Is there a API to cause the max wrapper to see this single new jitter method without (re)parsing all methods in bulk as I'm guessing max_jit_class_wrap_addmethods() does?

After this example is clarified, would be good to add documentation for this function and the others in related doc issues #20

Please update latest release

It looks like a few changes have gone into master since the last release (v7.1.0)—most importantly, 84044d3, which fixes building externals on macOS Sierra. Could you please make a new release here on GH and in the AWS download from cycling74.com? Not having the latest code caused me some confusion. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.