mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-12 06:08:34 +00:00
attempt to send an OSC message
This commit is contained in:
parent
69884c61b4
commit
7fca7e6bd9
@ -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 });
|
||||
|
||||
@ -28,6 +28,7 @@ import '@strudel.cycles/xen/tune.mjs';
|
||||
import '@strudel.cycles/core/euclid.mjs';
|
||||
import '@strudel.cycles/tone/pianoroll.mjs';
|
||||
import '@strudel.cycles/tone/draw.mjs';
|
||||
import '@strudel.cycles/osc/osc.mjs';
|
||||
|
||||
extend(Tone, strudel, strudel.Pattern.prototype.bootstrap(), toneHelpers, voicingHelpers, drawHelpers, uiHelpers, {
|
||||
gist,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user