mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
rename init to initStrudel + add to window
This commit is contained in:
parent
6e02bf59e9
commit
6089849d35
@ -13,8 +13,8 @@
|
|||||||
<button id="c">C</button>
|
<button id="c">C</button>
|
||||||
<button id="stop">stop</button>
|
<button id="stop">stop</button>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { init } from '@strudel/web';
|
import { initStrudel } from '@strudel/web';
|
||||||
init({
|
initStrudel({
|
||||||
prebake: () => samples('github:tidalcycles/Dirt-Samples/master'),
|
prebake: () => samples('github:tidalcycles/Dirt-Samples/master'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export async function defaultPrebake() {
|
|||||||
let initDone;
|
let initDone;
|
||||||
|
|
||||||
let scheduler;
|
let scheduler;
|
||||||
export function init(options = {}) {
|
export function initStrudel(options = {}) {
|
||||||
initAudioOnFirstClick();
|
initAudioOnFirstClick();
|
||||||
miniAllStrings();
|
miniAllStrings();
|
||||||
const { prebake, ...schedulerOptions } = options;
|
const { prebake, ...schedulerOptions } = options;
|
||||||
@ -41,6 +41,8 @@ export function init(options = {}) {
|
|||||||
scheduler = webaudioScheduler(schedulerOptions);
|
scheduler = webaudioScheduler(schedulerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.initStrudel = initStrudel;
|
||||||
|
|
||||||
// this method will play the pattern on the default scheduler
|
// this method will play the pattern on the default scheduler
|
||||||
Pattern.prototype.play = function () {
|
Pattern.prototype.play = function () {
|
||||||
if (!scheduler) {
|
if (!scheduler) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user