Home › Forums › General › Programming › change midiMessageType of a modulator in LUA
- This topic has 29 replies, 7 voices, and was last updated 10 years, 6 months ago by zeoka.
-
AuthorPosts
-
March 14, 2013 at 10:21 pm #7201
Can you give me a scenario where i can reproduce this ? It looks like MIDI device settings are saved for me.
September 28, 2013 at 9:53 am #13687Also try to avoid calling panel:getModulatorByName() at runtime, this is the biggest mistake people make, in situation where you have hundreds or thousands of modulators in the panel (those static ones count too) Ctrlr needs to go through the table to find the one you want.
If you are done with designing your panel you can type somewhere in the init method for a panel
OK, this seems like really good advice, so I have given it a go. But now I am getting “Callback errors” on panel launch. Seems that the other methods are not aware of the ‘init method’ and are giving “nil values”.
Init is in the ‘Called when the panel has finished loading’ panel field and goes like this (shortened for this example):
function init() AftertouchEnv1toDCO = panel:getCombo("Aftertouch Env 1 to DCO") AftertouchLFO1toDCO = panel:getCombo("Aftertouch LFO 1 to DCO") AllSoundOff = panel:getButton("All Sound Off") BankDisplay = panel:getLCDLabel("Bank Display") Env1Attack = panel:getSlider("Env 1 Attack") PitchBendtoDCOPitch = panel:getCombo("Pitch Bend to DCO Pitch") end
One of the methods that fails is this:
benderDCOpitchMessage = function(mod, value) comboValue = PitchBendtoDCOPitch:getModulatorValue() if comboValue == 00 then mySysex = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0xb0, 0x23, 0x00, 0xF7}) panel:sendMidiMessageNow(mySysex) elseif comboValue == 01 then mySysex = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0xb0, 0x23, 0x20, 0xF7}) panel:sendMidiMessageNow(mySysex) elseif comboValue == 02 then mySysex = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0xb0, 0x23, 0x40, 0xF7}) panel:sendMidiMessageNow(mySysex) elseif comboValue == 03 then mySysex = CtrlrMidiMessage({0xF0, 0x7F, 0x7F, 0x7F, 0x60, 0x01, 0x00, 0xb0, 0x23, 0x60, 0xF7}) panel:sendMidiMessageNow(mySysex) end end
I also tried:
comboValue = PitchBendtoDCOPitch:getProperty()
Attachments:
You must be logged in to view attached files.Here is some noise I organised into an acceptable format:
https://soundcloud.com/lfo2vco/a-dark-crystalSeptember 28, 2013 at 11:11 am #13691Read up here for info on this:
ctrlr.org/forums/topic/preventing-script-from-running-at-panel-load/- This reply was modified 10 years, 7 months ago by Hecticcc.
September 28, 2013 at 11:33 pm #13726Read up here for info on this:
ctrlr.org/forums/topic/preventing-script-from-running-at-panel-load/Hi Hecticcc, I have this variable in a Method I am using (written by Atom).
if panel:getRestoreState() == true or panel:getProgramState() == true then return end
This looks very similar to what Msepsis mentioned in the thread you referenced above. It does the job, many thanks for your assistance.
Here is some noise I organised into an acceptable format:
https://soundcloud.com/lfo2vco/a-dark-crystalSeptember 29, 2013 at 11:53 am #13752Yeah that should work, but for some reason sometimes it fails for me. That’s why i use a custom variable just to be sure.
September 29, 2013 at 3:07 pm #13759Yeah that should work, but for some reason sometimes it fails for me. That’s why i use a custom variable just to be sure.
Cheers again for pointing me towards this. If I encounter any further problems I may press you for more info on the custom variable : )
Here is some noise I organised into an acceptable format:
https://soundcloud.com/lfo2vco/a-dark-crystalOctober 7, 2013 at 4:39 pm #13953Hi all,
just thought I should add this because it fits the topic:
modulator:getMidiMessage() will return nil when the modulatorIsStatic (“Modulator does not react to value changes”) property is set to 1 (“Static”).
October 21, 2013 at 6:20 pm #14390Hi
I still don’t know how to set midi property of a modulator via LUA
i want to change midiMessageCtrlrNumber of a button by another modulator
setProperty is not working
Any idea ?October 21, 2013 at 6:28 pm #14391Can you show the line of code you use to change the property ?
October 21, 2013 at 7:18 pm #14392Hello Atom ! how are you ?
i just saw in old post here how to do
getMidiMessage() replace getComponent()
sorry -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.