Encoders gang together when using sysex strings

13 posts / 0 new
Last post
stevehunt100
stevehunt100's picture
Encoders gang together when using sysex strings

I have created a preset for my BCR2000 to control my Kenton Pro Solo 2, which requires short sysex strings.  The BCR controls the Kenton fine but the LEDs round the 5 encoders that use the sysex strings 'gang' together, i.e. as soon as one is moved, all LEDs for these 5 encoders move together.  The actual output to the Kenton is ok, but the encoders' LEDs is moved by other encoders!!.  Help!  Thanks :)

Hopefully below is links to the settings table and a video of the behaviour...

settings

video of 'ganging'

Royce
Royce's picture

Hi

Your BCR patch shows that not only are you sending out sysex (which the BCR will not sync other controls to) but also CC7 (the BCR will sync to CC messages)

If you only want the sysex to be sent out, you need to get rid of the CC7 settings.

If you want to keep the CC messages to sync the leds, then you need different CC messages (either different CC type CC8 or CC 9 etc or a different Midi channel) on every control.

All the best

Royce

stevehunt100
stevehunt100's picture

Magic - many thanks Royce, that does the trick.  I don't really understand how CCs are necessary to sync the LEDs though.  There's some fundamental bit of understanding about how the encoders sync to CCs that I'm lacking!  I can't see anything in the manuals; do you know of a tutorial or something that might help?

 

Thanks again

Steve

stevehunt100
stevehunt100's picture

Sorry to be a nuisance but I'm stuck on LED ring motion now...  I've changed the resolution of encoder 8 to 8 steps because the parameter the BCR is controlling is LFO waveform and there are 8 waveforms, so having the entire rotation of the encoder shared among only 8 positions works nicely.  But the LED ring round that encoder doesn't follow the rotation, it never gets beyond one step.  How can I make the LED dot follow the knob around, and idealy skip between 8 positions around the circle?  Link below.

Manythanks :)

revised settings

 

Royce
Royce's picture

Hi Steve,

If the settings are still the same as in the pic you have a range 0 to 127.

You should set the Min and Max to 0 and 7 (or 1 to 8 - I'm not sure what values you need) .At the moment, I'm guessing, if you kept turning you would be outputing sysex with values too high, but the synth is ignoring them. Setting Min and Max lets the BCR know when to stop outputing sysex. This then becomes the range for the LEDs ie all LEDs off at 0 and all on when the value reaches 7.

Mark, quite rightly, calls these Value1 and Value2 as you can make the encoder go backwards by having Value1 set to a bigger number than Value2. In your case Min = Value 1 and Max = Value2.

As far as a tutorial, you might like to start with some notes, but mainly examples I wrote some time ago when working out how to get this thing working. It's called "SecretBC.pdf" because Behringer failed to let anyone know what these things could really do.  It is on my website.

http://www.bwalk.com.au/BC2k/BC2k.html

Mark, of course, has a lot more detail in his Manager manual.

And you can always ask questions here and we are all happy to help you out.

All the best

Royce

.

 

stevehunt100
stevehunt100's picture

Hi Royce

That worked fine, many thanks.  Thanks for reminding me about your secrets document - I'd used that back in September to sort out the val statements but then forgot where I'd found the information so it's good to have the refresher.

I'm now stuck on generating negative values.  I am trying to control the transpose and fine tune parameters of my Kenton Pro Solo 2.  I can send positive numbers but they only cover the up direction.  I need to generate values between 232 > 0 > 24 for transpose where 232= -24 semitones, 0 is no transpose and 24 is +24 semitones.  I've tried setting the type to 2's complement but I'm obviously doing something wrong.  And can Manager generate 8 bit data anyway; there seems to be a 0-127 limit?  The fine tune parameter needs to be in the range 129 > 0 > 127 where 129 > 0 is negative.

Is this possible?

Thanks again

Regards

Steve

Royce
Royce's picture

Hi Steve
It is good to look at the problem using binary's 0's and 1's
Group the 0's and 1's into bunches of 4 then hex is good to use as well
BC uses '$' as in $6F but I use the C language '0x' 0x6F

Midi data is always 7bits bit 0 to bit 6 - 0x00 to 0x7F
In 7 bit binary when you go from 0 to -1
000 0010 = 2
000 0001 = 1
000 0000 = 0 take away 1 all flip
111 1111 =-1
111 1110 =-2

In 7 bits you can go from -64 (100 0000) to 63 (011 1111).
In signed numbers the top bit (left hand side bit) is set to mean negative

You can use 8 bits for 0 to 255 (positive number) but also -128 to 127
If you can only use positive numbers, as in the BC, just go 1 bit larger

1000 0010 = 0x82 = 130 taking 1 away each time
1000 0001 = 0x81 = 129
1000 0000 = 0x80 = 128
0111 1111 = 0x7F = 127
0111 1110 = 0x7E = 126

So if you count down from 130, but then only use the lower 7 bits (on the right) you get negative numbers as in the first list
In BC the standard value (val) is val0.6 - bit 0 to bit 6, just what you want.
Inside the BC it works things out in at least 14 bits (probably 16) but sends it out the Midi data as 7 bits

So -24 to 24 (val0.6)
001 1000 = 24
001 0111 = 23
001 0112 = 22
...
000 0010 = 2
000 0001 = 1
000 0000 = 0
111 1111 = -1
111 1110 = -2
...
110 1010 = -22
110 1001 = -23
110 1000 = -24

So get the BC to internally add the extra bit. The max and min you need for -24 to 24

1001 1000 = 0x98 = 152 (24)
1001 0111 = 0x97 = 151 (23)
1001 0110 = 0x96 = 150 (22)
...
1000 0010 = 0x82 = 130 (2)
1000 0001 = 0x82 = 129 (1)
1000 0000 = 0x82 = 128 (0)
0111 1111 = 0x7F = 127 (-1)
0111 1110 = 0x7E = 126 (-2)
...
0110 1010 = 0x6A = 106 (-22)
0110 1001 = 0x69 = 105 (-23)
0110 1000 = 0x68 = 104 (-24)

Min 104 and Max is 152, but the BC only outputs 7 bits

For -127 to 127 you need 9 bits, but that's OK as we said the BC works in at least 14 bits

Max is 127 = 0x7F add extra bit 0x100 = 0x17F (in decimal 127 + 256 = 383)
1 0111 1111

Min -127 is 0x81 ( as a positive number 129)
0 1000 0001
so in BCL
.minmax 129 383
will work.

I hope this strangeness helps.

All the best
Royce

stevehunt100
stevehunt100's picture

Wow thanks Royce.
I think I follow the binary stuff - I got a degree in electronics but it was 35 years ago and your refresher is rather welcome :)

I'm struggling with the process, or order in which data is moved and processed.  Is this how it works: BCR encoders generate 14 bit data.  Using BC Manager I set standard output mode to Absolute 14 bit with min =  104 and max = 152.  So now 14 bit numbers between 00 0000 0110 1000 and 00 0000 1001 1000 are available from the encoder.  These are then processed by the val0.6 command which ANDs the above with 0111 1111 to give a range of 111 1111 to 001 1000.
Using the val7.13 command on the same data yields the range 000 0000 to 000 0001.
So if I send val7.13 followed by val0.6, the Kenton will piece the two together as 00 0000 0111 1111 to 00 0000 1001 1000.  

But the Kenton is expecting 8 bit data, i.e. 0110 1000 for -24 and 1001 1000 for +24.

The string I put in the custom output tab is:
$F0 $00 $20 $13 $03 $20 $0C $00 val7.13 val0.6 $F7

The Kenton responds by changing the correct parameter but its values aren't correct.  I've tried reversing the order of the two val statements.

I also tried the fine tune parameter which needs to be in the range 129 > 0 > 127 where 129 > 0 is negative, and set standard output mode to Absolute 14 bit with min =  129 and max = 383 but again this yields incorrect values at the Kenton.    $F0 $00 $20 $13 $03 $20 $0D $00 val0.6 val7.13 $F7

I'm just using BC Manager and its Standard Output and Custom Output tabs.  You are referring to commands like .minmax.  Do I need to be using a different tool for this or should I type this into the custom output text field or does BC Manager take care of this when I set values for min and max in the Standard Output tab?
Thanks
Steve

Mark van den Berg
Mark van den Berg's picture

I'm just using BC Manager and its Standard Output and Custom Output tabs.  You are referring to commands like .minmax.  Do I need to be using a different tool for this or should I type this into the custom output text field or does BC Manager take care of this when I set values for min and max in the Standard Output tab?

As far as I know, BC Manager's element (btn/enc/fdr) dialog boxes cover all meaningful BCL definitions.
For instance, each "output line" leads to a ".tx" statement.
And the ".minmax" statement is covered by "Value 1" and "Value 2" on the "Custom output" tab: if Value 1 or Value 2 is non-zero, BC Manager generates a corresponding ".minmax" statement in the output (i.e. a setup file or the MIDI message sequence to a BCF/R).

You can see the exact BCL code generated by BC Manager's element dialog boxes in the BCL editor window
This window can be opened from the View pull-down menu of the B-Controls window.
See section 21 of the manual for more info.
Personally I often use Load -> Preset 0 to quickly load the underlying code of buttons/encoders/faders.
In the BCL editor window you can also write your own BCL scripts (and send them directly to your BCF/R, or have them interpreted by BC Manager).

But of course you can use any text editor to write BCL code, although you'll then have to find a way to send these scripts to your BCF/R. (This isn't trivial, since BCL statements must be embedded inside a rather complicated SysEx format. See section 7 of BC MIDI Implementation.pdf for details.)

Royce has also written a handy application that allows you to edit and send BCL code.
(But can this still be downloaded from somewhere, Royce? I couldn't immediately find it on your website.)

Apologies for intrudingsmiley
   Mark.

Royce
Royce's picture

Hi Mark,
how could it be an intrusion? It is your house 8)
I stopped developing my editor when yours came out and did everything anyone could want.
I still use mine (old dogs and new tricks) but I see no need in getting my editor into distributable form as yours is so good.

Hi Steve
The encoders like the buttons only put out pulses and the microcontroller uses that action to change the variables inside.
It adds or subtracts depending on the timing of the 2 pulse streams and changes its variable accordingly. It takes the final
Value and & masks it to produce the Data it inserts in the Midi message.

"But the Kenton is expecting 8 bit data, i.e. 0110 1000 for -24 and 1001 1000 for +24"
The Kenton can't expect 8bit data because data in Midi always starts with 0 0xxx xxxx.

Oh, I should have read the Kenton manual.
The Kenton sysex format is (all hex))
F0 00 20 13 03 datatype lowaddress highaddress lowdata highdata F7
datatype = DataChange and Device - normally 20
the other 4 data bytes are really just 4 bits (nibble) so you can join it together to make 8bit data (not allowed in Midi).

0000 LLLL and 0000 HHHH make HHHH LLLL

In the BC you need
val0.3 for the low nibble and val4.7 for the high nibble
So for address Coarse tuning 0x0C device 0 use $0C $00
.tx $F0 $00 $20 $13 $03 $20 $0C $00 val0.4 val4.7 $F7

24 = 0001 1000
232 = 1110 1000 is also -24
but how can you go from
0000 0000 = 0 to
1111 1111 = -1 ?????

You have to add the extra bit
1 0000 0000 = 0
0 1111 1111 = -1
So
24 = 1 0001 1000 (once it have been masked)
-24 = 0 1110 1000

24 + 256 = 280 = 1 0001 1000
-24 = 232 = 0 1110 1000

You need to use
.minmax 232 280
.tx $F0 $00 $20 $13 $03 $20 $0C $00 val0.4 val4.7 $F7

For fine tune (0x0D)
127 = 0111 1111
129 = 1000 0001 = -127
add the bit
127 + 256 = 383 = 1 0111 1111 = 127
129 = 0 1000 0001 = -127

.minmax 129 383
.tx $F0 $00 $20 $13 $03 $20 $0D $00 val0.4 val4.7 $F7
is what you need .

All the best
Royce

stevehunt100
stevehunt100's picture

Marvelous, thanks Royce.  

I think you meant val0.3 rather than 0.4, but that works a treat.  I had a bit of trouble getting the encoder to quantise correctly but discovered that if I trust 'default 0' then it works perfectly.  I am kicking myself about the nibble trick because I figured this out back in September when I got the other parameters to work with this and then got side-tracked with the negative numbers and forgot to re-apply the nibbles! 

Is there a way of getting the BCR to output a CC7=127 at either switchon or at intervals?  I've got a Doepfer MCV4 midi-CV converter that has an out put that is the velocity x volume.  I just want velocity so this is fine as long as I set CC7=127, but it always defaultys to 0 at switchon. To save me having to manually send a CC, is there a way of doing this automatically, ideally 10 secs after switchon, or at intervals?

Thanks again!

Best Regards

Steve

Royce
Royce's picture

Hi Steve,
Sorry about the "val0.4". Mistype once then cut and paste 8(

You can get the BC to send out all it's current values when you select the preset and if this is the first time since
power on that you selected it will send out the .default. It is called '.snapshot' and it is in the preset header.
Have a look in Mark's manual.

If you have a spare button on the BC, just make this your 'special button' on all your BC presets.
.easypar CC 01 07 off 127 toggleoff // channel 1

On the BC the 4 lower right buttons are standard, but the other 10 buttons on the right are dual function and can
be converted to programmable types.

For example, if you don't use all the groups for the top row encoder, you can limit it to, say, 3 encoder rows by putting
.egroups 3
in the preset header and then the bottom right button becomes programmable 'Button 60'.

There is no way that I know of to get the BC to automate an outpu output to produce a 'clock' type message.

All the best
Royce

stevehunt100
stevehunt100's picture

Cool, thanks a lot for your help Royce :)