mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-22 11:08:35 +00:00
funky serialisation for serial
This commit is contained in:
parent
c3f03f50b3
commit
34ba762b42
@ -43,8 +43,27 @@ Pattern.prototype.serial = async function (...args) {
|
|||||||
const onTrigger = (time, hap, currentTime) => {
|
const onTrigger = (time, hap, currentTime) => {
|
||||||
var message = "";
|
var message = "";
|
||||||
if (typeof hap.value === 'object') {
|
if (typeof hap.value === 'object') {
|
||||||
for (const [key, val] of Object.entries(hap.value).flat()) {
|
if ('what' in hap.value) {
|
||||||
message += `${key}:${val};`
|
message += hap.value['what'] + '(';
|
||||||
|
var first = true;
|
||||||
|
for (const [key, val] of Object.entries(hap.value)) {
|
||||||
|
if (key === 'what') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (first) {
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message +=',';
|
||||||
|
}
|
||||||
|
message += `${key}:${val}`
|
||||||
|
}
|
||||||
|
message += ')';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (const [key, val] of Object.entries(hap.value)) {
|
||||||
|
message += `${key}:${val};`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user