mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 20:18:34 +00:00
allow passing ccn numbers directly to midimapped control name
This commit is contained in:
parent
b87b2aff9a
commit
b74d5becd5
@ -94,7 +94,14 @@ export const midiMappings = new Map();
|
|||||||
|
|
||||||
// takes midimap and converts each control key to the main control name
|
// takes midimap and converts each control key to the main control name
|
||||||
function unifyMapping(mapping) {
|
function unifyMapping(mapping) {
|
||||||
return Object.fromEntries(Object.entries(mapping).map(([key, mapping]) => [getControlName(key), mapping]));
|
return Object.fromEntries(
|
||||||
|
Object.entries(mapping).map(([key, mapping]) => {
|
||||||
|
if (typeof mapping === 'number') {
|
||||||
|
mapping = { ccn: mapping };
|
||||||
|
}
|
||||||
|
return [getControlName(key), mapping];
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// adds a midimap to the registry
|
// adds a midimap to the registry
|
||||||
export function addMidimap(name, mapping) {
|
export function addMidimap(name, mapping) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user