@antimatter-audio/antimatter-ui 10.14.1 → 10.15.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/dist/index.js +593 -187
- package/dist/index.js.map +1 -1
- package/dist/src/advanced/LFOVisualizer/LFOVisualizer.d.ts.map +1 -1
- package/dist/src/advanced/LFOVisualizer/utils.d.ts +2 -3
- package/dist/src/advanced/LFOVisualizer/utils.d.ts.map +1 -1
- package/dist/src/advanced/ModuleFooter/LFO.d.ts.map +1 -1
- package/dist/src/advanced/ModuleFooter/SeqTab.d.ts.map +1 -1
- package/dist/src/advanced/Oscilloscope/LinePlot.d.ts +2 -1
- package/dist/src/advanced/Oscilloscope/LinePlot.d.ts.map +1 -1
- package/dist/src/common/utils.d.ts +4 -2
- package/dist/src/common/utils.d.ts.map +1 -1
- package/dist/src/context/GlobalContextProvider.d.ts.map +1 -1
- package/dist/src/core/Slider/RotarySlider.d.ts.map +1 -1
- package/dist/src/hooks/useDropdown.d.ts.map +1 -1
- package/dist/src/hooks/useSlider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -159,12 +159,12 @@ var ButtonType = /*#__PURE__*/ function(ButtonType) {
|
|
|
159
159
|
return ButtonType;
|
|
160
160
|
}({});
|
|
161
161
|
|
|
162
|
-
function _array_like_to_array$
|
|
162
|
+
function _array_like_to_array$h(arr, len) {
|
|
163
163
|
if (len == null || len > arr.length) len = arr.length;
|
|
164
164
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
165
165
|
return arr2;
|
|
166
166
|
}
|
|
167
|
-
function _array_with_holes$
|
|
167
|
+
function _array_with_holes$g(arr) {
|
|
168
168
|
if (Array.isArray(arr)) return arr;
|
|
169
169
|
}
|
|
170
170
|
function _define_property$k(obj, key, value) {
|
|
@@ -180,7 +180,7 @@ function _define_property$k(obj, key, value) {
|
|
|
180
180
|
}
|
|
181
181
|
return obj;
|
|
182
182
|
}
|
|
183
|
-
function _iterable_to_array_limit$
|
|
183
|
+
function _iterable_to_array_limit$g(arr, i) {
|
|
184
184
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
185
185
|
if (_i == null) return;
|
|
186
186
|
var _arr = [];
|
|
@@ -204,7 +204,7 @@ function _iterable_to_array_limit$f(arr, i) {
|
|
|
204
204
|
}
|
|
205
205
|
return _arr;
|
|
206
206
|
}
|
|
207
|
-
function _non_iterable_rest$
|
|
207
|
+
function _non_iterable_rest$g() {
|
|
208
208
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
209
209
|
}
|
|
210
210
|
function _object_spread$k(target) {
|
|
@@ -222,16 +222,16 @@ function _object_spread$k(target) {
|
|
|
222
222
|
}
|
|
223
223
|
return target;
|
|
224
224
|
}
|
|
225
|
-
function _sliced_to_array$
|
|
226
|
-
return _array_with_holes$
|
|
225
|
+
function _sliced_to_array$g(arr, i) {
|
|
226
|
+
return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$g();
|
|
227
227
|
}
|
|
228
|
-
function _unsupported_iterable_to_array$
|
|
228
|
+
function _unsupported_iterable_to_array$h(o, minLen) {
|
|
229
229
|
if (!o) return;
|
|
230
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
230
|
+
if (typeof o === "string") return _array_like_to_array$h(o, minLen);
|
|
231
231
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
232
232
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
233
233
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
234
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
234
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
|
|
235
235
|
}
|
|
236
236
|
function Button(param) {
|
|
237
237
|
var disabled = param.disabled, text = param.text, id = param.id, className = param.className, style = param.style, onClick = param.onClick, children = param.children, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -239,7 +239,7 @@ function Button(param) {
|
|
|
239
239
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
240
240
|
Spacing.none
|
|
241
241
|
] : _param_margin, _param_type = param.type, type = _param_type === void 0 ? ButtonType.latch : _param_type, _param_size = param.size, size = _param_size === void 0 ? ButtonSize.large : _param_size;
|
|
242
|
-
var _React_useState = _sliced_to_array$
|
|
242
|
+
var _React_useState = _sliced_to_array$g(React__default.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
243
243
|
var buttonState = Juce.getToggleState(id);
|
|
244
244
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
245
245
|
// Update the local state when the ID changes
|
|
@@ -357,13 +357,13 @@ function useObservable(param) {
|
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
function _array_like_to_array$
|
|
360
|
+
function _array_like_to_array$g(arr, len) {
|
|
361
361
|
if (len == null || len > arr.length) len = arr.length;
|
|
362
362
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
363
363
|
return arr2;
|
|
364
364
|
}
|
|
365
365
|
function _array_without_holes$1(arr) {
|
|
366
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
366
|
+
if (Array.isArray(arr)) return _array_like_to_array$g(arr);
|
|
367
367
|
}
|
|
368
368
|
function _iterable_to_array$1(iter) {
|
|
369
369
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
@@ -372,15 +372,15 @@ function _non_iterable_spread$1() {
|
|
|
372
372
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
373
373
|
}
|
|
374
374
|
function _to_consumable_array$1(arr) {
|
|
375
|
-
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$
|
|
375
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$1();
|
|
376
376
|
}
|
|
377
|
-
function _unsupported_iterable_to_array$
|
|
377
|
+
function _unsupported_iterable_to_array$g(o, minLen) {
|
|
378
378
|
if (!o) return;
|
|
379
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
379
|
+
if (typeof o === "string") return _array_like_to_array$g(o, minLen);
|
|
380
380
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
381
381
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
382
382
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
383
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
383
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
|
|
384
384
|
}
|
|
385
385
|
// export const roundUpToTwoDecimals = (val: number) => Math.ceil(val * 100) / 100;
|
|
386
386
|
// mocks the `normalisedToScaledValue` internal method from JUCE
|
|
@@ -394,9 +394,8 @@ function normalisedToScaled(param) {
|
|
|
394
394
|
// mocks the `getnormalisedValue` method from JUCE
|
|
395
395
|
// This will allow us to test the JS UI without needing access to the JUCE backend
|
|
396
396
|
function scaledToNormalised(param) {
|
|
397
|
-
var scaledValue = param.scaledValue,
|
|
398
|
-
|
|
399
|
-
return Math.pow((scaledValue - start) / (end - start), skew);
|
|
397
|
+
var scaledValue = param.scaledValue, start = param.start, end = param.end, skew = param.skew;
|
|
398
|
+
return Math.pow((scaledValue - start) / (end - start), skew !== null && skew !== void 0 ? skew : 1);
|
|
400
399
|
}
|
|
401
400
|
var decimalToPercent = function(decimal) {
|
|
402
401
|
return Math.round(100 * (typeof decimal === 'string' ? parseFloat(decimal) : decimal));
|
|
@@ -496,12 +495,12 @@ var randomizeValue = function(min, max) {
|
|
|
496
495
|
return Math.random() * (max - min) + min;
|
|
497
496
|
};
|
|
498
497
|
|
|
499
|
-
function _array_like_to_array$
|
|
498
|
+
function _array_like_to_array$f(arr, len) {
|
|
500
499
|
if (len == null || len > arr.length) len = arr.length;
|
|
501
500
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
502
501
|
return arr2;
|
|
503
502
|
}
|
|
504
|
-
function _array_with_holes$
|
|
503
|
+
function _array_with_holes$f(arr) {
|
|
505
504
|
if (Array.isArray(arr)) return arr;
|
|
506
505
|
}
|
|
507
506
|
function _define_property$j(obj, key, value) {
|
|
@@ -517,7 +516,7 @@ function _define_property$j(obj, key, value) {
|
|
|
517
516
|
}
|
|
518
517
|
return obj;
|
|
519
518
|
}
|
|
520
|
-
function _iterable_to_array_limit$
|
|
519
|
+
function _iterable_to_array_limit$f(arr, i) {
|
|
521
520
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
522
521
|
if (_i == null) return;
|
|
523
522
|
var _arr = [];
|
|
@@ -541,7 +540,7 @@ function _iterable_to_array_limit$e(arr, i) {
|
|
|
541
540
|
}
|
|
542
541
|
return _arr;
|
|
543
542
|
}
|
|
544
|
-
function _non_iterable_rest$
|
|
543
|
+
function _non_iterable_rest$f() {
|
|
545
544
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
546
545
|
}
|
|
547
546
|
function _object_spread$j(target) {
|
|
@@ -578,16 +577,16 @@ function _object_spread_props$4(target, source) {
|
|
|
578
577
|
}
|
|
579
578
|
return target;
|
|
580
579
|
}
|
|
581
|
-
function _sliced_to_array$
|
|
582
|
-
return _array_with_holes$
|
|
580
|
+
function _sliced_to_array$f(arr, i) {
|
|
581
|
+
return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$f();
|
|
583
582
|
}
|
|
584
|
-
function _unsupported_iterable_to_array$
|
|
583
|
+
function _unsupported_iterable_to_array$f(o, minLen) {
|
|
585
584
|
if (!o) return;
|
|
586
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
585
|
+
if (typeof o === "string") return _array_like_to_array$f(o, minLen);
|
|
587
586
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
588
587
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
589
588
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
590
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
589
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
|
|
591
590
|
}
|
|
592
591
|
// Initial state
|
|
593
592
|
var defaultGlobalStateValue = {
|
|
@@ -672,7 +671,7 @@ function useGlobalContext(selector) {
|
|
|
672
671
|
// Context provider
|
|
673
672
|
function GlobalContextProvider(param) {
|
|
674
673
|
var children = param.children;
|
|
675
|
-
var _useReducer = _sliced_to_array$
|
|
674
|
+
var _useReducer = _sliced_to_array$f(useReducer(reducer, defaultGlobalStateValue), 2), state = _useReducer[0], dispatch = _useReducer[1];
|
|
676
675
|
var highlightedItemChanged = useCallback(function(highlightedItem) {
|
|
677
676
|
dispatch({
|
|
678
677
|
type: 'HIGHLIGHTED_ITEM_CHANGED',
|
|
@@ -744,10 +743,13 @@ function GlobalContextProvider(param) {
|
|
|
744
743
|
var defaultValue = state === null || state === void 0 ? void 0 : state.defaultParamValues[paramIndex];
|
|
745
744
|
var parameterType = state === null || state === void 0 ? void 0 : state.parameterTypes[paramIndex];
|
|
746
745
|
if (parameterType === 'slider') {
|
|
746
|
+
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2;
|
|
747
747
|
var sliderState = Juce.getSliderState(id);
|
|
748
748
|
var normalisedDefaultValue = scaledToNormalised({
|
|
749
749
|
scaledValue: defaultValue,
|
|
750
|
-
|
|
750
|
+
start: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.start,
|
|
751
|
+
end: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties1 = sliderState.properties) === null || _sliderState_properties1 === void 0 ? void 0 : _sliderState_properties1.end,
|
|
752
|
+
skew: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties2 = sliderState.properties) === null || _sliderState_properties2 === void 0 ? void 0 : _sliderState_properties2.skew
|
|
751
753
|
});
|
|
752
754
|
sliderState.setNormalisedValue(normalisedDefaultValue);
|
|
753
755
|
}
|
|
@@ -780,15 +782,15 @@ function GlobalContextProvider(param) {
|
|
|
780
782
|
}, children);
|
|
781
783
|
}
|
|
782
784
|
|
|
783
|
-
function _array_like_to_array$
|
|
785
|
+
function _array_like_to_array$e(arr, len) {
|
|
784
786
|
if (len == null || len > arr.length) len = arr.length;
|
|
785
787
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
786
788
|
return arr2;
|
|
787
789
|
}
|
|
788
|
-
function _array_with_holes$
|
|
790
|
+
function _array_with_holes$e(arr) {
|
|
789
791
|
if (Array.isArray(arr)) return arr;
|
|
790
792
|
}
|
|
791
|
-
function _iterable_to_array_limit$
|
|
793
|
+
function _iterable_to_array_limit$e(arr, i) {
|
|
792
794
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
793
795
|
if (_i == null) return;
|
|
794
796
|
var _arr = [];
|
|
@@ -812,26 +814,26 @@ function _iterable_to_array_limit$d(arr, i) {
|
|
|
812
814
|
}
|
|
813
815
|
return _arr;
|
|
814
816
|
}
|
|
815
|
-
function _non_iterable_rest$
|
|
817
|
+
function _non_iterable_rest$e() {
|
|
816
818
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
817
819
|
}
|
|
818
|
-
function _sliced_to_array$
|
|
819
|
-
return _array_with_holes$
|
|
820
|
+
function _sliced_to_array$e(arr, i) {
|
|
821
|
+
return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$e();
|
|
820
822
|
}
|
|
821
|
-
function _unsupported_iterable_to_array$
|
|
823
|
+
function _unsupported_iterable_to_array$e(o, minLen) {
|
|
822
824
|
if (!o) return;
|
|
823
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
825
|
+
if (typeof o === "string") return _array_like_to_array$e(o, minLen);
|
|
824
826
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
825
827
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
826
828
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
827
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
829
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
|
|
828
830
|
}
|
|
829
831
|
var useDropdown = function(param) {
|
|
830
832
|
var id = param.id, label = param.label, _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, filter = param.filter, onChange = param.onChange, _param_displayValInHeader = param.displayValInHeader, displayValInHeader = _param_displayValInHeader === void 0 ? true : _param_displayValInHeader;
|
|
831
833
|
var _properties_choices;
|
|
832
834
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
833
|
-
var _useState = _sliced_to_array$
|
|
834
|
-
var _useState1 = _sliced_to_array$
|
|
835
|
+
var _useState = _sliced_to_array$e(useState(comboBoxState.getChoiceIndex()), 2), index = _useState[0], setIndex = _useState[1];
|
|
836
|
+
var _useState1 = _sliced_to_array$e(useState(comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
835
837
|
var setHighlightedItem = useGlobalContext().setHighlightedItem;
|
|
836
838
|
var choices = items.length ? items : (properties === null || properties === void 0 ? void 0 : (_properties_choices = properties.choices) === null || _properties_choices === void 0 ? void 0 : _properties_choices.length) ? properties === null || properties === void 0 ? void 0 : properties.choices : [];
|
|
837
839
|
var filteredChoices = filter ? choices === null || choices === void 0 ? void 0 : choices.filter(function(item) {
|
|
@@ -866,6 +868,7 @@ var useDropdown = function(param) {
|
|
|
866
868
|
useEffect(function() {
|
|
867
869
|
var valueListenerId = comboBoxState.valueChangedEvent.addListener(function() {
|
|
868
870
|
setIndex(comboBoxState.getChoiceIndex());
|
|
871
|
+
console.log(id, comboBoxState.getChoiceIndex(), 'IDDDIDIDIDIDIDIin dropdown');
|
|
869
872
|
});
|
|
870
873
|
var propertiesListenerId = comboBoxState.propertiesChangedEvent.addListener(function() {
|
|
871
874
|
setProperties(comboBoxState.properties);
|
|
@@ -1205,12 +1208,12 @@ function Dropdown(param) {
|
|
|
1205
1208
|
var css_248z$7 = ".TextInput {\n pointer-events: auto;\n /* font-size: var(--text-xs); */\n}\n\n.TextInput::-moz-selection {\n background: transparent;\n}\n.TextInput::selection {\n background: transparent;\n}\n\n.TextInput.is-highlighted {\n background: var(--color-gray-600);\n border: 1px solid var(--color-gray-500);\n}\n";
|
|
1206
1209
|
styleInject(css_248z$7);
|
|
1207
1210
|
|
|
1208
|
-
function _array_like_to_array$
|
|
1211
|
+
function _array_like_to_array$d(arr, len) {
|
|
1209
1212
|
if (len == null || len > arr.length) len = arr.length;
|
|
1210
1213
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1211
1214
|
return arr2;
|
|
1212
1215
|
}
|
|
1213
|
-
function _array_with_holes$
|
|
1216
|
+
function _array_with_holes$d(arr) {
|
|
1214
1217
|
if (Array.isArray(arr)) return arr;
|
|
1215
1218
|
}
|
|
1216
1219
|
function _define_property$f(obj, key, value) {
|
|
@@ -1226,7 +1229,7 @@ function _define_property$f(obj, key, value) {
|
|
|
1226
1229
|
}
|
|
1227
1230
|
return obj;
|
|
1228
1231
|
}
|
|
1229
|
-
function _iterable_to_array_limit$
|
|
1232
|
+
function _iterable_to_array_limit$d(arr, i) {
|
|
1230
1233
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1231
1234
|
if (_i == null) return;
|
|
1232
1235
|
var _arr = [];
|
|
@@ -1250,7 +1253,7 @@ function _iterable_to_array_limit$c(arr, i) {
|
|
|
1250
1253
|
}
|
|
1251
1254
|
return _arr;
|
|
1252
1255
|
}
|
|
1253
|
-
function _non_iterable_rest$
|
|
1256
|
+
function _non_iterable_rest$d() {
|
|
1254
1257
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1255
1258
|
}
|
|
1256
1259
|
function _object_spread$f(target) {
|
|
@@ -1268,16 +1271,16 @@ function _object_spread$f(target) {
|
|
|
1268
1271
|
}
|
|
1269
1272
|
return target;
|
|
1270
1273
|
}
|
|
1271
|
-
function _sliced_to_array$
|
|
1272
|
-
return _array_with_holes$
|
|
1274
|
+
function _sliced_to_array$d(arr, i) {
|
|
1275
|
+
return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$d();
|
|
1273
1276
|
}
|
|
1274
|
-
function _unsupported_iterable_to_array$
|
|
1277
|
+
function _unsupported_iterable_to_array$d(o, minLen) {
|
|
1275
1278
|
if (!o) return;
|
|
1276
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1279
|
+
if (typeof o === "string") return _array_like_to_array$d(o, minLen);
|
|
1277
1280
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1278
1281
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1279
1282
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1280
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1283
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
|
|
1281
1284
|
}
|
|
1282
1285
|
// import { decimalToPercent, percentToDecimal } from '../../common/utils';
|
|
1283
1286
|
// import debounce from 'lodash.debounce';
|
|
@@ -1289,9 +1292,9 @@ var InputTypes = /*#__PURE__*/ function(InputTypes) {
|
|
|
1289
1292
|
function Input(param) {
|
|
1290
1293
|
var onComplete = param.onComplete, value = param.value; param.min; param.max; var _param_fontSize = param.fontSize, fontSize = _param_fontSize === void 0 ? FontSizes.xSmall : _param_fontSize, style = param.style, className = param.className, id = param.id, _param_textColor = param.textColor, textColor = _param_textColor === void 0 ? 'var(--color-text)' : _param_textColor;
|
|
1291
1294
|
var _inputRef_current;
|
|
1292
|
-
var _useState = _sliced_to_array$
|
|
1295
|
+
var _useState = _sliced_to_array$d(useState(value), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
1293
1296
|
// const [hasError, setHasError] = useState<boolean>(false);
|
|
1294
|
-
var _useState1 = _sliced_to_array$
|
|
1297
|
+
var _useState1 = _sliced_to_array$d(useState(false), 2), isHighlighted = _useState1[0], setIsHighlighted = _useState1[1];
|
|
1295
1298
|
var valueRef = useRef(null);
|
|
1296
1299
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
1297
1300
|
// Sets up listeners to handle changes on the backend
|
|
@@ -1435,15 +1438,15 @@ var SliderType = /*#__PURE__*/ function(SliderType) {
|
|
|
1435
1438
|
return SliderType;
|
|
1436
1439
|
}({});
|
|
1437
1440
|
|
|
1438
|
-
function _array_like_to_array$
|
|
1441
|
+
function _array_like_to_array$c(arr, len) {
|
|
1439
1442
|
if (len == null || len > arr.length) len = arr.length;
|
|
1440
1443
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1441
1444
|
return arr2;
|
|
1442
1445
|
}
|
|
1443
|
-
function _array_with_holes$
|
|
1446
|
+
function _array_with_holes$c(arr) {
|
|
1444
1447
|
if (Array.isArray(arr)) return arr;
|
|
1445
1448
|
}
|
|
1446
|
-
function _iterable_to_array_limit$
|
|
1449
|
+
function _iterable_to_array_limit$c(arr, i) {
|
|
1447
1450
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1448
1451
|
if (_i == null) return;
|
|
1449
1452
|
var _arr = [];
|
|
@@ -1467,19 +1470,19 @@ function _iterable_to_array_limit$b(arr, i) {
|
|
|
1467
1470
|
}
|
|
1468
1471
|
return _arr;
|
|
1469
1472
|
}
|
|
1470
|
-
function _non_iterable_rest$
|
|
1473
|
+
function _non_iterable_rest$c() {
|
|
1471
1474
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1472
1475
|
}
|
|
1473
|
-
function _sliced_to_array$
|
|
1474
|
-
return _array_with_holes$
|
|
1476
|
+
function _sliced_to_array$c(arr, i) {
|
|
1477
|
+
return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$c();
|
|
1475
1478
|
}
|
|
1476
|
-
function _unsupported_iterable_to_array$
|
|
1479
|
+
function _unsupported_iterable_to_array$c(o, minLen) {
|
|
1477
1480
|
if (!o) return;
|
|
1478
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1481
|
+
if (typeof o === "string") return _array_like_to_array$c(o, minLen);
|
|
1479
1482
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1480
1483
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1481
1484
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1482
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1485
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
|
|
1483
1486
|
}
|
|
1484
1487
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
1485
1488
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
@@ -1528,14 +1531,14 @@ var useSlider = function(param) {
|
|
|
1528
1531
|
* AudioProcessorParameter::getValue() (C++).
|
|
1529
1532
|
*/ // See https://github.com/juce-framework/JUCE/blob/51d11a2be6d5c97ccf12b4e5e827006e19f0555a/modules/juce_gui_extra/native/javascript/index.js#L230C1-L238C6
|
|
1530
1533
|
// NOTE: We can think of this as a percentage value, in 0 to 1 format
|
|
1531
|
-
var _useState = _sliced_to_array$
|
|
1534
|
+
var _useState = _sliced_to_array$c(useState(0), 2), scaledValue = _useState[0], setScaledValue = _useState[1];
|
|
1532
1535
|
// const [normalisedValue, setNormalisedValue] = useState(0);
|
|
1533
|
-
var _useState1 = _sliced_to_array$
|
|
1536
|
+
var _useState1 = _sliced_to_array$c(useState(), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
1534
1537
|
var scaledValueRef = useRef(null);
|
|
1535
1538
|
var normalisedValueRef = useRef(null);
|
|
1536
1539
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1537
1540
|
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged, setDefaultParameter = _useGlobalContext.setDefaultParameter;
|
|
1538
|
-
var _useState2 = _sliced_to_array$
|
|
1541
|
+
var _useState2 = _sliced_to_array$c(useState(false), 2), isActive = _useState2[0], setIsActive = _useState2[1];
|
|
1539
1542
|
useEffect(function() {
|
|
1540
1543
|
document.addEventListener('click', clickListener);
|
|
1541
1544
|
document.addEventListener('keydown', keyDownListener);
|
|
@@ -1552,11 +1555,13 @@ var useSlider = function(param) {
|
|
|
1552
1555
|
useEffect(function() {
|
|
1553
1556
|
var sliderState = Juce.getSliderState(id);
|
|
1554
1557
|
var setRandom = function() {
|
|
1555
|
-
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2, _sliderState_properties3;
|
|
1558
|
+
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2, _sliderState_properties3, _sliderState_properties4, _sliderState_properties5, _sliderState_properties6;
|
|
1556
1559
|
var randomValue = randomizeValue(sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.start, sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties1 = sliderState.properties) === null || _sliderState_properties1 === void 0 ? void 0 : _sliderState_properties1.end);
|
|
1557
1560
|
var newValue = (sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties2 = sliderState.properties) === null || _sliderState_properties2 === void 0 ? void 0 : _sliderState_properties2.start) === 0 && (sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties3 = sliderState.properties) === null || _sliderState_properties3 === void 0 ? void 0 : _sliderState_properties3.end) === 1 ? randomValue : scaledToNormalised({
|
|
1558
1561
|
scaledValue: randomValue,
|
|
1559
|
-
|
|
1562
|
+
start: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties4 = sliderState.properties) === null || _sliderState_properties4 === void 0 ? void 0 : _sliderState_properties4.start,
|
|
1563
|
+
end: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties5 = sliderState.properties) === null || _sliderState_properties5 === void 0 ? void 0 : _sliderState_properties5.end,
|
|
1564
|
+
skew: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties6 = sliderState.properties) === null || _sliderState_properties6 === void 0 ? void 0 : _sliderState_properties6.skew
|
|
1560
1565
|
});
|
|
1561
1566
|
setNormalisedState(newValue);
|
|
1562
1567
|
};
|
|
@@ -1574,6 +1579,21 @@ var useSlider = function(param) {
|
|
|
1574
1579
|
normalisedValueRef.current = mockInitialNormalisedValue;
|
|
1575
1580
|
}
|
|
1576
1581
|
}, []);
|
|
1582
|
+
// Update the local state from JUCE
|
|
1583
|
+
var updateLocalState = function(sliderState) {
|
|
1584
|
+
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
1585
|
+
var scaledValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getScaledValue();
|
|
1586
|
+
var scaledValue = parseFloat(scaledValueFromState.toFixed(2));
|
|
1587
|
+
normalisedValueRef.current = parseFloat(normalisedValueFromState.toFixed(2));
|
|
1588
|
+
setScaledValue(scaledValue);
|
|
1589
|
+
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1590
|
+
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1591
|
+
highlightedItemChanged({
|
|
1592
|
+
label: label,
|
|
1593
|
+
value: scaledValue
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1577
1597
|
// Update the local state when the ID changes
|
|
1578
1598
|
useEffect(function() {
|
|
1579
1599
|
var sliderState = Juce.getSliderState(id);
|
|
@@ -1600,21 +1620,6 @@ var useSlider = function(param) {
|
|
|
1600
1620
|
}, [
|
|
1601
1621
|
window
|
|
1602
1622
|
]);
|
|
1603
|
-
// Update the local state from JUCE
|
|
1604
|
-
var updateLocalState = function(sliderState) {
|
|
1605
|
-
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
1606
|
-
var scaledValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getScaledValue();
|
|
1607
|
-
var scaledValue = parseFloat(scaledValueFromState.toFixed(2));
|
|
1608
|
-
normalisedValueRef.current = parseFloat(normalisedValueFromState.toFixed(2));
|
|
1609
|
-
setScaledValue(scaledValue);
|
|
1610
|
-
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1611
|
-
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1612
|
-
highlightedItemChanged({
|
|
1613
|
-
label: label,
|
|
1614
|
-
value: scaledValue
|
|
1615
|
-
});
|
|
1616
|
-
}
|
|
1617
|
-
};
|
|
1618
1623
|
// Update JUCE state
|
|
1619
1624
|
var setNormalisedState = function(newValue) {
|
|
1620
1625
|
var sliderState = Juce.getSliderState(id);
|
|
@@ -1655,9 +1660,12 @@ var useSlider = function(param) {
|
|
|
1655
1660
|
var setScaledState = function(newValue) {
|
|
1656
1661
|
var sliderState = Juce.getSliderState(id);
|
|
1657
1662
|
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
1663
|
+
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2;
|
|
1658
1664
|
!isLocalhost && properties && sliderState.setNormalisedValue(scaledToNormalised({
|
|
1659
1665
|
scaledValue: clamp(parseFloat(newValue.toFixed(2)), properties === null || properties === void 0 ? void 0 : properties.start, properties === null || properties === void 0 ? void 0 : properties.end),
|
|
1660
|
-
properties:
|
|
1666
|
+
start: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.start,
|
|
1667
|
+
end: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties1 = sliderState.properties) === null || _sliderState_properties1 === void 0 ? void 0 : _sliderState_properties1.end,
|
|
1668
|
+
skew: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties2 = sliderState.properties) === null || _sliderState_properties2 === void 0 ? void 0 : _sliderState_properties2.skew
|
|
1661
1669
|
}));
|
|
1662
1670
|
scaledValueRef.current = newValue;
|
|
1663
1671
|
}
|
|
@@ -1963,7 +1971,9 @@ function RotarySlider(param) {
|
|
|
1963
1971
|
onComplete: function(value) {
|
|
1964
1972
|
var normalisedVal = properties && scaledToNormalised({
|
|
1965
1973
|
scaledValue: value,
|
|
1966
|
-
properties: properties
|
|
1974
|
+
start: properties === null || properties === void 0 ? void 0 : properties.start,
|
|
1975
|
+
end: properties === null || properties === void 0 ? void 0 : properties.end,
|
|
1976
|
+
skew: properties === null || properties === void 0 ? void 0 : properties.skew
|
|
1967
1977
|
});
|
|
1968
1978
|
normalisedVal !== undefined && setNormalisedState(normalisedVal);
|
|
1969
1979
|
}
|
|
@@ -2149,15 +2159,15 @@ Heading.fontSize = FontSizes;
|
|
|
2149
2159
|
Heading.tag = HeadingTags;
|
|
2150
2160
|
Heading.padding = Spacing;
|
|
2151
2161
|
|
|
2152
|
-
function _array_like_to_array$
|
|
2162
|
+
function _array_like_to_array$b(arr, len) {
|
|
2153
2163
|
if (len == null || len > arr.length) len = arr.length;
|
|
2154
2164
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2155
2165
|
return arr2;
|
|
2156
2166
|
}
|
|
2157
|
-
function _array_with_holes$
|
|
2167
|
+
function _array_with_holes$b(arr) {
|
|
2158
2168
|
if (Array.isArray(arr)) return arr;
|
|
2159
2169
|
}
|
|
2160
|
-
function _iterable_to_array_limit$
|
|
2170
|
+
function _iterable_to_array_limit$b(arr, i) {
|
|
2161
2171
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2162
2172
|
if (_i == null) return;
|
|
2163
2173
|
var _arr = [];
|
|
@@ -2181,26 +2191,26 @@ function _iterable_to_array_limit$a(arr, i) {
|
|
|
2181
2191
|
}
|
|
2182
2192
|
return _arr;
|
|
2183
2193
|
}
|
|
2184
|
-
function _non_iterable_rest$
|
|
2194
|
+
function _non_iterable_rest$b() {
|
|
2185
2195
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2186
2196
|
}
|
|
2187
|
-
function _sliced_to_array$
|
|
2188
|
-
return _array_with_holes$
|
|
2197
|
+
function _sliced_to_array$b(arr, i) {
|
|
2198
|
+
return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$b();
|
|
2189
2199
|
}
|
|
2190
|
-
function _unsupported_iterable_to_array$
|
|
2200
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
2191
2201
|
if (!o) return;
|
|
2192
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2202
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
2193
2203
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2194
2204
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2195
2205
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2196
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2206
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
2197
2207
|
}
|
|
2198
2208
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
2199
2209
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
2200
2210
|
var useIndicator = function(param) {
|
|
2201
2211
|
var id = param.id;
|
|
2202
2212
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
2203
|
-
var _useState = _sliced_to_array$
|
|
2213
|
+
var _useState = _sliced_to_array$b(useState(0), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
2204
2214
|
// Set the initial state
|
|
2205
2215
|
useEffect(function() {
|
|
2206
2216
|
if (!isLocalhost) {
|
|
@@ -2284,7 +2294,7 @@ function IndicatorLight(param) {
|
|
|
2284
2294
|
}) : null);
|
|
2285
2295
|
}
|
|
2286
2296
|
|
|
2287
|
-
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\
|
|
2297
|
+
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\n.IconButton svg {\n height: 100%;\n width: 100%;\n}\n";
|
|
2288
2298
|
styleInject(css_248z$5);
|
|
2289
2299
|
|
|
2290
2300
|
function _define_property$a(obj, key, value) {
|
|
@@ -2694,14 +2704,16 @@ function KeyValueDisplayScreen(param) {
|
|
|
2694
2704
|
}
|
|
2695
2705
|
|
|
2696
2706
|
function LinePlot(param) {
|
|
2697
|
-
var data = param.data, _param_width = param.width, width = _param_width === void 0 ? 600 : _param_width, _param_height = param.height, height = _param_height === void 0 ? 200 : _param_height, _param_marginTop = param.marginTop, marginTop = _param_marginTop === void 0 ? 20 : _param_marginTop, _param_marginRight = param.marginRight, marginRight = _param_marginRight === void 0 ? 20 : _param_marginRight, _param_marginBottom = param.marginBottom, marginBottom = _param_marginBottom === void 0 ? 20 : _param_marginBottom, _param_marginLeft = param.marginLeft, marginLeft = _param_marginLeft === void 0 ? 20 : _param_marginLeft;
|
|
2707
|
+
var data = param.data, _param_width = param.width, width = _param_width === void 0 ? 600 : _param_width, _param_height = param.height, height = _param_height === void 0 ? 200 : _param_height, _param_marginTop = param.marginTop, marginTop = _param_marginTop === void 0 ? 20 : _param_marginTop, _param_marginRight = param.marginRight, marginRight = _param_marginRight === void 0 ? 20 : _param_marginRight, _param_marginBottom = param.marginBottom, marginBottom = _param_marginBottom === void 0 ? 20 : _param_marginBottom, _param_marginLeft = param.marginLeft, marginLeft = _param_marginLeft === void 0 ? 20 : _param_marginLeft, _param_displayGrid = param.displayGrid, displayGrid = _param_displayGrid === void 0 ? true : _param_displayGrid;
|
|
2698
2708
|
//TODO: Figure out why some data is null
|
|
2699
|
-
var filteredData = data.filter(function(item) {
|
|
2709
|
+
var filteredData = data ? Array.isArray(data) ? data === null || data === void 0 ? void 0 : data.filter(function(item) {
|
|
2700
2710
|
return item !== null;
|
|
2701
|
-
})
|
|
2711
|
+
}) : [
|
|
2712
|
+
data
|
|
2713
|
+
] : [];
|
|
2702
2714
|
var x = d3.scaleLinear([
|
|
2703
2715
|
0,
|
|
2704
|
-
filteredData.length - 1
|
|
2716
|
+
(filteredData === null || filteredData === void 0 ? void 0 : filteredData.length) - 1
|
|
2705
2717
|
], [
|
|
2706
2718
|
marginLeft,
|
|
2707
2719
|
width - marginRight
|
|
@@ -2736,7 +2748,7 @@ function LinePlot(param) {
|
|
|
2736
2748
|
filter: "url(#blur)",
|
|
2737
2749
|
// @ts-expect-error
|
|
2738
2750
|
d: line(filteredData)
|
|
2739
|
-
})), /*#__PURE__*/ React__default.createElement("svg", {
|
|
2751
|
+
})), displayGrid ? /*#__PURE__*/ React__default.createElement("svg", {
|
|
2740
2752
|
style: {
|
|
2741
2753
|
position: 'absolute',
|
|
2742
2754
|
top: 0,
|
|
@@ -2761,18 +2773,18 @@ function LinePlot(param) {
|
|
|
2761
2773
|
width: width,
|
|
2762
2774
|
height: width,
|
|
2763
2775
|
fill: "url(#grid)"
|
|
2764
|
-
})));
|
|
2776
|
+
})) : null);
|
|
2765
2777
|
}
|
|
2766
2778
|
|
|
2767
2779
|
var css_248z$4 = ".Oscilloscope {\n background: #0EAC8B;\n box-shadow: inset 0 0 20px #086350;\n height: 200px;\n };";
|
|
2768
2780
|
styleInject(css_248z$4);
|
|
2769
2781
|
|
|
2770
|
-
function _array_like_to_array$
|
|
2782
|
+
function _array_like_to_array$a(arr, len) {
|
|
2771
2783
|
if (len == null || len > arr.length) len = arr.length;
|
|
2772
2784
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2773
2785
|
return arr2;
|
|
2774
2786
|
}
|
|
2775
|
-
function _array_with_holes$
|
|
2787
|
+
function _array_with_holes$a(arr) {
|
|
2776
2788
|
if (Array.isArray(arr)) return arr;
|
|
2777
2789
|
}
|
|
2778
2790
|
function _define_property$7(obj, key, value) {
|
|
@@ -2788,7 +2800,7 @@ function _define_property$7(obj, key, value) {
|
|
|
2788
2800
|
}
|
|
2789
2801
|
return obj;
|
|
2790
2802
|
}
|
|
2791
|
-
function _iterable_to_array_limit$
|
|
2803
|
+
function _iterable_to_array_limit$a(arr, i) {
|
|
2792
2804
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2793
2805
|
if (_i == null) return;
|
|
2794
2806
|
var _arr = [];
|
|
@@ -2812,7 +2824,7 @@ function _iterable_to_array_limit$9(arr, i) {
|
|
|
2812
2824
|
}
|
|
2813
2825
|
return _arr;
|
|
2814
2826
|
}
|
|
2815
|
-
function _non_iterable_rest$
|
|
2827
|
+
function _non_iterable_rest$a() {
|
|
2816
2828
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2817
2829
|
}
|
|
2818
2830
|
function _object_spread$7(target) {
|
|
@@ -2830,20 +2842,20 @@ function _object_spread$7(target) {
|
|
|
2830
2842
|
}
|
|
2831
2843
|
return target;
|
|
2832
2844
|
}
|
|
2833
|
-
function _sliced_to_array$
|
|
2834
|
-
return _array_with_holes$
|
|
2845
|
+
function _sliced_to_array$a(arr, i) {
|
|
2846
|
+
return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$a();
|
|
2835
2847
|
}
|
|
2836
|
-
function _unsupported_iterable_to_array$
|
|
2848
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
2837
2849
|
if (!o) return;
|
|
2838
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2850
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
2839
2851
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2840
2852
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2841
2853
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2842
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2854
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
2843
2855
|
}
|
|
2844
2856
|
function Oscilloscope(param) {
|
|
2845
2857
|
var width = param.width, height = param.height, className = param.className, style = param.style, id = param.id;
|
|
2846
|
-
var _useState = _sliced_to_array$
|
|
2858
|
+
var _useState = _sliced_to_array$a(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
2847
2859
|
useEffect(function() {
|
|
2848
2860
|
//@ts-expect-error
|
|
2849
2861
|
var removalToken = window.__JUCE__.backend.addEventListener('oscData', function() {
|
|
@@ -2878,12 +2890,12 @@ styleInject(css_248z$3);
|
|
|
2878
2890
|
var css_248z$2 = ".PresetManagerContainer {\n width: 100%;\n height: 100%;\n background-color: var(--bg-page);\n color: var(--color-text);\n}\n\n.PresetManagerButton {\n width: 100%;\n height: 100%;\n max-width: 300px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n cursor: pointer;\n font-family: var(--font-leagueSpartan);\n}\n.PresetManagerButtonLabel {\n cursor: pointer;\n text-align: center;\n font-family: var(--font-leagueSpartan);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 225px;\n display: inline-block;\n vertical-align: middle;\n height: 1rem;\n line-height: 1.25;\n /* position: relative; */\n &:hover,\n &:active {\n background: var(--color-gray-900);\n }\n /* &.isDirty {\n &::after {\n content: '*';\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n } */\n}\n\n.PresetManagerButtonLabelContainer.isDirty::after {\n content: '*';\n position: absolute;\n height: 1rem;\n width: 1rem;\n right: -0.75rem;\n top: 0;\n}\n\n.PresetManagerButtonLabelOuterContainer {\n position: relative;\n width: auto;\n}\n\n[data-headlessui-state='open active'] .PresetManagerButtonLabel {\n background: var(--color-gray-900);\n}\n.PresetManagerPanel {\n position: absolute;\n font-family: var(--font-leagueSpartan);\n right: 0px;\n left: 0px;\n width: 100%;\n max-width: 400px !important;\n color: var(--color-text);\n background: var(--bg-popover);\n}\n\n.PresetManagerPanel:focus,\n.PresetManagerPanel:focus-visible {\n outline: none;\n}\n\n/* .PresetManagerCategoryItem {\n font-family: var(--font-leagueSpartan);\n cursor: pointer;\n background: var(--color-gray-800);\n text-transform: uppercase;\n &:hover,\n &.isSelected {\n background: var(--bg-selected);\n }\n} */\n\n.PresetManagerListItem {\n cursor: pointer;\n background: var(--color-gray-800);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n}\n\n.PresetManagerListItem:hover,\n.PresetManagerListItem.isSelected {\n background: var(--bg-selected);\n}\n\n.PresetManagerListItemText {\n display: inline-block;\n vertical-align: middle;\n height: 1.5rem;\n line-height: 1.75;\n}\n";
|
|
2879
2891
|
styleInject(css_248z$2);
|
|
2880
2892
|
|
|
2881
|
-
function _array_like_to_array$
|
|
2893
|
+
function _array_like_to_array$9(arr, len) {
|
|
2882
2894
|
if (len == null || len > arr.length) len = arr.length;
|
|
2883
2895
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2884
2896
|
return arr2;
|
|
2885
2897
|
}
|
|
2886
|
-
function _array_with_holes$
|
|
2898
|
+
function _array_with_holes$9(arr) {
|
|
2887
2899
|
if (Array.isArray(arr)) return arr;
|
|
2888
2900
|
}
|
|
2889
2901
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2915,7 +2927,7 @@ function _async_to_generator$3(fn) {
|
|
|
2915
2927
|
});
|
|
2916
2928
|
};
|
|
2917
2929
|
}
|
|
2918
|
-
function _iterable_to_array_limit$
|
|
2930
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
2919
2931
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2920
2932
|
if (_i == null) return;
|
|
2921
2933
|
var _arr = [];
|
|
@@ -2939,23 +2951,23 @@ function _iterable_to_array_limit$8(arr, i) {
|
|
|
2939
2951
|
}
|
|
2940
2952
|
return _arr;
|
|
2941
2953
|
}
|
|
2942
|
-
function _non_iterable_rest$
|
|
2954
|
+
function _non_iterable_rest$9() {
|
|
2943
2955
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2944
2956
|
}
|
|
2945
2957
|
function _object_destructuring_empty(o) {
|
|
2946
2958
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
2947
2959
|
return o;
|
|
2948
2960
|
}
|
|
2949
|
-
function _sliced_to_array$
|
|
2950
|
-
return _array_with_holes$
|
|
2961
|
+
function _sliced_to_array$9(arr, i) {
|
|
2962
|
+
return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$9();
|
|
2951
2963
|
}
|
|
2952
|
-
function _unsupported_iterable_to_array$
|
|
2964
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
2953
2965
|
if (!o) return;
|
|
2954
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2966
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
2955
2967
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2956
2968
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2957
2969
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2958
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2970
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
2959
2971
|
}
|
|
2960
2972
|
function _ts_generator$3(thisArg, body) {
|
|
2961
2973
|
var f, y, t, _ = {
|
|
@@ -3050,16 +3062,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
3050
3062
|
}
|
|
3051
3063
|
function PresetManager(param) {
|
|
3052
3064
|
_object_destructuring_empty(param);
|
|
3053
|
-
var _useState = _sliced_to_array$
|
|
3054
|
-
var _useState1 = _sliced_to_array$
|
|
3065
|
+
var _useState = _sliced_to_array$9(useState([]), 2), presetList = _useState[0], setPresetList = _useState[1];
|
|
3066
|
+
var _useState1 = _sliced_to_array$9(useState(false), 2); _useState1[0]; var setIsSaving = _useState1[1];
|
|
3055
3067
|
var savePresetFunc = Juce.getNativeFunction('savePreset');
|
|
3056
3068
|
var loadPresetFunc = Juce.getNativeFunction('loadPreset');
|
|
3057
3069
|
var getAllPresetsFunc = Juce.getNativeFunction('getAllPresets');
|
|
3058
3070
|
var getCurrentPresetFunc = Juce.getNativeFunction('getCurrentPreset');
|
|
3059
3071
|
var isDirtyFunc = Juce.getNativeFunction('canUndo');
|
|
3060
|
-
var _useState2 = _sliced_to_array$
|
|
3072
|
+
var _useState2 = _sliced_to_array$9(useState(), 2), selectedPreset = _useState2[0], setSelectedPreset = _useState2[1];
|
|
3061
3073
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3062
|
-
var _useState3 = _sliced_to_array$
|
|
3074
|
+
var _useState3 = _sliced_to_array$9(useState(false), 2), isDirty = _useState3[0], setIsDirty = _useState3[1];
|
|
3063
3075
|
useEffect(function() {
|
|
3064
3076
|
if (!isLocalhost) {
|
|
3065
3077
|
var isDirtyListenerId = //@ts-expect-error
|
|
@@ -3335,12 +3347,12 @@ function PresetManager(param) {
|
|
|
3335
3347
|
}))))));
|
|
3336
3348
|
}
|
|
3337
3349
|
|
|
3338
|
-
function _array_like_to_array$
|
|
3350
|
+
function _array_like_to_array$8(arr, len) {
|
|
3339
3351
|
if (len == null || len > arr.length) len = arr.length;
|
|
3340
3352
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3341
3353
|
return arr2;
|
|
3342
3354
|
}
|
|
3343
|
-
function _array_with_holes$
|
|
3355
|
+
function _array_with_holes$8(arr) {
|
|
3344
3356
|
if (Array.isArray(arr)) return arr;
|
|
3345
3357
|
}
|
|
3346
3358
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3385,7 +3397,7 @@ function _define_property$6(obj, key, value) {
|
|
|
3385
3397
|
}
|
|
3386
3398
|
return obj;
|
|
3387
3399
|
}
|
|
3388
|
-
function _iterable_to_array_limit$
|
|
3400
|
+
function _iterable_to_array_limit$8(arr, i) {
|
|
3389
3401
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3390
3402
|
if (_i == null) return;
|
|
3391
3403
|
var _arr = [];
|
|
@@ -3409,7 +3421,7 @@ function _iterable_to_array_limit$7(arr, i) {
|
|
|
3409
3421
|
}
|
|
3410
3422
|
return _arr;
|
|
3411
3423
|
}
|
|
3412
|
-
function _non_iterable_rest$
|
|
3424
|
+
function _non_iterable_rest$8() {
|
|
3413
3425
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3414
3426
|
}
|
|
3415
3427
|
function _object_spread$6(target) {
|
|
@@ -3427,16 +3439,16 @@ function _object_spread$6(target) {
|
|
|
3427
3439
|
}
|
|
3428
3440
|
return target;
|
|
3429
3441
|
}
|
|
3430
|
-
function _sliced_to_array$
|
|
3431
|
-
return _array_with_holes$
|
|
3442
|
+
function _sliced_to_array$8(arr, i) {
|
|
3443
|
+
return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$8();
|
|
3432
3444
|
}
|
|
3433
|
-
function _unsupported_iterable_to_array$
|
|
3445
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
3434
3446
|
if (!o) return;
|
|
3435
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3447
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
3436
3448
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3437
3449
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3438
3450
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3439
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3451
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
3440
3452
|
}
|
|
3441
3453
|
function _ts_generator$2(thisArg, body) {
|
|
3442
3454
|
var f, y, t, _ = {
|
|
@@ -3619,8 +3631,8 @@ function ModuleHeader(param) {
|
|
|
3619
3631
|
}, [
|
|
3620
3632
|
window
|
|
3621
3633
|
]);
|
|
3622
|
-
var _useState = _sliced_to_array$
|
|
3623
|
-
var _useState1 = _sliced_to_array$
|
|
3634
|
+
var _useState = _sliced_to_array$8(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3635
|
+
var _useState1 = _sliced_to_array$8(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3624
3636
|
var handleUndo = function() {
|
|
3625
3637
|
undo();
|
|
3626
3638
|
};
|
|
@@ -3924,15 +3936,15 @@ function SingleBarViz(param) {
|
|
|
3924
3936
|
}
|
|
3925
3937
|
SingleBarViz.polarity = Polarity;
|
|
3926
3938
|
|
|
3927
|
-
function _array_like_to_array$
|
|
3939
|
+
function _array_like_to_array$7(arr, len) {
|
|
3928
3940
|
if (len == null || len > arr.length) len = arr.length;
|
|
3929
3941
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3930
3942
|
return arr2;
|
|
3931
3943
|
}
|
|
3932
|
-
function _array_with_holes$
|
|
3944
|
+
function _array_with_holes$7(arr) {
|
|
3933
3945
|
if (Array.isArray(arr)) return arr;
|
|
3934
3946
|
}
|
|
3935
|
-
function _iterable_to_array_limit$
|
|
3947
|
+
function _iterable_to_array_limit$7(arr, i) {
|
|
3936
3948
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3937
3949
|
if (_i == null) return;
|
|
3938
3950
|
var _arr = [];
|
|
@@ -3956,26 +3968,26 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
3956
3968
|
}
|
|
3957
3969
|
return _arr;
|
|
3958
3970
|
}
|
|
3959
|
-
function _non_iterable_rest$
|
|
3971
|
+
function _non_iterable_rest$7() {
|
|
3960
3972
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3961
3973
|
}
|
|
3962
|
-
function _sliced_to_array$
|
|
3963
|
-
return _array_with_holes$
|
|
3974
|
+
function _sliced_to_array$7(arr, i) {
|
|
3975
|
+
return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$7();
|
|
3964
3976
|
}
|
|
3965
|
-
function _unsupported_iterable_to_array$
|
|
3977
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
3966
3978
|
if (!o) return;
|
|
3967
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3979
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
3968
3980
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3969
3981
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3970
3982
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3971
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3983
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
3972
3984
|
}
|
|
3973
3985
|
var useCombobox = function(param) {
|
|
3974
3986
|
var id = param.id, filter = param.filter, onChange = param.onChange;
|
|
3975
3987
|
var _Object_values;
|
|
3976
3988
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
3977
|
-
var _useState = _sliced_to_array$
|
|
3978
|
-
var _useState1 = _sliced_to_array$
|
|
3989
|
+
var _useState = _sliced_to_array$7(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
3990
|
+
var _useState1 = _sliced_to_array$7(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
3979
3991
|
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3980
3992
|
//TODO: Filter choices for subsequent rows
|
|
3981
3993
|
// const availableChoices = properties?.choices;
|
|
@@ -4039,12 +4051,12 @@ var useCombobox = function(param) {
|
|
|
4039
4051
|
};
|
|
4040
4052
|
};
|
|
4041
4053
|
|
|
4042
|
-
function _array_like_to_array$
|
|
4054
|
+
function _array_like_to_array$6(arr, len) {
|
|
4043
4055
|
if (len == null || len > arr.length) len = arr.length;
|
|
4044
4056
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4045
4057
|
return arr2;
|
|
4046
4058
|
}
|
|
4047
|
-
function _array_with_holes$
|
|
4059
|
+
function _array_with_holes$6(arr) {
|
|
4048
4060
|
if (Array.isArray(arr)) return arr;
|
|
4049
4061
|
}
|
|
4050
4062
|
function _define_property$4(obj, key, value) {
|
|
@@ -4060,7 +4072,7 @@ function _define_property$4(obj, key, value) {
|
|
|
4060
4072
|
}
|
|
4061
4073
|
return obj;
|
|
4062
4074
|
}
|
|
4063
|
-
function _iterable_to_array_limit$
|
|
4075
|
+
function _iterable_to_array_limit$6(arr, i) {
|
|
4064
4076
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4065
4077
|
if (_i == null) return;
|
|
4066
4078
|
var _arr = [];
|
|
@@ -4084,7 +4096,7 @@ function _iterable_to_array_limit$5(arr, i) {
|
|
|
4084
4096
|
}
|
|
4085
4097
|
return _arr;
|
|
4086
4098
|
}
|
|
4087
|
-
function _non_iterable_rest$
|
|
4099
|
+
function _non_iterable_rest$6() {
|
|
4088
4100
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4089
4101
|
}
|
|
4090
4102
|
function _object_spread$4(target) {
|
|
@@ -4102,22 +4114,22 @@ function _object_spread$4(target) {
|
|
|
4102
4114
|
}
|
|
4103
4115
|
return target;
|
|
4104
4116
|
}
|
|
4105
|
-
function _sliced_to_array$
|
|
4106
|
-
return _array_with_holes$
|
|
4117
|
+
function _sliced_to_array$6(arr, i) {
|
|
4118
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$6();
|
|
4107
4119
|
}
|
|
4108
|
-
function _unsupported_iterable_to_array$
|
|
4120
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
4109
4121
|
if (!o) return;
|
|
4110
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4122
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
4111
4123
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4112
4124
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4113
4125
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4114
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4126
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
4115
4127
|
}
|
|
4116
4128
|
function ModMatrixComboboxCell(param) {
|
|
4117
4129
|
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
4118
4130
|
var _SingleBarViz_polarity;
|
|
4119
|
-
var _useState = _sliced_to_array$
|
|
4120
|
-
var _useState1 = _sliced_to_array$
|
|
4131
|
+
var _useState = _sliced_to_array$6(useState(), 2), targetValue = _useState[0], setTargetValue = _useState[1];
|
|
4132
|
+
var _useState1 = _sliced_to_array$6(useState(''), 2), filterString = _useState1[0], setFilterString = _useState1[1];
|
|
4121
4133
|
var _useGlobalContext = useGlobalContext(), automatableParamLabels = _useGlobalContext.globalState.automatableParamLabels;
|
|
4122
4134
|
var _useCombobox = useCombobox({
|
|
4123
4135
|
id: rowId,
|
|
@@ -4413,16 +4425,16 @@ function ModMatrixRow(param) {
|
|
|
4413
4425
|
}));
|
|
4414
4426
|
}
|
|
4415
4427
|
|
|
4416
|
-
function _array_like_to_array$
|
|
4428
|
+
function _array_like_to_array$5(arr, len) {
|
|
4417
4429
|
if (len == null || len > arr.length) len = arr.length;
|
|
4418
4430
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4419
4431
|
return arr2;
|
|
4420
4432
|
}
|
|
4421
|
-
function _array_with_holes$
|
|
4433
|
+
function _array_with_holes$5(arr) {
|
|
4422
4434
|
if (Array.isArray(arr)) return arr;
|
|
4423
4435
|
}
|
|
4424
4436
|
function _array_without_holes(arr) {
|
|
4425
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
4437
|
+
if (Array.isArray(arr)) return _array_like_to_array$5(arr);
|
|
4426
4438
|
}
|
|
4427
4439
|
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4428
4440
|
try {
|
|
@@ -4469,7 +4481,7 @@ function _define_property$1(obj, key, value) {
|
|
|
4469
4481
|
function _iterable_to_array(iter) {
|
|
4470
4482
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4471
4483
|
}
|
|
4472
|
-
function _iterable_to_array_limit$
|
|
4484
|
+
function _iterable_to_array_limit$5(arr, i) {
|
|
4473
4485
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4474
4486
|
if (_i == null) return;
|
|
4475
4487
|
var _arr = [];
|
|
@@ -4493,7 +4505,7 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
4493
4505
|
}
|
|
4494
4506
|
return _arr;
|
|
4495
4507
|
}
|
|
4496
|
-
function _non_iterable_rest$
|
|
4508
|
+
function _non_iterable_rest$5() {
|
|
4497
4509
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4498
4510
|
}
|
|
4499
4511
|
function _non_iterable_spread() {
|
|
@@ -4514,19 +4526,19 @@ function _object_spread$1(target) {
|
|
|
4514
4526
|
}
|
|
4515
4527
|
return target;
|
|
4516
4528
|
}
|
|
4517
|
-
function _sliced_to_array$
|
|
4518
|
-
return _array_with_holes$
|
|
4529
|
+
function _sliced_to_array$5(arr, i) {
|
|
4530
|
+
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$5();
|
|
4519
4531
|
}
|
|
4520
4532
|
function _to_consumable_array(arr) {
|
|
4521
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$
|
|
4533
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread();
|
|
4522
4534
|
}
|
|
4523
|
-
function _unsupported_iterable_to_array$
|
|
4535
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
4524
4536
|
if (!o) return;
|
|
4525
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4537
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
4526
4538
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4527
4539
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4528
4540
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4529
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4541
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
4530
4542
|
}
|
|
4531
4543
|
function _ts_generator$1(thisArg, body) {
|
|
4532
4544
|
var f, y, t, _ = {
|
|
@@ -4623,7 +4635,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
4623
4635
|
function ModMatrix(param) {
|
|
4624
4636
|
var className = param.className, style = param.style;
|
|
4625
4637
|
var _Object_keys, _Object_keys1, _Object_keys2;
|
|
4626
|
-
var _useState = _sliced_to_array$
|
|
4638
|
+
var _useState = _sliced_to_array$5(useState(), 2), previewRowIsActive = _useState[0], setPreviewRowIsActive = _useState[1];
|
|
4627
4639
|
var getAutomatableParamsListFunc = Juce.getNativeFunction('getAutomatableParamsList');
|
|
4628
4640
|
var getAllModSlotsFunc = Juce.getNativeFunction('getAllModSlots');
|
|
4629
4641
|
var getModSlotParamsFunc = Juce.getNativeFunction('getModSlotParams');
|
|
@@ -4780,6 +4792,399 @@ function ModMatrix(param) {
|
|
|
4780
4792
|
})));
|
|
4781
4793
|
}
|
|
4782
4794
|
|
|
4795
|
+
var svgInnerMargin = 5;
|
|
4796
|
+
var WaveTypes = /*#__PURE__*/ function(WaveTypes) {
|
|
4797
|
+
WaveTypes["Sine"] = "Sine";
|
|
4798
|
+
WaveTypes["Triangle"] = "Triangle";
|
|
4799
|
+
WaveTypes["Ramp"] = "Ramp";
|
|
4800
|
+
WaveTypes["Saw"] = "Saw";
|
|
4801
|
+
WaveTypes["ExpUp"] = "Exp Up";
|
|
4802
|
+
WaveTypes["ExpDown"] = "Exp Down";
|
|
4803
|
+
WaveTypes["Square"] = "Square";
|
|
4804
|
+
return WaveTypes;
|
|
4805
|
+
}({});
|
|
4806
|
+
|
|
4807
|
+
var getPointArray = function(param) {
|
|
4808
|
+
var waveType = param.waveType, hz = param.hz, _param_pulseWidth = param.pulseWidth, pulseWidth = _param_pulseWidth === void 0 ? 1 : _param_pulseWidth, _param_ampValue = param.ampValue, ampValue = _param_ampValue === void 0 ? 0.5 : _param_ampValue, _param_randValue = param.randValue, randValue = _param_randValue === void 0 ? 1 : _param_randValue, _param_maxLength = param.maxLength, maxLength = _param_maxLength;
|
|
4809
|
+
var generateCycle = // Returns a coordinate array for one cycle
|
|
4810
|
+
function generateCycle(index) {
|
|
4811
|
+
var cycle = [];
|
|
4812
|
+
// Pick a number from the 'randomNumbers' array to set the randValue for the cycle
|
|
4813
|
+
var randomNumber = randomNumbers[index % randomNumbers.length] * randValue;
|
|
4814
|
+
//Generate the coordinate array for the cycle
|
|
4815
|
+
for(var i = 1; i < cycleLength; i++){
|
|
4816
|
+
var getAdjustedVal = function() {
|
|
4817
|
+
var startingValue = i + cycleLength;
|
|
4818
|
+
var returnValue;
|
|
4819
|
+
if (startingValue > cycleLength) {
|
|
4820
|
+
returnValue = startingValue % cycleLength;
|
|
4821
|
+
} else if (startingValue < 0) {
|
|
4822
|
+
returnValue = cycleLength - Math.abs(startingValue);
|
|
4823
|
+
} else {
|
|
4824
|
+
returnValue = startingValue;
|
|
4825
|
+
}
|
|
4826
|
+
var pulseWidthParam = 1 - pulseWidth;
|
|
4827
|
+
returnValue = returnValue * (1 + 4 * pulseWidthParam);
|
|
4828
|
+
if (returnValue > cycleLength) {
|
|
4829
|
+
returnValue = 0;
|
|
4830
|
+
}
|
|
4831
|
+
return scaledToNormalised({
|
|
4832
|
+
scaledValue: returnValue,
|
|
4833
|
+
start: 0,
|
|
4834
|
+
end: cycleLength
|
|
4835
|
+
});
|
|
4836
|
+
};
|
|
4837
|
+
var adjustedVal = getAdjustedVal();
|
|
4838
|
+
switch(waveType){
|
|
4839
|
+
case WaveTypes.Sine:
|
|
4840
|
+
var angle = adjustedVal * (2 * Math.PI);
|
|
4841
|
+
//prettier-ignore
|
|
4842
|
+
var sineShape = (1 - randomNumber) * (ampValue * Math.sin(angle)) / 2 + 0.5;
|
|
4843
|
+
cycle.push({
|
|
4844
|
+
x: adjustedVal,
|
|
4845
|
+
//prettier-ignore
|
|
4846
|
+
y: sineShape
|
|
4847
|
+
});
|
|
4848
|
+
break;
|
|
4849
|
+
case WaveTypes.Ramp:
|
|
4850
|
+
cycle.push({
|
|
4851
|
+
y: adjustedVal * ampValue * (1 - randomNumber)
|
|
4852
|
+
});
|
|
4853
|
+
break;
|
|
4854
|
+
case WaveTypes.ExpUp:
|
|
4855
|
+
cycle.push({
|
|
4856
|
+
y: (Math.exp(adjustedVal * ampValue) - 1) / 1.7 * (1 - randomNumber)
|
|
4857
|
+
});
|
|
4858
|
+
break;
|
|
4859
|
+
case WaveTypes.ExpDown:
|
|
4860
|
+
cycle.push({
|
|
4861
|
+
//prettier-ignore
|
|
4862
|
+
y: (Math.exp(adjustedVal > 0 ? (1 - adjustedVal) * ampValue : 0) - 1) / 1.7 * (1 - randomNumber)
|
|
4863
|
+
});
|
|
4864
|
+
break;
|
|
4865
|
+
case WaveTypes.Saw:
|
|
4866
|
+
cycle.push({
|
|
4867
|
+
y: (adjustedVal > 0 ? 1 - adjustedVal : 0) * (1 - randomNumber) * ampValue
|
|
4868
|
+
});
|
|
4869
|
+
break;
|
|
4870
|
+
case WaveTypes.Square:
|
|
4871
|
+
cycle.push({
|
|
4872
|
+
y: adjustedVal > 0.5 ? 1 * (1 - randomNumber) * ampValue : 0 * (1 - randomNumber) * ampValue
|
|
4873
|
+
});
|
|
4874
|
+
break;
|
|
4875
|
+
case WaveTypes.Triangle:
|
|
4876
|
+
cycle.push({
|
|
4877
|
+
y: // prettier-ignore
|
|
4878
|
+
//(pwmInput * 2) > 1023 ? rampTable[2046 - (pwmInput * 2)] : rampTable[pwmInput * 2];
|
|
4879
|
+
adjustedVal * 2 > 1 ? (2 - adjustedVal * 2) * (1 - randomNumber) * ampValue : adjustedVal * 2 * (1 - randomNumber) * ampValue
|
|
4880
|
+
});
|
|
4881
|
+
break;
|
|
4882
|
+
}
|
|
4883
|
+
}
|
|
4884
|
+
return cycle;
|
|
4885
|
+
};
|
|
4886
|
+
var output = [];
|
|
4887
|
+
var randomNumbers = [
|
|
4888
|
+
0.3,
|
|
4889
|
+
0.8,
|
|
4890
|
+
0.5,
|
|
4891
|
+
0.1,
|
|
4892
|
+
0.7,
|
|
4893
|
+
0.4,
|
|
4894
|
+
0.8,
|
|
4895
|
+
0.2,
|
|
4896
|
+
0.9,
|
|
4897
|
+
0.4
|
|
4898
|
+
];
|
|
4899
|
+
// Calculate the length of one cycle
|
|
4900
|
+
var getCycleLength = function() {
|
|
4901
|
+
var minCycleLength = 40; // Arbitrary number - can adjust up and down
|
|
4902
|
+
var value = maxLength - Math.ceil(maxLength * hz);
|
|
4903
|
+
if (value < minCycleLength) {
|
|
4904
|
+
return minCycleLength;
|
|
4905
|
+
} else {
|
|
4906
|
+
return value;
|
|
4907
|
+
}
|
|
4908
|
+
};
|
|
4909
|
+
var cycleLength = getCycleLength();
|
|
4910
|
+
var numCycles = Math.floor(maxLength / cycleLength);
|
|
4911
|
+
var allCycles = [];
|
|
4912
|
+
for(var i = 0; i < numCycles; i++){
|
|
4913
|
+
var cycle = generateCycle(i);
|
|
4914
|
+
allCycles.push(cycle);
|
|
4915
|
+
}
|
|
4916
|
+
for(var i = 0; i < maxLength; i++){
|
|
4917
|
+
var _allCycles_flat_i;
|
|
4918
|
+
output.push({
|
|
4919
|
+
x: i,
|
|
4920
|
+
y: (_allCycles_flat_i = allCycles.flat()[i]) === null || _allCycles_flat_i === void 0 ? void 0 : _allCycles_flat_i.y
|
|
4921
|
+
});
|
|
4922
|
+
}
|
|
4923
|
+
return output;
|
|
4924
|
+
};
|
|
4925
|
+
|
|
4926
|
+
function _array_like_to_array$4(arr, len) {
|
|
4927
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4928
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4929
|
+
return arr2;
|
|
4930
|
+
}
|
|
4931
|
+
function _array_with_holes$4(arr) {
|
|
4932
|
+
if (Array.isArray(arr)) return arr;
|
|
4933
|
+
}
|
|
4934
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
4935
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4936
|
+
if (_i == null) return;
|
|
4937
|
+
var _arr = [];
|
|
4938
|
+
var _n = true;
|
|
4939
|
+
var _d = false;
|
|
4940
|
+
var _s, _e;
|
|
4941
|
+
try {
|
|
4942
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
4943
|
+
_arr.push(_s.value);
|
|
4944
|
+
if (i && _arr.length === i) break;
|
|
4945
|
+
}
|
|
4946
|
+
} catch (err) {
|
|
4947
|
+
_d = true;
|
|
4948
|
+
_e = err;
|
|
4949
|
+
} finally{
|
|
4950
|
+
try {
|
|
4951
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
4952
|
+
} finally{
|
|
4953
|
+
if (_d) throw _e;
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
return _arr;
|
|
4957
|
+
}
|
|
4958
|
+
function _non_iterable_rest$4() {
|
|
4959
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4960
|
+
}
|
|
4961
|
+
function _sliced_to_array$4(arr, i) {
|
|
4962
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
4963
|
+
}
|
|
4964
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
4965
|
+
if (!o) return;
|
|
4966
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
4967
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4968
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4969
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4970
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
4971
|
+
}
|
|
4972
|
+
function LFOVisualizer(param) {
|
|
4973
|
+
var id = param.id, _param_width = param.width, width = _param_width === void 0 ? 400 : _param_width, _param_height = param.height, height = _param_height === void 0 ? 150 : _param_height;
|
|
4974
|
+
var svgRef = useRef(null);
|
|
4975
|
+
var isLocalhost = window.location.hostname === 'localhost';
|
|
4976
|
+
var _useState = _sliced_to_array$4(useState(0), 2), waveValue = _useState[0], setWaveValue = _useState[1];
|
|
4977
|
+
var _useState1 = _sliced_to_array$4(useState(0), 2), hzValue = _useState1[0], setHzValue = _useState1[1];
|
|
4978
|
+
var _useState2 = _sliced_to_array$4(useState(0), 2), hzHiValue = _useState2[0], setHzHiValue = _useState2[1];
|
|
4979
|
+
//@ts-expect-error
|
|
4980
|
+
var _useState3 = _sliced_to_array$4(useState(0), 2); _useState3[0]; var setSyncRateValue = _useState3[1];
|
|
4981
|
+
var _useState4 = _sliced_to_array$4(useState(0), 2), syncTypeValue = _useState4[0], setSyncTypeValue = _useState4[1];
|
|
4982
|
+
//@ts-expect-error
|
|
4983
|
+
var _useState5 = _sliced_to_array$4(useState(0), 2); _useState5[0]; var setSixteenthsValue = _useState5[1];
|
|
4984
|
+
//@ts-expect-error
|
|
4985
|
+
var _useState6 = _sliced_to_array$4(useState(0), 2); _useState6[0]; var setThirdsValue = _useState6[1];
|
|
4986
|
+
var _useState7 = _sliced_to_array$4(useState(0), 2), syncOffsetValue = _useState7[0], setSyncOffsetValue = _useState7[1];
|
|
4987
|
+
var _useState8 = _sliced_to_array$4(useState(0), 2), phaseValue = _useState8[0], setPhaseValue = _useState8[1];
|
|
4988
|
+
var _useState9 = _sliced_to_array$4(useState(0), 2), widthValue = _useState9[0], setWidthValue = _useState9[1];
|
|
4989
|
+
var _useState10 = _sliced_to_array$4(useState(0), 2), ampValue = _useState10[0], setAmpValue = _useState10[1];
|
|
4990
|
+
var _useState11 = _sliced_to_array$4(useState(0), 2), randValue = _useState11[0], setRandValue = _useState11[1];
|
|
4991
|
+
var _useState12 = _sliced_to_array$4(useState([]), 2), points = _useState12[0], setPoints = _useState12[1];
|
|
4992
|
+
// const [numLoops, setNumLoops] = useState(1);
|
|
4993
|
+
var maxLength = 1024;
|
|
4994
|
+
// useEffect(() => {
|
|
4995
|
+
// console.log(
|
|
4996
|
+
// waveValue,
|
|
4997
|
+
// hzValue,
|
|
4998
|
+
// hzHiValue,
|
|
4999
|
+
// syncRateValue,
|
|
5000
|
+
// syncTypeValue,
|
|
5001
|
+
// sixteenthsValue,
|
|
5002
|
+
// thirdsValue,
|
|
5003
|
+
// syncOffsetValue,
|
|
5004
|
+
// phaseValue,
|
|
5005
|
+
// widthValue,
|
|
5006
|
+
// ampValue,
|
|
5007
|
+
// randValue,
|
|
5008
|
+
// );
|
|
5009
|
+
// }, [
|
|
5010
|
+
// waveValue,
|
|
5011
|
+
// hzValue,
|
|
5012
|
+
// hzHiValue,
|
|
5013
|
+
// syncRateValue,
|
|
5014
|
+
// syncTypeValue,
|
|
5015
|
+
// sixteenthsValue,
|
|
5016
|
+
// thirdsValue,
|
|
5017
|
+
// syncOffsetValue,
|
|
5018
|
+
// phaseValue,
|
|
5019
|
+
// widthValue,
|
|
5020
|
+
// ampValue,
|
|
5021
|
+
// randValue,
|
|
5022
|
+
// ]);
|
|
5023
|
+
// Sets up listeners to handle changes on the backend
|
|
5024
|
+
//@ts-expect-error
|
|
5025
|
+
useEffect(function() {
|
|
5026
|
+
// Set up slider state listeners for each LFO parameter
|
|
5027
|
+
if (!isLocalhost) {
|
|
5028
|
+
var waveState = Juce.getComboBoxState("LFO".concat(id, "_Wave"));
|
|
5029
|
+
setWaveValue(waveState === null || waveState === void 0 ? void 0 : waveState.getChoiceIndex());
|
|
5030
|
+
var hzState = Juce.getSliderState("LFO".concat(id, "_Hz"));
|
|
5031
|
+
setHzValue(hzState === null || hzState === void 0 ? void 0 : hzState.getNormalisedValue());
|
|
5032
|
+
var hzHiState = Juce.getSliderState("LFO".concat(id, "_Hz_Hi"));
|
|
5033
|
+
setHzHiValue(hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.getNormalisedValue());
|
|
5034
|
+
var syncRateState = Juce.getComboBoxState("LFO".concat(id, "_SyncRate"));
|
|
5035
|
+
setSyncRateValue(syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.getChoiceIndex());
|
|
5036
|
+
var syncTypeState = Juce.getComboBoxState("LFO".concat(id, "_SyncType"));
|
|
5037
|
+
setSyncTypeValue(syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.getChoiceIndex());
|
|
5038
|
+
var sixteenthsState = Juce.getSliderState("LFO".concat(id, "_Sixteenths"));
|
|
5039
|
+
setSixteenthsValue(sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.getNormalisedValue());
|
|
5040
|
+
var thirdsState = Juce.getSliderState("LFO".concat(id, "_Thirds"));
|
|
5041
|
+
setThirdsValue(thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.getNormalisedValue());
|
|
5042
|
+
var syncOffsetState = Juce.getSliderState("LFO".concat(id, "_Sync_Offset"));
|
|
5043
|
+
setSyncOffsetValue(syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.getNormalisedValue());
|
|
5044
|
+
var phaseState = Juce.getSliderState("LFO".concat(id, "_Phase"));
|
|
5045
|
+
setPhaseValue(phaseState === null || phaseState === void 0 ? void 0 : phaseState.getNormalisedValue());
|
|
5046
|
+
var widthState = Juce.getSliderState("LFO".concat(id, "_Width"));
|
|
5047
|
+
setWidthValue(widthState === null || widthState === void 0 ? void 0 : widthState.getNormalisedValue());
|
|
5048
|
+
var ampState = Juce.getSliderState("LFO".concat(id, "_Amp"));
|
|
5049
|
+
setAmpValue(ampState === null || ampState === void 0 ? void 0 : ampState.getNormalisedValue());
|
|
5050
|
+
var randState = Juce.getSliderState("LFO".concat(id, "_Rand"));
|
|
5051
|
+
setRandValue(randState === null || randState === void 0 ? void 0 : randState.getNormalisedValue());
|
|
5052
|
+
var waveListenerId = waveState === null || waveState === void 0 ? void 0 : waveState.valueChangedEvent.addListener(function() {
|
|
5053
|
+
setWaveValue(waveState === null || waveState === void 0 ? void 0 : waveState.getChoiceIndex());
|
|
5054
|
+
});
|
|
5055
|
+
var hzListenerId = hzState.valueChangedEvent.addListener(function() {
|
|
5056
|
+
setHzValue(hzState === null || hzState === void 0 ? void 0 : hzState.getNormalisedValue());
|
|
5057
|
+
});
|
|
5058
|
+
var hzHiListenerId = hzHiState.valueChangedEvent.addListener(function() {
|
|
5059
|
+
setHzHiValue(hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.getNormalisedValue());
|
|
5060
|
+
});
|
|
5061
|
+
var syncRateListenerId = syncRateState.valueChangedEvent.addListener(function() {
|
|
5062
|
+
setSyncRateValue(syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.getChoiceIndex());
|
|
5063
|
+
});
|
|
5064
|
+
var syncTypeListenerId = syncTypeState.valueChangedEvent.addListener(function() {
|
|
5065
|
+
setSyncTypeValue(syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.getChoiceIndex());
|
|
5066
|
+
});
|
|
5067
|
+
var sixteenthsListenerId = sixteenthsState.valueChangedEvent.addListener(function() {
|
|
5068
|
+
setSixteenthsValue(sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.getNormalisedValue());
|
|
5069
|
+
});
|
|
5070
|
+
var thirdsListenerId = thirdsState.valueChangedEvent.addListener(function() {
|
|
5071
|
+
setThirdsValue(thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.getNormalisedValue());
|
|
5072
|
+
});
|
|
5073
|
+
var syncOffsetListenerId = syncOffsetState.valueChangedEvent.addListener(function() {
|
|
5074
|
+
setSyncOffsetValue(syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.getNormalisedValue());
|
|
5075
|
+
});
|
|
5076
|
+
var phaseListenerId = phaseState.valueChangedEvent.addListener(function() {
|
|
5077
|
+
setPhaseValue(phaseState === null || phaseState === void 0 ? void 0 : phaseState.getNormalisedValue());
|
|
5078
|
+
});
|
|
5079
|
+
var widthListenerId = widthState.valueChangedEvent.addListener(function() {
|
|
5080
|
+
setWidthValue(widthState === null || widthState === void 0 ? void 0 : widthState.getNormalisedValue());
|
|
5081
|
+
});
|
|
5082
|
+
var ampListenerId = ampState.valueChangedEvent.addListener(function() {
|
|
5083
|
+
setAmpValue(ampState === null || ampState === void 0 ? void 0 : ampState.getNormalisedValue());
|
|
5084
|
+
});
|
|
5085
|
+
var randListenerId = randState.valueChangedEvent.addListener(function() {
|
|
5086
|
+
setRandValue(randState === null || randState === void 0 ? void 0 : randState.getNormalisedValue());
|
|
5087
|
+
});
|
|
5088
|
+
// Set up initial graph view
|
|
5089
|
+
var svg = d3.select(svgRef.current).attr('width', width * 2).attr('height', height);
|
|
5090
|
+
// create center line for graph
|
|
5091
|
+
svg.append('line').attr('x1', "".concat(svgInnerMargin)).attr('y1', "".concat(height / 2)).attr('x2', "".concat(width * 2 - svgInnerMargin)).attr('y2', "".concat(height / 2)).attr('fill', 'none').attr('stroke', 'var(--color-gray-600)').attr('stroke-width', 2);
|
|
5092
|
+
return function() {
|
|
5093
|
+
// Remove listeners on unmount
|
|
5094
|
+
waveState === null || waveState === void 0 ? void 0 : waveState.valueChangedEvent.removeListener(waveListenerId);
|
|
5095
|
+
hzState === null || hzState === void 0 ? void 0 : hzState.valueChangedEvent.removeListener(hzListenerId);
|
|
5096
|
+
hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.valueChangedEvent.removeListener(hzHiListenerId);
|
|
5097
|
+
syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.valueChangedEvent.removeListener(syncRateListenerId);
|
|
5098
|
+
syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.valueChangedEvent.removeListener(syncTypeListenerId);
|
|
5099
|
+
sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.valueChangedEvent.removeListener(sixteenthsListenerId);
|
|
5100
|
+
thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.valueChangedEvent.removeListener(thirdsListenerId);
|
|
5101
|
+
syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.valueChangedEvent.removeListener(syncOffsetListenerId);
|
|
5102
|
+
phaseState === null || phaseState === void 0 ? void 0 : phaseState.valueChangedEvent.removeListener(phaseListenerId);
|
|
5103
|
+
widthState === null || widthState === void 0 ? void 0 : widthState.valueChangedEvent.removeListener(widthListenerId);
|
|
5104
|
+
ampState === null || ampState === void 0 ? void 0 : ampState.valueChangedEvent.removeListener(ampListenerId);
|
|
5105
|
+
randState === null || randState === void 0 ? void 0 : randState.valueChangedEvent.removeListener(randListenerId);
|
|
5106
|
+
};
|
|
5107
|
+
}
|
|
5108
|
+
}, [
|
|
5109
|
+
window
|
|
5110
|
+
]);
|
|
5111
|
+
useEffect(function() {
|
|
5112
|
+
var _Object_values;
|
|
5113
|
+
var pointArray = getPointArray({
|
|
5114
|
+
waveType: (_Object_values = Object.values(WaveTypes)) === null || _Object_values === void 0 ? void 0 : _Object_values[waveValue],
|
|
5115
|
+
hz: syncTypeValue === 0 ? hzValue : hzHiValue,
|
|
5116
|
+
randValue: randValue,
|
|
5117
|
+
ampValue: ampValue,
|
|
5118
|
+
pulseWidth: widthValue,
|
|
5119
|
+
maxLength: maxLength
|
|
5120
|
+
});
|
|
5121
|
+
setPoints(pointArray);
|
|
5122
|
+
}, [
|
|
5123
|
+
waveValue,
|
|
5124
|
+
syncTypeValue,
|
|
5125
|
+
hzValue,
|
|
5126
|
+
hzHiValue,
|
|
5127
|
+
randValue,
|
|
5128
|
+
widthValue,
|
|
5129
|
+
maxLength,
|
|
5130
|
+
ampValue
|
|
5131
|
+
]);
|
|
5132
|
+
useEffect(function() {
|
|
5133
|
+
// 2 * Math.PI = 1 circle in radians
|
|
5134
|
+
// d3.range(initial value, last value, increment)
|
|
5135
|
+
// sets the number of values
|
|
5136
|
+
var xScale = d3.scaleLinear().domain([
|
|
5137
|
+
0,
|
|
5138
|
+
maxLength
|
|
5139
|
+
]).range([
|
|
5140
|
+
svgInnerMargin,
|
|
5141
|
+
width * 2 - svgInnerMargin
|
|
5142
|
+
]);
|
|
5143
|
+
var yScale = d3.scaleLinear().domain([
|
|
5144
|
+
0,
|
|
5145
|
+
1
|
|
5146
|
+
]).range([
|
|
5147
|
+
height - svgInnerMargin,
|
|
5148
|
+
svgInnerMargin
|
|
5149
|
+
]);
|
|
5150
|
+
var line = d3.line()//@ts-expect-error
|
|
5151
|
+
.x(function(d) {
|
|
5152
|
+
return xScale(d.x);
|
|
5153
|
+
})//@ts-expect-error
|
|
5154
|
+
.y(function(d) {
|
|
5155
|
+
return yScale(d.y);
|
|
5156
|
+
}).curve(d3.curveBasis);
|
|
5157
|
+
d3.select(svgRef.current).selectAll('path').attr('width', width * 2 - svgInnerMargin).attr('height', height).data([
|
|
5158
|
+
points
|
|
5159
|
+
]).attr('fill', 'none').attr('stroke', 'var(--color-brand)').attr('stroke-width', 2).join('path').attr('d', line);
|
|
5160
|
+
}, [
|
|
5161
|
+
points,
|
|
5162
|
+
maxLength
|
|
5163
|
+
]);
|
|
5164
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5165
|
+
style: {
|
|
5166
|
+
backgroundColor: 'var(--bg-page)'
|
|
5167
|
+
},
|
|
5168
|
+
padding: [
|
|
5169
|
+
Box.padding.medium
|
|
5170
|
+
]
|
|
5171
|
+
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
5172
|
+
style: {
|
|
5173
|
+
position: 'relative',
|
|
5174
|
+
overflow: 'hidden',
|
|
5175
|
+
width: width
|
|
5176
|
+
}
|
|
5177
|
+
}, /*#__PURE__*/ React__default.createElement("svg", {
|
|
5178
|
+
width: width * 2,
|
|
5179
|
+
height: height,
|
|
5180
|
+
ref: svgRef,
|
|
5181
|
+
style: {
|
|
5182
|
+
transform: "translate(".concat((syncTypeValue === 0 || syncTypeValue === 1 ? phaseValue * 100 - 50 : syncOffsetValue * 100 - 50) / 2, "%)"),
|
|
5183
|
+
margin: "0 -".concat(width / 2)
|
|
5184
|
+
}
|
|
5185
|
+
})));
|
|
5186
|
+
}
|
|
5187
|
+
|
|
4783
5188
|
function _array_like_to_array$3(arr, len) {
|
|
4784
5189
|
if (len == null || len > arr.length) len = arr.length;
|
|
4785
5190
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -4830,8 +5235,8 @@ function LFO(param) {
|
|
|
4830
5235
|
var id = param.id;
|
|
4831
5236
|
var _useState = _sliced_to_array$3(useState(0), 2), syncType = _useState[0], setSyncType = _useState[1];
|
|
4832
5237
|
useEffect(function() {
|
|
4833
|
-
var
|
|
4834
|
-
var syncType = (
|
|
5238
|
+
var _Juce_getComboBoxState;
|
|
5239
|
+
var syncType = (_Juce_getComboBoxState = Juce.getComboBoxState("LFO".concat(id, "_SyncType"))) === null || _Juce_getComboBoxState === void 0 ? void 0 : _Juce_getComboBoxState.getChoiceIndex();
|
|
4835
5240
|
setSyncType(syncType);
|
|
4836
5241
|
}, [
|
|
4837
5242
|
window
|
|
@@ -4842,10 +5247,9 @@ function LFO(param) {
|
|
|
4842
5247
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4843
5248
|
className: "LFOTab",
|
|
4844
5249
|
flexDirection: Box.flexDirection.column
|
|
4845
|
-
}, /*#__PURE__*/ React__default.createElement(
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
}, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
5250
|
+
}, /*#__PURE__*/ React__default.createElement(LFOVisualizer, {
|
|
5251
|
+
id: id
|
|
5252
|
+
}), /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4849
5253
|
labelColor: "var(--color-text)",
|
|
4850
5254
|
color: "var(--color-brand)",
|
|
4851
5255
|
id: "LFO".concat(id, "_SyncType"),
|
|
@@ -4868,15 +5272,15 @@ function LFO(param) {
|
|
|
4868
5272
|
}) : null, syncType === 4 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4869
5273
|
id: "LFO".concat(id, "_Sixteenths"),
|
|
4870
5274
|
label: "LFO".concat(id, " Sixteenths")
|
|
4871
|
-
}) : null), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4872
|
-
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
4873
|
-
id: "LFO".concat(id, "_Sync_Offset"),
|
|
4874
|
-
label: "LFO".concat(id, " Sync Offset")
|
|
4875
|
-
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
5275
|
+
}) : null), syncType === 0 || syncType === 1 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4876
5276
|
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
4877
5277
|
id: "LFO".concat(id, "_Phase"),
|
|
4878
5278
|
label: "LFO".concat(id, " Phase")
|
|
4879
|
-
}), /*#__PURE__*/ React__default.createElement(
|
|
5279
|
+
}) : null, syncType !== 0 && syncType !== 1 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
5280
|
+
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
5281
|
+
id: "LFO".concat(id, "_Sync_Offset"),
|
|
5282
|
+
label: "LFO".concat(id, " Sync Offset")
|
|
5283
|
+
}) : null, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4880
5284
|
labelColor: "var(--color-text)",
|
|
4881
5285
|
color: "var(--color-brand)",
|
|
4882
5286
|
id: "LFO".concat(id, "_Wave"),
|
|
@@ -4896,7 +5300,7 @@ function LFO(param) {
|
|
|
4896
5300
|
function LFOTab() {
|
|
4897
5301
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4898
5302
|
className: "LFOTab",
|
|
4899
|
-
|
|
5303
|
+
gap: Box.gap.medium
|
|
4900
5304
|
}, /*#__PURE__*/ React__default.createElement(LFO, {
|
|
4901
5305
|
id: 1
|
|
4902
5306
|
}), /*#__PURE__*/ React__default.createElement(LFO, {
|
|
@@ -5091,9 +5495,14 @@ function SeqTab$1(param) {
|
|
|
5091
5495
|
var handleSyncTypeChange = function(value) {
|
|
5092
5496
|
setSyncType(value);
|
|
5093
5497
|
};
|
|
5094
|
-
return /*#__PURE__*/ React__default.createElement(Box,
|
|
5498
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5499
|
+
flexDirection: Box.flexDirection.column,
|
|
5500
|
+
gap: Box.gap.medium
|
|
5501
|
+
}, /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(StepSequencer, {
|
|
5502
|
+
seqId: seqId
|
|
5503
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
5095
5504
|
alignItems: Box.alignItems.flexEnd,
|
|
5096
|
-
justifyContent: Box.justifyContent.
|
|
5505
|
+
justifyContent: Box.justifyContent.center
|
|
5097
5506
|
}, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
5098
5507
|
labelColor: "var(--color-text)",
|
|
5099
5508
|
color: "var(--color-brand)",
|
|
@@ -5120,16 +5529,13 @@ function SeqTab$1(param) {
|
|
|
5120
5529
|
}) : null), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
5121
5530
|
id: "seq".concat(seqId, "_amp"),
|
|
5122
5531
|
label: "Seq".concat(seqId, " Amp")
|
|
5123
|
-
})), /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(StepSequencer, {
|
|
5124
|
-
seqId: seqId
|
|
5125
5532
|
})));
|
|
5126
5533
|
}
|
|
5127
5534
|
|
|
5128
5535
|
function SeqTab() {
|
|
5129
5536
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5130
5537
|
className: "SeqTab",
|
|
5131
|
-
|
|
5132
|
-
gap: Box.gap.large
|
|
5538
|
+
gap: Box.gap.medium
|
|
5133
5539
|
}, /*#__PURE__*/ React__default.createElement(SeqTab$1, {
|
|
5134
5540
|
seqId: 1
|
|
5135
5541
|
}), /*#__PURE__*/ React__default.createElement(SeqTab$1, {
|