mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-17 00:28:27 +00:00
15 lines
425 B
JavaScript
15 lines
425 B
JavaScript
import { Pattern } from '@strudel/core';
|
|
import { registerWidget } from '@strudel/transpiler';
|
|
import { getWidgetDrawContext } from './Canvas.jsx';
|
|
|
|
registerWidget('roll', 'strudel-canvas');
|
|
|
|
Pattern.prototype.roll = function (id, options = { fold: 1 }) {
|
|
// TODO: remove setTimeout...
|
|
setTimeout(() => {
|
|
const ctx = getWidgetDrawContext(id, options);
|
|
this.pianoroll({ ...options, ctx });
|
|
});
|
|
return this;
|
|
};
|