codeformat

This commit is contained in:
nkymut 2025-02-09 15:12:14 +08:00
parent b98ebc696d
commit 43523b73c4
2 changed files with 3 additions and 1 deletions

View File

@ -1622,7 +1622,6 @@ export const ar = register('ar', (t, pat) => {
*/
export const { midichan } = registerControl('midichan');
export const { midimap } = registerControl('midimap');
/**

View File

@ -180,6 +180,8 @@ function normalize(value = 0, min = 0, max = 1, exp = 1) {
}
function mapCC(mapping, value) {
console.log('mapping', mapping);
console.log('value', value);
return Object.keys(value)
.filter((key) => !!mapping[getControlName(key)])
.map((key) => {
@ -340,6 +342,7 @@ Pattern.prototype.midi = function (output) {
velocity = gain * velocity;
// if midimap is set, send a cc messages from defined controls
if (midicontrolMap.has(midimap)) {
console.log('midimap', midimap);
const ccs = mapCC(midicontrolMap.get(midimap), hap.value);
ccs.forEach(({ ccn, ccv }) => sendCC(ccn, ccv, device, midichan, timeOffsetString));
}