Help an ignorant, frustrated noob map my controllers on my APC40... I know, it's been covered but...

Monkeyfarm

2016-06-10 21:57:48

Hello everyone.

I have one very simple requirement from Bome. I need to convert the absolute CC messages from my APC40 to a relative mode I can use in Reaper's learn.

1) Yes, I know there are several posts on the forum about the APC, but they all seem to deal with the LED's etc, which i have covered via Reaper sending MIDI.
2) Yes, I know there are posts about absolute>relative, but I can't figure out where to begin to try them, and I can never get very far before Bome trial timer expires on me. If Bome can't do this one thing I need, or put another way, I can't get it through my dense brain without spending a month learning Bome, then I'll need to look elsewhere.

So I'm going to be one of "those" people on a forum. Yes, I hate myself for this, and I freely admit I'm being "lazy" even though I've already spent like 4+ hours with the trial trying to figure this out...

With all that out of the way...

For those that don't know, the APC40 (first gen) has rotary encoders that are 1) endless physically, 2) only send continuous data (0-127), but helpfully (based on posts I've read about this) once you hit a limit like 0 or 127, because the encoders physically are endless, it will keep sending a 0 or 127.

So, can some kind soul please tell me in steps even I can understand how I can set up a translation so that ALL CC's on ALL channels from my APC40 will be converted from absolute to a relative mode Reaper can understand (1=-1:127=+1 OR 63=-1:65=+1, etc.)?

So I get that in a pseudo-code manner it's like this:

CC_val(CC.Channel) = current value of CC read by Bome when I twiddle a knob. [** Sticking point: how do I do this for multiple channels... i.e. CC20 on CH1, CC20 on CH2, etc?]

Old_CC_Val(CC.Channel) = last read value [** Sticking point** I don't get how you deal with the initial "Instance" of a read... As when you start out, there's not an "old" value to compare with...]

New_CC_Val(CC.Channel) = "Converted" CC value for the CC/Channel combo in question

Assuming 63:65 mode

If CC_val(CC.Channel) > Old_CC_Val(CC.Channel) : New_CC_Val(CC.Channel)= 65
If CC_val(CC.Channel) < Old_CC_Val(CC.Channel) : New_CC_Val(CC.Channel)= 63

Endpoint cases

If CC_val(CC.Channel) = 127 : New_CC_Val(CC.Channel)= 65
If CC_val(CC.Channel) = 0 : New_CC_Val(CC.Channel)= 63


I kind of got one CC on one channel to work based on what I've read on the forum and via Google searches, but I don't understand how to write it so it will work on all CC's (all status bytes for CC's) on all Channels (all status bytes for CC's) ?

There's got to be a more elegant solution that writing potentially 1600 individual translators to cover all the CC's on 16 channels, right? Some kind of loop, conditional, or array, or something?



If I can get this to work, I'll buy Bome in a heartbeat

ibanman555

2016-06-11 19:15:06

Hey, so let's take the first step and find out what message a single button push or encoder move sends. Connect your APC, open MTP and "open" the APC midi ports. Both ports for input and output. You'll find those sections on the right side of MTP. Now, open the log window and you should see "midi in" messages in the log window, granted it is selected to log as such. Once you find out what the message are, we can start mapping.

Monkeyfarm

2016-06-12 20:36:35

ibanman555 wrote:Hey, so let's take the first step and find out what message a single button push or encoder move sends. Connect your APC, open MTP and "open" the APC midi ports. Both ports for input and output. You'll find those sections on the right side of MTP. Now, open the log window and you should see "midi in" messages in the log window, granted it is selected to log as such. Once you find out what the message are, we can start mapping.
Hey there ibanman555, I'm not quite that hopeless. I've gotten beyond that stage. :)

But for completeness, here's what I've got. This is one knob, CC20 on Ch1 going from zero to 127, then showing that it will send 127 repeatedly once it hits the limit. Again, the physical knobs will spin forever. They have no physical stops, which I think should make this work correctly:

Code: Select all

1: MIDI IN [Akai APC40]: B0 14 01
2: MIDI IN [Akai APC40]: B0 14 02
3: MIDI IN [Akai APC40]: B0 14 03
4: MIDI IN [Akai APC40]: B0 14 04
5: MIDI IN [Akai APC40]: B0 14 05
6: MIDI IN [Akai APC40]: B0 14 06
7: MIDI IN [Akai APC40]: B0 14 07
8: MIDI IN [Akai APC40]: B0 14 08
9: MIDI IN [Akai APC40]: B0 14 09
10: MIDI IN [Akai APC40]: B0 14 0A
11: MIDI IN [Akai APC40]: B0 14 0B
12: MIDI IN [Akai APC40]: B0 14 0C
13: MIDI IN [Akai APC40]: B0 14 0D
14: MIDI IN [Akai APC40]: B0 14 0E
15: MIDI IN [Akai APC40]: B0 14 0F
16: MIDI IN [Akai APC40]: B0 14 10
17: MIDI IN [Akai APC40]: B0 14 11
18: MIDI IN [Akai APC40]: B0 14 12
19: MIDI IN [Akai APC40]: B0 14 13
20: MIDI IN [Akai APC40]: B0 14 14
21: MIDI IN [Akai APC40]: B0 14 15
22: MIDI IN [Akai APC40]: B0 14 16
23: MIDI IN [Akai APC40]: B0 14 17
24: MIDI IN [Akai APC40]: B0 14 18
25: MIDI IN [Akai APC40]: B0 14 19
26: MIDI IN [Akai APC40]: B0 14 1A
27: MIDI IN [Akai APC40]: B0 14 1B
28: MIDI IN [Akai APC40]: B0 14 1C
29: MIDI IN [Akai APC40]: B0 14 1D
30: MIDI IN [Akai APC40]: B0 14 1E
31: MIDI IN [Akai APC40]: B0 14 1F
32: MIDI IN [Akai APC40]: B0 14 20
33: MIDI IN [Akai APC40]: B0 14 21
34: MIDI IN [Akai APC40]: B0 14 22
35: MIDI IN [Akai APC40]: B0 14 23
36: MIDI IN [Akai APC40]: B0 14 24
37: MIDI IN [Akai APC40]: B0 14 25
38: MIDI IN [Akai APC40]: B0 14 26
39: MIDI IN [Akai APC40]: B0 14 27
40: MIDI IN [Akai APC40]: B0 14 28
41: MIDI IN [Akai APC40]: B0 14 29
42: MIDI IN [Akai APC40]: B0 14 2A
43: MIDI IN [Akai APC40]: B0 14 2B
44: MIDI IN [Akai APC40]: B0 14 2C
45: MIDI IN [Akai APC40]: B0 14 2D
46: MIDI IN [Akai APC40]: B0 14 2E
47: MIDI IN [Akai APC40]: B0 14 30
48: MIDI IN [Akai APC40]: B0 14 31
49: MIDI IN [Akai APC40]: B0 14 32
50: MIDI IN [Akai APC40]: B0 14 33
51: MIDI IN [Akai APC40]: B0 14 34
52: MIDI IN [Akai APC40]: B0 14 35
53: MIDI IN [Akai APC40]: B0 14 36
54: MIDI IN [Akai APC40]: B0 14 37
55: MIDI IN [Akai APC40]: B0 14 38
56: MIDI IN [Akai APC40]: B0 14 39
57: MIDI IN [Akai APC40]: B0 14 3A
58: MIDI IN [Akai APC40]: B0 14 3B
59: MIDI IN [Akai APC40]: B0 14 3C
60: MIDI IN [Akai APC40]: B0 14 3E
61: MIDI IN [Akai APC40]: B0 14 3F
62: MIDI IN [Akai APC40]: B0 14 40
63: MIDI IN [Akai APC40]: B0 14 41
64: MIDI IN [Akai APC40]: B0 14 42
65: MIDI IN [Akai APC40]: B0 14 43
66: MIDI IN [Akai APC40]: B0 14 44
67: MIDI IN [Akai APC40]: B0 14 46
68: MIDI IN [Akai APC40]: B0 14 47
69: MIDI IN [Akai APC40]: B0 14 48
70: MIDI IN [Akai APC40]: B0 14 49
71: MIDI IN [Akai APC40]: B0 14 4A
72: MIDI IN [Akai APC40]: B0 14 4C
73: MIDI IN [Akai APC40]: B0 14 4D
74: MIDI IN [Akai APC40]: B0 14 4E
75: MIDI IN [Akai APC40]: B0 14 4F
76: MIDI IN [Akai APC40]: B0 14 50
77: MIDI IN [Akai APC40]: B0 14 51
78: MIDI IN [Akai APC40]: B0 14 52
79: MIDI IN [Akai APC40]: B0 14 53
80: MIDI IN [Akai APC40]: B0 14 54
81: MIDI IN [Akai APC40]: B0 14 55
82: MIDI IN [Akai APC40]: B0 14 56
83: MIDI IN [Akai APC40]: B0 14 57
84: MIDI IN [Akai APC40]: B0 14 58
85: MIDI IN [Akai APC40]: B0 14 5A
86: MIDI IN [Akai APC40]: B0 14 5B
87: MIDI IN [Akai APC40]: B0 14 5C
88: MIDI IN [Akai APC40]: B0 14 5D
89: MIDI IN [Akai APC40]: B0 14 5F
90: MIDI IN [Akai APC40]: B0 14 60
91: MIDI IN [Akai APC40]: B0 14 61
92: MIDI IN [Akai APC40]: B0 14 62
93: MIDI IN [Akai APC40]: B0 14 63
94: MIDI IN [Akai APC40]: B0 14 64
95: MIDI IN [Akai APC40]: B0 14 65
96: MIDI IN [Akai APC40]: B0 14 66
97: MIDI IN [Akai APC40]: B0 14 67
98: MIDI IN [Akai APC40]: B0 14 68
99: MIDI IN [Akai APC40]: B0 14 69
100: MIDI IN [Akai APC40]: B0 14 6A
101: MIDI IN [Akai APC40]: B0 14 6B
102: MIDI IN [Akai APC40]: B0 14 6C
103: MIDI IN [Akai APC40]: B0 14 6D
104: MIDI IN [Akai APC40]: B0 14 6E
105: MIDI IN [Akai APC40]: B0 14 6F
106: MIDI IN [Akai APC40]: B0 14 70
107: MIDI IN [Akai APC40]: B0 14 71
108: MIDI IN [Akai APC40]: B0 14 72
109: MIDI IN [Akai APC40]: B0 14 73
110: MIDI IN [Akai APC40]: B0 14 74
111: MIDI IN [Akai APC40]: B0 14 75
112: MIDI IN [Akai APC40]: B0 14 76
113: MIDI IN [Akai APC40]: B0 14 77
114: MIDI IN [Akai APC40]: B0 14 78
115: MIDI IN [Akai APC40]: B0 14 79
116: MIDI IN [Akai APC40]: B0 14 7A
117: MIDI IN [Akai APC40]: B0 14 7B
118: MIDI IN [Akai APC40]: B0 14 7C
119: MIDI IN [Akai APC40]: B0 14 7D
120: MIDI IN [Akai APC40]: B0 14 7E
121: MIDI IN [Akai APC40]: B0 14 7F
122: MIDI IN [Akai APC40]: B0 14 7F
123: MIDI IN [Akai APC40]: B0 14 7F
124: MIDI IN [Akai APC40]: B0 14 7F
125: MIDI IN [Akai APC40]: B0 14 7F
126: MIDI IN [Akai APC40]: B0 14 7F
127: MIDI IN [Akai APC40]: B0 14 7F
128: MIDI IN [Akai APC40]: B0 14 7F
129: MIDI IN [Akai APC40]: B0 14 7F
130: MIDI IN [Akai APC40]: B0 14 7F
131: MIDI IN [Akai APC40]: B0 14 7F
132: MIDI IN [Akai APC40]: B0 14 7F
133: MIDI IN [Akai APC40]: B0 14 7F
134: MIDI IN [Akai APC40]: B0 14 7F
135: MIDI IN [Akai APC40]: B0 14 7F

DvlsAdvct

2016-06-18 23:14:28

Hey Monkeyfarm

One of the posts in the FAQ thread covers this exactly, converting Absolute to Relative messages. You want to build translators that remembers what the previous position was and send a relative message based on the next message. So, if you turn a knob, we need MT Pro to know it's going left or right. The below code should help

Code: Select all

Translator 0: turn left
Options: stop=false
Incoming: MIDI B0 0E pp
Rules:
  if pp==0 then exit rules, execute outgoing action
  gd=pp-ga
  ga=pp
  if gd>=0 then exit rules, skip Outgoing Action
Outgoing: B0 0E 3F

Translator 1: turn right
Options: stop=false
Incoming: MIDI B0 0E pp
Rules:
  if pp==127 then exit rules, execute outgoing action
  if gd<=0 then exit rules, skip Outgoing Action
Outgoing: B0 0E 41 
Use those as examples. Change the incoming and outgoing messages as you need.

Hope that helps
Jared

Monkeyfarm

2016-06-18 23:52:28

DvlsAdvct wrote:Hey Monkeyfarm

One of the posts in the FAQ thread covers this exactly, converting Absolute to Relative messages. You want to build translators that remembers what the previous position was and send a relative message based on the next message. So, if you turn a knob, we need MT Pro to know it's going left or right. The below code should help

Code: Select all

Translator 0: turn left
Options: stop=false
Incoming: MIDI B0 0E pp
Rules:
  if pp==0 then exit rules, execute outgoing action
  gd=pp-ga
  ga=pp
  if gd>=0 then exit rules, skip Outgoing Action
Outgoing: B0 0E 3F

Translator 1: turn right
Options: stop=false
Incoming: MIDI B0 0E pp
Rules:
  if pp==127 then exit rules, execute outgoing action
  if gd<=0 then exit rules, skip Outgoing Action
Outgoing: B0 0E 41 
Use those as examples. Change the incoming and outgoing messages as you need.

Hope that helps
Jared
Thanks Jared! I actually figured out a way to do it in Reaper via JS that's going to offer me more flexibility. But this code example is a good reference. Can you point me to where you found this in the FAQ, 'cause I couldn't find an example, but I may be looking at the wrong FAQ or the wrong section...

DvlsAdvct

2016-07-18 00:39:23

Hi monkeyfarm

Terribly sorry for the delay. Life got pretty much completely away from me.

This thread is listed as Absolute to Relative in the FAQ, and presents that exact code. :)

Thanks
Jared