const D = require('Diagnostics'); const Patches = require('Patches'); // // RECVIEVING SIGNALS FROM PATCHES // // // Old way // const onTap = Patches.getPulseValue('tap'); onTap.subscribe(evt => { D.log('tap') }); // // New way // Patches.outputs.getPulse('tap').then(signal => { signal.subscribe(evt => { D.log('tap'); }); }); // // SENDING SIGNALS TO PATCHES // // // Old way // Patches.setStringValue('timeNow', new Date().toString()); // // New way // // Note how the new method returns a promise. Not sure what // it can be used for though, Patches.inputs.setString('timeNow', new Date().toString()).then(() => { D.log('Signal is set?'); }); // So this could be enough for this Patches.inputs.setString('timeNow', new Date().toString());