Replies: 4 comments 41 replies
-
You have a loop running. The timer 0 never stops since you set counter1 back to 1 when you have set it to 2. SInce you have the same sysex message in both timers I don't understand your script.
end -- f SendSysexTwiceOnDbleClick_1_0_0_2022-03-07_04-52.panel.zip Can you please explain precisely what you want to achieve? |
Beta Was this translation helpful? Give feedback.
-
Thanks guys.
I am have not been able to test it further today because of work. Will do
as soon as possible.
I think I noticed where it went wrong though.
Will update as soon as I can.
Op ma 7 mrt. 2022 22:05 schreef Damien S. ***@***.***>:
… I don't know if it worked for @DRBAUS <https://github.com/DRBAUS> but
this is actually the only way to do it.
You can streamline the process with a table and iteration to remove
everything redundant lines if ever there's just 1 byte in the message
changing for the different parameters (1 to 16) to reset to 0. If they are
not the same number as the counter number, we can crossmatch it with a
lookuptable and use counter as K to to table in pair.
TimerCallback = function(timerId)
if timerId == 0 then
if counter1 < 16 then
console("counter1 : "..(counter1))
panel:sendMidiMessageNow(CtrlrMidiMessage({0xF0, 0x0F, 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x03, 0x00, 0x00, 0x00, counter1, 0xF7}))
counter1 = counter1 + 1
else
timer:stopTimer(0)
end
end -- end timer #0
end -- f
—
Reply to this email directly, view it on GitHub
<#442 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNL6ILOZ6ZMWFWECA6UNQLU6ZVQFANCNFSM5QCVPUPQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Like this maybe? -- -- Called when the panel is created, no modulators will exist at this point -- consider this the panels constructor -- constructor = function() m=MemoryBlock("F0 0F 03 00 11 00 00 00 00 00 01 04 03 00 00") -- global tableMod = {2,6,3,18,27,4,3,6,8,6,1,5,9,15,14,21} -- global tab16th={0,1,0,1,0,0,1,0,0,1,1,1,0,1,0,0} end -- -- Called when a double-click event occurs on this component -- myMethod = function(--[[ CtrlrComponent --]] comp, --[[ MouseEvent --]] event) assert(#tab16th >= #tabMod) console("timer starts on double click") counter1 = 1 console("timer starts on double click and Counter1 = 1") timer:setCallback(0, TimerCallback) -- TimerId 0 timer:startTimer(0, 500) -- Timer Id 0 500ms end TimerCallback = function(timerId) if timerId == 0 then if counter1 == #tableMod then panel:getLabel("d"):setText("") timer:stopTimer(timerId) else panel:getLabel("d"):setText(counter1 .. "\187 ") local tmp = MemoryBlock(m) tmp:append(MemoryBlock(string.format("%.2x",tab16th[counter1]))) tmp:append(MemoryBlock(string.format("%.2x F7", tableMod[counter1]))) panel:sendMidiMessageNow(CtrlrMidiMessage(tmp)) counter1 = counter1 + 1 end end -- end timer #0 end -- f |
Beta Was this translation helpful? Give feedback.
-
Great!!!
I see now how I can manipulate that sysex string.
On to make the ENV TEMPLATES and put them to work.
Thanks everyone!
Op wo 9 mrt. 2022 07:08 schreef John Goodland ***@***.***>:
… Like this maybe?
--
-- Called when the panel is created, no modulators will exist at this point
-- consider this the panels constructor
--
constructor = function()
m=MemoryBlock("F0 0F 03 00 11 00 00 00 00 00 01 04 03 00 00") -- global
tableMod = {2,6,3,18,27,4,3,6,8,6,1,5,9,15,14,21} -- global
tab16th={0,1,0,1,0,0,1,0,0,1,1,1,0,1,0,0}
end
TimerCallback = function(timerId)
if timerId == 0 then
if counter1 == #tableMod then
panel:getLabel("d"):setText("")
timer:stopTimer(timerId)
else
panel:getLabel("d"):setText(counter1 .. "\187 ")
local tmp = MemoryBlock(m)
tmp:append(MemoryBlock(string.format("%.2x",tab16th[counter1])))
tmp:append(MemoryBlock(string.format("%.2x F7", tableMod[counter1])))
panel:sendMidiMessageNow(CtrlrMidiMessage(tmp))
counter1 = counter1 + 1
panel:getLabel("d"):append(tmp:toHexString(1))
end
end -- end timer #0
end -- f
------------------------------
Send Sysex With Delay Inbetween_2_0_4.zip
<https://github.com/RomanKubiak/ctrlr/files/8212117/Send.Sysex.With.Delay.Inbetween_2_0_4.zip>
—
Reply to this email directly, view it on GitHub
<#442 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNL6INB7NKKXUCJD4BJQDLU7A54VANCNFSM5QCVPUPQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have the following (simplified) script working and running.
`--
-- Called when a double-click event occurs on this component
L1E1FULLON = function(--[[ CtrlrComponent --]] comp, --[[ MouseEvent --]] event)
timer:setCallback(0, TimerCallback) -- TimerId 0
timer:startTimer(0, 500) -- Timer Id 0 500ms
end
counter1 = 1
TimerCallback = function(timerId00)
--TIME 1--
--TIME 2--
elseif counter1 == 2 then
end
end`
However when I copy this script and change the timer to for example Id 1 and run it either from the same double click on label or even from a double click on a different label it starts to behave unpredictable. Usually after saving if I double click each of the label it starts sending the sysex from the other script.
Any suggestion what might cause this?
Beta Was this translation helpful? Give feedback.
All reactions