mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
allow defining csound on the window
This commit is contained in:
parent
5727c0dc8a
commit
8e531f400e
@ -69,8 +69,13 @@ function eventLogger(type, args) {
|
||||
}
|
||||
|
||||
async function load() {
|
||||
const { Csound } = await import('@csound/browser');
|
||||
_csound = await Csound({ audioContext: getAudioContext() });
|
||||
if (window.__csound__) {
|
||||
// allows using some other csound instance
|
||||
_csound = window.__csound__;
|
||||
} else {
|
||||
const { Csound } = await import('@csound/browser');
|
||||
_csound = await Csound({ audioContext: getAudioContext() });
|
||||
}
|
||||
_csound.removeAllListeners('message');
|
||||
['message'].forEach((k) => _csound.on(k, (...args) => eventLogger(k, args)));
|
||||
await _csound.setOption('-m0'); // see -m flag https://csound.com/docs/manual/CommandFlags.html
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user