Node in Max

by Julian Rubisch, 2018-12-03javascriptmaxcreative-coding
01 Watch YouTube Videos

When I first heard that Max is getting a NodeJS integration, I thought to myself, what endless possibilities. I'm not the greatest supporter of the JavaScript language and the environment it lives in, but hey, the premise of re-using other software I had written in Max was just too tempting. That said, when it finally came out I was a little stunned not to find a more detailed introduction in how to set up a project with NPM, install modules etc. Maybe I didn't search intensely enough, but at least there wasn't something screaming at me: "TRY THIS". So well, while everybody else is freaking out about MC, here's my first take on Node in Max, a little script that allows you to play arbitrary YouTube videos in a `[]`. When I asked on Twitter what could be a nice starter project, the answer I got was "People will go nuts if NodeJS lets you open youtube tutos". So I just did it.

  Go to video
02 Static D3JS

I love d3js for data visualizations, I mean, who doesn't? Sometimes, though, it'd be nice to obtain an SVG without having to embed the relevant code in a website, run it in a browser and copy-paste the result. With an npm package called d3-node, this is possible, with a few limitations. We'll wrap this in a node.script and use it to render PNG files to be used in a Max patch.

  Go to video
03 SocketIO Client

A neat fact about node.script is that it gives us access to a bunch of Web APIs that are easy to implement using nodejs. The official Node4Max examples include one about creating and running a WebSocket server; I'm going to show you the opposite, how to make Max behave like a WebSocket client.

  Go to video
© 2018 Znibble~Powered by Contentful
Privacy Policy NewsletterImprint