diff --git a/assets/example_patches/808/cmaj_808.js b/assets/example_patches/808/cmaj_808.js index c32215ba..fded5e2d 100644 --- a/assets/example_patches/808/cmaj_808.js +++ b/assets/example_patches/808/cmaj_808.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch '808.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2636 +// This file was auto-generated by the Cmajor toolkit v1.0.2637 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/808/cmaj_api/cmaj-audio-worklet-helper.js b/assets/example_patches/808/cmaj_api/cmaj-audio-worklet-helper.js index 362eab3f..a2217dfa 100644 --- a/assets/example_patches/808/cmaj_api/cmaj-audio-worklet-helper.js +++ b/assets/example_patches/808/cmaj_api/cmaj-audio-worklet-helper.js @@ -554,7 +554,13 @@ export class AudioWorkletPatchConnection extends PatchConnection } else { - this.rootResourcePath = window.location.href; + const getBaseUrl = (relativeURL) => + { + const baseURL = relativeURL.href.substring(0, relativeURL.href.lastIndexOf('/')); + return baseURL; + }; + + this.rootResourcePath = getBaseUrl(new URL('.', import.meta.url)); if (! this.rootResourcePath.endsWith ("/")) this.rootResourcePath += "/../"; diff --git a/assets/example_patches/808/cmaj_api/cmaj-generic-patch-view.js b/assets/example_patches/808/cmaj_api/cmaj-generic-patch-view.js index e30389b2..ca136b66 100644 --- a/assets/example_patches/808/cmaj_api/cmaj-generic-patch-view.js +++ b/assets/example_patches/808/cmaj_api/cmaj-generic-patch-view.js @@ -93,6 +93,8 @@ class GenericPatchView extends HTMLElement /** @private */ getHTML() { + const baseUrl = import.meta.url; + return `