diff --git a/assets/example_patches/808/cmaj_808.js b/assets/example_patches/808/cmaj_808.js index 574c837a..7aea4779 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.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/CompuFart/cmaj_CompuFart.js b/assets/example_patches/CompuFart/cmaj_CompuFart.js index 9a555120..56dc7114 100644 --- a/assets/example_patches/CompuFart/cmaj_CompuFart.js +++ b/assets/example_patches/CompuFart/cmaj_CompuFart.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'CompuFartSynth.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/ElectricPiano/cmaj_Electric_Piano.js b/assets/example_patches/ElectricPiano/cmaj_Electric_Piano.js index 9de82432..91685ef4 100644 --- a/assets/example_patches/ElectricPiano/cmaj_Electric_Piano.js +++ b/assets/example_patches/ElectricPiano/cmaj_Electric_Piano.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'ElectricPiano.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/GuitarLSTM/cmaj_GuitarLSTM.js b/assets/example_patches/GuitarLSTM/cmaj_GuitarLSTM.js index 9f498ca3..8260cc13 100644 --- a/assets/example_patches/GuitarLSTM/cmaj_GuitarLSTM.js +++ b/assets/example_patches/GuitarLSTM/cmaj_GuitarLSTM.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'GuitarLSTM.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/HelloWorld/cmaj_Hello_World.js b/assets/example_patches/HelloWorld/cmaj_Hello_World.js index ef075eb6..6b6993d9 100644 --- a/assets/example_patches/HelloWorld/cmaj_Hello_World.js +++ b/assets/example_patches/HelloWorld/cmaj_Hello_World.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'HelloWorld.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/Piano/cmaj_Piano.js b/assets/example_patches/Piano/cmaj_Piano.js index 68e0d9d4..9807416f 100644 --- a/assets/example_patches/Piano/cmaj_Piano.js +++ b/assets/example_patches/Piano/cmaj_Piano.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'Piano.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/PirkleFilters/cmaj_vafilters.js b/assets/example_patches/PirkleFilters/cmaj_vafilters.js index adee1d34..80d18af9 100644 --- a/assets/example_patches/PirkleFilters/cmaj_vafilters.js +++ b/assets/example_patches/PirkleFilters/cmaj_vafilters.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'vafilters.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/Pro54/cmaj_Pro54.js b/assets/example_patches/Pro54/cmaj_Pro54.js index 67b8dda8..9afc9770 100644 --- a/assets/example_patches/Pro54/cmaj_Pro54.js +++ b/assets/example_patches/Pro54/cmaj_Pro54.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'Pro54.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/Pro54/gui/presets/presetBank.js b/assets/example_patches/Pro54/gui/presets/presetBank.js index c9af2966..61564a89 100644 --- a/assets/example_patches/Pro54/gui/presets/presetBank.js +++ b/assets/example_patches/Pro54/gui/presets/presetBank.js @@ -579,6 +579,32 @@ export class PresetBank preset["PatchName"] = name; } + + getPatchDetails() + { + let list = []; + + for (const p of this.bank) + { + let clone = { ...p[1] }; + clone.id = p[0]; + list.push (clone); + } + + return list; + } + + setPatchDetails (list) + { + this.bank.clear(); + + for (const item of list) + { + const id = item.id; + delete item.id; + this.bank.set (id, item); + } + } } export function splitIntoDigits (value) diff --git a/assets/example_patches/Pro54/worker/worker.js b/assets/example_patches/Pro54/worker/worker.js index 0ff650d8..1942ee33 100644 --- a/assets/example_patches/Pro54/worker/worker.js +++ b/assets/example_patches/Pro54/worker/worker.js @@ -44,20 +44,26 @@ const stateValueChangeListener = event => return; } + const oldProgramNumber = programNumber; programNumber = event.value ^ 0; - const info = presetBank.getPatch (programNumber); if (info) { currentParameterValues.clear(); - presetBank.sendParameterValuesToPatchConnection (patchConnection, programNumber); + + if (oldProgramNumber != 0 && programNumber != oldProgramNumber) + presetBank.sendParameterValuesToPatchConnection (patchConnection, programNumber); + patchConnection.sendStoredStateValue ("patchName", info.PatchName); } } if (event.key == "recordEnabled") { + if (recording == 1 && event.value == 0) + patchConnection.sendStoredStateValue ("patchDetails", presetBank.getPatchDetails()); + recording = event.value; } @@ -65,6 +71,14 @@ const stateValueChangeListener = event => { presetBank.setPatchName (programNumber, event.value); } + + if (event.key == "patchDetails") + { + if (event.value) + presetBank.setPatchDetails (event.value); + + patchConnection.sendStoredStateValue ("patchList", presetBank.getPatchList()); + } } const statusListener = status => @@ -105,6 +119,7 @@ export default function runWorker (pc) patchConnection.addEndpointListener ("midiIn", midiInListener); patchConnection.addAllParameterListener (parameterListener); - patchConnection.sendStoredStateValue ("patchList", presetBank.getPatchList()); + patchConnection.requestStoredStateValue ("patchDetails"); + patchConnection.requestStoredStateValue ("currentProgram"); } diff --git a/assets/example_patches/Replicant/cmaj_Replicant.js b/assets/example_patches/Replicant/cmaj_Replicant.js index 670efab6..386937b1 100644 --- a/assets/example_patches/Replicant/cmaj_Replicant.js +++ b/assets/example_patches/Replicant/cmaj_Replicant.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'replicant.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/RingMod/cmaj_Ring_Mod_Demo.js b/assets/example_patches/RingMod/cmaj_Ring_Mod_Demo.js index d8fd8145..e3f35c90 100644 --- a/assets/example_patches/RingMod/cmaj_Ring_Mod_Demo.js +++ b/assets/example_patches/RingMod/cmaj_Ring_Mod_Demo.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'RingMod.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/STunedBar6/cmaj_STunedBar6.js b/assets/example_patches/STunedBar6/cmaj_STunedBar6.js index fdaa2574..5bf49c3f 100644 --- a/assets/example_patches/STunedBar6/cmaj_STunedBar6.js +++ b/assets/example_patches/STunedBar6/cmaj_STunedBar6.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'STunedBar6.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/Tremolo/cmaj_Tremolo.js b/assets/example_patches/Tremolo/cmaj_Tremolo.js index 9beeda69..7d01174f 100644 --- a/assets/example_patches/Tremolo/cmaj_Tremolo.js +++ b/assets/example_patches/Tremolo/cmaj_Tremolo.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'Tremolo.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection diff --git a/assets/example_patches/ZitaReverb/cmaj_Zita_Reverb.js b/assets/example_patches/ZitaReverb/cmaj_Zita_Reverb.js index 81ee3726..f3bc0661 100644 --- a/assets/example_patches/ZitaReverb/cmaj_Zita_Reverb.js +++ b/assets/example_patches/ZitaReverb/cmaj_Zita_Reverb.js @@ -3,7 +3,7 @@ // This file contains a Javascript/Webassembly/WebAudio export of the Cmajor // patch 'ZitaReverb.cmajorpatch'. // -// This file was auto-generated by the Cmajor toolkit v1.0.2395 +// This file was auto-generated by the Cmajor toolkit v1.0.2396 // // To use it, import this module into your HTML/Javascript code and call // `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection