{"id":19208,"date":"2015-04-24T00:32:15","date_gmt":"2015-04-24T04:32:15","guid":{"rendered":"https:\/\/reactivemusic.net\/?p=19208"},"modified":"2015-04-24T01:29:05","modified_gmt":"2015-04-24T05:29:05","slug":"writing-jitter-external-objects","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=19208","title":{"rendered":"Writing Jitter external objects"},"content":{"rendered":"<p class=\"lead\">Not as easy as it looks.<\/p>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-19213\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png\" alt=\"Screen Shot 2015-04-24 at 12.48.55 AM\" width=\"300\" height=\"165\" srcset=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png 300w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-1024x564.png 1024w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM.png 1524w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h4>Getting started<\/h4>\n<p>First, think of a way to get the same results without writing an external. For example, borrow other code, use javascript, gen, Processing, or MSPaint.<\/p>\n<p>Apparently that didn&#8217;t work out. Well I can only get you so far.<\/p>\n<p>Assuming that you have already done the following<\/p>\n<ul>\n<li>Download the SDK:\u00a0<a href=\"https:\/\/cycling74.com\/downloads\/sdk\/\">https:\/\/cycling74.com\/downloads\/sdk\/<\/a><\/li>\n<li>Install Xcode (Mac OS) or Visual Studio Express (Windows)<\/li>\n<\/ul>\n<p>Learn how to write non-Jitter externals:<\/p>\n<ul>\n<li>Read documentation the comes with the SDK. I wasn&#8217;t able to do that.<\/li>\n<li>Windows:\u00a0<a style=\"line-height: normal;\" href=\"https:\/\/reactivemusic.net\/?p=19184\">https:\/\/reactivemusic.net\/?p=19184<\/a><\/li>\n<li>Audio:\u00a0<a style=\"line-height: normal;\" href=\"https:\/\/reactivemusic.net\/?p=19188\">https:\/\/reactivemusic.net\/?p=19188<\/a><\/li>\n<\/ul>\n<h4>Edit the examples<\/h4>\n<p>Currently the Jitter examples in the SDK are in the folders: examples\/matrix and examples\/gl. We&#8217;ll pretend we didn&#8217;t see GL.<\/p>\n<p>Here&#8217;s a sensible approach on Mac OS.<\/p>\n<ul>\n<li>Duplicate the example folder: jit.clip and rename the duplicate to something like jit.cliptz<\/li>\n<li>Inside jit.cliptz open the Xcode project<\/li>\n<li>Rename the Xcode project while in Xcode by single-clicking on the project name and editing it.<\/li>\n<li>Now feel free to alter the code in any way. Look in jit.clip.c<\/li>\n<\/ul>\n<p>In jit.clip.c, find the functions starting with<\/p>\n<p><span style=\"color: #bb2ca2;\">void<\/span> jit_clip_vector_char(<span style=\"color: #bb2ca2;\">long<\/span> n, <span style=\"color: #4f8187;\">t_jit_clip_vecdata<\/span> *vecdata, <span style=\"color: #703daa;\">t_jit_op_info<\/span> *in, <span style=\"color: #703daa;\">t_jit_op_info<\/span> *out)<\/p>\n<p>These are functions that processing the matrix vectors for char, long, and float matrixes respectively. We&#8217;ll work with the char function.<\/p>\n<p>Change the code so that the pixel values are inverted as well as clipped by subtracting pixel values from 255.<\/p>\n<p>Change two lines of code, marked here by the comment: \/\/ invert<\/p>\n<pre class=\"brush: c; gutter: true\">\tif ((is==1)&amp;&amp;(os==1)) {\r\n\t\t++n;--op;--ip;\r\n\t\twhile (--n) {\r\n\t\t\ttmp =  *++ip;\r\n\t\t\t*++op = 255 - tmp&gt;max?max:tmp&lt;min?min:tmp; \/\/ invert\r\n\t\t}\t\t\r\n\t} else {\r\n\t\twhile (n--) {\r\n\t\t\ttmp =  *ip;\r\n\t\t\t*op = 255 - tmp&gt;max?max:tmp&lt;min?min:tmp; \/\/ invert\r\n\t\t\tip+=is;op+=os;\r\n\t\t}\r\n\t}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u00a0Clean and build the project.<\/li>\n<li>The .mxo file will be under the Products folder. &lt;Ctrl&gt; click to show in finder<\/li>\n<li>Copy the .mxo file into the same folder as your Max patch<\/li>\n<li>What Max patch? This one:<\/li>\n<\/ul>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.38.14-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-19211\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.38.14-AM-300x202.png\" alt=\"Screen Shot 2015-04-24 at 12.38.14 AM\" width=\"300\" height=\"202\" srcset=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.38.14-AM-300x202.png 300w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.38.14-AM-1024x689.png 1024w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.38.14-AM.png 1678w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The window on the left is inverted because its getting that way in the object we just hacked.<\/p>\n<h4>That&#8217;s all<\/h4>\n<p>I didn&#8217;t really explain anything. Sometimes going through the motions is a start. If I had to do this for a living I would find the example that is most like a desired result and hack away.<\/p>\n<h4>Download<\/h4>\n<p><a href=\"https:\/\/github.com\/tkzic\/max-projects\">https:\/\/github.com\/tkzic\/max-projects<\/a><\/p>\n<p>folder: jitter-dev<\/p>\n<p>files:<\/p>\n<ul>\n<li>test-object.maxpat<\/li>\n<li>jit.cliptz.mxo (external) you will make your own version of this in Xcode<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not as easy as it looks. Getting started First, think of a way to get the same results without writing an external. For example, borrow other code, use javascript, gen, Processing, or MSPaint. Apparently that didn&#8217;t work out. Well I can only get you so far. Assuming that you have already done the following Download &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=19208\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Writing Jitter external objects&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[230,273,28],"tags":[347,51,337,345],"class_list":["post-19208","post","type-post","status-publish","format-standard","hentry","category-development","category-max-projects","category-maxmsp","tag-development","tag-jitter","tag-max-externals","tag-maxmsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Writing Jitter external objects - reactive music<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/reactivemusic.net\/?p=19208\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Writing Jitter external objects - reactive music\" \/>\n<meta property=\"og:description\" content=\"Not as easy as it looks. Getting started First, think of a way to get the same results without writing an external. For example, borrow other code, use javascript, gen, Processing, or MSPaint. Apparently that didn&#8217;t work out. Well I can only get you so far. Assuming that you have already done the following Download &hellip; Continue reading &quot;Writing Jitter external objects&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=19208\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-24T04:32:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-04-24T05:29:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"Writing Jitter external objects\",\"datePublished\":\"2015-04-24T04:32:15+00:00\",\"dateModified\":\"2015-04-24T05:29:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208\"},\"wordCount\":402,\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png\",\"keywords\":[\"development\",\"jitter\",\"Max externals\",\"Max\\\/MSP\"],\"articleSection\":[\"development\",\"max-projects\",\"Max\\\/MSP\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208\",\"name\":\"Writing Jitter external objects - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png\",\"datePublished\":\"2015-04-24T04:32:15+00:00\",\"dateModified\":\"2015-04-24T05:29:05+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=19208\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#primaryimage\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Screen-Shot-2015-04-24-at-12.48.55-AM.png\",\"contentUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2015\\\/04\\\/Screen-Shot-2015-04-24-at-12.48.55-AM.png\",\"width\":1524,\"height\":840},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=19208#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Writing Jitter external objects\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Writing Jitter external objects - reactive music","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/reactivemusic.net\/?p=19208","og_locale":"en_US","og_type":"article","og_title":"Writing Jitter external objects - reactive music","og_description":"Not as easy as it looks. Getting started First, think of a way to get the same results without writing an external. For example, borrow other code, use javascript, gen, Processing, or MSPaint. Apparently that didn&#8217;t work out. Well I can only get you so far. Assuming that you have already done the following Download &hellip; Continue reading \"Writing Jitter external objects\"","og_url":"https:\/\/reactivemusic.net\/?p=19208","og_site_name":"reactive music","article_published_time":"2015-04-24T04:32:15+00:00","article_modified_time":"2015-04-24T05:29:05+00:00","og_image":[{"url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png","type":"","width":"","height":""}],"author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=19208#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=19208"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"Writing Jitter external objects","datePublished":"2015-04-24T04:32:15+00:00","dateModified":"2015-04-24T05:29:05+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=19208"},"wordCount":402,"image":{"@id":"https:\/\/reactivemusic.net\/?p=19208#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png","keywords":["development","jitter","Max externals","Max\/MSP"],"articleSection":["development","max-projects","Max\/MSP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=19208","url":"https:\/\/reactivemusic.net\/?p=19208","name":"Writing Jitter external objects - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=19208#primaryimage"},"image":{"@id":"https:\/\/reactivemusic.net\/?p=19208#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM-300x165.png","datePublished":"2015-04-24T04:32:15+00:00","dateModified":"2015-04-24T05:29:05+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=19208#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=19208"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/reactivemusic.net\/?p=19208#primaryimage","url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM.png","contentUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-24-at-12.48.55-AM.png","width":1524,"height":840},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=19208#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"Writing Jitter external objects"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/19208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19208"}],"version-history":[{"count":7,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/19208\/revisions"}],"predecessor-version":[{"id":19217,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/19208\/revisions\/19217"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}