Best way to assign values to modulator

Home Forums General Programming Best way to assign values to modulator

Viewing 14 posts - 21 through 34 (of 34 total)
  • Author
    Posts
  • #4626
    msepsis
    Participant
      • Topics: 219
      • Replies: 732
      • Total: 951
      • ★★★
      "atom":18mjip3p wrote:
      That issue is a bit problematic due to Threading issues, the only work around for now is to use setModulatorValue(value, false, false, false) (only the 2nd false/true works anyway and indicates MIDI event), but this might also not work always (the call is not syncrhonus and might sometimes miss the dont-send-midi flag). This is something i know about but have no idea how to fix for now.[/quote:18mjip3p]

      Synth, are you infact using setModulatorValue like atom suggested or are you using setValue as you originally posted. I’d recommend setModulatorValue.

      Also Atom – about the asynchronous bit – I missed your comment the first time around. I think it explains why a handful of my modulators are actually sending their value to the synth when I do a program change even though every boolean known to man in my script is set to false… Of course this ends up causing the program to display as having been edited on the synth when all i’ve done is change programs. I spent days a while back trying to track this down/resolve it.. I think your explanation sheds a little light.
      .. I actually printed out the output from the midi monitor after doing a test, just change programs from 01 up to 10 and back down to 01. Out of 260 some modulators there are about 20 modulators that seemed to send their value back to the synth from the panel on program change. Not all 20 would send on every program, but there definitely was some pattern there, I just was never able to figure out what was different about those 20 modulators. If I were to change to program2 for example the same 12 or 13 modulators would send their value every time. If I then change to program3, a similar grouping of modulators but maybe a few more or less would be sent. Change back to program 2 and the same 12 or 13 modulator values that were sent originally were get sent again.

      Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

      #4627
      Synthetech
      Participant
        • Topics: 13
        • Replies: 70
        • Total: 83

        Yea, I’m using setModulatorValue

        Here’s the most recent code

        [code:1srziyp8]PrgChange = function(midiMessage)

        FilterMsb = midiMessage:getLuaData():getByte(53)
        FilterLsb = midiMessage:getLuaData():getByte(54)
        KBTrkMsb = midiMessage:getLuaData():getByte(55)
        KBTrkLsb = midiMessage:getLuaData():getByte(56)
        LFO1MdltrLsb = midiMessage:getLuaData():getByte(184)
        FilterValue = (FilterMsb*16)+(FilterLsb)
        KBTrkValue =(KBTrkMsb*16)+(KBTrkLsb)
        LFO1MdltrValue=(LFO1MdltrLsb)

        panel:getModulatorByName("VCFCutoff"):setModulatorValue(FilterValue, false, false, false)
        panel:getModulatorByName("KBTrack"):setModulatorValue(KBTrkValue, false, false, false)
        panel:getModulatorByName("LFO1ModSrc"):setModulatorValue(LFO1MdltrValue, false, false, false)

        end[/code:1srziyp8]

        I’m not sure how I can resolve this, it seems to be a bug in the min/max values set for the modulator.
        For knobs and buttons, I can get them to adjust and stay put after a patch dump by making them min value of 1.
        For combobox, it doesnt seem to help if I set the min value of 1.

        I did notice that knobs have two min/max values. A setting under Modulator and another under Component.
        The button and combobox does not have a min/max value under component.. probably because of the listbox settings…

        Man.. talk about frustrating.. I got real excited when I saw the knob move.. then it was like a Challenger incident when it sets back to 0.

        #4628
        Synthetech
        Participant
          • Topics: 13
          • Replies: 70
          • Total: 83

          maybe this has something to do with it…

          I finally got my midimonitor to work on Ctrlr.. I also noticed this in OXs monitor.

          Everytime a patch dump is req, this is what the synth transmits-

          [16:23:34:000931]: Time(-780361647) [System exclusive] Ch: No: Val: RAW:[f0 42 21 06 02 00 02 00 00 00 07 00 00 00 00 00 03 01 0f 00 01 00 02 00 01 00 01 00 01 00 00 00 03 01 0f 00 00 00 03 00 02 00 00 00 00 00 00 00 00 00 00 00 00 02 09 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 05 01 01 01 0f 00 00 01 0f 00 00 00 00 00 00 01 08 01 0f 01 0a 01 0f 01 0f 01 02 00 00 00 00 00 00 00 00 01 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 04 00 08 00 00 00 05 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 03 00 00 00 03 00 02 00 00 00 00 03 0a 00 03 00 00 00 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00 01 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 00 03 0f 00 00 00 00 00 02 f7]
          [16:23:35:000491]: Time(-1639355106) [System exclusive] Ch: No: Val: RAW:[f0 42 21 7e 06 02 f7]

          see that at the end, it sends a second sysex msg back. f0 42 21 7e 06 02 f7

          So am I correct to assume that if the panel is set to run the PrgChange script everytime it receives a midimessage, that if it gets that 2nd message, it will cause the script to run again.. but this time it wont have any series of hex values to use to set the modulator values.. so it defaults them all to "0"?
          But why would it work correctly if I set the min value to "1" instead??

          I can probably get my synth to not send that second message.. but it’ll be awhile before I’ll get that new Firmware update to remove it.

          #4629
          msepsis
          Participant
            • Topics: 219
            • Replies: 732
            • Total: 951
            • ★★★

            ok.. so we were chatting abou this but it’s far easier to describe in a full message <img decoding=” title=”Smile” />

            First you want to put in logic that determines what messages are actually program/patch dumps from the synth.
            You sent me the sysex chart for your synth which shows a program dump is sent from the synth in this format:
            F0 42 21 06 0x 0h(1) 0l(1) … 0h(128) 0l(128) F7.

            the fourth byte 0x06 is the message ID for program dumps from the synth. So you want to write logic that looks for that..
            Rememeber, anything prefixed with "–" is commented out and ignored by the Lua interpreter, these are notes for you.
            –[[ text within brackets that look like this are also
            commented out. it’s a good handy way to comment out
            multiple lines of code
            –]]
            Also, 0x before a number is just notation to indicate that the number is a HEX value, not a DEC value. sysex messages are ALL 7 bit hex values.

            [code:3fhhxif7]

            midiMessageReceived = function(midiMessage)

            –If the fourth byte (index 3) equals 0x06, then this message is a Sound Dump

            IDM = midiMessage:getLuaData():getByte(3) — creates variable "IDM" and sets it’s value to the fourth byte (index 3!!) of incoming msg

            console (string.format ("decimal=%d hex=%x", IDM, IDM)) –prints to the Lua console for debugging purposes

            if IDM == 06 then
            assignValues(midiMessage)
            end

            –[[
            The stuff above should weed out anything that’s not actually a program dump from the synth.
            the stuff below should be basically the same as what you’ve got in your script now but we’re naming it a function that is only called if byte3 is 0x06
            –]]

            function assignValues(midiMessage)

            –calculate actual parameter value from MSB and LSB format used by your synth:

            FilterMsb = midiMessage:getLuaData():getByte(53)
            FilterLsb = midiMessage:getLuaData():getByte(54)
            KBTrkMsb = midiMessage:getLuaData():getByte(55)
            KBTrkLsb = midiMessage:getLuaData():getByte(56)
            LFO1MdltrLsb = midiMessage:getLuaData():getByte(184)

            FilterValue = (FilterMsb*16)+(FilterLsb)
            KBTrkValue =(KBTrkMsb*16)+(KBTrkLsb)
            LFO1MdltrValue=(LFO1MdltrLsb)

            –actually assigning the values
            panel:getModulatorByName("VCFCutoff"):setModulatorValue(FilterValue, false, false, false)
            panel:getModulatorByName("KBTrack"):setModulatorValue(KBTrkValue, false, false, false)
            panel:getModulatorByName("LFO1ModSrc"):setModulatorValue(LFO1MdltrValue, false, false, false)

            end

            [/code:3fhhxif7]

            I really think this should solve your issue. The problem as it stands now after I understand what’s going on w/ that second message is that you’re telling ctrlr to assign values from ANY sysex message that comes into the panel. If the message is not an actual program dump, the values are getting zero’d out cause none of these MSB or LSBs exist to assign based from!!

            Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

            #4630
            Synthetech
            Participant
              • Topics: 13
              • Replies: 70
              • Total: 83

              well after figuring out that there needs to be two ENDs at the end of that code, I got it working.. finally!
              Well at least in my test panel for now. I’ll do the Korg panel when I got 2=3hrs to kill.

              Damn, that one had me locked up for over a week getting it to go…

              Thanks msepsis, I couldnt have figured it out without your help..

              I’m finding that googling the error msg gives me clues on what to look for. That’s how I figured out the end error.

              Thanks again.. now back to the envelope daskafar created…

              -Blaine

              #4631
              msepsis
              Participant
                • Topics: 219
                • Replies: 732
                • Total: 951
                • ★★★

                Great to hear! Right now I’m taking a short break from working on my own stuff, so I’m happy I was able to help you. You should be able to apply a lot of what you did and learned here to many other things in the future. This is one of the more complex routines that you’ve just got worked out.

                hopefully also you see now why the modulators were getting set to zero?

                Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

                #4632
                Synthetech
                Participant
                  • Topics: 13
                  • Replies: 70
                  • Total: 83

                  yea.. I figured out why the zero settings.. also figured out why setting to a min of "1" for the modulator caused it to stay at the dump value.. since it only was accepting a value of at LEAST 1.. when it saw a ZERO, it ignored it and just left it at the last value…. some kinda if/then logic in there that was doing that.

                  I almost have this down. I have one more problem (besides the hours of time spent creating and debugging code for each modulator in the dump assignment script)..

                  When I first load the panel up and attempt to do a dump request/patch change for the first time, it fails and the method is disabled.
                  If I go to the script, refresh it/save it, then try again, it works.
                  I’m wondering if it needs a dump req. at startup of the panel so it has some kind of value/data in there before I request it for the very first time.

                  #4633
                  Synthetech
                  Participant
                    • Topics: 13
                    • Replies: 70
                    • Total: 83

                    Would a script like this trigger a patch dump for me from the panel?
                    I need something like this to send out when I open the panel file up.

                    [code:29yidpsc]StartupDump = function(midMessage)

                    fetchDump = {0xF0; 0x42, 0x21, 0x07, 0x00, 0xF7}
                    panel:sendMidiMessageNow(CtrlrMidiMessage(fetchDump))

                    end

                    [/code:29yidpsc]

                    I stole that from the other current thread and altered it for my use.
                    Thanks to hecticc for posting it.

                    #4634
                    msepsis
                    Participant
                      • Topics: 219
                      • Replies: 732
                      • Total: 951
                      • ★★★

                      Yes it should work, put that on the script that is called when the panel is opened and see if it spits any errors <img decoding=” title=”Smile” />

                      Also, probably the reason your script is failing the first time is because of that idle time bug (we chatted a bit about this last week w/ das faker). You probably need a statement in there that says if the variable is nil then do nothing, else proceed with assigning values.

                      I can elaborate a bit more later if needed. . .

                      Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

                      #4635
                      Synthetech
                      Participant
                        • Topics: 13
                        • Replies: 70
                        • Total: 83

                        I figured out what was wrong..

                        check this code out and you can probably see the problem.

                        [code:98rjaory]PrgChange = function(midiMessage)

                        –If the fourth byte (index 3) equals 0x06, then this message is a Sound Dump

                        IDM = midiMessage:getLuaData():getByte(3) — creates variable "IDM" and sets it’s value to the fourth byte (index 3!!) of incoming msg

                        console (string.format ("decimal=%d hex=%x", IDM, IDM)) –prints to the Lua console for debugging purposes

                        if IDM == 06 then
                        assignValues(midiMessage)
                        end

                        function assignValues(midiMessage)

                        –Get LFO Knob Values
                        FilterMsb = midiMessage:getLuaData():getByte(53)
                        FilterLsb = midiMessage:getLuaData():getByte(54)
                        KBTrkMsb = midiMessage:getLuaData():getByte(55)
                        KBTrkLsb = midiMessage:getLuaData():getByte(56)
                        ResValMsb = midiMessage:getLuaData():getByte(197)
                        ResValLsb = midiMessage:getLuaData():getByte(198)
                        LFO1Lsb = midiMessage:getLuaData():getByte(134)
                        LFO2Lsb = midiMessage:getLuaData():getByte(150)
                        LFO1DpthLsb = midiMessage:getLuaData():getByte(186)
                        LFO2DpthLsb = midiMessage:getLuaData():getByte(192)

                        LFO1PWMsb = midiMessage:getLuaData():getByte(141)
                        LFO1PWLsb = midiMessage:getLuaData():getByte(142)
                        LFO2PWMsb = midiMessage:getLuaData():getByte(157)
                        LFO2PWLsb = midiMessage:getLuaData():getByte(158)
                        LFO1DlyLsb = midiMessage:getLuaData():getByte(136)
                        LFO2DlyLsb = midiMessage:getLuaData():getByte(152)
                        SLFO3FqLsb = midiMessage:getLuaData():getByte(230)
                        SLFO4FqLsb = midiMessage:getLuaData():getByte(238)
                        SLFO3DpthLsb = midiMessage:getLuaData():getByte(146)
                        SLFO4DpthLsb = midiMessage:getLuaData():getByte(162)
                        SLFO3PWMsb = midiMessage:getLuaData():getByte(231)
                        SLFO3PWLsb = midiMessage:getLuaData():getByte(232)
                        SLFO4PWMsb = midiMessage:getLuaData():getByte(239)
                        SLFO4PWLsb = midiMessage:getLuaData():getByte(240)

                        –Get EG Values
                        Attk1Msb = midiMessage:getLuaData():getByte(69)
                        Attk1Lsb = midiMessage:getLuaData():getByte(70)
                        Dcy1Msb = midiMessage:getLuaData():getByte(71)
                        Dcy1Lsb = midiMessage:getLuaData():getByte(72)
                        Brk1Msb = midiMessage:getLuaData():getByte(73)
                        Brk1Lsb = midiMessage:getLuaData():getByte(74)
                        Slop1Msb = midiMessage:getLuaData():getByte(75)
                        Slop1Lsb = midiMessage:getLuaData():getByte(76)
                        Sust1Msb = midiMessage:getLuaData():getByte(77)
                        Sust1Lsb = midiMessage:getLuaData():getByte(78)
                        Rls1Msb = midiMessage:getLuaData():getByte(79)
                        Rls1Lsb = midiMessage:getLuaData():getByte(80)
                        Attk2Msb = midiMessage:getLuaData():getByte(85)
                        Attk2Lsb = midiMessage:getLuaData():getByte(86)
                        Dcy2Msb = midiMessage:getLuaData():getByte(87)
                        Dcy2Lsb = midiMessage:getLuaData():getByte(88)
                        Brk2Msb = midiMessage:getLuaData():getByte(89)
                        Brk2Lsb = midiMessage:getLuaData():getByte(90)
                        Slop2Msb = midiMessage:getLuaData():getByte(91)
                        Slop2Lsb = midiMessage:getLuaData():getByte(92)
                        Sust2Msb = midiMessage:getLuaData():getByte(93)
                        Sust2Lsb = midiMessage:getLuaData():getByte(94)
                        Rls2Msb = midiMessage:getLuaData():getByte(95)
                        Rls2Lsb = midiMessage:getLuaData():getByte(96)
                        Attk3Msb = midiMessage:getLuaData():getByte(101)
                        Attk3Lsb = midiMessage:getLuaData():getByte(102)
                        Dcy3Msb = midiMessage:getLuaData():getByte(103)
                        Dcy3Lsb = midiMessage:getLuaData():getByte(104)
                        Brk3Msb = midiMessage:getLuaData():getByte(105)
                        Brk3Lsb = midiMessage:getLuaData():getByte(106)
                        Slop3Msb = midiMessage:getLuaData():getByte(107)
                        Slop3Lsb = midiMessage:getLuaData():getByte(108)
                        Sust3Msb = midiMessage:getLuaData():getByte(109)
                        Sust3Lsb = midiMessage:getLuaData():getByte(110)
                        Rls3Msb = midiMessage:getLuaData():getByte(111)
                        Rls3Lsb = midiMessage:getLuaData():getByte(112)

                        LFO1MdltrLsb = midiMessage:getLuaData():getByte(184)
                        LFO1WavLsb = midiMessage:getLuaData():getByte(182)
                        LFO2MdltrLsb = midiMessage:getLuaData():getByte(190)
                        LFO2WavLsb = midiMessage:getLuaData():getByte(188)
                        SLFO3WavLsb = midiMessage:getLuaData():getByte(144)
                        SLFO4WavLsb = midiMessage:getLuaData():getByte(160)

                        FilterValue = (FilterMsb*16)+(FilterLsb)
                        KBTrkValue =(KBTrkMsb*16)+(KBTrkLsb)

                        ResValue=(ResValMsb*16)+(ResValLsb)
                        — 15’s
                        LFO1FQValue=(LFO1Lsb)*8
                        LFO2FQValue=(LFO2Lsb)*8
                        LFO1DpthValue=(LFO1DpthLsb)*8
                        LFO2DpthValue=(LFO2DpthLsb)*8

                        LFO1PWValue=((LFO1PWMsb*16)+(LFO1PWLsb))*2
                        LFO2PWValue=((LFO2PWMsb*16)+(LFO2PWLsb))*2
                        LFO1DlyValue=(LFO1DlyLsb)*8
                        LFO2DlyValue=(LFO2DlyLsb)*8
                        SLFO3FqValue=(SLFO3FqLsb)*8
                        SLFO4FqValue=(SLFO4FqLsb)*8
                        SLFO3DpthValue=(SLFO3DpthLsb)*8
                        SLFO4DpthValue=(SLFO4DpthLsb)*8
                        SLFO3PWValue=((SLFO3PWMsb*16)+(SLFO3PWLsb))*2
                        SLFO4PWValue=((SLFO4PWMsb*16)+(SLFO3PWLsb))*2

                        — 32’s
                        Attack1Value=(Attk1Msb*16)+(Attk1Lsb)*4
                        Decay1Value=(Dcy1Msb*16)+(Dcy1Lsb)*4
                        BreakPoint1Value=(Brk1Msb*16)+(Brk1Lsb)*4
                        Slope1Value=(Slop1Msb*16)+(Slop1Lsb)*4
                        Sustain1Value=(Sust1Msb*16)+(Sust1Lsb)*4
                        Release1Value=(Rls1Msb*16)+(Rls1Lsb)*4
                        Attack2Value=(Attk2Msb*16)+(Attk2Lsb)*4
                        Decay2Value=(Dcy2Msb*16)+(Dcy2Lsb)*4
                        BreakPoint2Value=(Brk2Msb*16)+(Brk2Lsb)*4
                        Slope2Value=(Slop2Msb*16)+(Slop2Lsb)*4
                        Sustain2Value=(Sust2Msb*16)+(Sust2Lsb)*4
                        Release2Value=(Rls2Msb*16)+(Rls2Lsb)*4
                        Attack3Value=(Attk3Msb*16)+(Attk3Lsb)*4
                        Decay3Value=(Dcy3Msb*16)+(Dcy3Lsb)*4
                        BreakPoint3Value=(Brk3Msb*16)+(Brk3Lsb)*4
                        Slope3Value=(Slop3Msb*16)+(Slop3Lsb)*4
                        Sustain3Value=(Sust3Msb*16)+(Sust3Lsb)*4
                        Release3Value=(Rls3Msb*16)+(Rls3Lsb)*4

                        LFO1MdltrValue=(LFO1MdltrLsb)
                        LFO1WavValue=(LFO1WavLsb)
                        LFO2MdltrValue=(LFO2MdltrLsb)
                        LFO2WavValue=(LFO2WavLsb)
                        SLFO3WavValue=(SLFO3WavLsb)
                        SLFO4WavValue=(SLFO4WavLsb)

                        panel:getModulatorByName("VCFCutoff"):setModulatorValue(FilterValue, false, false, false)
                        panel:getModulatorByName("KBTrack"):setModulatorValue(KBTrkValue, false, false, false)

                        panel:getModulatorByName("Resonance"):setModulatorValue(ResValue, false, false, false)
                        panel:getModulatorByName("LFO1Frequency"):setModulatorValue(LFO1FQValue, false, false, false)
                        panel:getModulatorByName("LFO2Frequency"):setModulatorValue(LFO2FQValue, false, false, false)
                        panel:getModulatorByName("LFO1Depth"):setModulatorValue(LFO1DpthValue, false, false, false)
                        panel:getModulatorByName("LFO2Depth"):setModulatorValue(LFO2DpthValue, false, false, false)
                        panel:getModulatorByName("LFO1PWM"):setModulatorValue(LFO1PWValue, false, false, false)
                        panel:getModulatorByName("LFO2PWM"):setModulatorValue(LFO2PWValue, false, false, false)
                        panel:getModulatorByName("LFO1Delay"):setModulatorValue(LFO1DlyValue, false, false, false)
                        panel:getModulatorByName("LFO2Delay"):setModulatorValue(LFO2DlyValue, false, false, false)
                        panel:getModulatorByName("SLFO3Freq"):setModulatorValue(SLFO3FqValue, false, false, false)
                        panel:getModulatorByName("SLFO4Freq"):setModulatorValue(SLFO4FqValue, false, false, false)
                        panel:getModulatorByName("SLFO3Depth"):setModulatorValue(SLFO3DpthValue, false, false, false)
                        panel:getModulatorByName("SLFO4Depth"):setModulatorValue(SLFO3DpthValue, false, false, false)
                        panel:getModulatorByName("SLFO3PWM"):setModulatorValue(SLFO3PWValue, false, false, false)
                        panel:getModulatorByName("SLFO4PWM"):setModulatorValue(SLFO4PWValue, false, false, false)

                        –EG1
                        panel:getModulatorByName("Attack1"):setModulatorValue(Attack1Value, false, false, false)
                        panel:getModulatorByName("Decay1"):setModulatorValue(Decay1Value, false, false, false)
                        panel:getModulatorByName("BreakPoint1"):setModulatorValue(BreakPoint1Value, false, false, false)
                        panel:getModulatorByName("Slope1"):setModulatorValue(Slope1Value, false, false, false)
                        panel:getModulatorByName("Sustain1"):setModulatorValue(Sustain1Value, false, false, false)
                        panel:getModulatorByName("Release1"):setModulatorValue(Release1Value, false, false, false)

                        –EG2
                        panel:getModulatorByName("Attack2"):setModulatorValue(Attack2Value, false, false, false)
                        panel:getModulatorByName("Decay2"):setModulatorValue(Decay2Value, false, false, false)
                        panel:getModulatorByName("BreakPoint2"):setModulatorValue(BreakPoint2Value, false, false, false)
                        panel:getModulatorByName("Slope2"):setModulatorValue(Slope2Value, false, false, false)
                        panel:getModulatorByName("Sustain2"):setModulatorValue(Sustain2Value, false, false, false)
                        panel:getModulatorByName("Release2"):setModulatorValue(Release2Value, false, false, false)

                        –EG3
                        panel:getModulatorByName("Attack3"):setModulatorValue(Attack3Value, false, false, false)
                        panel:getModulatorByName("Decay3"):setModulatorValue(Decay3Value, false, false, false)
                        panel:getModulatorByName("BreakPoint3"):setModulatorValue(BreakPoint3Value, false, false, false)
                        panel:getModulatorByName("Slope3"):setModulatorValue(Slope3Value, false, false, false)
                        panel:getModulatorByName("Sustain3"):setModulatorValue(Sustain3Value, false, false, false)
                        panel:getModulatorByName("Release3"):setModulatorValue(Release3Value, false, false, false)

                        –LFO and SLFO comboboxs
                        panel:getModulatorByName("LFO1ModSrc"):setModulatorValue(LFO1MdltrValue, false, false, false)
                        panel:getModulatorByName("LFO1Waveform"):setModulatorValue(LFO1WavValue, false, false, false)
                        panel:getModulatorByName("LFO2ModSrc"):setModulatorValue(LFO2MdltrValue, false, false, false)
                        panel:getModulatorByName("LFO2Waveform"):setModulatorValue(LFO2WavValue, false, false, false)
                        panel:getModulatorByName("SLFO3Waveform"):setModulatorValue(SLFO3WavValue, false, false, false)
                        panel:getModulatorByName("SLFO4Waveform"):setModulatorValue(SLFO4WavValue, false, false, false)

                        end
                        end
                        [/code:98rjaory]

                        What I did was I created a separate method for "assignValues"

                        it didnt like the scripts being inside the same method.

                        Seems to all work correctly everytime now.

                        #20048
                        jasefos
                        Participant
                          • Topics: 13
                          • Replies: 76
                          • Total: 89

                          Finding this thread very educational. Just posting so that I can keep track of further conversation and find this again easily.

                          Cheers

                          JaseFOS

                          --> Music: www.soundcloud.com/jasefos
                          --> DAW: OSX10.10.5 with Live 9.6 x64, UA Apollo Quad
                          --> Controllers: Push 2, KeyLab61, Maschine mk2, MCU Pro, 2xMCU-Ext
                          --> Synths: Cyclone Bass Bot TT303, ESQ1, MKS80/MPG80, Matrix 6R, Matrix1000, Mopho, 05RW, DW8000, Virus TI Polar, Voyager Electric Blue, MiniBrute, AN1X, K5000s, FIZMO, ASR10 rack, Kenton ProSolo (controls Sequential Pro-One, Yamaha CS15), Prophecy, EMX1, MonoTribe, SP1200, DX100, KARP Odyssey

                          #38028
                          dasfaker
                          Keymaster
                            • Topics: 80
                            • Replies: 793
                            • Total: 873
                            • ★★★

                            That issue is a bit problematic due to Threading issues, the only work around for now is to use setModulatorValue(value, false, false, false) (only the 2nd false/true works anyway and indicates MIDI event), but this might also not work always (the call is not syncrhonus and might sometimes miss the dont-send-midi flag). This is something i know about but have no idea how to fix for now.

                            I know this is an old post, but i wonder if there has been some change here.

                            Using setModulatorValue(xx, false, false, false) works fine (it doesn’t send the midi message) except with combos, they always send the message.

                            Using setValue(xx,false) the message is sent always with all modulators, and with combos the message is sent duplicated.

                            #69777
                            t0f4st
                            Participant
                              • Topics: 5
                              • Replies: 13
                              • Total: 18

                              That issue is a bit problematic due to Threading issues, the only work around for now is to use setModulatorValue(value, false, false, false) (only the 2nd false/true works anyway and indicates MIDI event), but this might also not work always (the call is not syncrhonus and might sometimes miss the dont-send-midi flag). This is something i know about but have no idea how to fix for now.

                              does this statement still complie to the current version (5…)??

                              setValueMapped(const int newValue, const bool force, const bool mute)
                              setValueNonMapped(const int newValue, const bool force, const bool mute)
                              setValue(const int newValue, const bool force, const bool mute)
                              setModulatorValue(const int newValue, bool unused_vst, bool midi, bool unused_ui)

                              • This reply was modified 7 years, 7 months ago by t0f4st.
                              #72719
                              dnaldoog
                              Participant
                                • Topics: 4
                                • Replies: 480
                                • Total: 484
                                • ★★

                                This elaborates on some code Atom posted before – how to generate a list of modulators in your program by name. print() function is optional – can use console() instead.

                                myGenerateModNames = function()
                                n = panel:getNumModulators()

                                for i=0,n-1 do
                                mod = panel:getModulatorByIndex(i)
                                local Name= L(mod:getName())
                                print (i,Name)
                                end
                                end — function

                                print=function(…)
                                local output=””
                                for i,v in ipairs(arg) do
                                v=string.format(“%s”,v)
                                output = output..” “..v
                                end
                                console(String(output))
                                end –function

                                myGenerateModNames()

                              Viewing 14 posts - 21 through 34 (of 34 total)
                              • The forum ‘Programming’ is closed to new topics and replies.
                              There is currently 0 users and 85 guests online
                              No users are currently active
                              Forum Statistics
                              Threads: 2,495, Posts: 17,374, Members: 77,605
                              Most users ever online was 12 on January 22, 2019 3:47 pm
                              Ctrlr