Template button to send series of bytes

I'm trying to trigger the transmission of a MIDI "note on" sequence and "note off" sequence of 8 bit bytes. I've got this working with an "inject" node using the "buffer" variable type (using the same format to indicate an array). But I can't figure out the code to send the same within a "template" node from examples in other postings. Plus I don't get the "background" color (green) when the button is released, just the "foreground" color (red) flashes a bit. Here's my attempt to modify the template code from that of the first result when I search for "node red momentary button".

[{"id":"4b2d328f.9ec20c","type":"ui_template","z":"44740f39.d8f0d","group":"49f9b7c5.e534b8","name":"C5","order":1,"width":"1","height":"1","format":"<md-button\n    class=\"vibrate filled bigfont\"\n    ng-style=\"{background: !msg.payload ? 'red' : 'green' }\"\n    ng-mousedown=\"send({payload: [145,60,64]})\"\n    ng-mouseup=\"send({payload: [129,60,64]})\"\n    > \n    C5<br/>\n    </md-button>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":130,"y":60,"wires":[[]]},{"id":"49f9b7c5.e534b8","type":"ui_group","z":"","name":"Momentary","tab":"5a95caa7.08b884","order":1,"disp":false,"width":"10","collapse":false},{"id":"5a95caa7.08b884","type":"ui_tab","z":"","name":"Momentary","icon":"book","order":1,"disabled":false,"hidden":false}]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.