{"id":13420211,"url":"https://github.com/grrrwaaa/maxcpp","last_synced_at":"2025-03-15T06:32:03.567Z","repository":{"id":7479805,"uuid":"8828173","full_name":"grrrwaaa/maxcpp","owner":"grrrwaaa","description":"C++ templates for Max/MSP objects","archived":false,"fork":false,"pushed_at":"2017-12-21T15:07:51.000Z","size":83,"stargazers_count":134,"open_issues_count":5,"forks_count":15,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-07-31T22:53:55.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grrrwaaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-17T01:24:31.000Z","updated_at":"2024-07-10T09:57:31.000Z","dependencies_parsed_at":"2022-09-02T02:51:13.723Z","dependency_job_id":null,"html_url":"https://github.com/grrrwaaa/maxcpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grrrwaaa%2Fmaxcpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grrrwaaa%2Fmaxcpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grrrwaaa%2Fmaxcpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grrrwaaa%2Fmaxcpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grrrwaaa","download_url":"https://codeload.github.com/grrrwaaa/maxcpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695235,"owners_count":20332620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:28.814Z","updated_at":"2025-03-15T06:32:03.308Z","avatar_url":"https://github.com/grrrwaaa.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"![logo](maxcpp.png) MaxCpp\n==========================\n\n\nA C++ template single-header file for constructing Max/MSP externals from C++ classes, in a friendly and readable manner. The core notion is that an instance of the external is encapsulated by an instance of the C++ class. Most of the mechanics of typical max objects are encapsulated by the curiously recurring template pattern.\n\nPreviously hosted at [Google Code](https://code.google.com/p/maxcpp), updated and tested against Max 6 (2013).\n\n## Using\n\nTo develop Max/MSP projects, you will first need the Max SDK, available from [Cycling `74](http://cycling74.com/products/sdk) (also mirrored [on github](https://github.com/Cycling74/max6-sdk))\n\nThe source trunk includes headers, examples and Xcode project / Visual C++ project files. The example projects should work 'out of the box' if the this repo is placed inside your MaxSDK folder (next to the c74support folder). \n\nSince the source files will be C++, the ```main``` function needs to be qualified with ```extern \"C\"```.\n\nCaveats: it almost surely won't work with virtuals or multiple inheritance. Also be careful not to include the header twice, or there'll be linker errors for duplicate m_class symbols.\n\nThanks to Oli Larkin and Thijs Koerselman for feedback and contributions.\n\n## Sample code (Max object)\n\n```cpp\n#include \"maxcpp6.h\"\n\nclass Example : public MaxCpp6\u003cExample\u003e {\npublic:\n\tExample(t_symbol * sym, long ac, t_atom * av) { \n\t\tsetupIO(2, 2); // inlets / outlets\n\t}\n\t~Example() {}\t\n\t\n\t// methods:\n\tvoid bang(long inlet) { \n\t\toutlet_bang(m_outlets[0]);\n\t}\n\tvoid testfloat(long inlet, double v) { \n\t\toutlet_float(m_outlets[0], v);\n\t}\n\tvoid testint(long inlet, long v) { \n\t\toutlet_int(m_outlets[0], v);\n\t}\n\tvoid test(long inlet, t_symbol * s, long ac, t_atom * av) { \n\t\toutlet_anything(m_outlets[1], gensym(\"test\"), ac, av); \n\t}\n};\n\nC74_EXPORT extern \"C\" int main(void) {\n\t// create a class with the given name:\n\tExample::makeMaxClass(\"example\");\n\tREGISTER_METHOD(Example, bang);\n\tREGISTER_METHOD_FLOAT(Example, testfloat);\n\tREGISTER_METHOD_LONG(Example, testint);\n\tREGISTER_METHOD_GIMME(Example, test);\n}\n```\n\n## Sample code (MSP object)\n\n```cpp\n#include \"maxcpp6.h\"\n\n// inherit from the MSP base class, template-specialized for myself:\n\nclass Example : public MspCpp6\u003cExample\u003e {\npublic:\n\n\tExample(t_symbol * sym, long ac, t_atom * av) { \n\t\tsetupIO(2, 2); \n\t}\n\t\n\t~Example() {}\t\n\t\n\t// methods:\n\tvoid bang(long inlet) { \n\t\tpost(\"bang in inlet %i!\", inlet); \n\t}\n\t\n\tvoid test(long inlet, t_symbol * s, long ac, t_atom * av) { \n\t\tpost(\"%s in inlet %i (%i args)\", s-\u003es_name, inlet, ac);\n\t}\n\t\n\t// default signal processing method is called 'perform'\n\tvoid perform(double **ins, long numins, double **outs, long numouts, long sampleframes) {\n\t\t// example code to invert inputs\n\t\tfor (long channel = 0; channel \u003c numouts; channel++) {\n\t\t\tdouble * in = ins[channel];\n\t\t\tdouble * out = outs[channel];\n\t\t\tfor (long i=0; i \u003c sampleframes; i++) {\n\t\t\t\tout[i] = -in[i];\n\t\t\t}\n\t\t}\n\t}\n};\n\nC74_EXPORT extern \"C\" int main(void) {\n\t// create a class with the given name:\n\tExample::makeMaxClass(\"example~\");\n\tREGISTER_METHOD(Example, bang);\n\tREGISTER_METHOD_GIMME(Example, test);\n}\n```\n\n## Licence\n\nmaxcpp is distributed under the permissive BSD-like MIT licence:\n\nCopyright (c) 2009-2013 Graham Wakefield\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrrrwaaa%2Fmaxcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrrrwaaa%2Fmaxcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrrrwaaa%2Fmaxcpp/lists"}