Getting knobs/sliders position from midi controller when plugged in?

Chi Him Chik's icon

Not so sure how to describe it well... So basically I am trying to find a way to get the position data of all the knobs and sliders position from my dj controller (Pioneer ddj SX) whenever I plug it in to the computer, so I don't need to worry that the positions of the knobs and sliders of my controller are not in sync with the patch whenever I launch it or reconnect the controller. I am hoping there should be a way to work it out since it does that when I connect this with the Serato DJ program.

Does anyone know anything about this, or is it possible in Max at all?

Thank you very much in advance!!

Him

Peter Ostry's icon

You need information about current parameter values. SysEx would work, do you have a documentation for that?

Otherwise you can set the knobs and sliders to a known state by sending values from Max. With [pattrstorage] you can also store presets.

Chi Him Chik's icon

Hi Peter,

Thank you very much for your reply and for the lead!! So I have found someone on github (https://github.com/mixxxdj/mixxx/wiki/Serato-Sysex) saying that there is a sysex message I can send it to the controller to trigger the status dump, which force the controller to send back the status of each item on the control surface.

Unfortunately, I don't have any experience with sysex message so far, I tried to send the dedicated message (F0 00 20 7F 03 01 F7) directly to midiout and monitor through ctlin but nothing matter. The website also provided a line of code at the bottom for doing the job, but unfortunately I also don't have any experience in Javascript...

May I ask do you know how should I send the dedicated message for triggering by chance?

Thanks a lot again!!

Andy Maskell's icon

MIDI can be a bit of a headache to start with but Max handles it very well if you work at it. Google some information on how MIDI messages are formatted a compare that with the tutorials in Max.

I’d also recommend that you acquire a good MIDI monitor, such as Protokol, so that you can see what data is being sent back and forth.

I presume that you have worked out how to connect your controller to Max using the MIDI Setup?

To send your Sysex message you need to format it with sxformat before sending it out via midiout. Bear in mind that you will have to convert the hexadecimal codes you quoted into integers for sxformat to work! A hex to decimal converter will be handy for this.

For the sysex message you quoted, you need to code it in Max as:
sxformat 240 0 32 127 3 1 247

Don‘t assume that what your controller sends back will all be ctrl messages either. It might send back a variety of message types, including sysex messages, that you may have to unpick one at a time. For example, my controller uses notes for the buttons, pbend for the faders, ctrl for the knobs and the numerical displays and sysex for the lcd displays. Max is extremely capable at all this once you can work out what you are dealing with. It helps a lot if you can find a good MIDI implementation chart for your device.