Compare commits
1 Commits
hotfix
...
541ab6d459
| Author | SHA1 | Date | |
|---|---|---|---|
| 541ab6d459 |
65
ModEnum.maxhelp
Normal file
65
ModEnum.maxhelp
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"patcher" : {
|
||||||
|
"fileversion" : 1,
|
||||||
|
"appversion" : {
|
||||||
|
"major" : 9,
|
||||||
|
"minor" : 0,
|
||||||
|
"revision" : 5,
|
||||||
|
"architecture" : "x64",
|
||||||
|
"modernui" : 1
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"classnamespace" : "box",
|
||||||
|
"rect" : [ 203.0, 196.0, 750.0, 734.0 ],
|
||||||
|
"gridsize" : [ 15.0, 15.0 ],
|
||||||
|
"boxes" : [ {
|
||||||
|
"box" : {
|
||||||
|
"bgmode" : 0,
|
||||||
|
"border" : 0,
|
||||||
|
"clickthrough" : 0,
|
||||||
|
"enablehscroll" : 0,
|
||||||
|
"enablevscroll" : 0,
|
||||||
|
"id" : "obj-1",
|
||||||
|
"lockeddragscroll" : 0,
|
||||||
|
"lockedsize" : 0,
|
||||||
|
"maxclass" : "bpatcher",
|
||||||
|
"name" : "ModEnum.maxpat",
|
||||||
|
"numinlets" : 1,
|
||||||
|
"numoutlets" : 6,
|
||||||
|
"offset" : [ 0.0, 0.0 ],
|
||||||
|
"outlettype" : [ "", "", "", "", "", "" ],
|
||||||
|
"patching_rect" : [ 25.30120575428009, 154.216873168945312, 838.631580829620361, 601.0 ],
|
||||||
|
"varname" : "ModEnum",
|
||||||
|
"viewvisibility" : 1
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lines" : [ ],
|
||||||
|
"originid" : "pat-3701",
|
||||||
|
"parameters" : {
|
||||||
|
"obj-1::obj-25" : [ "dict", "dict", 0 ],
|
||||||
|
"parameterbanks" : {
|
||||||
|
"0" : {
|
||||||
|
"index" : 0,
|
||||||
|
"name" : "",
|
||||||
|
"parameters" : [ "-", "-", "-", "-", "-", "-", "-", "-" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"inherited_shortname" : 1
|
||||||
|
}
|
||||||
|
,
|
||||||
|
"dependency_cache" : [ {
|
||||||
|
"name" : "ModEnum.maxpat",
|
||||||
|
"bootpath" : "~/Documents/max-mod-enum",
|
||||||
|
"patcherrelativepath" : ".",
|
||||||
|
"type" : "JSON",
|
||||||
|
"implicit" : 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autosave" : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3260
ModEnum.maxpat
Normal file
3260
ModEnum.maxpat
Normal file
File diff suppressed because it is too large
Load Diff
14
common.js
14
common.js
@@ -43,19 +43,15 @@ function Switch(props){
|
|||||||
e('span', {className: 'slider round'}, null))
|
e('span', {className: 'slider round'}, null))
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendSaveEvent(){
|
|
||||||
setTimeout(() => {
|
|
||||||
window.dispatchEvent(new CustomEvent('saveDict', {'detail' : "localStorage"}));
|
|
||||||
}, 50)
|
|
||||||
}
|
|
||||||
|
|
||||||
function CreateParamChanger(arr, setArr, index, postCB=() => {}, preCB=(val) => val){
|
function CreateParamChanger(arr, setArr, index, postCB=() => {}, preCB=(val) => val){
|
||||||
return (event) => {
|
return (event) => {
|
||||||
let newArr = arr.slice();
|
let newArr = arr.slice();
|
||||||
newArr[index] = preCB(event.target.value);
|
newArr[index] = preCB(event.target.value);
|
||||||
setArr(newArr);
|
setArr(newArr);
|
||||||
postCB();
|
postCB();
|
||||||
SendSaveEvent();
|
setTimeout(() => {
|
||||||
|
window.dispatchEvent(new CustomEvent('saveDict', {'detail' : "localStorage"}));
|
||||||
|
}, 50)
|
||||||
|
|
||||||
log(`${index} ${event.target.value}`);
|
log(`${index} ${event.target.value}`);
|
||||||
}
|
}
|
||||||
@@ -68,7 +64,9 @@ function CreateMatrixParamChanger(matrix, setMatrix, i, j){
|
|||||||
});
|
});
|
||||||
newMatrix[i][j] = event.target.value;
|
newMatrix[i][j] = event.target.value;
|
||||||
setMatrix(newMatrix);
|
setMatrix(newMatrix);
|
||||||
SendSaveEvent();
|
setTimeout(() => {
|
||||||
|
window.dispatchEvent(new CustomEvent('saveDict', {'detail' : "localStorage"}));
|
||||||
|
}, 50)
|
||||||
log(`${i}, ${j} ${event.target.value}`);
|
log(`${i}, ${j} ${event.target.value}`);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
24
enums.js
24
enums.js
@@ -4,18 +4,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function DataCell(element) {
|
|
||||||
return e('td', null, element);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOT A REACT FUNCTIONAL COMPONENT. MERELY RETURNS AN ARRAY WHICH IS UNPACKED
|
// NOT A REACT FUNCTIONAL COMPONENT. MERELY RETURNS AN ARRAY WHICH IS UNPACKED
|
||||||
function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames, setEnumNames, djParam, locked){
|
function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames, setEnumNames, djParam, locked){
|
||||||
let items = [];
|
let items = [];
|
||||||
for (let i = 0; i < MAXENUMPOINTS; i++){
|
for (let i = 0; i < MAXENUMPOINTS; i++){
|
||||||
|
|
||||||
items.push(DataCell(e(TextBox, {locked, onChange: CreateMatrixParamChanger(enumNames, setEnumNames, index, i), value: enumNames[index][i], id:`text-${djParam}-${enumNames[index][i]}`}, null)));
|
items.push(ListItem(e(TextBox, {locked, onChange: CreateMatrixParamChanger(enumNames, setEnumNames, index, i), value: enumNames[index][i], id:`text-${djParam}-${enumNames[index][i]}`}, null)));
|
||||||
// Add 1 to make up for the lower enum bound
|
// Add 1 to make up for the lower enum bound
|
||||||
items.push(DataCell(e(NumberBox, {locked, onChange: CreateMatrixParamChanger(enumBreakPoints, setEnumBreakPoints, index, i + 1), value:enumBreakPoints[index][i + 1]}, null)));
|
items.push(ListItem(e(NumberBox, {locked, onChange: CreateMatrixParamChanger(enumBreakPoints, setEnumBreakPoints, index, i + 1), value:enumBreakPoints[index][i + 1]}, null)));
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
@@ -23,15 +19,15 @@ function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames,
|
|||||||
function EnumeratorRow(props){
|
function EnumeratorRow(props){
|
||||||
let linkedText = props.linked ? "<- mods" : "";
|
let linkedText = props.linked ? "<- mods" : "";
|
||||||
|
|
||||||
let content = e('tr', {className: 'lfo-item', id: `${props.djParam}-enum-row`},
|
let content = e('ul', {className: 'lfo-item', id: `${props.djParam}-enum-row`},
|
||||||
DataCell(DropDown({locked:props.locked, onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})),
|
ListItem(DropDown({locked:props.locked, onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})),
|
||||||
DataCell(DropDown({locked:props.locked, onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})),
|
ListItem(DropDown({locked:props.locked, onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})),
|
||||||
DataCell(e(NumberBox, {locked:props.locked, onChange: props.setEnumItemCounts, step:1, value:props.enumItems, className: 'enum-count'}, null)),
|
ListItem(e(NumberBox, {locked:props.locked, onChange: props.setEnumItemCounts, step:1, value:props.enumItems, className: 'enum-count'}, null)),
|
||||||
DataCell(e(NumberBox, {locked:props.locked, onChange: CreateMatrixParamChanger(props.enumBreakPoints, props.setEnumBreakPoints, props.index, 0), value:props.enumBreakPoints[props.index][0], step:0.1}, null)),
|
ListItem(e(NumberBox, {locked:props.locked, onChange: CreateMatrixParamChanger(props.enumBreakPoints, props.setEnumBreakPoints, props.index, 0), value:props.enumBreakPoints[props.index][0], step:0.1}, null)),
|
||||||
...(EnumeratorItems(props.index, props.enumBreakPoints, props.setEnumBreakPoints, props.enumNames, props.setEnumNames, props.djParam, props.locked).slice(0, props.enumItems * 2)),
|
...(EnumeratorItems(props.index, props.enumBreakPoints, props.setEnumBreakPoints, props.enumNames, props.setEnumNames, props.djParam, props.locked).slice(0, props.enumItems * 2)),
|
||||||
DataCell(e(Button, {locked:props.locked, text:'+', onClick: props.addEnum}, null)),
|
ListItem(e(Button, {locked:props.locked, text:'+', onClick: props.addEnum}, null)),
|
||||||
DataCell(e(Button, {locked:props.locked, text:'-', onClick: props.removeEnum}, null)),
|
ListItem(e(Button, {locked:props.locked, text:'-', onClick: props.removeEnum}, null)),
|
||||||
DataCell(e("div", {className:"linked"}, linkedText))
|
ListItem(e("div", {className:"linked"}, linkedText))
|
||||||
);
|
);
|
||||||
if (props.visible){
|
if (props.visible){
|
||||||
return content;
|
return content;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
16
lfogui.js
16
lfogui.js
@@ -102,7 +102,7 @@ function MasterLfoHandler() {
|
|||||||
const [modTypeArr, setModTypeArr] = React.useState(Array(MAXLFOS).fill('LFO'));
|
const [modTypeArr, setModTypeArr] = React.useState(Array(MAXLFOS).fill('LFO'));
|
||||||
const [modInstanceNumArr, setModInstanceNumArr] = React.useState(Array(MAXLFOS).fill('1'));
|
const [modInstanceNumArr, setModInstanceNumArr] = React.useState(Array(MAXLFOS).fill('1'));
|
||||||
|
|
||||||
const [modCenterVals, setModCenterVals] = React.useState({ '1': {}, '2': {}, '3': {}, '4': {}, '5': {}, '6': {}});
|
const [modCenterVals, setModCenterVals] = React.useState({ '1': {}, '2': {}, '3': {}, '4': {} });
|
||||||
|
|
||||||
const [ticks, setTicks] = React.useState(0);
|
const [ticks, setTicks] = React.useState(0);
|
||||||
const [beatsInMeasure, setBeatsInMeasure] = React.useState(4);
|
const [beatsInMeasure, setBeatsInMeasure] = React.useState(4);
|
||||||
@@ -445,7 +445,6 @@ function MasterLfoHandler() {
|
|||||||
allModSetters[j](array);
|
allModSetters[j](array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SendSaveEvent();
|
|
||||||
rerender(!render);
|
rerender(!render);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -455,7 +454,6 @@ function MasterLfoHandler() {
|
|||||||
let newArr = modVisibleArr.slice();
|
let newArr = modVisibleArr.slice();
|
||||||
newArr[id] = false;
|
newArr[id] = false;
|
||||||
setModVisibleArr(newArr);
|
setModVisibleArr(newArr);
|
||||||
SendSaveEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -479,15 +477,9 @@ function MasterLfoHandler() {
|
|||||||
enumItems: enumItemCounts[i],
|
enumItems: enumItemCounts[i],
|
||||||
setEnumItemCounts: CreateParamChanger(enumItemCounts, setEnumItemCounts, i),
|
setEnumItemCounts: CreateParamChanger(enumItemCounts, setEnumItemCounts, i),
|
||||||
enumBreakPoints: enumBreakPoints,
|
enumBreakPoints: enumBreakPoints,
|
||||||
setEnumBreakPoints: (val) => {
|
setEnumBreakPoints: setEnumBreakPoints,
|
||||||
setEnumBreakPoints(val);
|
|
||||||
SendSaveEvent
|
|
||||||
},
|
|
||||||
enumNames: enumNames,
|
enumNames: enumNames,
|
||||||
setEnumNames: (val) => {
|
setEnumNames: setEnumNames,
|
||||||
setEnumNames(val);
|
|
||||||
SendSaveEvent
|
|
||||||
},
|
|
||||||
visible: enumVisibleArr[i],
|
visible: enumVisibleArr[i],
|
||||||
djParam: enumDjParamArr[i],
|
djParam: enumDjParamArr[i],
|
||||||
setDjParam: CreateParamChanger(enumDjParamArr, setEnumDjParamArr, i),
|
setDjParam: CreateParamChanger(enumDjParamArr, setEnumDjParamArr, i),
|
||||||
@@ -533,7 +525,6 @@ function MasterLfoHandler() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
rerender(!render);
|
rerender(!render);
|
||||||
SendSaveEvent();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeEnum: () => {
|
removeEnum: () => {
|
||||||
@@ -541,7 +532,6 @@ function MasterLfoHandler() {
|
|||||||
let newArr = enumVisibleArr.slice();
|
let newArr = enumVisibleArr.slice();
|
||||||
newArr[id] = false;
|
newArr[id] = false;
|
||||||
setEnumVisibleArr(newArr);
|
setEnumVisibleArr(newArr);
|
||||||
SendSaveEvent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, null)
|
}, null)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var TYPEOPTIONS = ["LFO", "Noise"];
|
|||||||
var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square", "Custom_1", "Custom_2", "Custom_3", "Custom_4"];
|
var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square", "Custom_1", "Custom_2", "Custom_3", "Custom_4"];
|
||||||
var NOISETYPES = ["Rand", "Line Int.", "Sine Int."]
|
var NOISETYPES = ["Rand", "Line Int.", "Sine Int."]
|
||||||
|
|
||||||
var INSTANCEOPTIONS = ["1", "2", "3", "4", "5", "6"];
|
var INSTANCEOPTIONS = ["1", "2", "3", "4"];
|
||||||
|
|
||||||
const MODPARAMOPTIONS = ["NONE", "stream", "pulse_length", "eventfulness", "event_length", "metriclarity",
|
const MODPARAMOPTIONS = ["NONE", "stream", "pulse_length", "eventfulness", "event_length", "metriclarity",
|
||||||
"harmoniclarity", "melodic_cohesion", "melody_scope", "tonic_pitch", "pitch_center", "pitch_range", "dynamics",
|
"harmoniclarity", "melodic_cohesion", "melody_scope", "tonic_pitch", "pitch_center", "pitch_range", "dynamics",
|
||||||
|
|||||||
Reference in New Issue
Block a user