Skip to content

Instantly share code, notes, and snippets.

@monteslu
Created September 24, 2016 05:51
Show Gist options
  • Save monteslu/53b579e496131ff50663ded181f2ddb2 to your computer and use it in GitHub Desktop.
Save monteslu/53b579e496131ff50663ded181f2ddb2 to your computer and use it in GitHub Desktop.
midi input with neopixel display and organ music
[{"id":"1edd1c65.74c624","type":"subflow","name":"key to Hz","info":"","in":[{"x":50,"y":30,"wires":[{"id":"74b957b9.772a98"}]}],"out":[{"x":599,"y":83,"wires":[{"id":"33d59d5d.5fd7d2","port":0}]}]},{"id":"74b957b9.772a98","type":"math","z":"1edd1c65.74c624","name":"","operator":"-","operand":"65","payloadProp":"","resultProp":"","x":237,"y":194,"wires":[["2737e658.96909a"]]},{"id":"2737e658.96909a","type":"math","z":"1edd1c65.74c624","name":"","operator":"/","operand":"12","x":278,"y":136,"wires":[["7b172864.38a918"]]},{"id":"973dda4f.6eeb38","type":"math","z":"1edd1c65.74c624","name":"","operator":"*","operand":"440","x":427,"y":130,"wires":[["33d59d5d.5fd7d2"]]},{"id":"7b172864.38a918","type":"math","z":"1edd1c65.74c624","name":"","operator":"^r","operand":"2","x":348,"y":71,"wires":[["973dda4f.6eeb38"]]},{"id":"33d59d5d.5fd7d2","type":"math","z":"1edd1c65.74c624","name":"","operator":"round","operand":"","payloadProp":"","resultProp":"frequency","x":484,"y":190,"wires":[[]]},{"id":"64371572.bdc03c","type":"nodebot","z":"ff8b1c45.faefd","name":"","username":"","password":"","boardType":"firmata","serialportName":"/dev/tty.usbmodem1411","connectionType":"local","mqttServer":"","socketServer":"","pubTopic":"","subTopic":"","tcpHost":"","tcpPort":"","sparkId":"","sparkToken":"","beanId":"","impId":"","meshbluServer":"https://meshblu.octoblu.com","uuid":"","token":"","sendUuid":""},{"id":"24c3b1fb.09e34e","type":"oscillator","z":"ff8b1c45.faefd","name":"oscillator","duration":500,"frequency":440,"shape":"sine","active":true,"x":607,"y":380,"wires":[]},{"id":"d4f8f3ad.f1ecd","type":"midi in","z":"ff8b1c45.faefd","name":"","deviceId":"","x":82,"y":501,"wires":[["e77f1be.3b0d0e8"]]},{"id":"e77f1be.3b0d0e8","type":"switch","z":"ff8b1c45.faefd","name":"","property":"payload[0]","propertyType":"msg","rules":[{"t":"eq","v":"144","vt":"num"},{"t":"eq","v":"128","vt":"num"}],"checkall":"false","outputs":2,"x":155,"y":437,"wires":[["a5ad34e3.52dc78"],["69a33db8.7f1f24"]]},{"id":"a5ad34e3.52dc78","type":"change","z":"ff8b1c45.faefd","name":"key on","rules":[{"t":"set","p":"duration","pt":"msg","to":"10000","tot":"num"},{"t":"set","p":"payload","pt":"msg","to":"payload[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":312,"y":448,"wires":[["1ebc0f9.9238df"]]},{"id":"69a33db8.7f1f24","type":"change","z":"ff8b1c45.faefd","name":"key off","rules":[{"t":"set","p":"duration","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"payload","pt":"msg","to":"payload[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":237,"y":513,"wires":[["56030629.173da8","9740f7d3.f6fb88"]]},{"id":"3ebe7d87.cc20a2","type":"pixel","z":"ff8b1c45.faefd","name":"neopixel","pin":"6","length":"8","controller":"FIRMATA","board":"64371572.bdc03c","x":806,"y":513,"wires":[]},{"id":"4f19af03.2eb13","type":"math","z":"ff8b1c45.faefd","name":"","operator":"-","operand":"53","payloadProp":"key","resultProp":"key","x":424,"y":507,"wires":[["8826d9d5.d4c5c8"]]},{"id":"42d2ca64.926864","type":"debug","z":"ff8b1c45.faefd","name":"","active":true,"console":"false","complete":"true","x":823,"y":388,"wires":[]},{"id":"8826d9d5.d4c5c8","type":"math","z":"ff8b1c45.faefd","name":"","operator":">>","operand":"2","payloadProp":"key","resultProp":"commands[1].id","x":507,"y":567,"wires":[["c653c819.6eed48"]]},{"id":"56030629.173da8","type":"change","z":"ff8b1c45.faefd","name":"","rules":[{"t":"set","p":"key","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"commands","pt":"msg","to":"[{\"strip\":\"black\"},{\"color\":\"red\"}]","tot":"json"},{"t":"set","p":"payload","pt":"msg","to":"[\"blue\",\"green\",\"yellow\",\"red\"]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":324,"y":573,"wires":[["4f19af03.2eb13"]]},{"id":"4f060b03.080ff4","type":"arrays","z":"ff8b1c45.faefd","name":"","func":"nth","wantsPayloadParsed":false,"param2":"2","param3":"","param4":"","resultProp":"commands[1].color","x":654,"y":560,"wires":[["d3a3493a.f10778"]]},{"id":"c653c819.6eed48","type":"math","z":"ff8b1c45.faefd","name":"","operator":"%","operand":"4","payloadProp":"key","resultProp":"param2","x":579,"y":498,"wires":[["4f060b03.080ff4"]]},{"id":"d3a3493a.f10778","type":"change","z":"ff8b1c45.faefd","name":"commands","rules":[{"t":"move","p":"commands","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":721,"y":461,"wires":[["3ebe7d87.cc20a2","42d2ca64.926864"]]},{"id":"9740f7d3.f6fb88","type":"subflow:1edd1c65.74c624","z":"ff8b1c45.faefd","x":483,"y":447,"wires":[["24c3b1fb.09e34e","42d2ca64.926864"]]},{"id":"1ebc0f9.9238df","type":"change","z":"ff8b1c45.faefd","name":"organ waveform","rules":[{"t":"set","p":"realTable","pt":"msg","to":"[ 0, 0, -0.042008, 0.010474, -0.138038, 0.002641, -0.001673, 0.001039, -0.021054, 0.000651, -0.000422, 0.000334, -0.000236, 0.000191, -0.000161, 0.000145, -0.018478, 0.000071, -0.000066, 0.000047, -0.000044, 0.000041, -0.000034, 0.000031, -0.000030, 0.000028, -0.000025, 0.000024, -0.000022, 0.000020, -0.000015, 0.000013, -0.011570, 0.000004, -0.000003, 0.000003, -0.000003, 0.000003, -0.000003, 0.000002, -0.000002, 0.000002, -0.000002, 0.000002, -0.000002, 0.000002, -0.000002, 0.000002, -0.000001, 0.000001, -0.000001, 0.000001, 0, 0, 0, 0, 0, 0, 0, 0,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3.f6fb88"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment