cleaning up
This commit is contained in:
parent
4001cc9531
commit
a9d8e7ca82
3 changed files with 7 additions and 6 deletions
|
|
@ -6,3 +6,4 @@ This program is free software: you can redistribute it and/or modify it under th
|
|||
|
||||
export * from './midibridge.mjs';
|
||||
export * from './utils.mjs';
|
||||
export * from './oscbridge.mjs';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { logger, parseNumeral, Pattern } from '@strudel.cycles/core';
|
||||
import { parseNumeral, Pattern } from '@strudel.cycles/core';
|
||||
import { Invoke } from './utils.mjs';
|
||||
|
||||
Pattern.prototype.osc = function () {
|
||||
|
|
@ -11,9 +11,9 @@ Pattern.prototype.osc = function () {
|
|||
controls.n && (controls.n = parseNumeral(controls.n));
|
||||
controls.note && (controls.note = parseNumeral(controls.note));
|
||||
|
||||
const messagesfromjs = [];
|
||||
const params = [];
|
||||
const offset = Math.round((time - currentTime) * 1000 - 48);
|
||||
|
||||
const timestamp = Math.round(Date.now() + (time - currentTime) * 1000);
|
||||
|
||||
Object.keys(controls).forEach((key) => {
|
||||
const val = controls[key];
|
||||
|
|
@ -29,10 +29,10 @@ Pattern.prototype.osc = function () {
|
|||
});
|
||||
});
|
||||
|
||||
const messagesfromjs = [];
|
||||
if (params.length) {
|
||||
messagesfromjs.push({ target: '/dirt/play', offset, params });
|
||||
messagesfromjs.push({ target: '/dirt/play', timestamp, params });
|
||||
}
|
||||
console.log(messagesfromjs);
|
||||
|
||||
if (messagesfromjs.length) {
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@strudel/desktopbridge",
|
||||
"version": "0.1.0",
|
||||
"description": "send midi messages between the JS and Tauri (Rust) sides of the Studel desktop app",
|
||||
"description": "tools/shims for communicating between the JS and Tauri (Rust) sides of the Studel desktop app",
|
||||
"main": "index.mjs",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue