Home › Forums › General › Programming › lua&demo panel question
- This topic has 25 replies, 3 voices, and was last updated 10 years, 6 months ago by zeoka.
-
AuthorPosts
-
October 15, 2013 at 4:52 pm #14191
Ofcourse it’s the same code so it will be fixed on all platforms.
October 15, 2013 at 8:31 pm #14197i’ve reduced my code to the max for sound dump
the problem is the same Ctrlr is too busy to do anything else than assign value to mods
Atom is there a way to improve that or stay with the old method : assign values to mods 1 by 1myNewMethod = function(midi) vendor = midi:getLuaData():getByte(1) model = midi:getLuaData():getByte(2) typ1 = midi:getLuaData():getByte(4) typ2 = midi:getLuaData():getByte(5) typ3 = midi:getLuaData():getByte(6) txt = panel:getComponent("modulator-1") lbl2 = panel:getComponent("Current Value") if vendor == 62 and model == 17 and typ1 == 16 then i0to13 = midi:getLuaData():getRange(7,14) i16to23 = midi:getLuaData():getRange(23,8) i26to33 = midi:getLuaData():getRange(33,8) i36to50 = midi:getLuaData():getRange(43,15) i53to67 = midi:getLuaData():getRange(60,15) i69to73 = midi:getLuaData():getRange(76,5) i75to83 = midi:getLuaData():getRange(82,9) i85to91 = midi:getLuaData():getRange(92,7) i94 = midi:getLuaData():getByte(101) sound = MemoryBlock(string.format("%s %s %s %s %s %s %s %s %.2x", i0to13:toHexString(1),i16to23:toHexString(1),i26to33:toHexString(1),i36to50:toHexString(1),i53to67:toHexString(1),i69to73:toHexString(1),i75to83:toHexString(1),i85to91:toHexString(1),i94)) panel:setModulatorValuesFromData(sound, "vstIndex", CtrlrPanel.EncodeNormal, (typ3 * 82), 1, false) if typ3 <= 8 then txt:setText (string.format("Sound 0%s",typ3 + 1)) else txt:setText (string.format("Sound %s",typ3 + 1)) end elseif vendor == 62 and model == 17 and typ1 == 21 then i0to12 = midi:getLuaData():getRange(7,13) fx1and2 = MemoryBlock(string.format("%s",i0to12:toHexString(1))) i0to8 = midi:getLuaData():getRange(7,9) i10 = midi:getLuaData():getByte(17) fx3and4 = MemoryBlock(string.format("%s %.2x",i0to8:toHexString(1),i10)) if typ3 == 0 then panel:setModulatorValuesFromData(fx1and2, "vstIndex", CtrlrPanel.EncodeNormal, 1968, 1, false) elseif typ3 == 1 then panel:setModulatorValuesFromData(fx1and2, "vstIndex", CtrlrPanel.EncodeNormal, 1981, 1, false) elseif typ3 >= 2 then panel:setModulatorValuesFromData(fx3and4, "vstIndex", CtrlrPanel.EncodeNormal, 1994, 1, false) elseif typ3 >= 3 then panel:setModulatorValuesFromData(fx3and4, "vstIndex", CtrlrPanel.EncodeNormal, 2004, 1, false) end end end
October 15, 2013 at 11:07 pm #14203Well this method is just a utility method to set modulator values quickly from a MemoryBlock, it happens in the main thread so it will block the UI and since that change causes any component attached to the modulator to get repainted it will cause a CPU spike, if there is a lot of stuff to change it will have to take a moment. I’ll have to think if it can be done better but i doubt it.
October 15, 2013 at 11:49 pm #14204Yes all works in fact but not refreshed
I tried to have a monitoring of label with the console :txt:setText (string.format(“Sound 0%s”,typ3 + 1))
mon = txt:getText()
console(“mon = “..mon)
not sure it is correct…. but your explanation is clearAnyway i have pleasure to use Ctrlr to make sound and music !
Thank you
October 18, 2013 at 9:59 am #14286Ok i got the new method working very well on other panel that have only 1 sound params integrated (82).
Replaced :
panel:setModulatorValuesFromData(sound, “vstIndex”, CtrlrPanel.EncodeNormal,
(typ3 * 82), 1, false)
by
panel:setModulatorValuesFromData(sound, “vstIndex”, CtrlrPanel.EncodeNormal,
0, 1, false)All 24 sounds go to sound 1 , and text is displayed fine
So my question is What this first INT ( i know about the last INT : the nb of byte to assign to modulator, by one byte most of time) ????
From what you see i’ve done , i believed this first INT was the starting vstindex nb ?
Can you confirm please ?? May be i was wrong….
October 22, 2013 at 6:29 pm #14424Ok the method is working with a new panel
it seems layer changes on old panel blocks the ui i keep the old method for it
and use the new one with the new panelThis new method is very interesting for multimbral synths
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.