|
Post by reathpd on Sept 19, 2019 20:15:06 GMT
i am using a midi controller to AUM. Within AUM I have two different apps I would like to select separately the patches.
I would like to use a CC to select which app I’m directing the CC 0 and CC 32. (Bank MSB and LSB)
I would designate 4 POTs to complete this
1st to App Selection,
2nd MSB,
3rd LSB,
4th convert CC TO PC (using BX 34 = CX X3)
Depending on the 1st CC VALUE the MSB, LSB, PC would be applied to the app
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 20, 2019 9:35:39 GMT
Hi reathpd , Couple of questions first: 1. Are you using MidiFire before AUM or do you want to use the StreamByterAU inside AUM? 2. Are the two apps operating on different MIDI channels and we just need to switch channels based on POT 1 or you want POT1 to redirect the messages on same channel (which is somewhat more complex) Regards, Nic.
|
|
|
Post by reathpd on Sept 21, 2019 17:36:47 GMT
StreamByter within AUM and use same channel for the Apps
I would assign StreamByter to a fader used for the App. I would use a Pot set to CC89 3 as Max, 0 as Min
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 23, 2019 11:54:23 GMT
Hi reathpd , OK, I think I understand. We will need two StreamByters; both receive events from the MIDI controller. StreamByter 'A' will be connected to first app and 'B' to second app. Can you give me the CC numbers for app selection, MSB and LSB (I will use hex 34 as the trigger event) and I will give you some code. Regards, Nic.
|
|
|
Post by reathpd on Sept 25, 2019 14:27:59 GMT
Sorry I must have missed the send button earlier
the CC for MSB is 00 CC for LSB is 32
Thank you
Peter
|
|
|
Post by reathpd on Sept 25, 2019 14:31:14 GMT
App Selection is CC89 value 0, 1, 2
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 26, 2019 9:29:17 GMT
Hi reathpd , OK, I have some code for you to try out. Since we are flipping between two apps, I made it so that the switching CC (89) flips between app A and app B as you move the fader up/down. If you really need the apps switched based on a specific value of CC 89 let me know and I can advise on how to adjust. Here is what you do: You add two StreamByters to AUM and connect the external controller to both of these in the MIDI matrix. You then connect each of the StreamByters to app A or app B. Paste the code below into each StreamByter (and press Install Rules), but for the StreamByter connected to app B, make the following change to this line near the top: define app_id 0change to define app_id 1and press 'Install Rules' (this is important!) So you can see at a glance which app is active (A or B) the script sets the icon name in AUM with 'APP A' or 'APP B' and then a '+' (active) or a '-' (inactive) at the start. You could give these more meaningful names; the code that sets these is marked as '# set icon name' in the code. If app A is active (which means app B is inactive) then CC0 and 32 are passed and CC52 (BX 34) is remapped to PC. If app A is inactive (which means app B is active) then CC0 and 32 are blocked and CC52 is not remapped. And vice versa. # reathpd switcher by audeonic
if load # app_id - set this to 1 for app B define app_id 0 # cc used to switch apps define switch_cc B0 $89 # internals alias L0 active assign active = 0 send switch_cc 0 +inject end
# handle app switch cc if M0 == switch_cc assign I0 = 0 if app_id == 0 if M2 < 40 assign I0 = 1 end else if M2 >= 40 assign I0 = 1 end end # if changed, flip if I0 != active assign active = I0 end # set icon name if active == 1 if app_id == 0 set name +APP_A else set name +APP_B end else if app_id == 0 set name -APP_A else set name -APP_B end end block end
# handle CC0 and 32 if MT == B0 if M1 == 0 if active == 0 block end end if M1 == $32 if active == 0 block end end end
# convert CC to PC if active if active == 1 BX 34 = CX X3 end
Regards, Nic.
|
|
|
Post by reathpd on Sept 27, 2019 4:30:52 GMT
Thank you. I will try it out.
|
|
|
Post by reathpd on Sept 29, 2019 1:41:35 GMT
I was able to test it. Worked great.. the flip occurs when $89 is max or min. I would like to assign values for $89 to switch. I’d appreciate your advise on how to proceed.
Thank you
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 29, 2019 10:46:48 GMT
Hi reathpd , OK, here is an alternate version. CC89, value 0 = both apps inactive CC89, value 1 = app 1 active, app2 inactive CC89, value 2 = app1 inactive, app2 active CC89, value 3 = both apps active # reathpd switcher by audeonic # alternate version
if load # app_id - set this to 1 for app B define app_id 0 # cc used to switch apps define switch_cc B0 $89 # internals alias L0 active assign active = 0 send switch_cc 0 +inject end
# handle app switch cc if M0 == switch_cc assign I0 = 0 if app_id == 0 if M2 == 1 assign I0 = 1 end else if M2 == 2 assign I0 = 1 end end if M2 == 3 assign I0 = 1 end # if changed, flip if I0 != active assign active = I0 end # set icon name if active == 1 if app_id == 0 set name +APP_A else set name +APP_B end else if app_id == 0 set name -APP_A else set name -APP_B end end block end
# handle CC0 and 32 if MT == B0 if M1 == 0 if active == 0 block end end if M1 == $32 if active == 0 block end end end
# convert CC to PC if active if active == 1 BX 34 = CX X3 end
Regards, Nic.
|
|
|
Post by reathpd on Sept 30, 2019 20:00:10 GMT
Thank you so much for all your help
|
|