-
Notifications
You must be signed in to change notification settings - Fork 2
/
createRemoteMap.ts
33 lines (26 loc) · 941 Bytes
/
createRemoteMap.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Devices } from './ReasonDevices.ts'
import { objKeys } from './src/deps.ts'
export const allDeviceNames = objKeys(Devices)
export const remotemap = allDeviceNames.map(device => {
const developerName = Devices[device]['developer']
const params = objKeys(Devices[device]['params'])
const scope = `Scope ${developerName} ${device}
// Control Surface Item Key Remotable Item Scale Mode
${params.map((paramName, paramNum) => {
const channelNumber = Math.ceil((1 + paramNum) / 127)
const ccNumber = `${1 + (paramNum % 127)}`.padStart(2, '0')
return `Map Ch${channelNumber}-CC ${ccNumber} ${paramName}`
}).join('\n')}
`
return scope
}).join('')
// console.log(remotemap)
Deno.writeTextFileSync(
'MIDI Controller Multi.remotemap',
`Propellerhead Remote Mapping File
File Format Version 1.0.0
Control Surface Manufacturer <Other>
Control Surface Model MIDI Multichannel Control Surface
Map Version 1.4.2
${remotemap}`
)