ArtGateOne / dot2apcmini_old

this code is for control dot2 (DMX) console or software with Akai APC mini (midi controller) required installed nodejs v 14.15.0
2 stars 1 forks source link

throw new Error('cannot call send() while not connected'); when connecting #1

Closed Petorrrrr closed 1 year ago

Petorrrrr commented 3 years ago

First of all, thanks for the hard work!! Looks awesome!

I try to run it, but I receive the error below. I've installed websocket and easymidi in NPM and updated the password on the dot2 to 'remote'.

Any clue what could be causing this?

c:\dot2apcmini>node dot2apcmini
Midi IN
[ 'loopMIDI Port 0', 'Bome MIDI Translator 1 1' ]
Midi OUT
[
  'Microsoft GS Wavetable Synth 0',
  'loopMIDI Port 1',
  'Bome MIDI Translator 1 2',
  'Protokol 3'
]
Connecting to dot2 ...
PAGE 0
PAGE 1
PAGE 2
PAGE 3
PAGE 4
PAGE 5
PAGE 6
PAGE 7
PAGE 8
PAGE 9
PAGE 10
PAGE 11
PAGE 12
PAGE 13
PAGE 14
PAGE 15
c:\dot2apcmini\node_modules\websocket\lib\W3CWebSocket.js:111
        throw new Error('cannot call send() while not connected');
        ^

Error: cannot call send() while not connected
    at W3CWebSocket.send (c:\dot2apcmini\node_modules\websocket\lib\W3CWebSocket.js:111:15)
    at Input.<anonymous> (c:\dot2apcmini\dot2apcmini.js:265:32)
    at Input.emit (events.js:315:20)
    at NodeMidiInput.<anonymous> (c:\dot2apcmini\node_modules\easymidi\index.js:89:16)
    at NodeMidiInput.emit (events.js:315:20)
ArtGateOne commented 3 years ago

When you run this Code, show all midi devices .. I dont see akai apc mini. Maybe this device is used by another application?

wt., 26 sty 2021, 21:10 użytkownik Petorrrrr notifications@github.com napisał:

First of all, thanks for the hard work!! Looks awesome!

I try to run it, but I receive the error below. I've installed websocket and easymidi in NPM and updated the password on the dot2 to 'remote'.

Any clue what could be causing this?

c:\dot2apcmini>node dot2apcmini Midi IN [ 'loopMIDI Port 0', 'Bome MIDI Translator 1 1' ] Midi OUT [ 'Microsoft GS Wavetable Synth 0', 'loopMIDI Port 1', 'Bome MIDI Translator 1 2', 'Protokol 3' ] Connecting to dot2 ... PAGE 0 PAGE 1 PAGE 2 PAGE 3 PAGE 4 PAGE 5 PAGE 6 PAGE 7 PAGE 8 PAGE 9 PAGE 10 PAGE 11 PAGE 12 PAGE 13 PAGE 14 PAGE 15 c:\dot2apcmini\node_modules\websocket\lib\W3CWebSocket.js:111 throw new Error('cannot call send() while not connected'); ^

Error: cannot call send() while not connected at W3CWebSocket.send (c:\dot2apcmini\node_modules\websocket\lib\W3CWebSocket.js:111:15) at Input. (c:\dot2apcmini\dot2apcmini.js:265:32) at Input.emit (events.js:315:20) at NodeMidiInput. (c:\dot2apcmini\node_modules\easymidi\index.js:89:16) at NodeMidiInput.emit (events.js:315:20)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ArtGateOne/dot2apcmini/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQOM32A7OJHPR3WNY2V6TLS34OUJANCNFSM4WUBILPA .

Petorrrrr commented 3 years ago

Correct. I have no akai apc mini unfortunately. I figured I could use this code as a starting point for another midi controller (actually one that that is triggered by OSC values that are converted to midi using midimonster. This is already working).

This morning I found one of your other repositories: https://github.com/ArtGateOne/dot2midicon Perhaps that is a better place to start for what I have in mind?

ArtGateOne commented 3 years ago

I make code for 3 midi devices - this is the same code - but different midi notes...

code for midicon only send commands to do2 (no led feedback)

best way - try use dot2apcmini

just rename midi device name in code IN & OUT

śr., 27 sty 2021 o 11:42 Petorrrrr notifications@github.com napisał(a):

Correct. I have no akai apc mini unfortunately. I figured I could use this code as a starting point for another midi controller (actually one that that is triggered by OSC values that are converted to midi using midimonster. This is already working).

This morning I found one of your other repositories: https://github.com/ArtGateOne/dot2midicon Perhaps that is a better place to start for what I have in mind?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArtGateOne/dot2apcmini/issues/1#issuecomment-768197525, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQOM33IEGZ2WR533S72G33S37U2BANCNFSM4WUBILPA .

-- Pozdrawiam Krzysztof Korzeniowski

Petorrrrr commented 3 years ago

Thanks for your feedback. I was able to get it going and have it send out OSC messages instead of midi. For me a great addition was to also get the names of the executors to show it on a touchOSC configuration.

Unfortunately in my situation it is not stable enough. Somehow, it seems to mix up several web responses from time to time. Then, when it tries to iterate through the items, it fails on item 6 and 7 (executors 7 and 8). It seems sometimes the websocket sometimes starts over at the command wing again when the code is expecting a wing. I have no clue if this can be tamed... I was trying out midimonster and think I see some sort of the same problem from time to time. Especially when you resize the dot2 wnidow on the computer it doesn't seem to like it....

Feel free to close this issue, since my original problem was resolved. If you want I can share my code. It's more of a hackjob than a real improvement, since I have very limited code experience. I took out most of the midi specific code and replaced it with some sending of OSC messages.

Thanks again for the effort! It's great to see initiatives like this

ArtGateOne commented 3 years ago

U can send request to server for all executors {"requestType":"playbacks","startIndex":[300,400,500,600,700,800],"itemsCount":[16,16,16,16,16,16],"pageIndex":0,"itemsType":[3,3,3,3,3,3],"view":3,"execButtonViewMode":2,"buttonsViewMode":0,"session":1,"maxRequests":1}

or all faders {"requestType":"playbacks","startIndex":[0,100,200],"itemsCount":[22,22,22],"pageIndex":0,"itemsType":[2,3,3],"view":2,"execButtonViewMode":1,"buttonsViewMode":0,"session":1,"maxRequests":1}