Query the value of an Encoder?

5 posts / 0 new
Last post
mIIwaukee
mIIwaukee's picture
Query the value of an Encoder?

Hello,

Is it possible to query the value of an encoder? I was hoping to do something like this:

$encoder 1; Set's the Value
  .showvalue on
  .mode 1dot
  .resolution 64 64 127 127
  .minmax 0 9

$encoder 2; Query's Encoder 1's Value:
  .tx $F0 $7D $40 val cks-2 2 $72 $F7 $F0 $10 $06 $0B $encoder1.value $02 cks-2 4 $04 $F7
  .minmax 0 127
  .default 64
  .mode bar
  .showvalue on
  .resolution 64 64 127 127

thanks,

mark

Royce
Royce's picture

Hi Mark

Great idea. You would also be able to work parameters that are packed together in a single byte. This is what you need to do in the Korg DW6000.

Sadly you can only access the current controls value, as far as I know.

This, along with being able to use negative numbers, would be my new feature requests.

All the best

Royce

 

Mark van den Berg
Mark van den Berg's picture

It is possible to make different BCF/BCR elements (buttons/encoders/faders) "talk" to each other in a limited way:
If the "standard output" (".easypar") definitions of two or more elements refer to the same "MIDI entity" (Channel + e.g. Controller), physically moving one of these elements makes the BCF/BCR update the value(s) of the other element(s) too.
See section 14.9 ("Value synchronization") in BC MIDI Implementation.pdf ("BCMI") for further discussion, including some examples.
However, I doubt whether value synchronization is useful for what you're trying to achieve here.

A totally different approach: as discussed in sections 13.2 and 23.4 of BCMI, the BCF/BCR can send a "snapshot", i.e. the current output of all elements. You can even ask the BCF/BCR to send a snapshot via the Request Snapshot ($43) command, as listed in section 6.1 of BCMI.

Hope this helps,
   a different Mark.

mIIwaukee
mIIwaukee's picture

Thanks (different) Mark. I'm going to give the snapshot approach a try and report back. It took me a while to grasp how powerful BC Manager is. A work of genius.

Royce, thanks for responding. Negative numbers can in fact be "sent", but I think it's up to the device to "interpet" them as negatives. This is the case for the Oberheim Matrix 6/6r/1000. Not being a math wiz, the shifting of bits, two's compliment, etc. boggled my mind.

In this case, a range of -63 to 63 is desired from encoder values ranging from 1-127. The important bits are the hex sysex values:

$encoder 6; Mod
  .tx $F0 $7D $40 val cks-2 2 $72 $F7 $F0 $10 $06 $0B $01 $02 cks-2 4 $04 $F7
  .minmax 0 127
  .default 64
  .mode bar
  .showvalue on
  .resolution 64 64 127 127

This is Sysex statement is essentually 2 parts... In this case I'm changing a synth value under the parameter 0B:

$F0 $7D $40 val cks-2 2 $72 $F7 (transform value)
Start - Mfg ID (null) - Device (null) - encoder value - [checksum value] - (Parameter 7D - 0B) - End

$F0 $10 $06 $0B $01 $02 cks-2 4 $04 $F7 (send to device)
Start - Oberheim - Matrix - Mod Matrix - Mod Slot 1 - Source: Env1 - [new value checksum] - Dest: DCO1 - End

Some how this works!

Royce
Royce's picture

"Questioning" Mark,

You are right. Roland does something similar and often sets "0" to be 64 and so the parameter number is really (val - 64) . This works well on the BC

But the BCR will also send out real 'computer' negative numbers.

That is, when if you add -1 to 1 you get 0.

So what is computer -1 ? It is all the bits set to 1, because when you add 1 to that value all bits get cleared (and the carry flag is set). Ignore the carry flag and it is the action of  -1 to 0.

All bits set for 7bit Midi data (this is BC's val) is 7F (or 127). If we add 1 we get 128 which is the 8th bit set and 0 for all the other 7 bits.

So if we make '0' to be 128 then 127 = -1 in our 7bit BC val, If you only use val then this works for negative numbers.

If you want a range of -7 to +7, (128 =0) set min to 128 - 7 = 121 or 0x79 (is -7) and max to 128 +7 = 135 or 0x87 (is +7) and use just the 7bit val.

You will see val go from 79,7A,7B,7C,7D,7E,7F,00,01,02,03,04,05,06,07 which is true 7bit signed numbers.

BUT the M1 is 14 bit Midi (two 7bit bytes ) and expects 7F 7E, 7F 7F, 00 00, 00 01 , 00 02, going from -2 to  2.

Using the above 7bit example where we took advantage of the 8th bit, it would be possible if we could access 15bits or more in out minmax statement

Unfortunately the BC doesn't like that.

I have thought about modifing the firmware as the CPU is at least 16bit wide and I think it is just the firmware's max number is 14bit 3FFFF.

I also should have said that it would good if you could mask and rortate values to get access to all the bits to handle the packed data in a lot of early synths.

All the best

Royce