Skip to content

Commit

Permalink
Docs update 1.0.2689
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaref committed Oct 18, 2024
1 parent fdccf14 commit 3d76cf0
Show file tree
Hide file tree
Showing 33 changed files with 104 additions and 93 deletions.
2 changes: 1 addition & 1 deletion assets/example_patches/808/cmaj_808.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.2688
// This file was auto-generated by the Cmajor toolkit v1.0.2689
//
// To use it, import this module into your HTML/Javascript code and call
// `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/example_patches/CompuFart/cmaj_CompuFart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.2688
// This file was auto-generated by the Cmajor toolkit v1.0.2689
//
// To use it, import this module into your HTML/Javascript code and call
// `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/example_patches/GuitarLSTM/cmaj_GuitarLSTM.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/example_patches/HelloWorld/cmaj_Hello_World.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.2688
// This file was auto-generated by the Cmajor toolkit v1.0.2689
//
// To use it, import this module into your HTML/Javascript code and call
// `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/example_patches/Piano/cmaj_Piano.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.2688
// This file was auto-generated by the Cmajor toolkit v1.0.2689
//
// To use it, import this module into your HTML/Javascript code and call
// `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/example_patches/PirkleFilters/cmaj_vafilters.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/example_patches/Pro54/cmaj_Pro54.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.2688
// This file was auto-generated by the Cmajor toolkit v1.0.2689
//
// To use it, import this module into your HTML/Javascript code and call
// `createAudioWorkletNodePatchConnection()`. The AudioWorkletPatchConnection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
39 changes: 23 additions & 16 deletions assets/example_patches/Pro54/gui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ import * as presets from "./presets/presetBank.js"
export default function createPatchView (patchConnection)
{
defineKeyboardElement (patchConnection);
return new Pro54PatchView (patchConnection);

return new (window.customElements.get ("pro54-patch-view")) (patchConnection);
}

function registerCustomElement (name, element)
{
if (! window.customElements.get (name))
window.customElements.define (name, element);
}

//==============================================================================
Expand All @@ -48,7 +55,7 @@ function defineKeyboardElement (patchConnection)
getNoteLabel (note) { return ""; }
}

window.customElements.define ("pro54-keyboard", Pro54Keyboard);
registerCustomElement ("pro54-keyboard", Pro54Keyboard);
}
}

Expand Down Expand Up @@ -985,17 +992,17 @@ class Pro54PatchView extends HTMLElement
}
}

window.customElements.define ("pro54-black-knob", Pro54BlackKnob);
window.customElements.define ("pro54-metal-knob", Pro54MetalKnob);
window.customElements.define ("pro54-black-button", Pro54BlackButton);
window.customElements.define ("pro54-grey-button", Pro54GreyButton);
window.customElements.define ("pro54-orange-button", Pro54OrangeButton);
window.customElements.define ("pro54-voices", Pro54VoicesElement);
window.customElements.define ("pro54-wheel", Pro54WheelElement);
window.customElements.define ("pro54-filter", Pro54FilterElement);
window.customElements.define ("pro54-midi-light", Pro54MIDIActivityLight);
window.customElements.define ("pro54-program-digit", Pro54ProgramDigitElement);
window.customElements.define ("pro54-program-bank", Pro54ProgramBank);
window.customElements.define ("pro54-program-name", Pro54ProgramName);
window.customElements.define ("pro54-patch-view", Pro54PatchView);
window.customElements.define ("pro54-bpf", Pro54BPF);
registerCustomElement ("pro54-black-knob", Pro54BlackKnob);
registerCustomElement ("pro54-metal-knob", Pro54MetalKnob);
registerCustomElement ("pro54-black-button", Pro54BlackButton);
registerCustomElement ("pro54-grey-button", Pro54GreyButton);
registerCustomElement ("pro54-orange-button", Pro54OrangeButton);
registerCustomElement ("pro54-voices", Pro54VoicesElement);
registerCustomElement ("pro54-wheel", Pro54WheelElement);
registerCustomElement ("pro54-filter", Pro54FilterElement);
registerCustomElement ("pro54-midi-light", Pro54MIDIActivityLight);
registerCustomElement ("pro54-program-digit", Pro54ProgramDigitElement);
registerCustomElement ("pro54-program-bank", Pro54ProgramBank);
registerCustomElement ("pro54-program-name", Pro54ProgramName);
registerCustomElement ("pro54-patch-view", Pro54PatchView);
registerCustomElement ("pro54-bpf", Pro54BPF);
2 changes: 1 addition & 1 deletion assets/example_patches/Replicant/cmaj_Replicant.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,13 @@ export function getAllCSS()
export function createControl (patchConnection, endpointInfo)
{
if (Switch.canBeUsedFor (endpointInfo))
return new Switch (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-switch-control")) (patchConnection, endpointInfo);

if (Options.canBeUsedFor (endpointInfo))
return new Options (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-options-control")) (patchConnection, endpointInfo);

if (Knob.canBeUsedFor (endpointInfo))
return new Knob (patchConnection, endpointInfo);
return new (window.customElements.get ("cmaj-knob-control")) (patchConnection, endpointInfo);

return undefined;
}
Expand All @@ -853,7 +853,7 @@ export function createLabelledControl (patchConnection, endpointInfo)
const control = createControl (patchConnection, endpointInfo);

if (control)
return new LabelledControlHolder (patchConnection, endpointInfo, control);
return new (window.customElements.get ("cmaj-labelled-control-holder")) (patchConnection, endpointInfo, control);

return undefined;
}
Expand Down
8 changes: 6 additions & 2 deletions assets/example_patches/RingMod/RingMod_GUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class DalekView extends HTMLElement
}
}

window.customElements.define ("dalek-view", DalekView);

/* This is the function that a host (the command line patch player, or a Cmajor plugin
loader, or our VScode extension, etc) will call in order to create a view for your patch.
Expand All @@ -100,5 +99,10 @@ window.customElements.define ("dalek-view", DalekView);
*/
export default function createPatchView (patchConnection)
{
return new DalekView (patchConnection);
const customElementName = "dalek-view";

if (! window.customElements.get (customElementName))
window.customElements.define (customElementName, DalekView);

return new (window.customElements.get (customElementName)) (patchConnection);
}
Loading

0 comments on commit 3d76cf0

Please sign in to comment.