@gorilla-engine-sdk/create-gorilla-engine-plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +64 -0
- package/README.md +103 -0
- package/generator-gorilla-engine-plugin/app/index.js +338 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/SKILL.md +295 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/effects-filters.md +186 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/indexing.md +129 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/instrument-files.md +547 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/key-rules.md +81 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/modulation.md +210 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-control.md +217 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-bus-effects.md +663 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-core.md +145 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-misc.md +59 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-modulation.md +85 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-voice-effects.md +407 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/note-events.md +278 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/properties.md +230 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/script-patterns.md +494 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/time-tempo.md +209 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/SKILL.md +104 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/advanced-controls.md +194 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/base-props.md +167 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/basic-controls.md +230 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/bindings.md +183 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/composite-components.md +258 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/containers.md +149 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/editors.md +191 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/event-handlers.md +150 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/getting-started.md +143 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/gorilla-engine-api.md +147 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/instrument-api.md +250 -0
- package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/visualization.md +209 -0
- package/generator-gorilla-engine-plugin/app/templates/.prettierignore +13 -0
- package/generator-gorilla-engine-plugin/app/templates/.vscode/settings.json +14 -0
- package/generator-gorilla-engine-plugin/app/templates/.vscode_input/launch.json +89 -0
- package/generator-gorilla-engine-plugin/app/templates/README.md +36 -0
- package/generator-gorilla-engine-plugin/app/templates/assets/fonts/OFL.txt +93 -0
- package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Bold.otf +0 -0
- package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Medium.otf +0 -0
- package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Regular.otf +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/Presets/Factory/Category 1/Init.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/Presets/Factory/Category 1/Three Quarters.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Horizontal Slider.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Horizontal Slider@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary Bipolar.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary-Bipolar@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-default.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-default@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-hover.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-hover@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-pressed.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-pressed@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-default.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-default@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-hover.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-hover@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-pressed.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-pressed@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-default.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-default@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-pressed.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-pressed@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/instruments/Basic Synth Example_part1.blob +0 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/instruments/Basic Synth Example_part2.blob +1 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/instrument/Basic Synth Example.inst +157 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/instrument/Basic Synth Example.txt +184 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/Root.tsx +35 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/components/ErrorBoundary.tsx +138 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/components/UserInterface.tsx +338 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/pluginConfig.ts +4 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/dialogsCustomStyle.ts +98 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/index.tsx +217 -0
- package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/presetBrowserCustomStyle.ts +124 -0
- package/generator-gorilla-engine-plugin/app/templates/build.ugep +173 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/01 - All The Way Down.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/02 - About Half.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/03 - Three Quarters.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/04 - All The Way Up.preset +1 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/images/Rotary.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/images/Rotary@2x.png +0 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/instruments/Reverb Example_part1.blob +0 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/assets/instruments/Reverb Example_part2.blob +1 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/instrument/Reverb Example.inst +73 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/instrument/Reverb Example.txt +21 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/app/Root.tsx +35 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/ErrorBoundary.tsx +114 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/UserInterface.tsx +85 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/app/pluginConfig.ts +4 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/dialogsCustomStyle.ts +101 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/index.tsx +214 -0
- package/generator-gorilla-engine-plugin/app/templates/effect/src/presetBrowserCustomStyle.ts +124 -0
- package/generator-gorilla-engine-plugin/app/templates/gitignore +9 -0
- package/generator-gorilla-engine-plugin/app/templates/licence.txt +0 -0
- package/generator-gorilla-engine-plugin/app/templates/package.json +38 -0
- package/generator-gorilla-engine-plugin/app/templates/prettierrc +9 -0
- package/generator-gorilla-engine-plugin/app/templates/tsconfig.json +20 -0
- package/generator-gorilla-engine-plugin/package.json +17 -0
- package/index.js +72 -0
- package/package.json +42 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Module": "Instrument",
|
|
3
|
+
"Name": "gorilla-reverb",
|
|
4
|
+
"Blob Number": "None",
|
|
5
|
+
"Blob Path": "../assets/Reverb Example.blob",
|
|
6
|
+
"Pitch Bend Range": 2,
|
|
7
|
+
"Script Defines": null,
|
|
8
|
+
"Version": "2.0.4",
|
|
9
|
+
"Editor Data": null,
|
|
10
|
+
"Groups": [
|
|
11
|
+
{
|
|
12
|
+
"Module": "Group",
|
|
13
|
+
"Name": "default",
|
|
14
|
+
"Volume": 0.6299895322,
|
|
15
|
+
"Output": -1,
|
|
16
|
+
"ModSources": [
|
|
17
|
+
{
|
|
18
|
+
"Module": "ModSourceADSR",
|
|
19
|
+
"Name": "Amp Env",
|
|
20
|
+
"Sustain": 1.0
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"ModRoutings": [
|
|
24
|
+
{
|
|
25
|
+
"Module": "ModRouting",
|
|
26
|
+
"Depth": 1.0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"Module": "ModRouting",
|
|
30
|
+
"Source": "Velocity",
|
|
31
|
+
"Depth": 1.0
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"Module": "ModRouting",
|
|
35
|
+
"Source": "Pitch Bend",
|
|
36
|
+
"Depth": 1.0,
|
|
37
|
+
"Smooth": 0.25906554,
|
|
38
|
+
"Dest": "Tune"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"Voice Groups": [
|
|
44
|
+
{
|
|
45
|
+
"Module": "VoiceGroup",
|
|
46
|
+
"Name": null
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"FX Busses": [
|
|
50
|
+
{
|
|
51
|
+
"Module": "EffectBus",
|
|
52
|
+
"Name": "",
|
|
53
|
+
"Effects": [
|
|
54
|
+
{
|
|
55
|
+
"Module": "EffectReverb",
|
|
56
|
+
"Pre Delay": 0.25,
|
|
57
|
+
"Low Cut": 0.25,
|
|
58
|
+
"Damping": 0.352,
|
|
59
|
+
"Dry": 0.0,
|
|
60
|
+
"Wet": 1.0,
|
|
61
|
+
"Low Damping": 0.25
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"Scripts": [
|
|
67
|
+
{
|
|
68
|
+
"Module": "Script",
|
|
69
|
+
"Script Path": "Reverb Example.txt",
|
|
70
|
+
"Script": "on init\n prop_squared Reverb_PreDelay(0, 1000000, 0, 200) = 250000; set_prop_param(Reverb_PreDelay, PROP_UNITS, \"ms\"); set_prop_param(Reverb_PreDelay, PROP_NAME, \"PreDelay\")\n prop_exp Reverb_Time(1000000, 100, 60000) = 500000; set_prop_param(Reverb_Time, PROP_UNITS, \"s\"); set_prop_param(Reverb_Time, PROP_NAME, \"Time\")\n prop_linear Reverb_Dry_Wet(0, 100, 1) = 100; set_prop_param(Reverb_Dry_Wet, PROP_UNITS, \"%\"); set_prop_param(Reverb_Dry_Wet, PROP_NAME, \"Dry/Wet\")\n\n var temp\nend on\n\non Reverb_PreDelay\n set_module_param(M_BUS+1, M_EFFECT+1, 0, 3, Reverb_PreDelay) 'EffectReverb Pre Delay\nend on\n\non Reverb_Time\n set_module_param(M_BUS+1, M_EFFECT+1, 0, 2, Reverb_Time) 'EffectReverb Time\nend on\n\non Reverb_Dry_Wet\n temp = 100 - Reverb_Dry_Wet\n set_module_param(M_BUS+1, M_EFFECT+1, 0, 7, temp * 10000) 'EffectReverb Dry\n set_module_param(M_BUS+1, M_EFFECT+1, 0, 8, Reverb_Dry_Wet * 10000) 'EffectReverb Wet\nend on"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
on init
|
|
2
|
+
prop_squared Reverb_PreDelay(0, 1000000, 0, 200) = 250000; set_prop_param(Reverb_PreDelay, PROP_UNITS, "ms"); set_prop_param(Reverb_PreDelay, PROP_NAME, "PreDelay")
|
|
3
|
+
prop_exp Reverb_Time(1000000, 100, 60000) = 500000; set_prop_param(Reverb_Time, PROP_UNITS, "s"); set_prop_param(Reverb_Time, PROP_NAME, "Time")
|
|
4
|
+
prop_linear Reverb_Dry_Wet(0, 100, 1) = 100; set_prop_param(Reverb_Dry_Wet, PROP_UNITS, "%"); set_prop_param(Reverb_Dry_Wet, PROP_NAME, "Dry/Wet")
|
|
5
|
+
|
|
6
|
+
var temp
|
|
7
|
+
end on
|
|
8
|
+
|
|
9
|
+
on Reverb_PreDelay
|
|
10
|
+
set_module_param(M_BUS+1, M_EFFECT+1, 0, 3, Reverb_PreDelay) 'EffectReverb Pre Delay
|
|
11
|
+
end on
|
|
12
|
+
|
|
13
|
+
on Reverb_Time
|
|
14
|
+
set_module_param(M_BUS+1, M_EFFECT+1, 0, 2, Reverb_Time) 'EffectReverb Time
|
|
15
|
+
end on
|
|
16
|
+
|
|
17
|
+
on Reverb_Dry_Wet
|
|
18
|
+
temp = 100 - Reverb_Dry_Wet
|
|
19
|
+
set_module_param(M_BUS+1, M_EFFECT+1, 0, 7, temp * 10000) 'EffectReverb Dry
|
|
20
|
+
set_module_param(M_BUS+1, M_EFFECT+1, 0, 8, Reverb_Dry_Wet * 10000) 'EffectReverb Wet
|
|
21
|
+
end on
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { UserInterface } from './components/UserInterface';
|
|
3
|
+
import { useNotification } from '@gorilla-engine-sdk/ge-dialogs-lib';
|
|
4
|
+
import {
|
|
5
|
+
IPresetManager,
|
|
6
|
+
useSessionAndPresetsManager,
|
|
7
|
+
} from '@gorilla-engine-sdk/ge-session-presets-lib';
|
|
8
|
+
|
|
9
|
+
export function Root(props) {
|
|
10
|
+
const presetManager: IPresetManager = useSessionAndPresetsManager();
|
|
11
|
+
const [showNotification] = useNotification();
|
|
12
|
+
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (presetManager) {
|
|
15
|
+
// it is possible to add additional logic when saving or loading sessions or presets
|
|
16
|
+
// typically you would add custom logic here to handle additional tasks when saving or loading presets
|
|
17
|
+
presetManager.setAdditionalSavePreset(
|
|
18
|
+
async (
|
|
19
|
+
instrument: GorillaEngine.Instrument,
|
|
20
|
+
presetObj: any,
|
|
21
|
+
fileObj: { filePath: string },
|
|
22
|
+
) => {
|
|
23
|
+
showNotification({ message: 'Preset saved successfully' });
|
|
24
|
+
return true;
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}, [presetManager]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<geLabel x={0} y={0} width={700} height={250} backgroundColor={'2F323D'}>
|
|
32
|
+
<UserInterface instrument={props.instrument} />
|
|
33
|
+
</geLabel>
|
|
34
|
+
);
|
|
35
|
+
}
|
package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/ErrorBoundary.tsx
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const FONT_MEDIUM = 'fonts/Roboto-Medium.otf';
|
|
4
|
+
const FONT_BOLD = 'fonts/Roboto-Bold.otf';
|
|
5
|
+
const FONT_REGULAR = 'fonts/Roboto-Regular.otf';
|
|
6
|
+
|
|
7
|
+
type ErrorBoundaryState = {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
stack: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class ErrorBoundary extends React.Component<React.PropsWithChildren, ErrorBoundaryState> {
|
|
14
|
+
declare state: ErrorBoundaryState;
|
|
15
|
+
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.state = { hasError: false, message: '', stack: '' };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getDerivedStateFromError(error: Error) {
|
|
22
|
+
return { hasError: true, message: error.message || String(error) };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
|
|
26
|
+
this.setState({
|
|
27
|
+
message: error.message || String(error),
|
|
28
|
+
stack: errorInfo.componentStack || error.stack || '',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render() {
|
|
33
|
+
if (this.state.hasError) {
|
|
34
|
+
return (
|
|
35
|
+
<geLabel x={0} y={0} width={700} height={250} backgroundColor="17191F">
|
|
36
|
+
<geLabel x={0} y={0} width={7} height={250} backgroundColor="E85D5D" />
|
|
37
|
+
<geLabel x={7} y={0} width={693} height={64} backgroundColor="20232B">
|
|
38
|
+
<geLabel
|
|
39
|
+
x={24}
|
|
40
|
+
y={15}
|
|
41
|
+
width={34}
|
|
42
|
+
height={34}
|
|
43
|
+
backgroundColor="E85D5D"
|
|
44
|
+
text="!"
|
|
45
|
+
textColor="FFFFFF"
|
|
46
|
+
font={FONT_BOLD}
|
|
47
|
+
fontSize={21}
|
|
48
|
+
textAlign="center"
|
|
49
|
+
/>
|
|
50
|
+
<geLabel
|
|
51
|
+
x={72}
|
|
52
|
+
y={21}
|
|
53
|
+
width={330}
|
|
54
|
+
height={22}
|
|
55
|
+
text="PLUGIN UI INTERRUPTED"
|
|
56
|
+
textColor="F4F6FA"
|
|
57
|
+
font={FONT_BOLD}
|
|
58
|
+
fontSize={18}
|
|
59
|
+
/>
|
|
60
|
+
<geLabel
|
|
61
|
+
x={538}
|
|
62
|
+
y={22}
|
|
63
|
+
width={126}
|
|
64
|
+
height={20}
|
|
65
|
+
text="RENDER ERROR"
|
|
66
|
+
textColor="E85D5D"
|
|
67
|
+
font={FONT_MEDIUM}
|
|
68
|
+
fontSize={10}
|
|
69
|
+
textAlign="center"
|
|
70
|
+
backgroundColor="33262A"
|
|
71
|
+
/>
|
|
72
|
+
</geLabel>
|
|
73
|
+
|
|
74
|
+
<geLabel
|
|
75
|
+
x={28}
|
|
76
|
+
y={82}
|
|
77
|
+
width={644}
|
|
78
|
+
height={16}
|
|
79
|
+
text="WHAT HAPPENED"
|
|
80
|
+
textColor="7E8797"
|
|
81
|
+
font={FONT_MEDIUM}
|
|
82
|
+
fontSize={10}
|
|
83
|
+
/>
|
|
84
|
+
<geLabel
|
|
85
|
+
x={28}
|
|
86
|
+
y={104}
|
|
87
|
+
width={644}
|
|
88
|
+
height={70}
|
|
89
|
+
text={this.state.message || 'An unexpected rendering error occurred.'}
|
|
90
|
+
textColor="F4F6FA"
|
|
91
|
+
font={FONT_MEDIUM}
|
|
92
|
+
fontSize={14}
|
|
93
|
+
backgroundColor="242730"
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<geLabel x={28} y={196} width={644} height={1} backgroundColor="353945" />
|
|
97
|
+
<geLabel
|
|
98
|
+
x={538}
|
|
99
|
+
y={214}
|
|
100
|
+
width={134}
|
|
101
|
+
height={16}
|
|
102
|
+
text="GORILLA ENGINE"
|
|
103
|
+
textColor="596171"
|
|
104
|
+
font={FONT_MEDIUM}
|
|
105
|
+
fontSize={9}
|
|
106
|
+
textAlign="right"
|
|
107
|
+
/>
|
|
108
|
+
</geLabel>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return (this.props as any).children;
|
|
113
|
+
}
|
|
114
|
+
}
|
package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/UserInterface.tsx
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LabeledKnob } from '@gorilla-engine-sdk/ge-labeled-components';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
instrument: GorillaEngine.Runtime.Instrument;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const KNOB_PROPS = {
|
|
9
|
+
y: 145,
|
|
10
|
+
width: 85,
|
|
11
|
+
height: 85,
|
|
12
|
+
backgroundColor: '00FFFFFF',
|
|
13
|
+
hideValueLabel: true,
|
|
14
|
+
hideTextValue: true,
|
|
15
|
+
toggleVisibilityOnHover: true,
|
|
16
|
+
valueLabel: {
|
|
17
|
+
y: 71,
|
|
18
|
+
height: 14,
|
|
19
|
+
font: 'fonts/Roboto-Medium.otf',
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
textAlign: 'center' as const,
|
|
22
|
+
},
|
|
23
|
+
knob: {
|
|
24
|
+
filmstrip: { path: 'images/Rotary.png', count: 128, direction: 'vertical' as const },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const knobLabel = (text: string) => ({
|
|
29
|
+
...KNOB_PROPS.valueLabel,
|
|
30
|
+
text,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function UserInterface(props: Props) {
|
|
34
|
+
const { instrument } = props;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
{/* ── Header: centred in the space to the right of the preset browser ── */}
|
|
39
|
+
<geLabel
|
|
40
|
+
x={397}
|
|
41
|
+
y={25}
|
|
42
|
+
width={263}
|
|
43
|
+
height={14}
|
|
44
|
+
text={GorillaEngine.getManufacturerName()}
|
|
45
|
+
textColor={'5177E0'}
|
|
46
|
+
font={'fonts/Roboto-Medium.otf'}
|
|
47
|
+
fontSize={12}
|
|
48
|
+
textAlign={'center'}
|
|
49
|
+
/>
|
|
50
|
+
<geLabel
|
|
51
|
+
x={397}
|
|
52
|
+
y={40}
|
|
53
|
+
width={263}
|
|
54
|
+
height={28}
|
|
55
|
+
text={GorillaEngine.getPluginName()}
|
|
56
|
+
textColor={'E1E6F5'}
|
|
57
|
+
font={'fonts/Roboto-Bold.otf'}
|
|
58
|
+
fontSize={24}
|
|
59
|
+
textAlign={'center'}
|
|
60
|
+
/>
|
|
61
|
+
{/* ── Knobs: centred in full 700px width (margin=111, gap=111) ──── */}
|
|
62
|
+
<LabeledKnob
|
|
63
|
+
{...KNOB_PROPS}
|
|
64
|
+
x={111}
|
|
65
|
+
instrument={instrument}
|
|
66
|
+
instrumentProp={instrument.reverb_predelay}
|
|
67
|
+
textLabel={knobLabel('PRE DELAY')}
|
|
68
|
+
/>
|
|
69
|
+
<LabeledKnob
|
|
70
|
+
{...KNOB_PROPS}
|
|
71
|
+
x={307}
|
|
72
|
+
instrument={instrument}
|
|
73
|
+
instrumentProp={instrument.reverb_time}
|
|
74
|
+
textLabel={knobLabel('TIME')}
|
|
75
|
+
/>
|
|
76
|
+
<LabeledKnob
|
|
77
|
+
{...KNOB_PROPS}
|
|
78
|
+
x={503}
|
|
79
|
+
instrument={instrument}
|
|
80
|
+
instrumentProp={instrument.reverb_dry_wet}
|
|
81
|
+
textLabel={knobLabel('DRY / WET')}
|
|
82
|
+
/>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DialogHorizontalAlign,
|
|
3
|
+
DialogVerticalAlign,
|
|
4
|
+
DialogsStyleState,
|
|
5
|
+
} from '@gorilla-engine-sdk/ge-dialogs-lib/dist/DialogsStyleState'
|
|
6
|
+
|
|
7
|
+
export const dialogsCustomStyle: DialogsStyleState = {
|
|
8
|
+
pluginWidth: 566,
|
|
9
|
+
pluginHeight: 370,
|
|
10
|
+
|
|
11
|
+
modal: {
|
|
12
|
+
horizontalAlign: DialogHorizontalAlign.CENTER,
|
|
13
|
+
horizontalOffset: 0,
|
|
14
|
+
verticalAlign: DialogVerticalAlign.CENTER,
|
|
15
|
+
verticalOffset: 0,
|
|
16
|
+
|
|
17
|
+
blockingBackgroundColor: '33000000',
|
|
18
|
+
|
|
19
|
+
modalWidth: 400,
|
|
20
|
+
modalHeight: 220,
|
|
21
|
+
headerHeight: 50,
|
|
22
|
+
horizontalContentMargin: 16,
|
|
23
|
+
|
|
24
|
+
modal: {
|
|
25
|
+
cornerRadius: 4,
|
|
26
|
+
border: {
|
|
27
|
+
width: 1,
|
|
28
|
+
color: '3F4354',
|
|
29
|
+
},
|
|
30
|
+
backgroundColor: '2F333F',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
title: {
|
|
34
|
+
fontSize: 20,
|
|
35
|
+
textColor: 'ffffff',
|
|
36
|
+
textAlign: 'center',
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
dividerLine: {
|
|
40
|
+
height: 1,
|
|
41
|
+
backgroundColor: '3F4354',
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
message: {
|
|
45
|
+
fontSize: 14,
|
|
46
|
+
textColor: 'ffffff',
|
|
47
|
+
textAlign: 'top left',
|
|
48
|
+
multiLine: true,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
cancelButton: {
|
|
52
|
+
backgroundColor: '21242E',
|
|
53
|
+
textColor: 'E1E6F5',
|
|
54
|
+
font: 'fonts/Roboto-Medium.otf',
|
|
55
|
+
cornerRadius: 4,
|
|
56
|
+
},
|
|
57
|
+
approveButton: {
|
|
58
|
+
backgroundColor: '5177E0',
|
|
59
|
+
textColor: 'E1E6F5',
|
|
60
|
+
font: 'fonts/Roboto-Medium.otf',
|
|
61
|
+
cornerRadius: 4,
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
closeButton: {
|
|
65
|
+
width: 20,
|
|
66
|
+
height: 20,
|
|
67
|
+
backgroundColor: '333333',
|
|
68
|
+
cornerRadius: 10,
|
|
69
|
+
text: 'X',
|
|
70
|
+
},
|
|
71
|
+
closeButtonPosition: {
|
|
72
|
+
position: 'right',
|
|
73
|
+
space: 15,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
notification: {
|
|
78
|
+
horizontalAlign: DialogHorizontalAlign.RIGHT,
|
|
79
|
+
horizontalOffset: -30,
|
|
80
|
+
verticalAlign: DialogVerticalAlign.BOTTOM,
|
|
81
|
+
verticalOffset: -30,
|
|
82
|
+
container: {
|
|
83
|
+
width: 300,
|
|
84
|
+
height: 40,
|
|
85
|
+
cornerRadius: 5,
|
|
86
|
+
backgroundColor: '333333',
|
|
87
|
+
},
|
|
88
|
+
label: {
|
|
89
|
+
//font: defaultFontMedium,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
toolTip: {
|
|
94
|
+
container: { backgroundColor: '000000', cornerRadius: 5, height: 35 },
|
|
95
|
+
label: {
|
|
96
|
+
//font: defaultFontMedium,
|
|
97
|
+
fontSize: 13,
|
|
98
|
+
textAlign: 'center',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import path = require('path');
|
|
2
|
+
import os = require('os');
|
|
3
|
+
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as GEReact from '@gorilla-engine-sdk/gorilla-engine-react';
|
|
6
|
+
import { Root } from './app/Root';
|
|
7
|
+
import { ErrorBoundary } from './app/components/ErrorBoundary';
|
|
8
|
+
import {
|
|
9
|
+
SessionAndPresetsConfig,
|
|
10
|
+
SessionAndPresetsDispatchTypes,
|
|
11
|
+
SessionAndPresetsState,
|
|
12
|
+
SessionAndPresetsStateProvider,
|
|
13
|
+
SessionAndPresetsWrapper,
|
|
14
|
+
defaultSessionAndPresetsConfig,
|
|
15
|
+
defaultSessionAndPresetsState,
|
|
16
|
+
useSessionAndPresetsStateDispatch,
|
|
17
|
+
} from '@gorilla-engine-sdk/ge-session-presets-lib';
|
|
18
|
+
import {
|
|
19
|
+
Dialogs,
|
|
20
|
+
DialogsStylesState,
|
|
21
|
+
dialogsDefaultStyle,
|
|
22
|
+
} from '@gorilla-engine-sdk/ge-dialogs-lib';
|
|
23
|
+
import {
|
|
24
|
+
PresetBrowser,
|
|
25
|
+
PresetBrowserConfig,
|
|
26
|
+
PresetBrowserStyle,
|
|
27
|
+
defaultPresetBrowserConfig,
|
|
28
|
+
defaultPresetBrowserStyle,
|
|
29
|
+
} from '@gorilla-engine-sdk/ge-preset-browser';
|
|
30
|
+
|
|
31
|
+
import { DefaultModalProps, DefaultModal, useModal } from '@gorilla-engine-sdk/ge-dialogs-lib';
|
|
32
|
+
|
|
33
|
+
import { BlobManager, loadBlob } from '@gorilla-engine-sdk/ge-blob-manager';
|
|
34
|
+
import { presetBrowserCustomStyle, presetBrowserSaveModalStyle } from './presetBrowserCustomStyle';
|
|
35
|
+
import { dialogsCustomStyle } from './dialogsCustomStyle';
|
|
36
|
+
|
|
37
|
+
const PLUGIN_WIDTH: number = 700;
|
|
38
|
+
const PLUGIN_HEIGHT: number = 250;
|
|
39
|
+
|
|
40
|
+
const MANUFACTURER: string = GorillaEngine.getManufacturerName();
|
|
41
|
+
const PLUGINNAME = GorillaEngine.getPluginName();
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Factory Preset location
|
|
45
|
+
*/
|
|
46
|
+
const FACTORY_PRESET_LOCATION: string = path.resolve(
|
|
47
|
+
GorillaEngine.getResourcePath(),
|
|
48
|
+
'presets',
|
|
49
|
+
'Factory',
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const USER_CONTENT_PATH: string = path.resolve(os.homedir(), 'Documents', MANUFACTURER, PLUGINNAME);
|
|
53
|
+
const USER_PRESET_LOCATION: string = path.resolve(USER_CONTENT_PATH, 'Presets');
|
|
54
|
+
|
|
55
|
+
const dialogsStyle: DialogsStylesState = {
|
|
56
|
+
...dialogsCustomStyle,
|
|
57
|
+
pluginWidth: PLUGIN_WIDTH,
|
|
58
|
+
pluginHeight: PLUGIN_HEIGHT,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* Session Save/Restore & Presets config & content-state
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
const sessionAndPresetsConfiguration: SessionAndPresetsConfig = {
|
|
67
|
+
...defaultSessionAndPresetsConfig,
|
|
68
|
+
|
|
69
|
+
presetFileSuffix: '.preset',
|
|
70
|
+
// Location of factory presets
|
|
71
|
+
factoryPresetPath: FACTORY_PRESET_LOCATION,
|
|
72
|
+
// Location of user presets
|
|
73
|
+
userPresetPath: USER_PRESET_LOCATION,
|
|
74
|
+
|
|
75
|
+
// Factory library display name
|
|
76
|
+
factoryPresetType: 'Factory',
|
|
77
|
+
// User library display name
|
|
78
|
+
userPresetType: 'User',
|
|
79
|
+
|
|
80
|
+
handleErrors: true,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const initialSessionAndPresetsState: SessionAndPresetsState = {
|
|
84
|
+
...defaultSessionAndPresetsState,
|
|
85
|
+
instrument: undefined,
|
|
86
|
+
initialPresetPath: path.join(FACTORY_PRESET_LOCATION, 'Category 1', '02 - About Half.preset'),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Preset Browser Config
|
|
91
|
+
*/
|
|
92
|
+
const presetBrowserConfig: PresetBrowserConfig = {
|
|
93
|
+
...defaultPresetBrowserConfig,
|
|
94
|
+
enforceCategories: true,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function Main() {
|
|
98
|
+
const sessionAndPresetStateDispath = useSessionAndPresetsStateDispatch();
|
|
99
|
+
|
|
100
|
+
const [instrument, setInstrument] = React.useState<GorillaEngine.Runtime.Instrument | undefined>(
|
|
101
|
+
undefined,
|
|
102
|
+
);
|
|
103
|
+
const [instrumentLoaded, setInstrumentLoaded] = React.useState(false);
|
|
104
|
+
const [instrumentName, setInstrumentName] = React.useState('');
|
|
105
|
+
let showRelocateTrigger = false;
|
|
106
|
+
// Logic has a different flow since it does not allow a popup if the UI is not visible
|
|
107
|
+
if (GorillaEngine.getHostDescription() == 'Apple Logic') {
|
|
108
|
+
showRelocateTrigger = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// setup Modal
|
|
112
|
+
const defaultModalProps = {
|
|
113
|
+
width: 400,
|
|
114
|
+
height: 200,
|
|
115
|
+
|
|
116
|
+
title: 'An Error Occured!',
|
|
117
|
+
message: 'Error message',
|
|
118
|
+
|
|
119
|
+
cancelTrigger: showRelocateTrigger,
|
|
120
|
+
cancelTriggerLabel: 'Locate',
|
|
121
|
+
onCancelTrigger: onLocate,
|
|
122
|
+
approveTrigger: false,
|
|
123
|
+
closeTrigger: false,
|
|
124
|
+
};
|
|
125
|
+
const [modalProps, setModalProps] = React.useState<DefaultModalProps>({
|
|
126
|
+
...defaultModalProps,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const modalPropsRef = React.useRef(modalProps);
|
|
130
|
+
modalPropsRef.current = modalProps;
|
|
131
|
+
|
|
132
|
+
const [showModal, hideModal] = useModal(
|
|
133
|
+
() => <DefaultModal {...modalPropsRef.current} />,
|
|
134
|
+
[true, false],
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
async function onLocate() {
|
|
138
|
+
hideModal();
|
|
139
|
+
loadBlob({
|
|
140
|
+
pluginName: GorillaEngine.getPluginName(),
|
|
141
|
+
blobName: PLUGINNAME,
|
|
142
|
+
defaultBlobPath: path.join(GorillaEngine.getResourcePath(), 'assets', 'instruments'),
|
|
143
|
+
manufacturerName: GorillaEngine.getManufacturerName(),
|
|
144
|
+
onErrorLoadingInstrument: onErrorLoadingInstrument,
|
|
145
|
+
onInstrumentLoaded: onInstrumentLoaded,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Callback when the BlobManager finds the blob and loads the instrument successfully
|
|
150
|
+
const onInstrumentLoaded = (instrument: GorillaEngine.Instrument, instrumentName: string) => {
|
|
151
|
+
const runtimeInstrument = instrument as GorillaEngine.Runtime.Instrument;
|
|
152
|
+
setInstrument(runtimeInstrument);
|
|
153
|
+
setInstrumentName(instrumentName);
|
|
154
|
+
setInstrumentLoaded(true);
|
|
155
|
+
|
|
156
|
+
// Enable audio processing
|
|
157
|
+
GorillaEngine.getPluginAE(true);
|
|
158
|
+
|
|
159
|
+
sessionAndPresetStateDispath({
|
|
160
|
+
type: SessionAndPresetsDispatchTypes.setInstrument,
|
|
161
|
+
payload: {
|
|
162
|
+
instrument: instrument,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// Callback when the BlobManager cannot locate the blob
|
|
168
|
+
const onErrorLoadingInstrument = (errorMessage: string) => {
|
|
169
|
+
setModalProps({
|
|
170
|
+
...defaultModalProps,
|
|
171
|
+
title: 'Error Loading Blob',
|
|
172
|
+
message: errorMessage,
|
|
173
|
+
});
|
|
174
|
+
showModal();
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<>
|
|
179
|
+
<BlobManager
|
|
180
|
+
pluginName={GorillaEngine.getPluginName()}
|
|
181
|
+
blobName={PLUGINNAME}
|
|
182
|
+
defaultBlobPath={path.join(GorillaEngine.getResourcePath(), 'assets', 'instruments')}
|
|
183
|
+
manufacturerName={GorillaEngine.getManufacturerName()}
|
|
184
|
+
onErrorLoadingInstrument={onErrorLoadingInstrument}
|
|
185
|
+
onInstrumentLoaded={onInstrumentLoaded}
|
|
186
|
+
/>
|
|
187
|
+
{instrumentLoaded && <Root instrument={instrument} instrumentName={instrumentName} />}
|
|
188
|
+
</>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
GEReact.createUI(
|
|
193
|
+
<React.StrictMode>
|
|
194
|
+
<ErrorBoundary>
|
|
195
|
+
<SessionAndPresetsStateProvider
|
|
196
|
+
config={sessionAndPresetsConfiguration}
|
|
197
|
+
state={initialSessionAndPresetsState}
|
|
198
|
+
>
|
|
199
|
+
<Dialogs styleState={dialogsStyle}>
|
|
200
|
+
<SessionAndPresetsWrapper>
|
|
201
|
+
<Main />
|
|
202
|
+
<PresetBrowser
|
|
203
|
+
config={presetBrowserConfig}
|
|
204
|
+
browserStyle={presetBrowserCustomStyle}
|
|
205
|
+
saveModalStyle={presetBrowserSaveModalStyle}
|
|
206
|
+
/>
|
|
207
|
+
</SessionAndPresetsWrapper>
|
|
208
|
+
</Dialogs>
|
|
209
|
+
</SessionAndPresetsStateProvider>
|
|
210
|
+
</ErrorBoundary>
|
|
211
|
+
</React.StrictMode>,
|
|
212
|
+
PLUGIN_WIDTH,
|
|
213
|
+
PLUGIN_HEIGHT,
|
|
214
|
+
);
|