Created
October 7, 2018 08:24
-
-
Save zeffii/a6d535d6497015fbb64eb4a991b14ead to your computer and use it in GitHub Desktop.
max msp node.script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const maxApi = require("max-api"); | |
let x = 0; | |
let y = 0; | |
maxApi.addHandler("input", (dir) => { | |
switch (dir) { | |
case "UP": | |
y += 1; | |
break; | |
case "DOWN": | |
y -= 1; | |
break; | |
case "LEFT": | |
x += 1; | |
break; | |
case "RIGHT": | |
x -= 1; | |
} | |
maxApi.post(`x: ${x}, y: ${y}`); | |
maxApi.outlet(x, y); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
further.. for later