|
Post by mo13 on Mar 29, 2022 19:28:18 GMT
Phew. Working right off the bat! I have this below script running along with yours into a virtual port to AUM now, it's the Solo memory of the analogue clocks channels that also need to become active with the first of the Solo's press and released upon the last Solo in the bank, I can keep it that separate way if it's unhandy to have it merged? #init_preset #AutoSolo
If load # using aliases to try to make the logic clear # they also make it easy to change the implementation Alias 70 firstCC Alias 76 lastCC Alias 6F soloClock Alias J0 stateMemory # using bits in a word to remember state of all toggles # makes it really easy to check for all off Ass stateMemory = 0 # bit values for indexes 0..$15 Ass KD0 = 1 2 4 8 10 20 40 80 100 200 400 800 1000 2000 4000 8000 +P Alias D0 bitBase End
If M0 == B2 If M1 >= firstCC If M1 <= lastCC # memory is zero when first CC arrives If stateMemory == 0 Snd B3 6F 7F End # index bit for this CC# Mat I00 = M1 - firstCC # index in the bit array Mat I00 = I00 + bitBase # exclusive or toggles this bit in memory Mat stateMemory = stateMemory ^ KI00 # memory is zero when last bit is off If stateMemory == 0 Snd B3 6F 7F End End End End This seems not to be clashing with anything at this point as I disconnected my controller from AUM's Midi-Control so now it's only receiving the CC's from the virtual port as we only use those 2 banks's CC's for AUM. [edit] I see what you mean now, that last row of mutes is engaging the Solo's @aum so indeed those messages should be on a different Ch., #4 for instance.and to keep in mind for the Solo's only to send $112-118 and mutes $120-126. In the meantime there has been a little adjustment to Bank B. It has 8 Less bank-function CC's now, so 8 less LED's as well. It would be great If those Last 8 CC's $56-$63 could come on lit with the value of 1. And upon press have a little delay (unlit for a moment) I just calculated it and the sweet spot is +D200 with an example:  And lastly if I may, for CC$119 LED aka Unsolo ALL to become active upon the first Solo press (aka val.6) and unpressed (val.3): So I guess that would mean that it also needs to hold the active Solo LEDs in memory:  Thanks so much for the work and in depth documentation again!
|
|
|
Post by uncledave on Mar 29, 2022 23:34:52 GMT
What I meant was that the script normally only sends the commands for the lights. But to implement AllSolosOff, you asked that it send commands to AUM as well, to actually toggle off the Solo in AUM. Since those commands are on the same channel as the light commands, and use the same CC#, they cause confusion. Look at a MIDI monitor on the script output, turn on one solo, then use AllSolosOff.
I'll look at integrating the solo clock, and lighting AllSolosOff only when solos are active.
|
|
|
Post by mo13 on Mar 30, 2022 9:13:13 GMT
yes, it's cleared up, what I did now is to block the LED CC's from your script and only pass the UNsolo ALL (back on B2) as that's where AUM is receiving everything directly from the controller now. That way there is no interference of double messages. another option for AUM operation is to remap the controller from B2 to B3 and set all Channels in AUM to B3. But that's practicly the same thing.
|
|
|
Post by mo13 on Mar 31, 2022 14:42:03 GMT
hey Dave, I just ran into something which I think has slipped our minds as this script is ment to be operating within switching MidiFire scenes, I just discovered this while saving a new scene and ofcourse those 2 banks of Solo/Mutes LEDs get reloaded by clearblock, so now I wonder if there is a way around this? as i'm not at all familiar with memory holds on scene switches.
|
|
|
Post by uncledave on Mar 31, 2022 21:21:27 GMT
hey Dave, I just ran into something which I think has slipped our minds as this script is ment to be operating within switching MidiFire scenes, I just discovered this while saving a new scene and ofcourse those 2 banks of Solo/Mutes LEDs get reloaded by clearblock, so now I wonder if there is a way around this? as i'm not at all familiar with memory holds on scene switches. I don't think there's any way to do this. There is no "memory hold on scene switch". A new scene is a completely fresh start, with new copies of the scripts and everything. Maybe you could load these hardware-related scripts in AUM or Audiobus, and use its MIDI routing to make the interconnections.
|
|
|
Post by uncledave on Apr 1, 2022 13:19:48 GMT
Actually, I was sceptical of this "LED Feedback" concept from the beginning. Essentially, the feedback script has to emulate whatever the "real" action is doing, without any actual knowledge. It would be much better to use a separate SB script, possibly running in AUM, that makes the decisions, issues the commands, and does the feedback. That way the feedback is always in sync with the system state.
But I have an idea that could allow us to save and restore some state info. You would need to have a separate SB instance running in a host that will not be restoring a preset. This could be AUM, Audiobus, or even SB stand-alone. (The SB app is a free download.) We would send this script a series of short SysEx messages containing the state info. Then, when a scene is loaded, we'd send another message asking it to return our data. It would send those messages back, we'd rebuild the state and update the lights accordingly. The only problem I see is knowing when to send the data. Do we have warning of when a scene is about to load? If we don't know, we might have to send a message whenever any state changed, and let the other script keep a shadow copy of the data.
In my implemetation of the solos and mutes, the state is just the 7 state variables. We could send all 7 in one message, or send just the column index and the new value for that column.
|
|
|
Post by mo13 on Apr 1, 2022 15:48:58 GMT
ofcourse, hosting it in AUM does the job right away now! I just stopped hosting all Midi types of things in AUM and do everything in MidiFIre but this one is a necessity ofcourse, unless it's somehow any better to use the standalone SB app for this?
It only needs to load ones on startup now (does it now when opening the AUM project containing the script) after that it just continues to funciton indefinitely
so yeah good to know that the solution is already here, we'll just use the hardware-related script outside of MF like you said.
|
|
|
Post by mo13 on Apr 4, 2022 13:39:21 GMT
hey uncledave, I just got back to trying everything out and yes, it's 2 separate scripts @ the LED script would be hosted in AUM. so all the one-led-a-time and Solo/Mute LEDs merged. and the funtions script that mimics AUM's solo/mutes operation + the solo clock channels script can be merged into one and be hosted in MidiFire. as now there are separate scripts with both LED and AUM functions sitting in between AUM and MF. It would be great to have those seperated and doing their own things like you've mentioned they should!
|
|
|
Post by mo13 on May 26, 2022 12:43:34 GMT
uncledave, AUM has just implemented a mapable UNsolo ALL control + also a DSP meter per nod, and I see that the SB instance of your toggle script from previous page in this thread is actually running the highest of all midi instances, even higher then some AUV3 audio fx, that would be @ 1.3 % DSP. from now on there is no more need for that function script (that mimics AUM's solo/mutes) only the LED + Toggle feedback, I was wondering of these SETLED + Toggle scripts can still be merged together to clean things up a little and maybe reduce the DSP? #SetLed If load Alias $32 bankSize Alias 4 numBanks Alias B2 setCommand Alias $112 totalBanks Ass J00 = 80 80 80 80 Ass K00 = 5 6 4 6 3 0 3 0 Sub ClearBank pBank Mat I20 = pBank * bankSize Mat I21 = I20 + bankSize If I21 > totalBanks Ass I21 = totalBanks End Mat I22 = pBank + numBanks Ass I22 = KI22 While I20 < I21 Send setCommand I20 I22 Mat I20 = I20 + 1 End End Sub SetLedAny pNumb Mat I10 = pNumb / bankSize If JI10 == 80 ClearBank I10 Else Mat I11 = I10 + numBanks Send setCommand JI10 KI11 End Send setCommand pNumb KI10 Ass JI10 = pNumb End Set Name SetLed End # Initialization ———————————————————————————
If M0 == B2 If M1 < totalBanks SetLedAny M1 Else End End Block
#Toggle + contains AUM's Solo/Mutes mimic functions that are not needed anymore: If Load Set Name Toggle Alias $112 totalBanks Alias B2 setCommand Alias 8 togSize # two rows of 8 toggles Alias 10 buttonBase # offset to button data in J and K Alias 20 transBase # offset to transition data in K Alias J18 needResend Alias 4 soloBit Alias 2 muteBit # J10, etc. contains 8 state memories. Each state memory contains 3 bits, # 4 for Solo, 2 for Mute, 1 for old mute. This initialization sets the mutes. Ass J10 = 2 2 2 2 2 2 2 0 # J18... contains working variables Ass J18 = 0 0 0 0 0 0 0 0 # K10, etc. contains 16 ON colors Ass K10 = 5 5 5 5 5 5 5 6 2 2 2 2 2 2 2 5 # K20 is transition table for first 7 columns, K28 for last column # Each entry is new states for a given state. High nybble for top button, # low nybble for bottom button. Ass K20 = 42 52 50 50 04 25 24 25 Ass K28 = 42 42 60 60 06 06 24 24 # Note that the values in the K array are packed together, with no gaps. # There are 16 colors, then 2 transition tables of 8. # our own internal SysEx message Define resendMessage F0 7D 02 # Sets one LED. pState is 0 for OFF, non-zero for ON. # pCol is the column number, pOffset is 0 for top row, 8 for bottom. Sub SetOneLed pValue pCol pOffset # determine the color If pValue > 0 Mat I28 = pCol + buttonBase # index column color Mat I28 = I28 + pOffset Ass I28 = KI28 # index ON color from table Else Ass I28 = 3 End # determine CC# Mat I29 = pCol + totalBanks Mat I29 = I29 + pOffset Send setCommand I29 I28 # set the LED End # sets both LEDs in the column, given the state value Sub SetLedPair pCol pState Mat I20 = pState & soloBit # top button state SetOneLed I20 pCol 0 Mat I20 = pState & muteBit # bottom button state SetOneLed I20 pCol togSize End # Updates data for one column. pNumb is button number, 0..15 Sub UpdateToggle pNumb Mat I10 = pNumb % togSize # column index 0..7 Mat I11 = pNumb / togSize # row number 0, 1 Mat I12 = I10 + buttonBase # index state, JI12 is state value Set LB0 JI12 # display entering state Mat I13 = JI12 + transBase # index transition entry for state # use second transition table for last column If I10 == 7 Mat I13 = I13 + togSize End # update new state from table, using high or low nybble of transition # in KI13. Top row uses high nybble, bottom uses low If I11 == 0 Mat JI12 = KI13 / 10 # divide moves high nybble to low Mat JI12 = JI12 & F # ensure nothing crazy Else Mat JI12 = KI13 & F # mask selects low nybble End Set LB1 JI12 # display new state # update leds in this column SetLedPair I10 JI12 End # sends an internal toggle message for each current solo # These messages are sent in one burst. Then SB will run to handle # each one of them. Enabling resend causes these messages to be # sent out also. Sub AllSolosOff # messages sent with +I flag go to the SB input queue, not outside. Send resendMessage 1 F7 +I # send internal msg to enable resend Ass I10 = 0 Ass I11 = togSize Mat I11 = I11 - 1 # I10 will run 0-6 While I10 < I11 Mat I12 = I10 + buttonBase # index button states Mat I12 = JI12 & soloBit # test the Solo bit If I12 != 0 Mat I13 = I10 + totalBanks # create the CC# Send setCommand I13 $127 +I # send internal cmd to push solo End Mat I10 = I10 + 1 End Send resendMessage 0 F7 +I # cancel previous resend enable End # sets the toggle LEDs to their initial values Sub PresetToggles Ass I10 = 0 # loop over columns While I10 < togSize Mat I12 = I10 + buttonBase SetLedPair I10 JI12 Mat I10 = I10 + 1 End Set LB0 STogs_Init End PresetToggles # initialize the lights End # Initialization ———————————————————————————
If M0 == B2 If M1 >= totalBanks # handle toggles If M1 == $119 # special case for AllSolosOff AllSolosOff Else # other toggles here Mat I00 = M1 - totalBanks # value 0..15 UpdateToggle I00 If needResend == 1 Mat M0 = M0 + 1 # send msg on next higher channel Send M0 M1 M2 # send this msg out (clone) End End End End
# handle internal resend message If M0 == resendMessage # M3 is 1 to enable resend, 0 to disable Ass needResend = M3 End Block # all input messages are blocked
|
|
|
Post by uncledave on May 26, 2022 13:51:51 GMT
Hi. SB should not be running at all unless it's receiving MIDI messages. Is your gear sending a steady stream of messages? The scripts are a bit complicated, but they do nothing unless there's a message. Try looking at the SB monitor to see if anything is happening when you're not pressing buttons.
Also, for those banks of 32 buttons, are we clearing all buttons in order to set only one? That should be a first time only step. After that, we only need to remember the button that was lit, and clear it before setting the new one.
Edit: Checked that. It should only clear the entire block once, then just turn one off and one on.
|
|
|
Post by mo13 on May 26, 2022 14:22:32 GMT
Indeed, regarding the DSP, at the moment I only have the means to check the project without any hardware attached. But there are multiple SB instances showing a DSP usage % above 0.0 Tomorrow I will be able to tell what's exactly going on when all the HW is connected.
|
|
|
Post by uncledave on May 26, 2022 15:10:18 GMT
Indeed, regarding the DSP, at the moment I only have the means to check the project without any hardware attached. But there are multiple SB instances showing a DSP usage % above 0.0 Tomorrow I will be able to tell what's exactly going on when all the HW is connected. I expect they'll be above 0.0% because AUM needs to switch to each instance and provide an empty buffer of MIDI messages. That will require some overhead. But I wonder if you're routing some continuous stream of MIDI notes through these scripts. By the way, the Else near the end of the SetLed script is where you could drop in the Toggles script. Notice that the question is whether M1 < totalBanks or >= totalBanks. And you'd need to add the initialization and subs to If Load. Make sure there is no duplicate data. What part of the Toggles script can be dropped? Is it just AllSolosOff? None of what's there is really high overhead, since it only runs when those specific CCs arrive.
|
|
|
Post by mo13 on May 27, 2022 10:36:11 GMT
I merged both and the Toggle LEDs are working now, the direct hardware controller for UNsolo ALL in AUM is mapped to Ch.3 CC119, which used to also UNsolo (unlit) all the active Solo LEDs but this one is not working anymore, it's only un-litting it's own LED but not the active Solo LEDs aka CC 112-118, maybe you can spot this somewhere? As I might have removed a wrong thing: [Edit] it was missing the AllSoloOff sub, now the Solo LEDs are being un-lit by the CC119 again, only now CC119 itself is not getting lit/unlit anymore upon engagement with the Solos:
If load Alias $32 bankSize Alias 4 numBanks Alias B2 setCommand Alias $112 totalBanks Alias 8 togSize # two rows of 8 toggles Alias 10 buttonBase # offset to button data in J and K Alias 20 transBase # offset to transition data in K Alias J18 needResend Alias 4 soloBit Alias 2 muteBit Ass J10 = 2 2 2 2 2 2 2 0 # J18... contains working variables Ass J18 = 0 0 0 0 0 0 0 0 # K10, etc. contains 16 ON colors Ass K10 = 5 5 5 5 5 5 5 6 2 2 2 2 2 2 2 5 # K20 is transition table for first 7 columns, K28 for last column # Each entry is new states for a given state. High nybble for top button, # low nybble for bottom button. Ass K20 = 42 52 50 50 04 25 24 25 Ass K28 = 42 42 60 60 06 06 24 24 # Note that the values in the K array are packed together, with no gaps. # There are 16 colors, then 2 transition tables of 8. # our own internal SysEx message Define resendMessage F0 7D 02 # Sets one LED. pState is 0 for OFF, non-zero for ON. # pCol is the column number, pOffset is 0 for top row, 8 for bottom. Sub SetOneLed pValue pCol pOffset # determine the color If pValue > 0 Mat I28 = pCol + buttonBase # index column color Mat I28 = I28 + pOffset Ass I28 = KI28 # index ON color from table Else Ass I28 = 3 End # determine CC# Mat I29 = pCol + totalBanks Mat I29 = I29 + pOffset Send setCommand I29 I28 # set the LED End Ass J00 = 80 80 80 80 Ass K00 = 5 6 4 6 3 0 3 0 Sub SetLedPair pCol pState Mat I20 = pState & soloBit # top button state SetOneLed I20 pCol 0 Mat I20 = pState & muteBit # bottom button state SetOneLed I20 pCol togSize End # Updates data for one column. pNumb is button number, 0..15 Sub UpdateToggle pNumb Mat I10 = pNumb % togSize # column index 0..7 Mat I11 = pNumb / togSize # row number 0, 1 Mat I12 = I10 + buttonBase # index state, JI12 is state value Set LB0 JI12 # display entering state Mat I13 = JI12 + transBase # index transition entry for state # use second transition table for last column If I10 == 7 Mat I13 = I13 + togSize End # update new state from table, using high or low nybble of transition # in KI13. Top row uses high nybble, bottom uses low If I11 == 0 Mat JI12 = KI13 / 10 # divide moves high nybble to low Mat JI12 = JI12 & F # ensure nothing crazy Else Mat JI12 = KI13 & F # mask selects low nybble End Set LB1 JI12 # display new state # update leds in this column SetLedPair I10 JI12 End Sub PresetToggles Ass I10 = 0 # loop over columns While I10 < togSize Mat I12 = I10 + buttonBase SetLedPair I10 JI12 Mat I10 = I10 + 1 End Set LB0 STogs_Init End Sub ClearBank pBank Mat I20 = pBank * bankSize Mat I21 = I20 + bankSize If I21 > totalBanks Ass I21 = totalBanks End Mat I22 = pBank + numBanks Ass I22 = KI22 While I20 < I21 Send setCommand I20 I22 Mat I20 = I20 + 1 End End Sub SetLedAny pNumb Mat I10 = pNumb / bankSize If JI10 == 80 ClearBank I10 Else Mat I11 = I10 + numBanks Send setCommand JI10 KI11 End Send setCommand pNumb KI10 Ass JI10 = pNumb End Sub AllSolosOff # messages sent with +I flag go to the SB input queue, not outside. Send resendMessage 1 F7 +I # send internal msg to enable resend Ass I10 = 0 Ass I11 = togSize Mat I11 = I11 - 1 # I10 will run 0-6 While I10 < I11 Mat I12 = I10 + buttonBase # index button states Mat I12 = JI12 & soloBit # test the Solo bit If I12 != 0 Mat I13 = I10 + totalBanks # create the CC# Send setCommand I13 $127 +I # send internal cmd to push solo End Mat I10 = I10 + 1 End Send resendMessage 0 F7 +I # cancel previous resend enable End Set Name SetLed End # Initialization ———————————————————————————
If M0 == B2 If M1 < totalBanks SetLedAny M1 Else If M0 == B2 If M1 >= totalBanks # handle toggles if M1 == $119 AllSolosOff Else Mat I00 = M1 - totalBanks # value 0..15 UpdateToggle I00 If needResend == 1 Mat M0 = M0 + 1 # send msg on next higher channel Send M0 M1 M2 # send this msg out (clone) End End End End End End Block
If M0 == resendMessage # M3 is 1 to enable resend, 0 to disable Ass needResend = M3 End Block # all input messages are blocked
|
|
|
Post by uncledave on May 27, 2022 11:48:49 GMT
Regarding the DSP issue: Does the controller send MIDI Clock or Active Sensing messages? They would cause a lot of useless activity in SB. You can block them in the hamburger menu beside the SB instance: 
|
|
|
Post by mo13 on May 27, 2022 11:57:04 GMT
even though it used to (untill now as from now on I'm only using AUM's clock to all destinations) I always had those filters on/off for each midi node to block the unnecessary. Btw thanks for the earlier help with converting clock tics to tap tempo, that's where the incoming clock was for, now fixed by AUM's 1.4.0.!
|
|