|
Post by midijam on Jan 22, 2022 16:37:39 GMT
Hello, how to make CC124 value every time "new" as NEXT BOTTON? For example 12 events, first press 0-10, second press, 10-20, third press 20-30 etc.. then again first 0-10... I would like to edit each press of 12(because depends on midi function how much need open). Thanks!
|
|
|
Post by uncledave on Jan 22, 2022 17:43:49 GMT
Hello, how to make CC124 value every time "new" as NEXT BOTTON? For example 12 events, first press 0-10, second press, 10-20, third press 20-30 etc.. then again first 0-10... I would like to edit each press of 12(because depends on midi function how much need open). Thanks! Need some clarification here. Does your controller only send one CC124 on each press? Or does it send on press and release? What do you want to change CC124 to on each press? Do you want a different CC#, or a different value? Can you show an example? I do not understand what you mean by "1-10", "10-20", etc. You will need to use a little StreamByter script to do this, the simple conversion rules cannot do this.
|
|
|
Post by midijam on Jan 22, 2022 23:15:52 GMT
Correct, midi Foot-switch send cc124, value 1 for ON and for OFF 0(momentary switch - stompbox mode - on behringer1010 uno chip).
Would like that 1st push would send value 10 and 0, second push 20 value 0 etc...I want add values(depends on presets)...But do not know how to start with code....
Also stuck with idea: when click "program change 03", then if is pressed CC124 become cc125. ( stompbox-mode is always fixed) cannot have different CC messige with changing program or bank. I think this should be solved with streambyter, but don't know to start with code. I just know to change value 1 to 127 on cc124;)
|
|
|
Post by uncledave on Jan 23, 2022 0:36:35 GMT
I can help you with the coding; it's actually easy. Just need to get the specs down.
Do you actually want to receive the 0 value from releasing the switch, or would it be better to remove them?
So you want CC124 to send value 10 first time, then 20, and so on up to 120, then back to 10?
Can you describe in more detail how you want CC124 to change when you send a program change? Is it just PC 3, change CC124 to CC125? How does it change back to 124? Does the value go back to 10 when the PC is sent, or does it continue to cycle.
|
|
|
Post by midijam on Jan 24, 2022 17:57:31 GMT
Thanks UncleDave, Yes code need 0 zero from releasing the switch. Yes first 10 then 20... to 120 and back yes to 10. Ideal.
YES I stock here, just "Program change 3" or PC3 would change cc124 to cc125. If I would click PC2 or PC5 or whatever would not change. I will then each PCX turn to different number from example code, if will need more from stomp-box mode. thanks uncleDave!
|
|
|
Post by uncledave on Jan 24, 2022 19:36:48 GMT
Thanks UncleDave, Yes code need 0 zero from releasing the switch. Yes first 10 then 20... to 120 and back yes to 10. Ideal. YES I stock here, just "Program change 3" or PC3 would change cc124 to cc125. If I would click PC2 or PC5 or whatever would not change. I will then each PCX turn to different number from example code, if will need more from stomp-box mode. thanks uncleDave! Still not clear on the PC part. You send PC3, and the next CC124 is converted to CC125, OK. Does the value start at 10 or does it continue from where it was? Every following CC124 is converted to CC125? Is there a different PC that resets back to "normal"? Or does this just happen for the first CC124 after PC3? Does the program remember the count value (10, 20, etc.) separately for each PC?
|
|
|
Post by midijam on Jan 25, 2022 10:15:46 GMT
YES, "JUST IF" IS PC3 pressed - every value of cc124 converted to cc125 ! Yes, This just happened if PC3 is pressed. As soon I click PC5 or PC1 etc... CC124 stays unattached EXCEPT If I copy your code from PC3 and insert it on new PC and CC. That means that all PROGRAM CHANGE can have own (cc)stopmboxes, now are fixed on all program changes.
|
|
|
Post by uncledave on Jan 25, 2022 11:03:05 GMT
YES, "JUST IF" IS PC3 pressed - every value of cc124 converted to cc125 ! Yes, This just happened if PC3 is pressed. As soon I click PC5 or PC1 etc... CC124 stays unattached EXCEPT If I copy your code from PC3 and insert it on new PC and CC. That means that all PROGRAM CHANGE can have own (cc)stopmboxes, now are fixed on all program changes. OK. After receiving PC3, all CC124 are converted to CC125. When any other PC is received, it switches back to CC124. Do these PC messages continue out of the script, or are they Blocked? What about the count? Say we were on 40, and we send PC3, then CC124. We're going to change it to CC125, and send 50? Or 10? Then we receive PC1, then CC124. We're going to send 60 (because we already sent 50 on CC125), or 50 (because CC125 started from 10)? I'm trying to know if we need a separate count for each PC, or if we just keep updating the same count.
|
|
|
Post by uncledave on Jan 25, 2022 11:43:43 GMT
So, here's the basic script. PC3 switches to CC125, any other PC switches back to CC124. The count just keeps advancing. To use this copy/paste into StreamByter and Install Rules. If you want to use it in an AUv3, save it to iCloud. #ModifyCC # NOTE: Be sure to use $ on decimal numbers, like $124. # Otherwise they are hex and will not work.
If load Alias $12 maxCount # J00 stores the current count, runs from 1 to 12, then repeats # J08 stores the CC# to be sent when CC124 is received Ass J00 = 1 0 0 0 0 0 0 0 Ass J08 = $124 0 0 0 0 0 0 0 End
# message is in M0, M1, M2 for CC command, CC#, and value If MT == B0 # CC message If M1 == $124 # CC 124 Ass M1 = J08 # change CC#, both press and release If M2 > 0 # on CC124 press, send the new count Mat M2 = $10 * J00 # change value to 10 times count Mat J00 = J00 + 1 # update count for next time If J00 > maxCount Ass J00 = 1 End End End End
# all PCs are sent on If MT == C0 # PC message Ass J08 = $124 # reset CC# to default If M1 == 3 # change to 125 for PC3 Ass J08 = $125 End End
I can change it to use a different counter for each PC. It would help if we specified how many different PCs we need to support.
How are you using SB? In MidiFire, or in a host like AUM or AudioBus?
You can test this by routing your controller to it and watching the SB monitor (magnifying glass). It shows the received messages and the sent messages side-by-side.
|
|
|
Post by midijam on Jan 25, 2022 11:46:55 GMT
YES!
Sorry, not sure if I correctly understand question about "out of the script" and blocking. GREAT would be that we have 2 codes or scripts: 1st script: for cc124 momentary (1st push send value 10 and 0, second push 20 value 0 etc..120 0 and back to 10 0 ) 2nd script: IF PC3 is pressed then cc124 is cc125
About blocking: This script will be plugged over midifire to FCB1010(virtual midi port) that I already made on mac, that will not be in conflict with other midi devices. Just for hacks, as I needed for momentary knob, where I changed (1 value to 127) that works as should with equipment.
About count(tricky possibilities): If we are on 40 value and send PC3 then cc124 should be at 10 value cc125. Then we receive PC1 then cc124, then I don't know what should be better if 0, 10 or last(I must hear this). The best would be comment in code, that I can change, if LAST STATE or FIRST?
|
|
|
Post by midijam on Jan 25, 2022 11:48:45 GMT
thanks for sharing code! Need to test!
|
|
|
Post by midijam on Jan 25, 2022 12:19:10 GMT
Works fabulous! All in one code. Did not expect magic in event monitor in streambyter! I changed CC number without problem, because of awesome comments. This unit is now really great, need to test with real effects. Thanks a lot!
|
|
|
Post by uncledave on Jan 25, 2022 13:22:37 GMT
Works fabulous! All in one code. Did not except magic in event monitor in streambyter! I changed CC number without problem, because of awesome comments. This unit is now really great, need to test with real effects. Thanks a lot! Excellent. Let me know if you need any change that you can't figure out. SB is pretty powerful for doing this stuff, although it may seem a little strange at times. Edit: I saw your earlier response. I'll add resetting the number later today. For now it just continues on when you change PC. Should it remember the last value for each PC, or go back to 10 whenever PC is sent, or whenever PC changes? Also, right now the count is reset when you load a MidiFire Scene, so the first CC124 always sends 10. We can change that so it picks up where it left off. Which do you prefer? Also, it always starts with CC124; it could resume with the CC it was last using. How many different PCs are we expecting? We can then reserve space to store them, so no troubles in the future. Are you happy with the PC messages being sent from the script? We could easily block them. And, of course, anything else that enters the script will exit without any change.
|
|
|
Post by midijam on Jan 25, 2022 14:51:31 GMT
Thanks, code is very clean and very well commented. I did not have problems with my example to change count on CC , numbers of CC. To me messages looks ok in streambyter monitor, so not sure what to block yet.
Very Useful would be, If I would know(not found yet in code) : how to change ( instead of values +10, would send new cc number cc1,cc2,cc3, to launch clips in ableton as next botton, now I can move knobs without problems) Mat M2 = $10 * J00 # change value to 10 times count so Mat M2 = $1 * J00 # change value to 1 times count this works, but would like to understand in more detail:
# message is in M0, M1, M2 for CC command, CC#, and value
So I am not sure, which M to change to get resolute: instead of value +10 would send "cc10 to cc120"...value127.
|
|
|
Post by uncledave on Jan 25, 2022 16:29:58 GMT
M1 holds the CC#, M2 holds the CC value. To change the CC#,Mat M1 = $10 * J00 or just Ass M1 = J00 to just use the number. SB is very fussy about this; must use Mat to do arithmetic, Ass to just set the value.
Here's a revised version that handles separate counters for each CC. Notice that what was J00 is now JJ00, or currentCount. #ModifyCC # NOTE: Be sure to use $ on decimal numbers, like $124. # Otherwise they are hex and will not work.
If load # these aliases make code more readable, and easier to change Alias $12 maxCount Alias J00 currentIndex Alias JJ00 currentCount # accesses position # J00 in array J Alias J08 currentCC Alias J09 prevCC
# J00 stores index of the current count. J01..J07 store the counts. # Each count runs from 0 to maxCount-1, then repeats. Ass J00 = 1 0 0 0 0 0 0 0 # J08 stores the CC# to be sent when CC124 is received Ass J08 = $124 0 0 0 0 0 0 0 Set Name ModCC End # Initialization ———————————————————————————
# message is in M0, M1, M2 for CC command, CC#, and value If MT == B0 # CC message If M1 == $124 # CC 124 Ass M1 = currentCC # change CC#, both press and release If M2 > 0 # on CC124 press, send the new count Mat currentCount = currentCount + 1 # update count Mat M2 = $10 * currentCount # change CC value to 10 times count If currentCount >= maxCount # back to start after 12 Ass currentCount = 0 End End End End
# all PCs are sent on out If MT == C0 # PC message Ass prevCC = currentCC # remember CC# we were using Ass currentCC = $124 # reset CC# to default Ass currentIndex = 1 # add other PCs here If M1 == 3 # change to 125 for PC3 Ass currentCC = $125 # use a different index for each CC#. 3..7 are available Ass currentIndex = 2 End # this will reset the currentCount first time CC# changes If currentCC != prevCC # Ass currentCount = 0 # enable this to reset count End End
|
|