diff --git a/packages/BigMuff/descriptor.json b/packages/BigMuff/descriptor.json index 15012e5..9f0d4b4 100644 --- a/packages/BigMuff/descriptor.json +++ b/packages/BigMuff/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.faust-bigmuff", "name": "Faust BigMuff", "vendor": "Michel Buffa", "description": "", diff --git a/packages/GuitarAmpSim60s/descriptor.json b/packages/GuitarAmpSim60s/descriptor.json index 70efedf..2c81ca2 100644 --- a/packages/GuitarAmpSim60s/descriptor.json +++ b/packages/GuitarAmpSim60s/descriptor.json @@ -1,10 +1,11 @@ { - "name": "GuitarAmpSim60s", - "vendor": "Michel Buffa", - "description": "TODO", - "version": "1.0.0", - "apiVersion": "2.0.0", - "keywords": ["faust"], - "isInstrument": false, - "website": "" - } \ No newline at end of file + "identifier": "com.webaudiomodules.wam-examples.guitarampsim60s", + "name": "GuitarAmpSim60s", + "vendor": "Michel Buffa", + "description": "TODO", + "version": "1.0.0", + "apiVersion": "2.0.0", + "keywords": ["faust"], + "isInstrument": false, + "website": "" +} \ No newline at end of file diff --git a/packages/StonePhaserStereo/descriptor.json b/packages/StonePhaserStereo/descriptor.json index 6f10cd7..9bd7223 100644 --- a/packages/StonePhaserStereo/descriptor.json +++ b/packages/StonePhaserStereo/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.stonephaser", "name": "StonePhaser", "vendor": "WebAudioModule", "description": "StonePhaser Stereo written in Faust", diff --git a/packages/TS9_OverdriveFaustGenerated/descriptor.json b/packages/TS9_OverdriveFaustGenerated/descriptor.json index a35043c..76b334c 100644 --- a/packages/TS9_OverdriveFaustGenerated/descriptor.json +++ b/packages/TS9_OverdriveFaustGenerated/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.ts9overdrive", "name": "TS9 Overdrive", "vendor": "WebAudioModule", "description": "Overdrive written in Faust", diff --git a/packages/VirtualMidiKeyboardNoSound/src/descriptor.json b/packages/VirtualMidiKeyboardNoSound/src/descriptor.json index 8d6e6a5..91a3ad5 100644 --- a/packages/VirtualMidiKeyboardNoSound/src/descriptor.json +++ b/packages/VirtualMidiKeyboardNoSound/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.virtual-midi-keyboard", "name": "VirtualMidiKeyboardNoSound", "vendor": "WebAudioModule", "description": "Midi Virtual keyboard", diff --git a/packages/WamExample/src/WamExampleProcessor.js b/packages/WamExample/src/WamExampleProcessor.js index 8637000..3d372d9 100644 --- a/packages/WamExample/src/WamExampleProcessor.js +++ b/packages/WamExample/src/WamExampleProcessor.js @@ -287,7 +287,7 @@ const getWamExampleProcessor = (moduleId) => { } } try { - registerProcessor('WebAudioModuleWamExample', WamExampleProcessor); + registerProcessor(moduleId, WamExampleProcessor); } catch (error) { console.warn(error); } diff --git a/packages/WamExample/src/descriptor.json b/packages/WamExample/src/descriptor.json index e83a5fe..7bc60bf 100644 --- a/packages/WamExample/src/descriptor.json +++ b/packages/WamExample/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.wam-example", "name": "WamExample", "vendor": "WebAudioModule", "description": "Simple example using WebAudioModule, WamNode, and WamProcessor classes.", diff --git a/packages/WamExampleTemplate/src/WamExampleTemplateProcessor.js b/packages/WamExampleTemplate/src/WamExampleTemplateProcessor.js index 942e2d4..61c829b 100644 --- a/packages/WamExampleTemplate/src/WamExampleTemplateProcessor.js +++ b/packages/WamExampleTemplate/src/WamExampleTemplateProcessor.js @@ -163,7 +163,7 @@ } } try { - registerProcessor('WebAudioModuleWamExampleTemplate', WamExampleTemplateProcessor); + registerProcessor(moduleId, WamExampleTemplateProcessor); } catch (error) { console.warn(error); } diff --git a/packages/WamExampleTemplate/src/descriptor.json b/packages/WamExampleTemplate/src/descriptor.json index b590f62..3c008b4 100644 --- a/packages/WamExampleTemplate/src/descriptor.json +++ b/packages/WamExampleTemplate/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.template", "name": "WamExampleTemplate", "vendor": "WebAudioModule", "description": "Simple example template for WebAudioModule, WamNode, and WamProcessor classes.", diff --git a/packages/csoundPitchShifter/src/descriptor.json b/packages/csoundPitchShifter/src/descriptor.json index 367a9f4..5276f65 100644 --- a/packages/csoundPitchShifter/src/descriptor.json +++ b/packages/csoundPitchShifter/src/descriptor.json @@ -1,11 +1,12 @@ { + "identifier": "com.webaudiomodules.wam-examples.csound-pitchshifter", "name": "Csound PitchShifter", "vendor": "Steven Yi", "description": "", "version": "1.0.0", "apiVersion": "2.0.0", "thumbnail": "screenshot.png", - "keywords": ["faust"], + "keywords": ["csound"], "isInstrument": false, "website": "" } diff --git a/packages/disto_machine/src/descriptor.json b/packages/disto_machine/src/descriptor.json index 19c917a..fedfcd3 100644 --- a/packages/disto_machine/src/descriptor.json +++ b/packages/disto_machine/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.distomachine-nobuilder", "name": "DistoMachine (No builder)", "vendor": "WebAudioModule", "description": "DistoMachine written in native WebAudio nodes", diff --git a/packages/faustFlute/descriptor.json b/packages/faustFlute/descriptor.json index ea0761d..ec85246 100644 --- a/packages/faustFlute/descriptor.json +++ b/packages/faustFlute/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.faust-flute", "name": "Faust Flute MIDI", "vendor": "Grame", "description": "Faust MIDI Instrument", diff --git a/packages/faustPingPongDelay/plugin/descriptor.json b/packages/faustPingPongDelay/plugin/descriptor.json index cdcecc2..d2853fd 100644 --- a/packages/faustPingPongDelay/plugin/descriptor.json +++ b/packages/faustPingPongDelay/plugin/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.faust-pingpongdelay", "name": "Faust PingPongDelay", "vendor": "Shihong Ren", "description": "A PingPongDelay written in Faust with its default UI", diff --git a/packages/faustPingPongDelayDefaultUI/descriptor.json b/packages/faustPingPongDelayDefaultUI/descriptor.json index 54c8af6..17f908d 100644 --- a/packages/faustPingPongDelayDefaultUI/descriptor.json +++ b/packages/faustPingPongDelayDefaultUI/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.faust-pingpongdelay-default-ui", "name": "Faust PingPongDelay (DefaultUI)", "vendor": "Shihong Ren", "description": "A PingPongDelay written in Faust with its default UI", diff --git a/packages/graphicEqualizer/descriptor.json b/packages/graphicEqualizer/descriptor.json index 87dd4ef..960dab7 100644 --- a/packages/graphicEqualizer/descriptor.json +++ b/packages/graphicEqualizer/descriptor.json @@ -1,11 +1,12 @@ { - "name": "Equalizer", - "vendor": "Wasabi", - "description": "TODO", - "version": "1.0.0", - "apiVersion": "2.0.0", - "thumbnail": "assets/equal.png", - "keywords": ["equalizer", "mixing"], - "isInstrument": false, - "website": "" - } \ No newline at end of file + "identifier": "com.webaudiomodules.wam-examples.graphic-equalizer", + "name": "Equalizer", + "vendor": "Wasabi", + "description": "TODO", + "version": "1.0.0", + "apiVersion": "2.0.0", + "thumbnail": "assets/equal.png", + "keywords": ["equalizer", "mixing"], + "isInstrument": false, + "website": "" +} \ No newline at end of file diff --git a/packages/livegain/src/livegain/descriptor.json b/packages/livegain/src/livegain/descriptor.json index b7b8f87..094ae4d 100644 --- a/packages/livegain/src/livegain/descriptor.json +++ b/packages/livegain/src/livegain/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.livegain", "name": "LiveGain", "vendor": "Shihong Ren", "description": "TypeScript/React LiveGain WebAudioModule", diff --git a/packages/livegain/src/livegain/index.tsx b/packages/livegain/src/livegain/index.tsx index bad4dfa..954a45e 100644 --- a/packages/livegain/src/livegain/index.tsx +++ b/packages/livegain/src/livegain/index.tsx @@ -5,13 +5,19 @@ import { createElement, destroyElement } from "../gui"; import Node from "./LiveGainNode"; import UI from "./LiveGainUI"; +const getBaseUrl = (relativeUrl: URL) => { + const baseUrl = relativeUrl.href.substring(0, relativeUrl.href.lastIndexOf("/")); + return baseUrl; +}; + export type Parameters = "gain" | "frameRate" | "speedLim" | "min" | "max" | "step" | "orientation" | "metering"; export class LiveGainModule extends WebAudioModule { - static descriptor = { - name: "LiveGain", - vendor: "WebAudioModule" - }; - + _baseUrl = getBaseUrl(new URL(".", import.meta.url)); + _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state?: any) { + await this._loadDescriptor(); + return super.initialize(state); + } async createAudioNode(initialState?: any) { const node = new Node(this.audioContext); const inputGainNode = this.audioContext.createGain(); diff --git a/packages/livegain/src/oscilloscope/descriptor.json b/packages/livegain/src/oscilloscope/descriptor.json index 0a2591d..d33468d 100644 --- a/packages/livegain/src/oscilloscope/descriptor.json +++ b/packages/livegain/src/oscilloscope/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.oscilloscope", "name": "Oscilloscope", "vendor": "Shihong Ren", "description": "TypeScript/React Oscilloscope WebAudioModule", diff --git a/packages/livegain/src/oscilloscope/index.tsx b/packages/livegain/src/oscilloscope/index.tsx index b8104d3..0c35141 100644 --- a/packages/livegain/src/oscilloscope/index.tsx +++ b/packages/livegain/src/oscilloscope/index.tsx @@ -5,13 +5,19 @@ import SpectralAnalyserNode from "../worklets/SpectralAnalyser"; import { createElement, destroyElement } from "../gui"; import UI from "./OscilloscopeUI"; +const getBaseUrl = (relativeUrl: URL) => { + const baseUrl = relativeUrl.href.substring(0, relativeUrl.href.lastIndexOf("/")); + return baseUrl; +}; + export type Parameters = "frameRate" | "windowSize" | "interleaved" | "showStats"; export class OscilloscopeModule extends WebAudioModule { - static descriptor = { - name: "Oscilloscope", - vendor: "WebAudioModule" - }; - + _baseUrl = getBaseUrl(new URL(".", import.meta.url)); + _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state?: any) { + await this._loadDescriptor(); + return super.initialize(state); + } async createAudioNode(initialState?: any) { const node = new Node(this.audioContext); const outGainNode = this.audioContext.createGain(); diff --git a/packages/livegain/src/spectrogram/descriptor.json b/packages/livegain/src/spectrogram/descriptor.json index db1eb26..7a540df 100644 --- a/packages/livegain/src/spectrogram/descriptor.json +++ b/packages/livegain/src/spectrogram/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.spectrogram", "name": "Spectrogram", "vendor": "Shihong Ren", "description": "TypeScript/React Spectrogram WebAudioModule", diff --git a/packages/livegain/src/spectrogram/index.tsx b/packages/livegain/src/spectrogram/index.tsx index db52754..645b359 100644 --- a/packages/livegain/src/spectrogram/index.tsx +++ b/packages/livegain/src/spectrogram/index.tsx @@ -5,13 +5,19 @@ import SpectralAnalyserNode from "../worklets/SpectralAnalyser"; import { createElement, destroyElement } from "../gui"; import UI from "./SpectrogramUI"; +const getBaseUrl = (relativeUrl: URL) => { + const baseUrl = relativeUrl.href.substring(0, relativeUrl.href.lastIndexOf("/")); + return baseUrl; +}; + export type Parameters = "frameRate" | "windowSize" | "fftSize" | "fftOverlap" | "windowFunction"; export class SpectrogramModule extends WebAudioModule { - static descriptor = { - name: "Spectrogram", - vendor: "WebAudioModule" - }; - + _baseUrl = getBaseUrl(new URL(".", import.meta.url)); + _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state?: any) { + await this._loadDescriptor(); + return super.initialize(state); + } async createAudioNode(initialState?: any) { const node = new Node(this.audioContext); const outGainNode = this.audioContext.createGain(); diff --git a/packages/livegain/src/spectroscope/descriptor.json b/packages/livegain/src/spectroscope/descriptor.json index df9d1e8..a7ecfe9 100644 --- a/packages/livegain/src/spectroscope/descriptor.json +++ b/packages/livegain/src/spectroscope/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.spectroscope", "name": "Spectroscope", "vendor": "Shihong Ren", "description": "TypeScript/React Spectroscope WebAudioModule", diff --git a/packages/livegain/src/spectroscope/index.tsx b/packages/livegain/src/spectroscope/index.tsx index a7e9a84..852b855 100644 --- a/packages/livegain/src/spectroscope/index.tsx +++ b/packages/livegain/src/spectroscope/index.tsx @@ -5,13 +5,19 @@ import SpectralAnalyserNode from "../worklets/SpectralAnalyser"; import { createElement, destroyElement } from "../gui"; import UI from "./SpectroscopeUI"; +const getBaseUrl = (relativeUrl: URL) => { + const baseUrl = relativeUrl.href.substring(0, relativeUrl.href.lastIndexOf("/")); + return baseUrl; +}; + export type Parameters = "frameRate" | "windowSize" | "fftSize" | "fftOverlap" | "windowFunction"; export class SpectroscopeModule extends WebAudioModule { - static descriptor = { - name: "Spectroscope", - vendor: "WebAudioModule" - }; - + _baseUrl = getBaseUrl(new URL(".", import.meta.url)); + _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state?: any) { + await this._loadDescriptor(); + return super.initialize(state); + } async createAudioNode(initialState?: any) { const node = new Node(this.audioContext); const outGainNode = this.audioContext.createGain(); diff --git a/packages/livegain/webpack.config.js b/packages/livegain/webpack.config.js index c46be72..ceb89ca 100644 --- a/packages/livegain/webpack.config.js +++ b/packages/livegain/webpack.config.js @@ -32,9 +32,16 @@ module.exports = (env, argv) => { path: path.resolve(__dirname, 'dist'), // library: 'JSPatcher', libraryTarget: 'module', - // chunkFilename: 'js/[chunkhash].js' + // chunkFilename: 'js/[chunkhash].js', + publicPath: "auto" }, module: { + parser: { + javascript: { + importMeta: false, + url: false + } + }, rules: [{ test: /\.worklet\.(ts|js)$/, use: [{ @@ -50,7 +57,7 @@ module.exports = (env, argv) => { loader: 'esbuild-loader', options: { loader: 'tsx', - target: 'es2017' + target: 'es2020' } }, exclude: /node_modules/ diff --git a/packages/midiOutput/src/descriptor.json b/packages/midiOutput/src/descriptor.json index ec6cee0..c4bc8ae 100644 --- a/packages/midiOutput/src/descriptor.json +++ b/packages/midiOutput/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.midi-output", "name": "MIDI Output", "vendor": "WebAudioModule", "description": "use WebMIDI API for output", diff --git a/packages/midiOutput/src/index.js b/packages/midiOutput/src/index.js index 60fc3ff..4405b08 100644 --- a/packages/midiOutput/src/index.js +++ b/packages/midiOutput/src/index.js @@ -19,6 +19,11 @@ class MidiOutput extends WebAudioModule { _baseUrl = getBaseUrl(new URL('.', import.meta.url)); _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state) { + await this._loadDescriptor(); + return super.initialize(state); + } + /** * @param {any} initialState */ diff --git a/packages/midiSequencer/src/descriptor.json b/packages/midiSequencer/src/descriptor.json index f3a0151..432658c 100644 --- a/packages/midiSequencer/src/descriptor.json +++ b/packages/midiSequencer/src/descriptor.json @@ -1,4 +1,5 @@ { + "identifier": "com.webaudiomodules.wam-examples.midi-sequencer", "name": "MIDI Sequencer", "vendor": "WebAudioModule", "description": "MIDI Sequencer (WAM events)", diff --git a/packages/midiSequencer/src/index.ts b/packages/midiSequencer/src/index.ts index 17d9962..ffe1247 100644 --- a/packages/midiSequencer/src/index.ts +++ b/packages/midiSequencer/src/index.ts @@ -10,6 +10,10 @@ const getBaseUrl = (relativeUrl: URL) => { class MidiSequencer extends WebAudioModule { _baseUrl = getBaseUrl(new URL(".", import.meta.url)); _descriptorUrl = `${this._baseUrl}/descriptor.json`; + async initialize(state?: any) { + await this._loadDescriptor(); + return super.initialize(state); + } async createAudioNode(initialState: any) { await MidiSequencerNode.addModules(this.audioContext, this.moduleId); const node: MidiSequencerNode = new MidiSequencerNode(this, {}); diff --git a/packages/obxd/WasmProcessor.js b/packages/obxd/WasmProcessor.js index b8937e3..05f9243 100644 --- a/packages/obxd/WasmProcessor.js +++ b/packages/obxd/WasmProcessor.js @@ -70,7 +70,7 @@ for (var c=0; c