This file contains hidden or 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
| private Handler handler = new Handler(); | |
| //trigger next event. | |
| handler.postDelayed(runnable, SAMPLE_INTERVAL_MS); | |
| private Runnable runnable = new Runnable() { | |
| //this class deals with generating periodic events, | |
| // to emulate the incoming "midi messages" from device | |
| // at a given rate |
This file contains hidden or 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
| // | |
| // mapper.c | |
| // a maxmsp and puredata external encapsulating the functionality of libmapper | |
| // http://www.idmil.org/software/libmapper | |
| // Joseph Malloch, IDMIL 2010 | |
| // | |
| // This software was written in the Input Devices and Music Interaction | |
| // Laboratory at McGill University in Montreal, and is copyright those | |
| // found in the AUTHORS file. It is licensed under the GNU Lesser Public | |
| // General License version 2.1 or later. Please see COPYING for details. |
This file contains hidden or 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
| int portInIndex = -1; | |
| int portOutIndex = -1; | |
| // print input ports to console | |
| midiIn.listPorts(); // via instance | |
| //ofxMidiIn::listPorts(); // via static as well | |
| if (midiIn.getNumPorts()) { | |
| for (int i=0; i<midiIn.getNumPorts(); i++) { | |
| string pname = midiIn.getPortName(i); | |
| if (ofStringTimesInString(pname, "ICubeX")) { |
This file contains hidden or 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
| gpio load spi | |
| while true; | |
| do | |
| gpio -x mcp3004:200:0 aread 200; #reads first channel of ADC; aread 201 reads 2nd channel, etc. | |
| done |
This file contains hidden or 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
| while true; do | |
| echo -n memfree: "`free -m | head -2 | tail -1 | awk '{print $4}'` "; | |
| echo -ne swap used: "`cat /proc/swaps | tail -1 | awk '{print $4}'` \r"; | |
| sleep 1; | |
| done |
This file contains hidden or 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
| [{"id":"c2c6477f.a696e8","type":"midi","z":"29801501.b12f9a","name":"MIDI In","filtermessage":"","port":"1","x":72,"y":42,"wires":[["a8489adb.12f6c8"]]},{"id":"a8489adb.12f6c8","type":"template","z":"29801501.b12f9a","name":"grab midi msg","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.message}}","x":139,"y":90,"wires":[["6a918548.45b34c"]]},{"id":"6a918548.45b34c","type":"csv","z":"29801501.b12f9a","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\\n","temp":"","x":217,"y":41,"wires":[["cc1b3fe4.be9cc","7a9da23f.8e6a2c","fbdad48.cbcff28"]]},{"id":"cc1b3fe4.be9cc","type":"template","z":"29801501.b12f9a","name":"col1","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.col1}}","x":319,"y":83,"wires":[["b7bcfdb6.33e0f"]]},{"id":"7a9da23f.8e6a2c","type":"template","z":"29801501.b12f9a","name":"col2","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload. |
This file contains hidden or 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
| [{"id":"8bc3934b.dec0c","type":"mcp3008","z":"bc7ea069.67a99","name":"","device":"/dev/spidev0.0","mode":"0x80","interval":"25","x":319,"y":156,"wires":[["941e2650.e518a8","178087e.871bf78"]]},{"id":"da077c2f.9bf43","type":"inject","z":"bc7ea069.67a99","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":true,"x":93,"y":72,"wires":[["8916983b.311a48"]]},{"id":"d1ea8f0e.568af","type":"inject","z":"bc7ea069.67a99","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"x":93.5,"y":37,"wires":[["8916983b.311a48"]]},{"id":"941e2650.e518a8","type":"debug","z":"bc7ea069.67a99","name":"","active":false,"console":"false","complete":"false","x":541,"y":156,"wires":[]},{"id":"178087e.871bf78","type":"ui_slider","z":"bc7ea069.67a99","tab":"e3257868.dcaa18","name":"Push","topic":"","group":"","order":1,"min":0,"max":"1023","x":527,"y":212,"wires":[["f2ec0099.fbb4c"]]},{"id":"b618b17a.ef5bb","type":"ui_gauge","z":"bc7ea069.67a99","tab":"e325786 |
This file contains hidden or 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
| // instructions: | |
| // 1.) install node.js and npm | |
| // 2.) put this file in a folder | |
| // 3.) go to this folder in terminal, and install ffi and ref using 'npm install ...' | |
| // 4.) execute by typing `node node-ffi-mapper.js` | |
| // | |
| // note: refers explicitly to libmapper-0.2.dylib so make sure it is on the path! | |
| var ref = require('ref'); | |
| var ffi = require('ffi'); |
This file contains hidden or 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
| // Import Express | |
| var express = require("express"); | |
| var app = express(); | |
| // Import Cors: cross origin resource | |
| var cors = require("cors"); | |
| app.use(cors()); | |
| // Import Mongoose | |
| var mongoose = require("mongoose"); |
This file contains hidden or 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
| MAX=1700 | |
| MID=1500 | |
| MIN=1200 | |
| sudo pigpiod | |
| pigs pfs 18 50 # set pwm freq to 50 hz on BCM18 | |
| pigs servo 18 $MID # set servo pulsewidth to MID us on BCM18 | |
| sleep 1 | |
| pigs servo 18 $MIN # set servo pulsewidth to MIN on BCM18 |
OlderNewer