bitwig kontroliranje
parent
a332223248
commit
cac41f51a3
|
@ -0,0 +1,73 @@
|
|||
const WebSocket = require('ws')
|
||||
const osc = require('osc')
|
||||
|
||||
const ip = process.argv[2]
|
||||
|
||||
const DEBUG = {
|
||||
osc: true
|
||||
}
|
||||
|
||||
const oscWS = new osc.WebSocketPort({
|
||||
url: `ws://${ip}:6676`,
|
||||
metadata: false
|
||||
})
|
||||
|
||||
const bwPortUkazi = 8000
|
||||
const bwPortStanje = 9000
|
||||
const bwIP = '192.168.64.113'
|
||||
|
||||
const oscWSstanje = new osc.UDPPort({
|
||||
localAddress: bwIP,
|
||||
localPort: bwPortStanje,
|
||||
metadata: false
|
||||
})
|
||||
|
||||
const oscWSukazi = new osc.UDPPort({
|
||||
localAddress: bwIP,
|
||||
localPort: bwPortUkazi,
|
||||
metadata: false
|
||||
})
|
||||
|
||||
oscWS.on('ready', () => {
|
||||
console.log(`Povezan sem na ${ip}`)
|
||||
|
||||
/*
|
||||
setInterval(() => {
|
||||
console.log('ping')
|
||||
oscWS.send({ address: '/ping', args: [true]})
|
||||
}, 500)
|
||||
*/
|
||||
})
|
||||
|
||||
oscWSstanje.on('ready', () => {
|
||||
console.log(`Prejemam bitwig info`)
|
||||
})
|
||||
|
||||
oscWSukazi.on('ready', () => {
|
||||
console.log(`Pripravljen sem na posiljanje v bitwig`)
|
||||
})
|
||||
|
||||
oscWS.on('message', ({ address, args }) => {
|
||||
DEBUG.osc && console.log('MSG OSC', address, args.map(x => x.toFixed(4)))
|
||||
|
||||
// Wavey Wind sporočila
|
||||
const re = /\/ww\/(\d+)\/([a-zA-Z]+)/
|
||||
const m = address.match(re)
|
||||
|
||||
if (m) {
|
||||
/*
|
||||
oscWS.send({
|
||||
address: '/midi',
|
||||
args: [midiKanal, visina, 127]
|
||||
})
|
||||
*/
|
||||
}
|
||||
})
|
||||
|
||||
oscWSstanje.on('message', ({ address, args }) => {
|
||||
DEBUG.osc && console.log('BITWIG OSC', address, args.map(x => x.toFixed(4)))
|
||||
})
|
||||
|
||||
oscWS.open()
|
||||
//oscWSstanje.open()
|
||||
oscWSukazi.open()
|
|
@ -30,13 +30,27 @@ byte KNOFI_LEN = 13;
|
|||
// Za stanje vrednosti
|
||||
byte knofi_prej[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
const char* kanali[15] = {
|
||||
"/premakni/gor",
|
||||
"/premakni/dol",
|
||||
"/premakni/levo",
|
||||
"/premakni/desno"
|
||||
// Kako dolgo pocakaj za dvoklik? (v milisekundah)
|
||||
int dvoklik_interval = 250;
|
||||
|
||||
const char* kanali[16] = {
|
||||
"/play",
|
||||
"/overdub/launcher",
|
||||
"/recarm", // rabi info o trenutno izbranem tracku
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"/clip/create/4",
|
||||
"/clip/create/8",
|
||||
"/clip/record" // rabi info o trenutno izbranem clipu / tracku
|
||||
};
|
||||
|
||||
|
||||
byte knofi_dvoklik[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
void setup() {
|
||||
for(int i = 0; i < KNOFI_LEN; i++) {
|
||||
pinMode(knofi[i], INPUT_PULLUP);
|
||||
|
|
Loading…
Reference in New Issue