DJ Controller MIDI Issues

Damian Ramsdell's icon

So I've built an additive synth with a bunch of filters, LFOs, etc. I intended to use my Pioneer DDJ SB2 to control the different objects in my patch. Unfortunately, I discovered that all of the sliders and knobs output random numbers. I've been able to assign all the objects to the right controls, but the values coming in make no sense. Is there a way to fix this?

brendan mccloskey's icon

Have you checked your ontroller's manual to determine exactly what data is being sent? I would guess that the values aren't random - they are probably sending (at least) a controller ID as well as the controller values. But I don't own one so I could be wrong.

Damian Ramsdell's icon

Have you checked your ontroller's manual to determine exactly what data is being sent? I would guess that the values aren't random - they are probably sending (at least) a controller ID as well as the controller values. But I don't own one so I could be wrong.

I looked into the manual and there was nothing about it. I did play with the knobs quite a bit and I discovered a pattern. It starts at 0 and bounces between high and low numbers, all of which are even. At regular intervals the cycle starts over. There are about 8 cycles per full knob rotation. I'm still looking into the issue

brendan mccloskey's icon

Hi Damian

I would recommend connecting a [print] object to one controller data stream, move it a little, then examine the data in the Max debug window to see if there is a pattern, or a repeating sequence. I'm not a MIDI expert, but it might be arriving as a number pair (ID and value, or vice-versa)

HTH

Brendan

Jean-Francois Charles's icon

The random numbers you are describing are high-resolution MIDI messages, 14-bit. For instance, channel fader for deck one outputs 2 values, one (the MSB) on CC4, the second (LSB) on CC36. Since the analog to digital converters are not 14 bit, but 10 bit, you get one number coded on 7 bits (0-127), the second only on 3 bits (thus the "always even" numbers you report).

Also, check the controller's list of midi messages: google "ddj-sb2 list of midi messages.pdf"

Damian Ramsdell's icon

I looked into it, and that might be happening. For every message output, there's two controllers being shown (ex. Controller 63 and 31). Controller 31 outputs the proper values, but the 63 outputs multiples of 16 in between each message from 31. Every knob or slider has two different inputs. I'm assuming that 31 is the integer while 63 is giving some sort of decimal value. I'm going to look deeper into how the MIDI works on this damn thing.

Jean-Francois Charles's icon

Your controller 31 outputs the MSB (most significant bits). Your controller 63 outputes the LSB (least significant bits).

A simple way to use both numbers is to do 128 * MSB + LSB and you will get a value between 0 and 16383 (2 ˆ 14 - 1). You will have jumps of "16" everywhere. This is due to the fact that the resolution of the ADCs inside your controller is 10 bit, not 14 bit. You can still use the value.

If you just want a low resolution, you might just use your controller 31 and ignore the higher resolution bits, although that would be too bad given that you have a nice controller giving you the better resolution.

PS: you can implement 128 * MSB + LSB more efficiently using bitshifting - don't worry about that if you are just getting started.

Damian Ramsdell's icon

Thank you very much Jean-Francois. I rarely use MIDI in my ventures with Max/MSP, so I'm not sure how to isolate the messages to perform the aforementioned equation. I'm currently using the ctlin object. Is there any way to isolate the MSB and LSB with this object or should I find another?

EDIT: For some of the inputs, I can change the controller number in the ctlin object. I've run more of the knobs and sliders through a MIDI monitor, and half of them don't have two controller numbers. I've reffered to a MIDI mapping document I found to find the MSB. I think I can handle it from here. Thank you for the help!

Jack Waldron's icon

Hi Damian,
Any chance I could see your patch? trying to do something similar.
Cheers.