## mdi negative range

Dec 5, 2011 at 1:20am

# mdi negative range

hey guys,

I’m trying to implement my mbrane in maxforlive and have problems, I have the following:

M1 Dampen MSB —- 0..1
M1 Dampen LSB —- 0..127

When the MSB is 0 the LSB range is: 0 to 126.
When the MSB is 1 the LSB range is: -1 to -128

I Would like to do a unique knob with the range : -128 to 126

Could anyone help me?

Thank you

W

#60466
Dec 5, 2011 at 9:51am

Not sure I understand your goals completely, but the knob could be made like this.

– Pasted Max Patch, click to expand. –
#217616
Dec 6, 2011 at 12:08am

dear broc,

thanks for your reply …. I did the tests here, but unfortunately did not work …. it froze on the mbrane display in -128, began to operate only when the knob (M4L) arrived in 1 … then when I push the knob(m4l) to maximum (126) the mbrane display moved to -2.

When i move the fisical (LSB) mbrane knob to the minimum i have -128… and when i move to the maximum i have 126.

So, via software the parameter only works in negative numbers when the MSB is set 1… and only works in positive numbers when the MSB is set 0….

So, i need to do a virtual knob like that:

LSB: -128……….1…………126
MSB: 11111111000000000

Can you understand me ?

W

#217617
Dec 6, 2011 at 12:20am

the algorithm, perhaps you can better understand

if (LSB < 0)
MSB = 1

if (LSB >= 1)
MSB = 0

#217618
Dec 6, 2011 at 9:33am

Remember that midi cannot handle negative values.
So you need to specify the mapping from your software knob to *positive* MSB and LSB values.
Maybe just use a midi monitor and see what messages the physical mbrane knob sends out.

#217619
Dec 6, 2011 at 10:06am

Look up 2′s Complement . . . .

#217620
Dec 6, 2011 at 10:48am

dear broc,

In the mbrane manual on the 25 page have this note:

“5.1. Sound Parameter CC
In the M.Brane 11, the fine resolution controllers such as Tune and Dampen
can be sent with 2 MSB/LSB controllers in order to have the full 8 bit
resolution. Most state-of-the-art sequencer programs are able to do this, you
only have to define the controllers as 14 bit CCs with MSB and LSB and edit
the corresponding values.
The other controllers use one step of 7 bit CC resolution for 2 steps 8 bit
internal resolution. However, with these parameters the controlling range is
absolutely satisfying.”

Maybe you can help me to understand better…. maybe I’m confused?

Thank you

#217621
Dec 6, 2011 at 12:32pm

Apparently mbrane uses a combination of 2 CC messages to represent 8 bit values. I suspect this will not work with M4L because Live considers them as separate messages and ignores any duplicates. But you can easily test it by sending the CC messages as specified in the manual (eg. CC92 and CC93).

#217622
Dec 6, 2011 at 9:37pm

dear broc,

yeah, the test works fine!

I do 2 knobs….

Knob1 controlling the CC92 (MSB)
knob2 controlling the CC93 (LSB)

so, if the the CC92 are set 0 the CC93 (LSB) is set to negative numbers
if the CC92 are set 1 the CC93 (LSB) is set to positive numbers

Maybe a toggle button to set 0 or 1 in CC92 will be better…. can you help me to work with that? i.e. if the toggle button are checked the cc92 need to be set 1 or if the toggle button are un-checked the cc92 is set 0

check attached my idea….

thanks

Willian

[attachment=178609,3036]

###### Attachments:
#217623
Dec 6, 2011 at 11:49pm

In the picture you are already using a toggle for MSB. Doesn’t it work as expected?

But now it should also be possible to make a unique knob.
For this I need to know the exact behavior of your test patch.

a) If CC92 is 0 and CC93 goes from 0 to 127, which values (from-to) do you see on the mbrane?

and

b) If CC92 is 1 and CC93 goes from 0 to 127, which values (from-to) do you see on the mbrane?

#217624
Dec 7, 2011 at 9:57am

Dear broc

yes, it works well with toggle … but a single button would be perfect!

a) I see on the mbrane the values (from-to) : 0 to 126

b) I see on the mbrane the values (from-to) : -1 to -128

Thanks,

#217625
Dec 7, 2011 at 12:10pm

The range 0-126 seems strange as the manual says the values go up to 127 (which makes sense to me).
And I wonder how the individual CC93 values 0-127 are actually mapped to values 0-126?

#217626
Dec 7, 2011 at 9:32pm

hey broc,

yeah the manual are correctly… in the display i have 0-126… maybe it’s occur as the most significative bit ? check the 5.4 (page 27) on the manual…

hugs

#217627
Dec 8, 2011 at 12:40am

But without understanding every detail of the actual mapping it’s difficult to make a unique knob.

#217628
Jan 28, 2012 at 12:11am