@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.
Files changed (101) hide show
  1. package/LICENSE.md +64 -0
  2. package/README.md +103 -0
  3. package/generator-gorilla-engine-plugin/app/index.js +338 -0
  4. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/SKILL.md +295 -0
  5. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/effects-filters.md +186 -0
  6. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/indexing.md +129 -0
  7. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/instrument-files.md +547 -0
  8. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/key-rules.md +81 -0
  9. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/modulation.md +210 -0
  10. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-control.md +217 -0
  11. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-bus-effects.md +663 -0
  12. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-core.md +145 -0
  13. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-misc.md +59 -0
  14. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-modulation.md +85 -0
  15. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/module-reference-voice-effects.md +407 -0
  16. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/note-events.md +278 -0
  17. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/properties.md +230 -0
  18. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/script-patterns.md +494 -0
  19. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-dsp/references/time-tempo.md +209 -0
  20. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/SKILL.md +104 -0
  21. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/advanced-controls.md +194 -0
  22. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/base-props.md +167 -0
  23. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/basic-controls.md +230 -0
  24. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/bindings.md +183 -0
  25. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/composite-components.md +258 -0
  26. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/containers.md +149 -0
  27. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/editors.md +191 -0
  28. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/event-handlers.md +150 -0
  29. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/getting-started.md +143 -0
  30. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/gorilla-engine-api.md +147 -0
  31. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/instrument-api.md +250 -0
  32. package/generator-gorilla-engine-plugin/app/templates/.agents/skills/gorilla-engine-ui/references/visualization.md +209 -0
  33. package/generator-gorilla-engine-plugin/app/templates/.prettierignore +13 -0
  34. package/generator-gorilla-engine-plugin/app/templates/.vscode/settings.json +14 -0
  35. package/generator-gorilla-engine-plugin/app/templates/.vscode_input/launch.json +89 -0
  36. package/generator-gorilla-engine-plugin/app/templates/README.md +36 -0
  37. package/generator-gorilla-engine-plugin/app/templates/assets/fonts/OFL.txt +93 -0
  38. package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Bold.otf +0 -0
  39. package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Medium.otf +0 -0
  40. package/generator-gorilla-engine-plugin/app/templates/assets/fonts/Roboto-Regular.otf +0 -0
  41. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/Presets/Factory/Category 1/Init.preset +1 -0
  42. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/Presets/Factory/Category 1/Three Quarters.preset +1 -0
  43. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Horizontal Slider.png +0 -0
  44. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Horizontal Slider@2x.png +0 -0
  45. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary Bipolar.png +0 -0
  46. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary-Bipolar@2x.png +0 -0
  47. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary.png +0 -0
  48. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/Rotary@2x.png +0 -0
  49. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-default.png +0 -0
  50. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-default@2x.png +0 -0
  51. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-hover.png +0 -0
  52. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-hover@2x.png +0 -0
  53. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-pressed.png +0 -0
  54. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-down-pressed@2x.png +0 -0
  55. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-default.png +0 -0
  56. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-default@2x.png +0 -0
  57. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-hover.png +0 -0
  58. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-hover@2x.png +0 -0
  59. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-pressed.png +0 -0
  60. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/arrow-up-pressed@2x.png +0 -0
  61. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-default.png +0 -0
  62. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-default@2x.png +0 -0
  63. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-pressed.png +0 -0
  64. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/images/toggle-pressed@2x.png +0 -0
  65. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/instruments/Basic Synth Example_part1.blob +0 -0
  66. package/generator-gorilla-engine-plugin/app/templates/basic-synth/assets/instruments/Basic Synth Example_part2.blob +1 -0
  67. package/generator-gorilla-engine-plugin/app/templates/basic-synth/instrument/Basic Synth Example.inst +157 -0
  68. package/generator-gorilla-engine-plugin/app/templates/basic-synth/instrument/Basic Synth Example.txt +184 -0
  69. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/Root.tsx +35 -0
  70. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/components/ErrorBoundary.tsx +138 -0
  71. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/components/UserInterface.tsx +338 -0
  72. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/app/pluginConfig.ts +4 -0
  73. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/dialogsCustomStyle.ts +98 -0
  74. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/index.tsx +217 -0
  75. package/generator-gorilla-engine-plugin/app/templates/basic-synth/src/presetBrowserCustomStyle.ts +124 -0
  76. package/generator-gorilla-engine-plugin/app/templates/build.ugep +173 -0
  77. package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/01 - All The Way Down.preset +1 -0
  78. package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/02 - About Half.preset +1 -0
  79. package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/03 - Three Quarters.preset +1 -0
  80. package/generator-gorilla-engine-plugin/app/templates/effect/assets/Presets/Factory/Category 1/04 - All The Way Up.preset +1 -0
  81. package/generator-gorilla-engine-plugin/app/templates/effect/assets/images/Rotary.png +0 -0
  82. package/generator-gorilla-engine-plugin/app/templates/effect/assets/images/Rotary@2x.png +0 -0
  83. package/generator-gorilla-engine-plugin/app/templates/effect/assets/instruments/Reverb Example_part1.blob +0 -0
  84. package/generator-gorilla-engine-plugin/app/templates/effect/assets/instruments/Reverb Example_part2.blob +1 -0
  85. package/generator-gorilla-engine-plugin/app/templates/effect/instrument/Reverb Example.inst +73 -0
  86. package/generator-gorilla-engine-plugin/app/templates/effect/instrument/Reverb Example.txt +21 -0
  87. package/generator-gorilla-engine-plugin/app/templates/effect/src/app/Root.tsx +35 -0
  88. package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/ErrorBoundary.tsx +114 -0
  89. package/generator-gorilla-engine-plugin/app/templates/effect/src/app/components/UserInterface.tsx +85 -0
  90. package/generator-gorilla-engine-plugin/app/templates/effect/src/app/pluginConfig.ts +4 -0
  91. package/generator-gorilla-engine-plugin/app/templates/effect/src/dialogsCustomStyle.ts +101 -0
  92. package/generator-gorilla-engine-plugin/app/templates/effect/src/index.tsx +214 -0
  93. package/generator-gorilla-engine-plugin/app/templates/effect/src/presetBrowserCustomStyle.ts +124 -0
  94. package/generator-gorilla-engine-plugin/app/templates/gitignore +9 -0
  95. package/generator-gorilla-engine-plugin/app/templates/licence.txt +0 -0
  96. package/generator-gorilla-engine-plugin/app/templates/package.json +38 -0
  97. package/generator-gorilla-engine-plugin/app/templates/prettierrc +9 -0
  98. package/generator-gorilla-engine-plugin/app/templates/tsconfig.json +20 -0
  99. package/generator-gorilla-engine-plugin/package.json +17 -0
  100. package/index.js +72 -0
  101. package/package.json +42 -0
@@ -0,0 +1,149 @@
1
+ # Container Controls
2
+
3
+ ## geScrollView
4
+
5
+ Scrollable container for child components.
6
+
7
+ **JSX tag:** `<geScrollView />`
8
+ **Interfaces:** Common, Bounds, Scrollable
9
+ **Handlers:** `onScrollPositionX`, `onScrollPositionY`, `onScrollPosition`
10
+
11
+ | Prop | Type | Description |
12
+ |------|------|-------------|
13
+ | `scrollbarThickness` | `number` | Scrollbar width in pixels |
14
+ | `hideVerticalScrollbar` | `boolean` | Hide vertical scrollbar |
15
+ | `hideHorizontalScrollbar` | `boolean` | Hide horizontal scrollbar |
16
+ | `ignoreKeypressEvent` | `boolean` | Ignore keyboard events |
17
+ | `scrollbar` | `object` | `{ background?, track?, thumb? }` — color strings |
18
+
19
+ **Methods (via ref → nativeHandle):**
20
+ - `scrollChildIntoView(childIndex)` — Scroll to make a child visible
21
+ - `setScrollPositionProportionately(xPos, yPos)` — Set scroll position (0-1)
22
+
23
+ ```tsx
24
+ <geScrollView x={10} y={10} width={300} height={400}
25
+ hideHorizontalScrollbar={true}
26
+ scrollbar={{ background: 'FF222222', thumb: 'FF666666', track: 'FF333333' }}
27
+ onScrollPositionY={(pos) => setScrollY(pos)}
28
+ >
29
+ {/* Children can exceed the scroll view bounds */}
30
+ {presets.map((preset, i) => (
31
+ <geLabel key={i} x={0} y={i * 30} width={280} height={28}
32
+ text={preset.name} textColor="FFFFFF"
33
+ backgroundColor={i % 2 === 0 ? 'FF2a2a2a' : 'FF333333'}
34
+ onClick={() => loadPreset(preset)}
35
+ />
36
+ ))}
37
+ </geScrollView>
38
+ ```
39
+
40
+ ---
41
+
42
+ ## geDragContainer
43
+
44
+ Wraps content that can be dragged.
45
+
46
+ **JSX tag:** `<geDragContainer />`
47
+ **Interfaces:** Common, Bounds, Clickable
48
+ **Handlers:** ClickableHandlers, `onDragging`, `onDragStart`, `onDragEnd`
49
+
50
+ | Prop | Type | Description |
51
+ |------|------|-------------|
52
+ | `dragGroup` | `string` | Drag group ID (must match target's dragGroup) |
53
+ | `dragContent` | `string` | Data to transfer during drag |
54
+ | `externalDragStartAction` | `string` | ViewModel action on external drag start |
55
+ | `externalDragEndAction` | `string` | ViewModel action on external drag end |
56
+ | `destinationCanMoveDraggedFiles` | `boolean` | Allow destination to move files |
57
+ | `externallyDraggedFiles` | `any` | Files being dragged externally |
58
+
59
+ ```tsx
60
+ <geDragContainer x={10} y={10} width={100} height={40}
61
+ dragGroup="presets"
62
+ dragContent={JSON.stringify(presetData)}
63
+ onDragStart={() => setDragging(true)}
64
+ onDragEnd={() => setDragging(false)}
65
+ >
66
+ <geLabel x={0} y={0} width={100} height={40}
67
+ text="Drag me" backgroundColor="FF444488" textColor="FFFFFF"
68
+ />
69
+ </geDragContainer>
70
+ ```
71
+
72
+ ---
73
+
74
+ ## geDragTarget
75
+
76
+ Drop target for items from a geDragContainer.
77
+
78
+ **JSX tag:** `<geDragTarget />`
79
+ **Interfaces:** Common, Bounds, Clickable
80
+ **Handlers:** ClickableHandlers, `onItemDropped`
81
+
82
+ | Prop | Type | Description |
83
+ |------|------|-------------|
84
+ | `dragGroup` | `string` | Must match the source's dragGroup |
85
+
86
+ ```tsx
87
+ <geDragTarget x={200} y={10} width={150} height={100}
88
+ dragGroup="presets"
89
+ onItemDropped={(data) => handleDrop(data)}
90
+ >
91
+ <geLabel x={0} y={0} width={150} height={100}
92
+ text="Drop here" backgroundColor="FF334433" textColor="FFFFFF"
93
+ textAlign="center"
94
+ />
95
+ </geDragTarget>
96
+ ```
97
+
98
+ ---
99
+
100
+ ## geDropZone
101
+
102
+ Drop zone for files dragged from outside the application.
103
+
104
+ **JSX tag:** `<geDropZone />`
105
+ **Interfaces:** Common, Bounds, Clickable
106
+ **Handlers:** ClickableHandlers, `onDraggedFiles`, `onDroppedFiles`
107
+
108
+ | Prop | Type | Description |
109
+ |------|------|-------------|
110
+ | `acceptedFileTypes` | `string[] \| string` | Allowed file extensions |
111
+
112
+ ```tsx
113
+ <geDropZone x={10} y={10} width={300} height={200}
114
+ acceptedFileTypes={['.wav', '.aiff', '.mp3']}
115
+ onDraggedFiles={(files) => setDragOver(true)}
116
+ onDroppedFiles={(files) => importSamples(files)}
117
+ >
118
+ <geLabel x={0} y={0} width={300} height={200}
119
+ text="Drop audio files here"
120
+ backgroundColor={isDragOver ? 'FF445544' : 'FF333333'}
121
+ textColor="FFFFFF" textAlign="center"
122
+ />
123
+ </geDropZone>
124
+ ```
125
+
126
+ ---
127
+
128
+ ## geRubberband
129
+
130
+ Container that forwards mouse-down events to its children as if each was individually clicked. Useful for graphic EQs where the user drags across multiple sliders.
131
+
132
+ **JSX tag:** `<geRubberband />`
133
+ **Interfaces:** Common, Bounds
134
+
135
+ No additional props beyond Common and Bounds.
136
+
137
+ ```tsx
138
+ <geRubberband x={10} y={10} width={400} height={200}>
139
+ {bands.map((band, i) => (
140
+ <geSlider key={i}
141
+ x={i * 25} y={0} width={20} height={200}
142
+ direction="vertical"
143
+ min={-12} max={12} value={band.gain}
144
+ filmstrip={{ path: 'eq_slider.png', count: 64 }}
145
+ onChange={(v) => setBandGain(i, v)}
146
+ />
147
+ ))}
148
+ </geRubberband>
149
+ ```
@@ -0,0 +1,191 @@
1
+ # Editor Controls
2
+
3
+ ## geSliceEditor
4
+
5
+ Sample slice editor with grid, markers, modulation, and zoom.
6
+
7
+ **JSX tag:** `<geSliceEditor />`
8
+ **Interfaces:** Common, Bounds, Background, Clickable
9
+ **Handlers:** `onSliceAdded`, `onSliceChanged`, `onSlicesRemoved`, `onModulationChanged`, `onMarkerChanged`, `onScroll`, `onPinch`
10
+
11
+ | Prop | Type | Description |
12
+ |------|------|-------------|
13
+ | `slices` | `any` | Slice data |
14
+ | `audioLengthInSamples` | `number` | Total audio length in samples |
15
+ | `audioLengthInBeats` | `number` | Total audio length in beats |
16
+ | `minSliceSpacing` | `number` | Minimum space between slices |
17
+ | `minMarkerSpacing` | `number` | Minimum space between markers |
18
+ | `canChangeSlices` | `boolean` | Allow editing slices |
19
+ | `canAddSlices` | `boolean` | Allow adding slices |
20
+ | `canRemoveSlices` | `boolean` | Allow removing slices |
21
+ | `snapSlicesToGrid` | `boolean` | Snap slices to grid |
22
+ | `zoom` | `object` | `{ start, end, dragToZoomFactor, dragToZoomEnabled }` |
23
+ | `grid` | `object` | Grid configuration (see below) |
24
+ | `sliceStyles` | `object` | `{ normal, hover, selected }` — each with `{ y, xOffset, width, height, color, image }` |
25
+ | `selectionAreaStyle` | `object` | `{ backgroundColor, enabled, border: { width, radius, color } }` |
26
+
27
+ **Grid configuration:**
28
+ ```tsx
29
+ grid={{
30
+ position: 'top',
31
+ height: 20,
32
+ enabled: true,
33
+ backgroundColor: 'FF222222',
34
+ measures: [{ fractionOfBar: 1, enabled: true, showLabels: true, tickWidth: 1, tickHeight: 10, tickColor: 'FF666666' }],
35
+ }}
36
+ ```
37
+
38
+ **Methods (available via ref → nativeHandle):**
39
+ - `addSlice(lengthInFrames)` → `Slice`
40
+ - `removeSlice(slice)`
41
+ - `clearSlices()`
42
+ - `addMarker(config)` → `Marker`
43
+ - `removeMarker(marker)`
44
+ - `addModulation(config)` → `Modulation`
45
+ - `removeModulation(modulation)`
46
+ - `addGridMeasure(config)` → `GridMeasure`
47
+ - `getSlicesForZoneModule()` → `number[]`
48
+ - `mappedSampleChanged()`
49
+
50
+ ```tsx
51
+ <geSliceEditor x={10} y={10} width={600} height={200}
52
+ backgroundColor="FF111111"
53
+ canAddSlices={true} canRemoveSlices={true} canChangeSlices={true}
54
+ snapSlicesToGrid={true}
55
+ zoom={{ start: 0, end: 1, dragToZoomEnabled: true, dragToZoomFactor: 0.5 }}
56
+ sliceStyles={{
57
+ normal: { width: 2, color: 'FFFF4444' },
58
+ hover: { width: 3, color: 'FFFF8888' },
59
+ selected: { width: 3, color: 'FFFFFF00' },
60
+ }}
61
+ onSliceAdded={(e) => handleSliceAdded(e)}
62
+ onSliceChanged={(e) => handleSliceChanged(e)}
63
+ />
64
+ ```
65
+
66
+ ---
67
+
68
+ ## geListBox
69
+
70
+ Scrollable list with selectable items.
71
+
72
+ **JSX tag:** `<geListBox />`
73
+ **Interfaces:** Common, Bounds, Font, Clickable, Background, Scrollable, Highlight, MIDILearn
74
+ **Handlers:** `onRowClicked`
75
+
76
+ | Prop | Type | Description |
77
+ |------|------|-------------|
78
+ | `items` | `string[]` | List items |
79
+ | `horizontalMargin` | `number` | Item horizontal margin |
80
+ | `cellColor` | `string` | Background color of items |
81
+ | `cellColorSelected` | `string` | Background of selected item |
82
+ | `textColorSelected` | `string` | Text color of selected item |
83
+ | `rowDoubleClickedAction` | `string` | ViewModel action on double-click |
84
+ | `returnKeyAction` | `string` | ViewModel action on return key |
85
+ | `rowClickedAction` | `string` | ViewModel action on row click |
86
+
87
+ ```tsx
88
+ <geListBox x={10} y={10} width={200} height={300}
89
+ items={['Preset 1', 'Preset 2', 'Preset 3', 'Preset 4']}
90
+ backgroundColor="FF222222" textColor="FFCCCCCC"
91
+ cellColor="FF2a2a2a" cellColorSelected="FF4444FF"
92
+ textColorSelected="FFFFFF"
93
+ onRowClicked={(row) => loadPreset(row)}
94
+ />
95
+ ```
96
+
97
+ ---
98
+
99
+ ## geStepEditor
100
+
101
+ Step sequencer grid control.
102
+
103
+ **JSX tag:** `<geStepEditor />`
104
+ **Interfaces:** Common, Background, Bounds, Clickable
105
+ **Handlers:** ClickableHandlers
106
+
107
+ | Prop | Type | Description |
108
+ |------|------|-------------|
109
+ | `value` | `any` | Step data |
110
+ | `divSize` | `number` | Spacing between bars |
111
+ | `min` / `max` | `number` | Value range |
112
+ | `paramPath` | `string` | Instrument script path |
113
+ | `startIndex` / `endIndex` | `number` | Visible step range |
114
+ | `step` | `object` | Step appearance (see below) |
115
+
116
+ **Step configuration:**
117
+ ```tsx
118
+ step={{
119
+ width: 20, height: 40,
120
+ cornerRadius: 2,
121
+ onColor: 'FF44AAFF',
122
+ offColor: 'FF333333',
123
+ activeColor: 'FFFFFF00',
124
+ backgroundColor: 'FF1a1a1a',
125
+ }}
126
+ ```
127
+
128
+ ```tsx
129
+ <geStepEditor x={10} y={10} width={500} height={100}
130
+ backgroundColor="FF111111"
131
+ min={0} max={127}
132
+ startIndex={0} endIndex={16}
133
+ divSize={2}
134
+ step={{
135
+ width: 25, height: 80,
136
+ cornerRadius: 2,
137
+ onColor: 'FF44AAFF', offColor: 'FF333333',
138
+ }}
139
+ bindings={{ value: 'Scripts/0/StepSequencer' }}
140
+ />
141
+ ```
142
+
143
+ ---
144
+
145
+ ## geBarStepEditor
146
+
147
+ Bar-based step editor (similar to geStepEditor).
148
+
149
+ **JSX tag:** `<geBarStepEditor />`
150
+ **Interfaces:** Common, Bounds, Background, Clickable
151
+ **Handlers:** ClickableHandlers
152
+
153
+ Props are identical to geStepEditor (without `value`):
154
+ - `divSize`, `min`, `max`, `paramPath`, `startIndex`, `endIndex`, `step`
155
+
156
+ ---
157
+
158
+ ## geMappingEditor
159
+
160
+ Visual sample/zone key and velocity mapping editor.
161
+
162
+ **JSX tag:** `<geMappingEditor />`
163
+ **Interfaces:** Common, Bounds, Background, Clickable
164
+ **Handlers:** ClickableHandlers, `onSelectedZone`, `onKeyPressed`, `onChangedZone`
165
+
166
+ | Prop | Type | Description |
167
+ |------|------|-------------|
168
+ | `zones` | `Zone[]` | Array of zone objects |
169
+ | `verticalZoom` | `number` | Vertical zoom level |
170
+ | `horizontalZoom` | `number` | Horizontal zoom level |
171
+
172
+ **Zone object:**
173
+ ```typescript
174
+ { path: string, name: string, index: number,
175
+ rootKey: number, lowKey: number, highKey: number,
176
+ lowVel: number, highVel: number }
177
+ ```
178
+
179
+ **Methods (via ref → nativeHandle):**
180
+ - `refreshView(index?)` — Refresh the display
181
+ - `selectAllZones()` / `deselectAllZones()`
182
+ - `selectZones(zones)` / `addZones(zones)` / `removeZones(zones)`
183
+
184
+ ```tsx
185
+ <geMappingEditor x={10} y={10} width={600} height={300}
186
+ backgroundColor="FF222222"
187
+ zones={mappingZones}
188
+ onSelectedZone={(zone) => setSelectedZone(zone)}
189
+ onChangedZone={(zone) => handleZoneChange(zone)}
190
+ />
191
+ ```
@@ -0,0 +1,150 @@
1
+ # Event Handlers
2
+
3
+ Event handlers connect React callback props to native Gorilla Engine events.
4
+
5
+ ## ClickableHandlers
6
+
7
+ Available on most interactive components (geKnob, geSlider, geButton, geToggle, geComboBox, gePad, geLabel, geXYPad, geDragContainer, geDragTarget, geDropZone, geMappingEditor, etc.).
8
+
9
+ | React Prop | Native Event | Signature |
10
+ |------------|-------------|-----------|
11
+ | `onClick` | `click` | `(args) => void` |
12
+ | `onClickWithInfo` | `clickWithInfo` | `(args) => void` — includes hit-test info |
13
+ | `onDoubleClick` | `doubleClick` | `(args) => void` |
14
+ | `onMouseUp` | `mouseUp` | `(args) => void` |
15
+ | `onMouseDown` | `mouseDown` | `(args) => void` |
16
+ | `onMouseDownWithInfo` | `mouseDownWithInfo` | `(args) => void` — includes hit-test info |
17
+ | `onMouseDrag` | `mouseDrag` | `(args) => void` |
18
+ | `onMouseEnter` | `mouseEnter` | `(args) => void` |
19
+ | `onMouseExit` | `mouseExit` | `(args) => void` |
20
+
21
+ ```tsx
22
+ <geLabel
23
+ x={0} y={0} width={100} height={40}
24
+ text="Click me"
25
+ onClick={() => console.log('clicked')}
26
+ onMouseEnter={() => console.log('hover')}
27
+ />
28
+ ```
29
+
30
+ ## KeyableHandlers
31
+
32
+ Available on geButton, geLabel, geLottieAnimation.
33
+
34
+ | React Prop | Native Event | Signature |
35
+ |------------|-------------|-----------|
36
+ | `onKeyPressed` | `keyPressed` | `(args) => void` |
37
+
38
+ ```tsx
39
+ <geButton
40
+ x={0} y={0} width={100} height={30}
41
+ text="Press Enter"
42
+ wantsKeyboardFocus={true}
43
+ onKeyPressed={(e) => console.log('key:', e)}
44
+ />
45
+ ```
46
+
47
+ ## Component-Specific Handlers
48
+
49
+ ### geKnob / geSlider — `onChange`
50
+ Maps to native `value` event. Fires when the control value changes.
51
+
52
+ ```tsx
53
+ <geKnob
54
+ x={0} y={0} width={60} height={60}
55
+ min={0} max={100} value={50}
56
+ onChange={(value) => console.log('new value:', value)}
57
+ />
58
+ ```
59
+
60
+ ### geToggle — `onChange`
61
+ Maps to native `value` event. Receives a boolean.
62
+
63
+ ```tsx
64
+ <geToggle
65
+ x={0} y={0} width={60} height={30}
66
+ value={false}
67
+ onChange={(isOn: boolean) => console.log('toggled:', isOn)}
68
+ />
69
+ ```
70
+
71
+ ### geComboBox — `onChange`
72
+ Maps to native `value` event. Receives the selected index.
73
+
74
+ ```tsx
75
+ <geComboBox
76
+ x={0} y={0} width={150} height={30}
77
+ items={['Option A', 'Option B', 'Option C']}
78
+ value={0}
79
+ onChange={(index: number) => console.log('selected:', index)}
80
+ />
81
+ ```
82
+
83
+ ### geTextBox — `onChange` / `onFocusLost`
84
+ - `onChange` maps to native `text` event (fires on each change)
85
+ - `onFocusLost` maps to native `focusLost` event
86
+
87
+ ```tsx
88
+ <geTextBox
89
+ x={0} y={0} width={200} height={30}
90
+ text="Hello"
91
+ onChange={(text: string) => console.log('text:', text)}
92
+ onFocusLost={(text: string) => console.log('committed:', text)}
93
+ />
94
+ ```
95
+
96
+ ### geScrollView — Scroll position handlers
97
+
98
+ | React Prop | Native Event |
99
+ |------------|-------------|
100
+ | `onScrollPositionX` | `scrollPositionX` |
101
+ | `onScrollPositionY` | `scrollPositionY` |
102
+ | `onScrollPosition` | `scrollPosition` |
103
+
104
+ ### geSliceEditor — Slice/modulation handlers
105
+
106
+ | React Prop | Native Event |
107
+ |------------|-------------|
108
+ | `onSliceAdded` | `sliceAdded` |
109
+ | `onSliceChanged` | `sliceChanged` |
110
+ | `onSlicesRemoved` | `slicesRemoved` |
111
+ | `onModulationChanged` | `modulationChanged` |
112
+ | `onMarkerChanged` | `markerChanged` |
113
+ | `onScroll` | `scroll` |
114
+ | `onPinch` | `pinch` |
115
+
116
+ ### geWaveform — `onDragzonePositionChanged`
117
+ Maps to native `dragzonePosition` event.
118
+
119
+ ### geListBox — `onRowClicked`
120
+ Maps to native `rowClicked` event.
121
+
122
+ ### geDragContainer — Drag handlers
123
+
124
+ | React Prop | Native Event |
125
+ |------------|-------------|
126
+ | `onDragging` | `dragPosition` |
127
+ | `onDragStart` | `dragStarted` |
128
+ | `onDragEnd` | `dragEnded` |
129
+
130
+ ### geDragTarget — `onItemDropped`
131
+ Maps to native `drop` event.
132
+
133
+ ### geDropZone — File drop handlers
134
+
135
+ | React Prop | Native Event |
136
+ |------------|-------------|
137
+ | `onDraggedFiles` | `draggedFiles` |
138
+ | `onDroppedFiles` | `droppedFiles` |
139
+
140
+ ### geMappingEditor — Zone/key handlers
141
+
142
+ | React Prop | Native Event |
143
+ |------------|-------------|
144
+ | `onSelectedZone` | `zoneSelected` |
145
+ | `onKeyPressed` | `keyPressed` |
146
+ | `onChangedZone` | `zoneChanged` |
147
+
148
+ ## Event Handler Update Behavior
149
+
150
+ When a handler prop changes between renders, the reconciler updates the stored callback reference without detaching/re-attaching the native event listener. The native event dispatches to the latest callback.
@@ -0,0 +1,143 @@
1
+ # Getting Started
2
+
3
+ ## Entry Points
4
+
5
+ ### `createUI(app, width?, height?, options?)` — Pure React UI
6
+ Creates a native window and mounts the React tree. No YAML needed.
7
+
8
+ ```tsx
9
+ import { createUI } from 'gorilla-engine-react';
10
+
11
+ createUI(<App />, 1280, 760);
12
+ createUI(<App />, 800, 600, { rootNodeId: 'myRoot', logger: myLogger });
13
+ ```
14
+
15
+ **Parameters:**
16
+ - `app` — Root React element
17
+ - `width` — Window width in pixels (default: `1280`)
18
+ - `height` — Window height in pixels (default: `760`)
19
+ - `options.rootNodeId` — ID for root window (default: `"root"`)
20
+ - `options.logger` — Custom `{ error, info }` logger
21
+
22
+ ### `loadUI(app, ymlPath?, rootNodeId?, logger?)` — YAML + React
23
+ Loads a YAML layout file, then mounts React into a container node.
24
+
25
+ ```tsx
26
+ import { loadUI } from 'gorilla-engine-react';
27
+
28
+ // Uses default: <resourcePath>/<pluginName>.yaml, rootNodeId='root'
29
+ loadUI(<App />);
30
+
31
+ // Custom path and root node
32
+ loadUI(<App />, '/path/to/layout.yaml', 'myContainer');
33
+ ```
34
+
35
+ **Parameters:**
36
+ - `app` — Root React element
37
+ - `ymlPath` — Path to YAML layout (default: `<resourcePath>/<pluginName>.yaml`)
38
+ - `rootNodeId` — ID of the container node in the YAML (default: `'root'`)
39
+ - `logger` — Custom logger
40
+
41
+ ### `render(reactElement, container, callback?)` — Low-level
42
+ Direct mount into an existing native container. Prefer `loadUI`/`createUI`.
43
+
44
+ ## Hooks
45
+
46
+ ### `useInstrument(overrideBlobPath?, options?)`
47
+
48
+ Loads a blob and its first instrument, optionally setting it as active. Returns a tuple:
49
+
50
+ ```tsx
51
+ const [instrument, instrumentName, blob, setBlobPath] = useInstrument();
52
+ ```
53
+
54
+ **Parameters:**
55
+ - `overrideBlobPath` — Custom path to a `.blob` file. Defaults to `<resourcePath>/<pluginName>_part1.blob`.
56
+ - `options.setActive` — Whether to call `GorillaEngine.setActiveInstrument()`. Defaults to `true`.
57
+
58
+ **Return tuple:**
59
+ | Index | Type | Description |
60
+ |-------|------|-------------|
61
+ | 0 | `Instrument \| null` | The loaded instrument |
62
+ | 1 | `string` | Current instrument name (first in blob) |
63
+ | 2 | `Blob \| null` | The loaded blob |
64
+ | 3 | `(path: string) => void` | Setter to change blob path (triggers reload) |
65
+
66
+ ### `useInstrumentProperty(instrument, propName)`
67
+
68
+ Subscribes to a single instrument property with reactive updates.
69
+
70
+ ```tsx
71
+ const [prop, setValue, setNormValue] = useInstrumentProperty(instrument, 'Volume');
72
+
73
+ // prop contains: { value, normValue, text, name, label, unit, minValue, maxValue,
74
+ // numSteps, steps, defaultValue, resolution, key, category,
75
+ // persistence, controlType, normValueAsync, valueAsync }
76
+
77
+ // Set absolute value
78
+ setValue(0.75);
79
+
80
+ // Set normalized value (0-1)
81
+ setNormValue(0.5);
82
+ ```
83
+
84
+ **Return tuple:**
85
+ | Index | Type | Description |
86
+ |-------|------|-------------|
87
+ | 0 | `InstrumentProperty` | Current property state (reactive) |
88
+ | 1 | `(value: number) => void` | Set denormalized value |
89
+ | 2 | `(value: number) => void` | Set normalized value (0–1) |
90
+
91
+ ## Typical App Structure
92
+
93
+ ```tsx
94
+ import { createUI, useInstrument, useInstrumentProperty } from 'gorilla-engine-react';
95
+
96
+ function App() {
97
+ const [instrument, instrumentName, blob] = useInstrument();
98
+ if (!instrument) return <geLabel text="Loading..." x={0} y={0} width={200} height={30} />;
99
+ return <MainUI instrument={instrument} />;
100
+ }
101
+
102
+ function MainUI({ instrument }: { instrument: GorillaEngine.Runtime.Instrument }) {
103
+ return (
104
+ <geLabel x={0} y={0} width={800} height={600} backgroundColor="FF1a1a2e">
105
+ <VolumeKnob instrument={instrument} />
106
+ <PanKnob instrument={instrument} />
107
+ </geLabel>
108
+ );
109
+ }
110
+
111
+ function VolumeKnob({ instrument }) {
112
+ const [vol, setVol] = useInstrumentProperty(instrument, 'Volume');
113
+ return (
114
+ <>
115
+ <geKnob
116
+ x={50} y={50} width={60} height={60}
117
+ min={vol.minValue} max={vol.maxValue} value={vol.value}
118
+ onChange={setVol}
119
+ filmstrip={{ path: 'assets/knob.png', count: 128 }}
120
+ />
121
+ <geLabel x={50} y={115} width={60} height={16}
122
+ text={vol.text} textColor="FFFFFF" textAlign="center" fontSize={11}
123
+ />
124
+ </>
125
+ );
126
+ }
127
+
128
+ createUI(<App />, 800, 600);
129
+ ```
130
+
131
+ ## GorillaEngine Global API
132
+
133
+ Key utility functions available at runtime (see [gorilla-engine-api.md](./gorilla-engine-api.md) for the full reference):
134
+
135
+ ```typescript
136
+ GorillaEngine.getResourcePath() // Platform-specific resource path
137
+ GorillaEngine.getPluginName() // Plugin name string
138
+ GorillaEngine.loadBlob(path) // Load a .blob file → Blob
139
+ GorillaEngine.setActiveInstrument(i) // Route MIDI/audio to instrument
140
+ GorillaEngine.openURLinBrowser(url) // Open URL in system browser
141
+ GorillaEngine.openFileChooser(config) // Native file picker dialog
142
+ GorillaEngine.checkLicense() // Check Codemeter license
143
+ ```