From 23be3e5ba363ded6d4a6ffdf1d7e14116f61fa18 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 17 Jun 2022 14:45:58 +0100 Subject: [PATCH] hackery --- packages/core/controls.mjs | 5 +++++ packages/serial/serial.mjs | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 7b8cfc8c..034376cd 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -744,6 +744,11 @@ const generic_params = [ ['f', 'uid', ''], ['f', 'val', ''], ['f', 'cps', ''], + ['s', 'action', ''], + ['f', 'by', ''], + ['s', 'part', ''], + ['f', 'to', ''], + ['f', 'duration', ''], ]; // TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13 diff --git a/packages/serial/serial.mjs b/packages/serial/serial.mjs index 911c770d..b2f1025d 100644 --- a/packages/serial/serial.mjs +++ b/packages/serial/serial.mjs @@ -34,7 +34,6 @@ export async function getWriter(br=115200) { const latency = 0.1; -// Pattern.prototype.midi = function (output: string | number, channel = 1) { Pattern.prototype.serial = async function (...args) { return this._withHap((hap) => { if (!serialWriter) { @@ -43,11 +42,11 @@ Pattern.prototype.serial = async function (...args) { const onTrigger = (time, hap, currentTime) => { var message = ""; if (typeof hap.value === 'object') { - if ('what' in hap.value) { - message += hap.value['what'] + '('; + if ('action' in hap.value) { + message += hap.value['action'] + '('; var first = true; for (const [key, val] of Object.entries(hap.value)) { - if (key === 'what') { + if (key === 'action') { continue; } if (first) { @@ -69,6 +68,7 @@ Pattern.prototype.serial = async function (...args) { else { message = hap.value; } + console.log("sending: " + message); const offset = (time - currentTime + latency) * 1000; window.setTimeout(serialWriter, offset, message); };