codeformat
This commit is contained in:
parent
b98ebc696d
commit
43523b73c4
2 changed files with 3 additions and 1 deletions
|
|
@ -1622,7 +1622,6 @@ export const ar = register('ar', (t, pat) => {
|
||||||
*/
|
*/
|
||||||
export const { midichan } = registerControl('midichan');
|
export const { midichan } = registerControl('midichan');
|
||||||
|
|
||||||
|
|
||||||
export const { midimap } = registerControl('midimap');
|
export const { midimap } = registerControl('midimap');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,8 @@ function normalize(value = 0, min = 0, max = 1, exp = 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapCC(mapping, value) {
|
function mapCC(mapping, value) {
|
||||||
|
console.log('mapping', mapping);
|
||||||
|
console.log('value', value);
|
||||||
return Object.keys(value)
|
return Object.keys(value)
|
||||||
.filter((key) => !!mapping[getControlName(key)])
|
.filter((key) => !!mapping[getControlName(key)])
|
||||||
.map((key) => {
|
.map((key) => {
|
||||||
|
|
@ -340,6 +342,7 @@ Pattern.prototype.midi = function (output) {
|
||||||
velocity = gain * velocity;
|
velocity = gain * velocity;
|
||||||
// if midimap is set, send a cc messages from defined controls
|
// if midimap is set, send a cc messages from defined controls
|
||||||
if (midicontrolMap.has(midimap)) {
|
if (midicontrolMap.has(midimap)) {
|
||||||
|
console.log('midimap', midimap);
|
||||||
const ccs = mapCC(midicontrolMap.get(midimap), hap.value);
|
const ccs = mapCC(midicontrolMap.get(midimap), hap.value);
|
||||||
ccs.forEach(({ ccn, ccv }) => sendCC(ccn, ccv, device, midichan, timeOffsetString));
|
ccs.forEach(({ ccn, ccv }) => sendCC(ccn, ccv, device, midichan, timeOffsetString));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue