@antimatter-audio/antimatter-ui 10.14.2 → 10.15.1
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/hooks/useSlider.d.ts.map +1 -1
- package/dist/index.js +613 -224
- 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
|
@@ -3,7 +3,7 @@ import React__default, { useEffect, useRef, useReducer, useCallback, createConte
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { TabGroup, TabList, Tab, Listbox, ListboxButton, ListboxOptions, ListboxOption, Combobox, ComboboxInput, ComboboxButton, ComboboxOptions, ComboboxOption } from '@headlessui/react';
|
|
5
5
|
import * as Juce from 'juce-framework-frontend';
|
|
6
|
-
import {
|
|
6
|
+
import { useGesture, useDrag } from '@use-gesture/react';
|
|
7
7
|
import * as d3 from 'd3';
|
|
8
8
|
|
|
9
9
|
function styleInject(css, ref) {
|
|
@@ -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,15 @@ 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);
|
|
1539
|
+
var sliderState = Juce.getSliderState(id);
|
|
1536
1540
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1537
1541
|
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged, setDefaultParameter = _useGlobalContext.setDefaultParameter;
|
|
1538
|
-
var _useState2 = _sliced_to_array$
|
|
1542
|
+
var _useState2 = _sliced_to_array$c(useState(false), 2), isActive = _useState2[0], setIsActive = _useState2[1];
|
|
1539
1543
|
useEffect(function() {
|
|
1540
1544
|
document.addEventListener('click', clickListener);
|
|
1541
1545
|
document.addEventListener('keydown', keyDownListener);
|
|
@@ -1550,13 +1554,14 @@ var useSlider = function(param) {
|
|
|
1550
1554
|
// Set the initial state
|
|
1551
1555
|
//@ts-expect-error
|
|
1552
1556
|
useEffect(function() {
|
|
1553
|
-
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,9 +1579,23 @@ 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
|
-
var sliderState = Juce.getSliderState(id);
|
|
1580
1599
|
updateLocalState(sliderState);
|
|
1581
1600
|
}, [
|
|
1582
1601
|
id
|
|
@@ -1585,7 +1604,6 @@ var useSlider = function(param) {
|
|
|
1585
1604
|
//@ts-expect-error
|
|
1586
1605
|
useEffect(function() {
|
|
1587
1606
|
if (!isLocalhost) {
|
|
1588
|
-
var sliderState = Juce.getSliderState(id);
|
|
1589
1607
|
var valueListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.addListener(function() {
|
|
1590
1608
|
updateLocalState(sliderState);
|
|
1591
1609
|
});
|
|
@@ -1600,24 +1618,8 @@ var useSlider = function(param) {
|
|
|
1600
1618
|
}, [
|
|
1601
1619
|
window
|
|
1602
1620
|
]);
|
|
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
1621
|
// Update JUCE state
|
|
1619
1622
|
var setNormalisedState = function(newValue) {
|
|
1620
|
-
var sliderState = Juce.getSliderState(id);
|
|
1621
1623
|
var fixedNewValue = parseFloat(newValue.toFixed(2));
|
|
1622
1624
|
if ((normalisedValueRef === null || normalisedValueRef === void 0 ? void 0 : normalisedValueRef.current) !== fixedNewValue) {
|
|
1623
1625
|
!isLocalhost && sliderState.setNormalisedValue(clamp(fixedNewValue));
|
|
@@ -1653,33 +1655,34 @@ var useSlider = function(param) {
|
|
|
1653
1655
|
setNormalisedState(newValue);
|
|
1654
1656
|
};
|
|
1655
1657
|
var setScaledState = function(newValue) {
|
|
1656
|
-
var sliderState = Juce.getSliderState(id);
|
|
1657
1658
|
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
1659
|
+
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2;
|
|
1658
1660
|
!isLocalhost && properties && sliderState.setNormalisedValue(scaledToNormalised({
|
|
1659
1661
|
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:
|
|
1662
|
+
start: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.start,
|
|
1663
|
+
end: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties1 = sliderState.properties) === null || _sliderState_properties1 === void 0 ? void 0 : _sliderState_properties1.end,
|
|
1664
|
+
skew: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties2 = sliderState.properties) === null || _sliderState_properties2 === void 0 ? void 0 : _sliderState_properties2.skew
|
|
1661
1665
|
}));
|
|
1662
1666
|
scaledValueRef.current = newValue;
|
|
1663
1667
|
}
|
|
1664
1668
|
};
|
|
1665
|
-
var bindDrag =
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1669
|
+
var bindDrag = useGesture({
|
|
1670
|
+
onMouseDown: function(param) {
|
|
1671
|
+
param.event;
|
|
1672
|
+
if (!dragInProgress) {
|
|
1673
|
+
sliderState.sliderDragStarted(id);
|
|
1674
|
+
dragInProgress = true;
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
onDrag: function(param) {
|
|
1678
|
+
param.event; var delta = param.delta;
|
|
1674
1679
|
var deltaVal = delta[1] * -1;
|
|
1675
1680
|
var newValue = updateValue(deltaVal);
|
|
1676
1681
|
setNormalisedState(newValue);
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
i: "".concat(0)
|
|
1682
|
-
});
|
|
1682
|
+
},
|
|
1683
|
+
onMouseUp: function(param) {
|
|
1684
|
+
param.event;
|
|
1685
|
+
sliderState.sliderDragEnded();
|
|
1683
1686
|
}
|
|
1684
1687
|
});
|
|
1685
1688
|
var bindBarSliderDrag = function() {
|
|
@@ -1691,10 +1694,7 @@ var useSlider = function(param) {
|
|
|
1691
1694
|
var x = (event === null || event === void 0 ? void 0 : event.clientX) - rect.left;
|
|
1692
1695
|
// 1138 - 1043.1
|
|
1693
1696
|
if (first) {
|
|
1694
|
-
|
|
1695
|
-
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1696
|
-
i: "".concat(0)
|
|
1697
|
-
});
|
|
1697
|
+
sliderState.sliderDragStarted(id);
|
|
1698
1698
|
}
|
|
1699
1699
|
if (down) {
|
|
1700
1700
|
// TODO: Increments?
|
|
@@ -1709,10 +1709,7 @@ var useSlider = function(param) {
|
|
|
1709
1709
|
setNormalisedState(clamp(newValue));
|
|
1710
1710
|
}
|
|
1711
1711
|
if (last) {
|
|
1712
|
-
|
|
1713
|
-
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1714
|
-
i: "".concat(0)
|
|
1715
|
-
});
|
|
1712
|
+
sliderState.sliderDragEnded();
|
|
1716
1713
|
}
|
|
1717
1714
|
}, {
|
|
1718
1715
|
preventDefault: false
|
|
@@ -1736,10 +1733,7 @@ var useSlider = function(param) {
|
|
|
1736
1733
|
onMouseDown: function(param) {
|
|
1737
1734
|
param.event;
|
|
1738
1735
|
if (!dragInProgress) {
|
|
1739
|
-
|
|
1740
|
-
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1741
|
-
i: "".concat(0)
|
|
1742
|
-
});
|
|
1736
|
+
sliderState.sliderDragStarted(id);
|
|
1743
1737
|
dragInProgress = true;
|
|
1744
1738
|
}
|
|
1745
1739
|
},
|
|
@@ -1766,10 +1760,7 @@ var useSlider = function(param) {
|
|
|
1766
1760
|
param.event;
|
|
1767
1761
|
if (dragInProgress = true) {
|
|
1768
1762
|
dragInProgress = false;
|
|
1769
|
-
|
|
1770
|
-
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1771
|
-
i: "".concat(0)
|
|
1772
|
-
});
|
|
1763
|
+
sliderState.sliderDragEnded();
|
|
1773
1764
|
}
|
|
1774
1765
|
}
|
|
1775
1766
|
});
|
|
@@ -1963,7 +1954,9 @@ function RotarySlider(param) {
|
|
|
1963
1954
|
onComplete: function(value) {
|
|
1964
1955
|
var normalisedVal = properties && scaledToNormalised({
|
|
1965
1956
|
scaledValue: value,
|
|
1966
|
-
properties: properties
|
|
1957
|
+
start: properties === null || properties === void 0 ? void 0 : properties.start,
|
|
1958
|
+
end: properties === null || properties === void 0 ? void 0 : properties.end,
|
|
1959
|
+
skew: properties === null || properties === void 0 ? void 0 : properties.skew
|
|
1967
1960
|
});
|
|
1968
1961
|
normalisedVal !== undefined && setNormalisedState(normalisedVal);
|
|
1969
1962
|
}
|
|
@@ -2149,15 +2142,15 @@ Heading.fontSize = FontSizes;
|
|
|
2149
2142
|
Heading.tag = HeadingTags;
|
|
2150
2143
|
Heading.padding = Spacing;
|
|
2151
2144
|
|
|
2152
|
-
function _array_like_to_array$
|
|
2145
|
+
function _array_like_to_array$b(arr, len) {
|
|
2153
2146
|
if (len == null || len > arr.length) len = arr.length;
|
|
2154
2147
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2155
2148
|
return arr2;
|
|
2156
2149
|
}
|
|
2157
|
-
function _array_with_holes$
|
|
2150
|
+
function _array_with_holes$b(arr) {
|
|
2158
2151
|
if (Array.isArray(arr)) return arr;
|
|
2159
2152
|
}
|
|
2160
|
-
function _iterable_to_array_limit$
|
|
2153
|
+
function _iterable_to_array_limit$b(arr, i) {
|
|
2161
2154
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2162
2155
|
if (_i == null) return;
|
|
2163
2156
|
var _arr = [];
|
|
@@ -2181,26 +2174,26 @@ function _iterable_to_array_limit$a(arr, i) {
|
|
|
2181
2174
|
}
|
|
2182
2175
|
return _arr;
|
|
2183
2176
|
}
|
|
2184
|
-
function _non_iterable_rest$
|
|
2177
|
+
function _non_iterable_rest$b() {
|
|
2185
2178
|
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
2179
|
}
|
|
2187
|
-
function _sliced_to_array$
|
|
2188
|
-
return _array_with_holes$
|
|
2180
|
+
function _sliced_to_array$b(arr, i) {
|
|
2181
|
+
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
2182
|
}
|
|
2190
|
-
function _unsupported_iterable_to_array$
|
|
2183
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
2191
2184
|
if (!o) return;
|
|
2192
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2185
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
2193
2186
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2194
2187
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2195
2188
|
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$
|
|
2189
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
2197
2190
|
}
|
|
2198
2191
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
2199
2192
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
2200
2193
|
var useIndicator = function(param) {
|
|
2201
2194
|
var id = param.id;
|
|
2202
2195
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
2203
|
-
var _useState = _sliced_to_array$
|
|
2196
|
+
var _useState = _sliced_to_array$b(useState(0), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
2204
2197
|
// Set the initial state
|
|
2205
2198
|
useEffect(function() {
|
|
2206
2199
|
if (!isLocalhost) {
|
|
@@ -2284,7 +2277,7 @@ function IndicatorLight(param) {
|
|
|
2284
2277
|
}) : null);
|
|
2285
2278
|
}
|
|
2286
2279
|
|
|
2287
|
-
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\
|
|
2280
|
+
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
2281
|
styleInject(css_248z$5);
|
|
2289
2282
|
|
|
2290
2283
|
function _define_property$a(obj, key, value) {
|
|
@@ -2694,14 +2687,16 @@ function KeyValueDisplayScreen(param) {
|
|
|
2694
2687
|
}
|
|
2695
2688
|
|
|
2696
2689
|
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;
|
|
2690
|
+
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
2691
|
//TODO: Figure out why some data is null
|
|
2699
|
-
var filteredData = data.filter(function(item) {
|
|
2692
|
+
var filteredData = data ? Array.isArray(data) ? data === null || data === void 0 ? void 0 : data.filter(function(item) {
|
|
2700
2693
|
return item !== null;
|
|
2701
|
-
})
|
|
2694
|
+
}) : [
|
|
2695
|
+
data
|
|
2696
|
+
] : [];
|
|
2702
2697
|
var x = d3.scaleLinear([
|
|
2703
2698
|
0,
|
|
2704
|
-
filteredData.length - 1
|
|
2699
|
+
(filteredData === null || filteredData === void 0 ? void 0 : filteredData.length) - 1
|
|
2705
2700
|
], [
|
|
2706
2701
|
marginLeft,
|
|
2707
2702
|
width - marginRight
|
|
@@ -2736,7 +2731,7 @@ function LinePlot(param) {
|
|
|
2736
2731
|
filter: "url(#blur)",
|
|
2737
2732
|
// @ts-expect-error
|
|
2738
2733
|
d: line(filteredData)
|
|
2739
|
-
})), /*#__PURE__*/ React__default.createElement("svg", {
|
|
2734
|
+
})), displayGrid ? /*#__PURE__*/ React__default.createElement("svg", {
|
|
2740
2735
|
style: {
|
|
2741
2736
|
position: 'absolute',
|
|
2742
2737
|
top: 0,
|
|
@@ -2761,18 +2756,18 @@ function LinePlot(param) {
|
|
|
2761
2756
|
width: width,
|
|
2762
2757
|
height: width,
|
|
2763
2758
|
fill: "url(#grid)"
|
|
2764
|
-
})));
|
|
2759
|
+
})) : null);
|
|
2765
2760
|
}
|
|
2766
2761
|
|
|
2767
2762
|
var css_248z$4 = ".Oscilloscope {\n background: #0EAC8B;\n box-shadow: inset 0 0 20px #086350;\n height: 200px;\n };";
|
|
2768
2763
|
styleInject(css_248z$4);
|
|
2769
2764
|
|
|
2770
|
-
function _array_like_to_array$
|
|
2765
|
+
function _array_like_to_array$a(arr, len) {
|
|
2771
2766
|
if (len == null || len > arr.length) len = arr.length;
|
|
2772
2767
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2773
2768
|
return arr2;
|
|
2774
2769
|
}
|
|
2775
|
-
function _array_with_holes$
|
|
2770
|
+
function _array_with_holes$a(arr) {
|
|
2776
2771
|
if (Array.isArray(arr)) return arr;
|
|
2777
2772
|
}
|
|
2778
2773
|
function _define_property$7(obj, key, value) {
|
|
@@ -2788,7 +2783,7 @@ function _define_property$7(obj, key, value) {
|
|
|
2788
2783
|
}
|
|
2789
2784
|
return obj;
|
|
2790
2785
|
}
|
|
2791
|
-
function _iterable_to_array_limit$
|
|
2786
|
+
function _iterable_to_array_limit$a(arr, i) {
|
|
2792
2787
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2793
2788
|
if (_i == null) return;
|
|
2794
2789
|
var _arr = [];
|
|
@@ -2812,7 +2807,7 @@ function _iterable_to_array_limit$9(arr, i) {
|
|
|
2812
2807
|
}
|
|
2813
2808
|
return _arr;
|
|
2814
2809
|
}
|
|
2815
|
-
function _non_iterable_rest$
|
|
2810
|
+
function _non_iterable_rest$a() {
|
|
2816
2811
|
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
2812
|
}
|
|
2818
2813
|
function _object_spread$7(target) {
|
|
@@ -2830,20 +2825,20 @@ function _object_spread$7(target) {
|
|
|
2830
2825
|
}
|
|
2831
2826
|
return target;
|
|
2832
2827
|
}
|
|
2833
|
-
function _sliced_to_array$
|
|
2834
|
-
return _array_with_holes$
|
|
2828
|
+
function _sliced_to_array$a(arr, i) {
|
|
2829
|
+
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
2830
|
}
|
|
2836
|
-
function _unsupported_iterable_to_array$
|
|
2831
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
2837
2832
|
if (!o) return;
|
|
2838
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2833
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
2839
2834
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2840
2835
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2841
2836
|
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$
|
|
2837
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
2843
2838
|
}
|
|
2844
2839
|
function Oscilloscope(param) {
|
|
2845
2840
|
var width = param.width, height = param.height, className = param.className, style = param.style, id = param.id;
|
|
2846
|
-
var _useState = _sliced_to_array$
|
|
2841
|
+
var _useState = _sliced_to_array$a(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
2847
2842
|
useEffect(function() {
|
|
2848
2843
|
//@ts-expect-error
|
|
2849
2844
|
var removalToken = window.__JUCE__.backend.addEventListener('oscData', function() {
|
|
@@ -2878,12 +2873,12 @@ styleInject(css_248z$3);
|
|
|
2878
2873
|
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
2874
|
styleInject(css_248z$2);
|
|
2880
2875
|
|
|
2881
|
-
function _array_like_to_array$
|
|
2876
|
+
function _array_like_to_array$9(arr, len) {
|
|
2882
2877
|
if (len == null || len > arr.length) len = arr.length;
|
|
2883
2878
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2884
2879
|
return arr2;
|
|
2885
2880
|
}
|
|
2886
|
-
function _array_with_holes$
|
|
2881
|
+
function _array_with_holes$9(arr) {
|
|
2887
2882
|
if (Array.isArray(arr)) return arr;
|
|
2888
2883
|
}
|
|
2889
2884
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2915,7 +2910,7 @@ function _async_to_generator$3(fn) {
|
|
|
2915
2910
|
});
|
|
2916
2911
|
};
|
|
2917
2912
|
}
|
|
2918
|
-
function _iterable_to_array_limit$
|
|
2913
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
2919
2914
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2920
2915
|
if (_i == null) return;
|
|
2921
2916
|
var _arr = [];
|
|
@@ -2939,23 +2934,23 @@ function _iterable_to_array_limit$8(arr, i) {
|
|
|
2939
2934
|
}
|
|
2940
2935
|
return _arr;
|
|
2941
2936
|
}
|
|
2942
|
-
function _non_iterable_rest$
|
|
2937
|
+
function _non_iterable_rest$9() {
|
|
2943
2938
|
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
2939
|
}
|
|
2945
2940
|
function _object_destructuring_empty(o) {
|
|
2946
2941
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
2947
2942
|
return o;
|
|
2948
2943
|
}
|
|
2949
|
-
function _sliced_to_array$
|
|
2950
|
-
return _array_with_holes$
|
|
2944
|
+
function _sliced_to_array$9(arr, i) {
|
|
2945
|
+
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
2946
|
}
|
|
2952
|
-
function _unsupported_iterable_to_array$
|
|
2947
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
2953
2948
|
if (!o) return;
|
|
2954
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2949
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
2955
2950
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2956
2951
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2957
2952
|
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$
|
|
2953
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
2959
2954
|
}
|
|
2960
2955
|
function _ts_generator$3(thisArg, body) {
|
|
2961
2956
|
var f, y, t, _ = {
|
|
@@ -3050,16 +3045,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
3050
3045
|
}
|
|
3051
3046
|
function PresetManager(param) {
|
|
3052
3047
|
_object_destructuring_empty(param);
|
|
3053
|
-
var _useState = _sliced_to_array$
|
|
3054
|
-
var _useState1 = _sliced_to_array$
|
|
3048
|
+
var _useState = _sliced_to_array$9(useState([]), 2), presetList = _useState[0], setPresetList = _useState[1];
|
|
3049
|
+
var _useState1 = _sliced_to_array$9(useState(false), 2); _useState1[0]; var setIsSaving = _useState1[1];
|
|
3055
3050
|
var savePresetFunc = Juce.getNativeFunction('savePreset');
|
|
3056
3051
|
var loadPresetFunc = Juce.getNativeFunction('loadPreset');
|
|
3057
3052
|
var getAllPresetsFunc = Juce.getNativeFunction('getAllPresets');
|
|
3058
3053
|
var getCurrentPresetFunc = Juce.getNativeFunction('getCurrentPreset');
|
|
3059
3054
|
var isDirtyFunc = Juce.getNativeFunction('canUndo');
|
|
3060
|
-
var _useState2 = _sliced_to_array$
|
|
3055
|
+
var _useState2 = _sliced_to_array$9(useState(), 2), selectedPreset = _useState2[0], setSelectedPreset = _useState2[1];
|
|
3061
3056
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3062
|
-
var _useState3 = _sliced_to_array$
|
|
3057
|
+
var _useState3 = _sliced_to_array$9(useState(false), 2), isDirty = _useState3[0], setIsDirty = _useState3[1];
|
|
3063
3058
|
useEffect(function() {
|
|
3064
3059
|
if (!isLocalhost) {
|
|
3065
3060
|
var isDirtyListenerId = //@ts-expect-error
|
|
@@ -3335,12 +3330,12 @@ function PresetManager(param) {
|
|
|
3335
3330
|
}))))));
|
|
3336
3331
|
}
|
|
3337
3332
|
|
|
3338
|
-
function _array_like_to_array$
|
|
3333
|
+
function _array_like_to_array$8(arr, len) {
|
|
3339
3334
|
if (len == null || len > arr.length) len = arr.length;
|
|
3340
3335
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3341
3336
|
return arr2;
|
|
3342
3337
|
}
|
|
3343
|
-
function _array_with_holes$
|
|
3338
|
+
function _array_with_holes$8(arr) {
|
|
3344
3339
|
if (Array.isArray(arr)) return arr;
|
|
3345
3340
|
}
|
|
3346
3341
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3385,7 +3380,7 @@ function _define_property$6(obj, key, value) {
|
|
|
3385
3380
|
}
|
|
3386
3381
|
return obj;
|
|
3387
3382
|
}
|
|
3388
|
-
function _iterable_to_array_limit$
|
|
3383
|
+
function _iterable_to_array_limit$8(arr, i) {
|
|
3389
3384
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3390
3385
|
if (_i == null) return;
|
|
3391
3386
|
var _arr = [];
|
|
@@ -3409,7 +3404,7 @@ function _iterable_to_array_limit$7(arr, i) {
|
|
|
3409
3404
|
}
|
|
3410
3405
|
return _arr;
|
|
3411
3406
|
}
|
|
3412
|
-
function _non_iterable_rest$
|
|
3407
|
+
function _non_iterable_rest$8() {
|
|
3413
3408
|
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
3409
|
}
|
|
3415
3410
|
function _object_spread$6(target) {
|
|
@@ -3427,16 +3422,16 @@ function _object_spread$6(target) {
|
|
|
3427
3422
|
}
|
|
3428
3423
|
return target;
|
|
3429
3424
|
}
|
|
3430
|
-
function _sliced_to_array$
|
|
3431
|
-
return _array_with_holes$
|
|
3425
|
+
function _sliced_to_array$8(arr, i) {
|
|
3426
|
+
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
3427
|
}
|
|
3433
|
-
function _unsupported_iterable_to_array$
|
|
3428
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
3434
3429
|
if (!o) return;
|
|
3435
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3430
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
3436
3431
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3437
3432
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3438
3433
|
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$
|
|
3434
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
3440
3435
|
}
|
|
3441
3436
|
function _ts_generator$2(thisArg, body) {
|
|
3442
3437
|
var f, y, t, _ = {
|
|
@@ -3619,8 +3614,8 @@ function ModuleHeader(param) {
|
|
|
3619
3614
|
}, [
|
|
3620
3615
|
window
|
|
3621
3616
|
]);
|
|
3622
|
-
var _useState = _sliced_to_array$
|
|
3623
|
-
var _useState1 = _sliced_to_array$
|
|
3617
|
+
var _useState = _sliced_to_array$8(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3618
|
+
var _useState1 = _sliced_to_array$8(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3624
3619
|
var handleUndo = function() {
|
|
3625
3620
|
undo();
|
|
3626
3621
|
};
|
|
@@ -3924,15 +3919,15 @@ function SingleBarViz(param) {
|
|
|
3924
3919
|
}
|
|
3925
3920
|
SingleBarViz.polarity = Polarity;
|
|
3926
3921
|
|
|
3927
|
-
function _array_like_to_array$
|
|
3922
|
+
function _array_like_to_array$7(arr, len) {
|
|
3928
3923
|
if (len == null || len > arr.length) len = arr.length;
|
|
3929
3924
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3930
3925
|
return arr2;
|
|
3931
3926
|
}
|
|
3932
|
-
function _array_with_holes$
|
|
3927
|
+
function _array_with_holes$7(arr) {
|
|
3933
3928
|
if (Array.isArray(arr)) return arr;
|
|
3934
3929
|
}
|
|
3935
|
-
function _iterable_to_array_limit$
|
|
3930
|
+
function _iterable_to_array_limit$7(arr, i) {
|
|
3936
3931
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3937
3932
|
if (_i == null) return;
|
|
3938
3933
|
var _arr = [];
|
|
@@ -3956,26 +3951,26 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
3956
3951
|
}
|
|
3957
3952
|
return _arr;
|
|
3958
3953
|
}
|
|
3959
|
-
function _non_iterable_rest$
|
|
3954
|
+
function _non_iterable_rest$7() {
|
|
3960
3955
|
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
3956
|
}
|
|
3962
|
-
function _sliced_to_array$
|
|
3963
|
-
return _array_with_holes$
|
|
3957
|
+
function _sliced_to_array$7(arr, i) {
|
|
3958
|
+
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
3959
|
}
|
|
3965
|
-
function _unsupported_iterable_to_array$
|
|
3960
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
3966
3961
|
if (!o) return;
|
|
3967
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3962
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
3968
3963
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3969
3964
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3970
3965
|
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$
|
|
3966
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
3972
3967
|
}
|
|
3973
3968
|
var useCombobox = function(param) {
|
|
3974
3969
|
var id = param.id, filter = param.filter, onChange = param.onChange;
|
|
3975
3970
|
var _Object_values;
|
|
3976
3971
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
3977
|
-
var _useState = _sliced_to_array$
|
|
3978
|
-
var _useState1 = _sliced_to_array$
|
|
3972
|
+
var _useState = _sliced_to_array$7(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
3973
|
+
var _useState1 = _sliced_to_array$7(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
3979
3974
|
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3980
3975
|
//TODO: Filter choices for subsequent rows
|
|
3981
3976
|
// const availableChoices = properties?.choices;
|
|
@@ -4039,12 +4034,12 @@ var useCombobox = function(param) {
|
|
|
4039
4034
|
};
|
|
4040
4035
|
};
|
|
4041
4036
|
|
|
4042
|
-
function _array_like_to_array$
|
|
4037
|
+
function _array_like_to_array$6(arr, len) {
|
|
4043
4038
|
if (len == null || len > arr.length) len = arr.length;
|
|
4044
4039
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4045
4040
|
return arr2;
|
|
4046
4041
|
}
|
|
4047
|
-
function _array_with_holes$
|
|
4042
|
+
function _array_with_holes$6(arr) {
|
|
4048
4043
|
if (Array.isArray(arr)) return arr;
|
|
4049
4044
|
}
|
|
4050
4045
|
function _define_property$4(obj, key, value) {
|
|
@@ -4060,7 +4055,7 @@ function _define_property$4(obj, key, value) {
|
|
|
4060
4055
|
}
|
|
4061
4056
|
return obj;
|
|
4062
4057
|
}
|
|
4063
|
-
function _iterable_to_array_limit$
|
|
4058
|
+
function _iterable_to_array_limit$6(arr, i) {
|
|
4064
4059
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4065
4060
|
if (_i == null) return;
|
|
4066
4061
|
var _arr = [];
|
|
@@ -4084,7 +4079,7 @@ function _iterable_to_array_limit$5(arr, i) {
|
|
|
4084
4079
|
}
|
|
4085
4080
|
return _arr;
|
|
4086
4081
|
}
|
|
4087
|
-
function _non_iterable_rest$
|
|
4082
|
+
function _non_iterable_rest$6() {
|
|
4088
4083
|
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
4084
|
}
|
|
4090
4085
|
function _object_spread$4(target) {
|
|
@@ -4102,22 +4097,22 @@ function _object_spread$4(target) {
|
|
|
4102
4097
|
}
|
|
4103
4098
|
return target;
|
|
4104
4099
|
}
|
|
4105
|
-
function _sliced_to_array$
|
|
4106
|
-
return _array_with_holes$
|
|
4100
|
+
function _sliced_to_array$6(arr, i) {
|
|
4101
|
+
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
4102
|
}
|
|
4108
|
-
function _unsupported_iterable_to_array$
|
|
4103
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
4109
4104
|
if (!o) return;
|
|
4110
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4105
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
4111
4106
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4112
4107
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4113
4108
|
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$
|
|
4109
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
4115
4110
|
}
|
|
4116
4111
|
function ModMatrixComboboxCell(param) {
|
|
4117
4112
|
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
4118
4113
|
var _SingleBarViz_polarity;
|
|
4119
|
-
var _useState = _sliced_to_array$
|
|
4120
|
-
var _useState1 = _sliced_to_array$
|
|
4114
|
+
var _useState = _sliced_to_array$6(useState(), 2), targetValue = _useState[0], setTargetValue = _useState[1];
|
|
4115
|
+
var _useState1 = _sliced_to_array$6(useState(''), 2), filterString = _useState1[0], setFilterString = _useState1[1];
|
|
4121
4116
|
var _useGlobalContext = useGlobalContext(), automatableParamLabels = _useGlobalContext.globalState.automatableParamLabels;
|
|
4122
4117
|
var _useCombobox = useCombobox({
|
|
4123
4118
|
id: rowId,
|
|
@@ -4413,16 +4408,16 @@ function ModMatrixRow(param) {
|
|
|
4413
4408
|
}));
|
|
4414
4409
|
}
|
|
4415
4410
|
|
|
4416
|
-
function _array_like_to_array$
|
|
4411
|
+
function _array_like_to_array$5(arr, len) {
|
|
4417
4412
|
if (len == null || len > arr.length) len = arr.length;
|
|
4418
4413
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4419
4414
|
return arr2;
|
|
4420
4415
|
}
|
|
4421
|
-
function _array_with_holes$
|
|
4416
|
+
function _array_with_holes$5(arr) {
|
|
4422
4417
|
if (Array.isArray(arr)) return arr;
|
|
4423
4418
|
}
|
|
4424
4419
|
function _array_without_holes(arr) {
|
|
4425
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
4420
|
+
if (Array.isArray(arr)) return _array_like_to_array$5(arr);
|
|
4426
4421
|
}
|
|
4427
4422
|
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4428
4423
|
try {
|
|
@@ -4469,7 +4464,7 @@ function _define_property$1(obj, key, value) {
|
|
|
4469
4464
|
function _iterable_to_array(iter) {
|
|
4470
4465
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4471
4466
|
}
|
|
4472
|
-
function _iterable_to_array_limit$
|
|
4467
|
+
function _iterable_to_array_limit$5(arr, i) {
|
|
4473
4468
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4474
4469
|
if (_i == null) return;
|
|
4475
4470
|
var _arr = [];
|
|
@@ -4493,7 +4488,7 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
4493
4488
|
}
|
|
4494
4489
|
return _arr;
|
|
4495
4490
|
}
|
|
4496
|
-
function _non_iterable_rest$
|
|
4491
|
+
function _non_iterable_rest$5() {
|
|
4497
4492
|
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
4493
|
}
|
|
4499
4494
|
function _non_iterable_spread() {
|
|
@@ -4514,19 +4509,19 @@ function _object_spread$1(target) {
|
|
|
4514
4509
|
}
|
|
4515
4510
|
return target;
|
|
4516
4511
|
}
|
|
4517
|
-
function _sliced_to_array$
|
|
4518
|
-
return _array_with_holes$
|
|
4512
|
+
function _sliced_to_array$5(arr, i) {
|
|
4513
|
+
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
4514
|
}
|
|
4520
4515
|
function _to_consumable_array(arr) {
|
|
4521
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$
|
|
4516
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread();
|
|
4522
4517
|
}
|
|
4523
|
-
function _unsupported_iterable_to_array$
|
|
4518
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
4524
4519
|
if (!o) return;
|
|
4525
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4520
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
4526
4521
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4527
4522
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4528
4523
|
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$
|
|
4524
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
4530
4525
|
}
|
|
4531
4526
|
function _ts_generator$1(thisArg, body) {
|
|
4532
4527
|
var f, y, t, _ = {
|
|
@@ -4623,7 +4618,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
4623
4618
|
function ModMatrix(param) {
|
|
4624
4619
|
var className = param.className, style = param.style;
|
|
4625
4620
|
var _Object_keys, _Object_keys1, _Object_keys2;
|
|
4626
|
-
var _useState = _sliced_to_array$
|
|
4621
|
+
var _useState = _sliced_to_array$5(useState(), 2), previewRowIsActive = _useState[0], setPreviewRowIsActive = _useState[1];
|
|
4627
4622
|
var getAutomatableParamsListFunc = Juce.getNativeFunction('getAutomatableParamsList');
|
|
4628
4623
|
var getAllModSlotsFunc = Juce.getNativeFunction('getAllModSlots');
|
|
4629
4624
|
var getModSlotParamsFunc = Juce.getNativeFunction('getModSlotParams');
|
|
@@ -4780,6 +4775,399 @@ function ModMatrix(param) {
|
|
|
4780
4775
|
})));
|
|
4781
4776
|
}
|
|
4782
4777
|
|
|
4778
|
+
var svgInnerMargin = 5;
|
|
4779
|
+
var WaveTypes = /*#__PURE__*/ function(WaveTypes) {
|
|
4780
|
+
WaveTypes["Sine"] = "Sine";
|
|
4781
|
+
WaveTypes["Triangle"] = "Triangle";
|
|
4782
|
+
WaveTypes["Ramp"] = "Ramp";
|
|
4783
|
+
WaveTypes["Saw"] = "Saw";
|
|
4784
|
+
WaveTypes["ExpUp"] = "Exp Up";
|
|
4785
|
+
WaveTypes["ExpDown"] = "Exp Down";
|
|
4786
|
+
WaveTypes["Square"] = "Square";
|
|
4787
|
+
return WaveTypes;
|
|
4788
|
+
}({});
|
|
4789
|
+
|
|
4790
|
+
var getPointArray = function(param) {
|
|
4791
|
+
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;
|
|
4792
|
+
var generateCycle = // Returns a coordinate array for one cycle
|
|
4793
|
+
function generateCycle(index) {
|
|
4794
|
+
var cycle = [];
|
|
4795
|
+
// Pick a number from the 'randomNumbers' array to set the randValue for the cycle
|
|
4796
|
+
var randomNumber = randomNumbers[index % randomNumbers.length] * randValue;
|
|
4797
|
+
//Generate the coordinate array for the cycle
|
|
4798
|
+
for(var i = 1; i < cycleLength; i++){
|
|
4799
|
+
var getAdjustedVal = function() {
|
|
4800
|
+
var startingValue = i + cycleLength;
|
|
4801
|
+
var returnValue;
|
|
4802
|
+
if (startingValue > cycleLength) {
|
|
4803
|
+
returnValue = startingValue % cycleLength;
|
|
4804
|
+
} else if (startingValue < 0) {
|
|
4805
|
+
returnValue = cycleLength - Math.abs(startingValue);
|
|
4806
|
+
} else {
|
|
4807
|
+
returnValue = startingValue;
|
|
4808
|
+
}
|
|
4809
|
+
var pulseWidthParam = 1 - pulseWidth;
|
|
4810
|
+
returnValue = returnValue * (1 + 4 * pulseWidthParam);
|
|
4811
|
+
if (returnValue > cycleLength) {
|
|
4812
|
+
returnValue = 0;
|
|
4813
|
+
}
|
|
4814
|
+
return scaledToNormalised({
|
|
4815
|
+
scaledValue: returnValue,
|
|
4816
|
+
start: 0,
|
|
4817
|
+
end: cycleLength
|
|
4818
|
+
});
|
|
4819
|
+
};
|
|
4820
|
+
var adjustedVal = getAdjustedVal();
|
|
4821
|
+
switch(waveType){
|
|
4822
|
+
case WaveTypes.Sine:
|
|
4823
|
+
var angle = adjustedVal * (2 * Math.PI);
|
|
4824
|
+
//prettier-ignore
|
|
4825
|
+
var sineShape = (1 - randomNumber) * (ampValue * Math.sin(angle)) / 2 + 0.5;
|
|
4826
|
+
cycle.push({
|
|
4827
|
+
x: adjustedVal,
|
|
4828
|
+
//prettier-ignore
|
|
4829
|
+
y: sineShape
|
|
4830
|
+
});
|
|
4831
|
+
break;
|
|
4832
|
+
case WaveTypes.Ramp:
|
|
4833
|
+
cycle.push({
|
|
4834
|
+
y: adjustedVal * ampValue * (1 - randomNumber)
|
|
4835
|
+
});
|
|
4836
|
+
break;
|
|
4837
|
+
case WaveTypes.ExpUp:
|
|
4838
|
+
cycle.push({
|
|
4839
|
+
y: (Math.exp(adjustedVal * ampValue) - 1) / 1.7 * (1 - randomNumber)
|
|
4840
|
+
});
|
|
4841
|
+
break;
|
|
4842
|
+
case WaveTypes.ExpDown:
|
|
4843
|
+
cycle.push({
|
|
4844
|
+
//prettier-ignore
|
|
4845
|
+
y: (Math.exp(adjustedVal > 0 ? (1 - adjustedVal) * ampValue : 0) - 1) / 1.7 * (1 - randomNumber)
|
|
4846
|
+
});
|
|
4847
|
+
break;
|
|
4848
|
+
case WaveTypes.Saw:
|
|
4849
|
+
cycle.push({
|
|
4850
|
+
y: (adjustedVal > 0 ? 1 - adjustedVal : 0) * (1 - randomNumber) * ampValue
|
|
4851
|
+
});
|
|
4852
|
+
break;
|
|
4853
|
+
case WaveTypes.Square:
|
|
4854
|
+
cycle.push({
|
|
4855
|
+
y: adjustedVal > 0.5 ? 1 * (1 - randomNumber) * ampValue : 0 * (1 - randomNumber) * ampValue
|
|
4856
|
+
});
|
|
4857
|
+
break;
|
|
4858
|
+
case WaveTypes.Triangle:
|
|
4859
|
+
cycle.push({
|
|
4860
|
+
y: // prettier-ignore
|
|
4861
|
+
//(pwmInput * 2) > 1023 ? rampTable[2046 - (pwmInput * 2)] : rampTable[pwmInput * 2];
|
|
4862
|
+
adjustedVal * 2 > 1 ? (2 - adjustedVal * 2) * (1 - randomNumber) * ampValue : adjustedVal * 2 * (1 - randomNumber) * ampValue
|
|
4863
|
+
});
|
|
4864
|
+
break;
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
return cycle;
|
|
4868
|
+
};
|
|
4869
|
+
var output = [];
|
|
4870
|
+
var randomNumbers = [
|
|
4871
|
+
0.3,
|
|
4872
|
+
0.8,
|
|
4873
|
+
0.5,
|
|
4874
|
+
0.1,
|
|
4875
|
+
0.7,
|
|
4876
|
+
0.4,
|
|
4877
|
+
0.8,
|
|
4878
|
+
0.2,
|
|
4879
|
+
0.9,
|
|
4880
|
+
0.4
|
|
4881
|
+
];
|
|
4882
|
+
// Calculate the length of one cycle
|
|
4883
|
+
var getCycleLength = function() {
|
|
4884
|
+
var minCycleLength = 40; // Arbitrary number - can adjust up and down
|
|
4885
|
+
var value = maxLength - Math.ceil(maxLength * hz);
|
|
4886
|
+
if (value < minCycleLength) {
|
|
4887
|
+
return minCycleLength;
|
|
4888
|
+
} else {
|
|
4889
|
+
return value;
|
|
4890
|
+
}
|
|
4891
|
+
};
|
|
4892
|
+
var cycleLength = getCycleLength();
|
|
4893
|
+
var numCycles = Math.floor(maxLength / cycleLength);
|
|
4894
|
+
var allCycles = [];
|
|
4895
|
+
for(var i = 0; i < numCycles; i++){
|
|
4896
|
+
var cycle = generateCycle(i);
|
|
4897
|
+
allCycles.push(cycle);
|
|
4898
|
+
}
|
|
4899
|
+
for(var i = 0; i < maxLength; i++){
|
|
4900
|
+
var _allCycles_flat_i;
|
|
4901
|
+
output.push({
|
|
4902
|
+
x: i,
|
|
4903
|
+
y: (_allCycles_flat_i = allCycles.flat()[i]) === null || _allCycles_flat_i === void 0 ? void 0 : _allCycles_flat_i.y
|
|
4904
|
+
});
|
|
4905
|
+
}
|
|
4906
|
+
return output;
|
|
4907
|
+
};
|
|
4908
|
+
|
|
4909
|
+
function _array_like_to_array$4(arr, len) {
|
|
4910
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4911
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4912
|
+
return arr2;
|
|
4913
|
+
}
|
|
4914
|
+
function _array_with_holes$4(arr) {
|
|
4915
|
+
if (Array.isArray(arr)) return arr;
|
|
4916
|
+
}
|
|
4917
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
4918
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4919
|
+
if (_i == null) return;
|
|
4920
|
+
var _arr = [];
|
|
4921
|
+
var _n = true;
|
|
4922
|
+
var _d = false;
|
|
4923
|
+
var _s, _e;
|
|
4924
|
+
try {
|
|
4925
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
4926
|
+
_arr.push(_s.value);
|
|
4927
|
+
if (i && _arr.length === i) break;
|
|
4928
|
+
}
|
|
4929
|
+
} catch (err) {
|
|
4930
|
+
_d = true;
|
|
4931
|
+
_e = err;
|
|
4932
|
+
} finally{
|
|
4933
|
+
try {
|
|
4934
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
4935
|
+
} finally{
|
|
4936
|
+
if (_d) throw _e;
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
return _arr;
|
|
4940
|
+
}
|
|
4941
|
+
function _non_iterable_rest$4() {
|
|
4942
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4943
|
+
}
|
|
4944
|
+
function _sliced_to_array$4(arr, i) {
|
|
4945
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
4946
|
+
}
|
|
4947
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
4948
|
+
if (!o) return;
|
|
4949
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
4950
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4951
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4952
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4953
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
4954
|
+
}
|
|
4955
|
+
function LFOVisualizer(param) {
|
|
4956
|
+
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;
|
|
4957
|
+
var svgRef = useRef(null);
|
|
4958
|
+
var isLocalhost = window.location.hostname === 'localhost';
|
|
4959
|
+
var _useState = _sliced_to_array$4(useState(0), 2), waveValue = _useState[0], setWaveValue = _useState[1];
|
|
4960
|
+
var _useState1 = _sliced_to_array$4(useState(0), 2), hzValue = _useState1[0], setHzValue = _useState1[1];
|
|
4961
|
+
var _useState2 = _sliced_to_array$4(useState(0), 2), hzHiValue = _useState2[0], setHzHiValue = _useState2[1];
|
|
4962
|
+
//@ts-expect-error
|
|
4963
|
+
var _useState3 = _sliced_to_array$4(useState(0), 2); _useState3[0]; var setSyncRateValue = _useState3[1];
|
|
4964
|
+
var _useState4 = _sliced_to_array$4(useState(0), 2), syncTypeValue = _useState4[0], setSyncTypeValue = _useState4[1];
|
|
4965
|
+
//@ts-expect-error
|
|
4966
|
+
var _useState5 = _sliced_to_array$4(useState(0), 2); _useState5[0]; var setSixteenthsValue = _useState5[1];
|
|
4967
|
+
//@ts-expect-error
|
|
4968
|
+
var _useState6 = _sliced_to_array$4(useState(0), 2); _useState6[0]; var setThirdsValue = _useState6[1];
|
|
4969
|
+
var _useState7 = _sliced_to_array$4(useState(0), 2), syncOffsetValue = _useState7[0], setSyncOffsetValue = _useState7[1];
|
|
4970
|
+
var _useState8 = _sliced_to_array$4(useState(0), 2), phaseValue = _useState8[0], setPhaseValue = _useState8[1];
|
|
4971
|
+
var _useState9 = _sliced_to_array$4(useState(0), 2), widthValue = _useState9[0], setWidthValue = _useState9[1];
|
|
4972
|
+
var _useState10 = _sliced_to_array$4(useState(0), 2), ampValue = _useState10[0], setAmpValue = _useState10[1];
|
|
4973
|
+
var _useState11 = _sliced_to_array$4(useState(0), 2), randValue = _useState11[0], setRandValue = _useState11[1];
|
|
4974
|
+
var _useState12 = _sliced_to_array$4(useState([]), 2), points = _useState12[0], setPoints = _useState12[1];
|
|
4975
|
+
// const [numLoops, setNumLoops] = useState(1);
|
|
4976
|
+
var maxLength = 1024;
|
|
4977
|
+
// useEffect(() => {
|
|
4978
|
+
// console.log(
|
|
4979
|
+
// waveValue,
|
|
4980
|
+
// hzValue,
|
|
4981
|
+
// hzHiValue,
|
|
4982
|
+
// syncRateValue,
|
|
4983
|
+
// syncTypeValue,
|
|
4984
|
+
// sixteenthsValue,
|
|
4985
|
+
// thirdsValue,
|
|
4986
|
+
// syncOffsetValue,
|
|
4987
|
+
// phaseValue,
|
|
4988
|
+
// widthValue,
|
|
4989
|
+
// ampValue,
|
|
4990
|
+
// randValue,
|
|
4991
|
+
// );
|
|
4992
|
+
// }, [
|
|
4993
|
+
// waveValue,
|
|
4994
|
+
// hzValue,
|
|
4995
|
+
// hzHiValue,
|
|
4996
|
+
// syncRateValue,
|
|
4997
|
+
// syncTypeValue,
|
|
4998
|
+
// sixteenthsValue,
|
|
4999
|
+
// thirdsValue,
|
|
5000
|
+
// syncOffsetValue,
|
|
5001
|
+
// phaseValue,
|
|
5002
|
+
// widthValue,
|
|
5003
|
+
// ampValue,
|
|
5004
|
+
// randValue,
|
|
5005
|
+
// ]);
|
|
5006
|
+
// Sets up listeners to handle changes on the backend
|
|
5007
|
+
//@ts-expect-error
|
|
5008
|
+
useEffect(function() {
|
|
5009
|
+
// Set up slider state listeners for each LFO parameter
|
|
5010
|
+
if (!isLocalhost) {
|
|
5011
|
+
var waveState = Juce.getComboBoxState("LFO".concat(id, "_Wave"));
|
|
5012
|
+
setWaveValue(waveState === null || waveState === void 0 ? void 0 : waveState.getChoiceIndex());
|
|
5013
|
+
var hzState = Juce.getSliderState("LFO".concat(id, "_Hz"));
|
|
5014
|
+
setHzValue(hzState === null || hzState === void 0 ? void 0 : hzState.getNormalisedValue());
|
|
5015
|
+
var hzHiState = Juce.getSliderState("LFO".concat(id, "_Hz_Hi"));
|
|
5016
|
+
setHzHiValue(hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.getNormalisedValue());
|
|
5017
|
+
var syncRateState = Juce.getComboBoxState("LFO".concat(id, "_SyncRate"));
|
|
5018
|
+
setSyncRateValue(syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.getChoiceIndex());
|
|
5019
|
+
var syncTypeState = Juce.getComboBoxState("LFO".concat(id, "_SyncType"));
|
|
5020
|
+
setSyncTypeValue(syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.getChoiceIndex());
|
|
5021
|
+
var sixteenthsState = Juce.getSliderState("LFO".concat(id, "_Sixteenths"));
|
|
5022
|
+
setSixteenthsValue(sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.getNormalisedValue());
|
|
5023
|
+
var thirdsState = Juce.getSliderState("LFO".concat(id, "_Thirds"));
|
|
5024
|
+
setThirdsValue(thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.getNormalisedValue());
|
|
5025
|
+
var syncOffsetState = Juce.getSliderState("LFO".concat(id, "_Sync_Offset"));
|
|
5026
|
+
setSyncOffsetValue(syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.getNormalisedValue());
|
|
5027
|
+
var phaseState = Juce.getSliderState("LFO".concat(id, "_Phase"));
|
|
5028
|
+
setPhaseValue(phaseState === null || phaseState === void 0 ? void 0 : phaseState.getNormalisedValue());
|
|
5029
|
+
var widthState = Juce.getSliderState("LFO".concat(id, "_Width"));
|
|
5030
|
+
setWidthValue(widthState === null || widthState === void 0 ? void 0 : widthState.getNormalisedValue());
|
|
5031
|
+
var ampState = Juce.getSliderState("LFO".concat(id, "_Amp"));
|
|
5032
|
+
setAmpValue(ampState === null || ampState === void 0 ? void 0 : ampState.getNormalisedValue());
|
|
5033
|
+
var randState = Juce.getSliderState("LFO".concat(id, "_Rand"));
|
|
5034
|
+
setRandValue(randState === null || randState === void 0 ? void 0 : randState.getNormalisedValue());
|
|
5035
|
+
var waveListenerId = waveState === null || waveState === void 0 ? void 0 : waveState.valueChangedEvent.addListener(function() {
|
|
5036
|
+
setWaveValue(waveState === null || waveState === void 0 ? void 0 : waveState.getChoiceIndex());
|
|
5037
|
+
});
|
|
5038
|
+
var hzListenerId = hzState.valueChangedEvent.addListener(function() {
|
|
5039
|
+
setHzValue(hzState === null || hzState === void 0 ? void 0 : hzState.getNormalisedValue());
|
|
5040
|
+
});
|
|
5041
|
+
var hzHiListenerId = hzHiState.valueChangedEvent.addListener(function() {
|
|
5042
|
+
setHzHiValue(hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.getNormalisedValue());
|
|
5043
|
+
});
|
|
5044
|
+
var syncRateListenerId = syncRateState.valueChangedEvent.addListener(function() {
|
|
5045
|
+
setSyncRateValue(syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.getChoiceIndex());
|
|
5046
|
+
});
|
|
5047
|
+
var syncTypeListenerId = syncTypeState.valueChangedEvent.addListener(function() {
|
|
5048
|
+
setSyncTypeValue(syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.getChoiceIndex());
|
|
5049
|
+
});
|
|
5050
|
+
var sixteenthsListenerId = sixteenthsState.valueChangedEvent.addListener(function() {
|
|
5051
|
+
setSixteenthsValue(sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.getNormalisedValue());
|
|
5052
|
+
});
|
|
5053
|
+
var thirdsListenerId = thirdsState.valueChangedEvent.addListener(function() {
|
|
5054
|
+
setThirdsValue(thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.getNormalisedValue());
|
|
5055
|
+
});
|
|
5056
|
+
var syncOffsetListenerId = syncOffsetState.valueChangedEvent.addListener(function() {
|
|
5057
|
+
setSyncOffsetValue(syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.getNormalisedValue());
|
|
5058
|
+
});
|
|
5059
|
+
var phaseListenerId = phaseState.valueChangedEvent.addListener(function() {
|
|
5060
|
+
setPhaseValue(phaseState === null || phaseState === void 0 ? void 0 : phaseState.getNormalisedValue());
|
|
5061
|
+
});
|
|
5062
|
+
var widthListenerId = widthState.valueChangedEvent.addListener(function() {
|
|
5063
|
+
setWidthValue(widthState === null || widthState === void 0 ? void 0 : widthState.getNormalisedValue());
|
|
5064
|
+
});
|
|
5065
|
+
var ampListenerId = ampState.valueChangedEvent.addListener(function() {
|
|
5066
|
+
setAmpValue(ampState === null || ampState === void 0 ? void 0 : ampState.getNormalisedValue());
|
|
5067
|
+
});
|
|
5068
|
+
var randListenerId = randState.valueChangedEvent.addListener(function() {
|
|
5069
|
+
setRandValue(randState === null || randState === void 0 ? void 0 : randState.getNormalisedValue());
|
|
5070
|
+
});
|
|
5071
|
+
// Set up initial graph view
|
|
5072
|
+
var svg = d3.select(svgRef.current).attr('width', width * 2).attr('height', height);
|
|
5073
|
+
// create center line for graph
|
|
5074
|
+
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);
|
|
5075
|
+
return function() {
|
|
5076
|
+
// Remove listeners on unmount
|
|
5077
|
+
waveState === null || waveState === void 0 ? void 0 : waveState.valueChangedEvent.removeListener(waveListenerId);
|
|
5078
|
+
hzState === null || hzState === void 0 ? void 0 : hzState.valueChangedEvent.removeListener(hzListenerId);
|
|
5079
|
+
hzHiState === null || hzHiState === void 0 ? void 0 : hzHiState.valueChangedEvent.removeListener(hzHiListenerId);
|
|
5080
|
+
syncRateState === null || syncRateState === void 0 ? void 0 : syncRateState.valueChangedEvent.removeListener(syncRateListenerId);
|
|
5081
|
+
syncTypeState === null || syncTypeState === void 0 ? void 0 : syncTypeState.valueChangedEvent.removeListener(syncTypeListenerId);
|
|
5082
|
+
sixteenthsState === null || sixteenthsState === void 0 ? void 0 : sixteenthsState.valueChangedEvent.removeListener(sixteenthsListenerId);
|
|
5083
|
+
thirdsState === null || thirdsState === void 0 ? void 0 : thirdsState.valueChangedEvent.removeListener(thirdsListenerId);
|
|
5084
|
+
syncOffsetState === null || syncOffsetState === void 0 ? void 0 : syncOffsetState.valueChangedEvent.removeListener(syncOffsetListenerId);
|
|
5085
|
+
phaseState === null || phaseState === void 0 ? void 0 : phaseState.valueChangedEvent.removeListener(phaseListenerId);
|
|
5086
|
+
widthState === null || widthState === void 0 ? void 0 : widthState.valueChangedEvent.removeListener(widthListenerId);
|
|
5087
|
+
ampState === null || ampState === void 0 ? void 0 : ampState.valueChangedEvent.removeListener(ampListenerId);
|
|
5088
|
+
randState === null || randState === void 0 ? void 0 : randState.valueChangedEvent.removeListener(randListenerId);
|
|
5089
|
+
};
|
|
5090
|
+
}
|
|
5091
|
+
}, [
|
|
5092
|
+
window
|
|
5093
|
+
]);
|
|
5094
|
+
useEffect(function() {
|
|
5095
|
+
var _Object_values;
|
|
5096
|
+
var pointArray = getPointArray({
|
|
5097
|
+
waveType: (_Object_values = Object.values(WaveTypes)) === null || _Object_values === void 0 ? void 0 : _Object_values[waveValue],
|
|
5098
|
+
hz: syncTypeValue === 0 ? hzValue : hzHiValue,
|
|
5099
|
+
randValue: randValue,
|
|
5100
|
+
ampValue: ampValue,
|
|
5101
|
+
pulseWidth: widthValue,
|
|
5102
|
+
maxLength: maxLength
|
|
5103
|
+
});
|
|
5104
|
+
setPoints(pointArray);
|
|
5105
|
+
}, [
|
|
5106
|
+
waveValue,
|
|
5107
|
+
syncTypeValue,
|
|
5108
|
+
hzValue,
|
|
5109
|
+
hzHiValue,
|
|
5110
|
+
randValue,
|
|
5111
|
+
widthValue,
|
|
5112
|
+
maxLength,
|
|
5113
|
+
ampValue
|
|
5114
|
+
]);
|
|
5115
|
+
useEffect(function() {
|
|
5116
|
+
// 2 * Math.PI = 1 circle in radians
|
|
5117
|
+
// d3.range(initial value, last value, increment)
|
|
5118
|
+
// sets the number of values
|
|
5119
|
+
var xScale = d3.scaleLinear().domain([
|
|
5120
|
+
0,
|
|
5121
|
+
maxLength
|
|
5122
|
+
]).range([
|
|
5123
|
+
svgInnerMargin,
|
|
5124
|
+
width * 2 - svgInnerMargin
|
|
5125
|
+
]);
|
|
5126
|
+
var yScale = d3.scaleLinear().domain([
|
|
5127
|
+
0,
|
|
5128
|
+
1
|
|
5129
|
+
]).range([
|
|
5130
|
+
height - svgInnerMargin,
|
|
5131
|
+
svgInnerMargin
|
|
5132
|
+
]);
|
|
5133
|
+
var line = d3.line()//@ts-expect-error
|
|
5134
|
+
.x(function(d) {
|
|
5135
|
+
return xScale(d.x);
|
|
5136
|
+
})//@ts-expect-error
|
|
5137
|
+
.y(function(d) {
|
|
5138
|
+
return yScale(d.y);
|
|
5139
|
+
}).curve(d3.curveBasis);
|
|
5140
|
+
d3.select(svgRef.current).selectAll('path').attr('width', width * 2 - svgInnerMargin).attr('height', height).data([
|
|
5141
|
+
points
|
|
5142
|
+
]).attr('fill', 'none').attr('stroke', 'var(--color-brand)').attr('stroke-width', 2).join('path').attr('d', line);
|
|
5143
|
+
}, [
|
|
5144
|
+
points,
|
|
5145
|
+
maxLength
|
|
5146
|
+
]);
|
|
5147
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5148
|
+
style: {
|
|
5149
|
+
backgroundColor: 'var(--bg-page)'
|
|
5150
|
+
},
|
|
5151
|
+
padding: [
|
|
5152
|
+
Box.padding.medium
|
|
5153
|
+
]
|
|
5154
|
+
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
5155
|
+
style: {
|
|
5156
|
+
position: 'relative',
|
|
5157
|
+
overflow: 'hidden',
|
|
5158
|
+
width: width
|
|
5159
|
+
}
|
|
5160
|
+
}, /*#__PURE__*/ React__default.createElement("svg", {
|
|
5161
|
+
width: width * 2,
|
|
5162
|
+
height: height,
|
|
5163
|
+
ref: svgRef,
|
|
5164
|
+
style: {
|
|
5165
|
+
transform: "translate(".concat((syncTypeValue === 0 || syncTypeValue === 1 ? phaseValue * 100 - 50 : syncOffsetValue * 100 - 50) / 2, "%)"),
|
|
5166
|
+
margin: "0 -".concat(width / 2)
|
|
5167
|
+
}
|
|
5168
|
+
})));
|
|
5169
|
+
}
|
|
5170
|
+
|
|
4783
5171
|
function _array_like_to_array$3(arr, len) {
|
|
4784
5172
|
if (len == null || len > arr.length) len = arr.length;
|
|
4785
5173
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -4830,8 +5218,8 @@ function LFO(param) {
|
|
|
4830
5218
|
var id = param.id;
|
|
4831
5219
|
var _useState = _sliced_to_array$3(useState(0), 2), syncType = _useState[0], setSyncType = _useState[1];
|
|
4832
5220
|
useEffect(function() {
|
|
4833
|
-
var
|
|
4834
|
-
var syncType = (
|
|
5221
|
+
var _Juce_getComboBoxState;
|
|
5222
|
+
var syncType = (_Juce_getComboBoxState = Juce.getComboBoxState("LFO".concat(id, "_SyncType"))) === null || _Juce_getComboBoxState === void 0 ? void 0 : _Juce_getComboBoxState.getChoiceIndex();
|
|
4835
5223
|
setSyncType(syncType);
|
|
4836
5224
|
}, [
|
|
4837
5225
|
window
|
|
@@ -4842,10 +5230,9 @@ function LFO(param) {
|
|
|
4842
5230
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4843
5231
|
className: "LFOTab",
|
|
4844
5232
|
flexDirection: Box.flexDirection.column
|
|
4845
|
-
}, /*#__PURE__*/ React__default.createElement(
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
}, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
5233
|
+
}, /*#__PURE__*/ React__default.createElement(LFOVisualizer, {
|
|
5234
|
+
id: id
|
|
5235
|
+
}), /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4849
5236
|
labelColor: "var(--color-text)",
|
|
4850
5237
|
color: "var(--color-brand)",
|
|
4851
5238
|
id: "LFO".concat(id, "_SyncType"),
|
|
@@ -4868,15 +5255,15 @@ function LFO(param) {
|
|
|
4868
5255
|
}) : null, syncType === 4 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4869
5256
|
id: "LFO".concat(id, "_Sixteenths"),
|
|
4870
5257
|
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, {
|
|
5258
|
+
}) : null), syncType === 0 || syncType === 1 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4876
5259
|
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
4877
5260
|
id: "LFO".concat(id, "_Phase"),
|
|
4878
5261
|
label: "LFO".concat(id, " Phase")
|
|
4879
|
-
}), /*#__PURE__*/ React__default.createElement(
|
|
5262
|
+
}) : null, syncType !== 0 && syncType !== 1 ? /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
5263
|
+
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
5264
|
+
id: "LFO".concat(id, "_Sync_Offset"),
|
|
5265
|
+
label: "LFO".concat(id, " Sync Offset")
|
|
5266
|
+
}) : null, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4880
5267
|
labelColor: "var(--color-text)",
|
|
4881
5268
|
color: "var(--color-brand)",
|
|
4882
5269
|
id: "LFO".concat(id, "_Wave"),
|
|
@@ -4896,7 +5283,7 @@ function LFO(param) {
|
|
|
4896
5283
|
function LFOTab() {
|
|
4897
5284
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4898
5285
|
className: "LFOTab",
|
|
4899
|
-
|
|
5286
|
+
gap: Box.gap.medium
|
|
4900
5287
|
}, /*#__PURE__*/ React__default.createElement(LFO, {
|
|
4901
5288
|
id: 1
|
|
4902
5289
|
}), /*#__PURE__*/ React__default.createElement(LFO, {
|
|
@@ -5091,9 +5478,14 @@ function SeqTab$1(param) {
|
|
|
5091
5478
|
var handleSyncTypeChange = function(value) {
|
|
5092
5479
|
setSyncType(value);
|
|
5093
5480
|
};
|
|
5094
|
-
return /*#__PURE__*/ React__default.createElement(Box,
|
|
5481
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5482
|
+
flexDirection: Box.flexDirection.column,
|
|
5483
|
+
gap: Box.gap.medium
|
|
5484
|
+
}, /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(StepSequencer, {
|
|
5485
|
+
seqId: seqId
|
|
5486
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
5095
5487
|
alignItems: Box.alignItems.flexEnd,
|
|
5096
|
-
justifyContent: Box.justifyContent.
|
|
5488
|
+
justifyContent: Box.justifyContent.center
|
|
5097
5489
|
}, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
5098
5490
|
labelColor: "var(--color-text)",
|
|
5099
5491
|
color: "var(--color-brand)",
|
|
@@ -5120,16 +5512,13 @@ function SeqTab$1(param) {
|
|
|
5120
5512
|
}) : null), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
5121
5513
|
id: "seq".concat(seqId, "_amp"),
|
|
5122
5514
|
label: "Seq".concat(seqId, " Amp")
|
|
5123
|
-
})), /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(StepSequencer, {
|
|
5124
|
-
seqId: seqId
|
|
5125
5515
|
})));
|
|
5126
5516
|
}
|
|
5127
5517
|
|
|
5128
5518
|
function SeqTab() {
|
|
5129
5519
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
5130
5520
|
className: "SeqTab",
|
|
5131
|
-
|
|
5132
|
-
gap: Box.gap.large
|
|
5521
|
+
gap: Box.gap.medium
|
|
5133
5522
|
}, /*#__PURE__*/ React__default.createElement(SeqTab$1, {
|
|
5134
5523
|
seqId: 1
|
|
5135
5524
|
}), /*#__PURE__*/ React__default.createElement(SeqTab$1, {
|