attempt to send an OSC message
This commit is contained in:
parent
69884c61b4
commit
7fca7e6bd9
2 changed files with 11 additions and 4 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import {OSC} from 'osc-js';
|
||||
//const OSC = require('osc-js');
|
||||
|
||||
import OSC from './node_modules/osc-js/lib/osc.js';
|
||||
import { Pattern, isPattern } from '@strudel.cycles/core/strudel.mjs';
|
||||
//import {OSC} from 'osc-js';
|
||||
|
||||
const comm = new OSC();
|
||||
comm.open();
|
||||
|
|
@ -7,8 +9,12 @@ comm.open();
|
|||
Pattern.prototype.osc = function () {
|
||||
return this._withEvent((event) => {
|
||||
const onTrigger = (time, event) => {
|
||||
const keyvals = Object.entries(event.value).flat();
|
||||
const message = new OSC.message("/dirt/play", ...keyvals);
|
||||
//const keyvals = Object.entries(event.value).flat();
|
||||
//const message = new OSC.Message("/dirt/play", ...keyvals);
|
||||
const message = new OSC.Message(
|
||||
'/dirt/play',
|
||||
...['_id_', '1', 'cps', 0.5625, 'cycle', 412.3333435058594, 'delta', 0.592592716217041, 'orbit', 0, 's', 'hh'],
|
||||
);
|
||||
comm.send(message);
|
||||
};
|
||||
return event.setContext({ ...event.context, onTrigger });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue