human fly

Forum Replies Created

Viewing 20 posts - 81 through 100 (of 1,070 total)
  • Author
    Posts
  • in reply to: why is this method looping through several times? #83658
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      ok i tried it just as ‘setValue’ and it did the same thing
      (why is it ‘true,true’ in that format? will check)

      so if i disable this bit/from here, it runs ok:

      for i=1,12 do 
      local param = tbl_keyParam
      --param:setModulatorValue((_G[ "tbl_keyassgn"..keyselct ])[ i ],false,false,false)
      param:setValue((_G[ "tbl_keyassgn"..keyselct ])[ i ],true,true)
      end

      so that’s making it run through the whole thing again
      -25 times, to be precise. that’s the one time it is supposed to,
      and 24 more times. mmm. i have 24 pads, or for each of the 12 parameters,
      it’s doing it twice… mystery continues…

      in reply to: why is this method looping through several times? #83657
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        i wonder if it’s worth worrying about? as long as the panel runs?

        of course that doesn’t sit very well with one’s quest for
        efficiency.

        previously, i have stopped something from running twice,
        just by moving some of the script around. but i think
        this is different.

        wonder if the latter part is forcing it to find the variable
        multiple times. have to check if other sections are doing
        the same thing (more console commands).

        in reply to: why is this method looping through several times? #83652
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          i had one label as ‘editing begins with click’, so i changed
          that, – so no labels now have any method associated – and it
          made no difference.

          however, labels are used to write to, as displays.
          they themselves don’t have any ‘action’ by themselves.

          so that, above, should be the only script being run.
          will have to look at this again later.

          in reply to: why is this method looping through several times? #83649
          human fly
          Participant
            • Topics: 124
            • Replies: 1070
            • Total: 1194
            • ★★★★

            however, just what’s above, run on its own,
            produces the console command multiple times.

            would clicking one button on a UI somehow trigger
            other buttons with ‘onclick’ methods assigned to them?
            i’m assuming they don’t, so what’s posted above should
            be all that is run by the button.

            in reply to: why is this method looping through several times? #83648
            human fly
            Participant
              • Topics: 124
              • Replies: 1070
              • Total: 1194
              • ★★★★

              to clarify: i was curious to check whether what i was
              doing was efficient: having lots of little subfunctions,
              and having main functions calling them. seems to be
              working ok, but what’s happening that i can’t see?

              so i put in a console command, as a marker, that tells me
              each time that function has run, and where it should only
              appear once, it is appearing, depending on what i click,
              24 times, or 25, or 70 or more. in fact, the console thing
              runs multiple times whatever i click on my UI.

              leading me to conclude that i might have overdone the minifunctions
              thing, and might need to reconstruct some individual methods again.
              this function get called whatever operation is performed.

              in reply to: Yamaha RX7 UI #83505
              human fly
              Participant
                • Topics: 124
                • Replies: 1070
                • Total: 1194
                • ★★★★

                >>>

                in reply to: Yamaha RX7 UI #83498
                human fly
                Participant
                  • Topics: 124
                  • Replies: 1070
                  • Total: 1194
                  • ★★★★

                  cut-down version:
                  having a little detour to sort out how to display
                  drum pad voice assignments on the midi keyboard.
                  not quite right yet…getting there, but some issues
                  (it is highlighting wrong key with single pad, but seems
                  ok with full ‘kits’)
                  suggestions appreciated!

                  i’m mixing up which list it should be calling from…
                  also some issues with how to display:
                  1/more keys in given space
                  2/more number characters for each key – can only do 2…

                  • This reply was modified 6 years, 1 month ago by human fly.
                  Attachments:
                  You must be logged in to view attached files.
                  in reply to: local function? #83438
                  human fly
                  Participant
                    • Topics: 124
                    • Replies: 1070
                    • Total: 1194
                    • ★★★★

                    got it working. so my lengthy thing now looks like:

                    function padSelect(mod,value)
                    	-- This variable stops index issues during panel bootup
                    	if panel:getRestoreState() == true or panel:getProgramState() == true then return end
                    --	------------------------------------------------------
                    	local function pselect()	--[ needs (mod,value) in main function ]--
                    		psub=nil	--[ pad number ]--
                    		local padName= L(mod:getName())
                    		psub=tonumber(string.sub(padName,4))
                    	end
                    --	------------------------------------------------------
                    	pselect()	--[ get psub pad# ]--
                    --	------------------------------------------------------
                    	findkit()	--[ get kitselct kit# ]--
                    --	------------------------------------------------------
                    	kgetcolour()	--[ get kit colours for psetcolour ]--
                    --	------------------------------------------------------
                    	findpad()	--[ get padselct pad# ]--
                    --	------------------------------------------------------
                    	psetcolour()	--[ set pad colour ]--
                    --	------------------------------------------------------
                    	keynumber() 	--[ get keyselct key# ]--
                    --	------------------------------------------------------
                    --[ optional: get pad letter and display pad data]--
                    --	displaypad()
                    --	------------------------------------------------------
                    	findVoice()
                    --	------------------------------------------------------
                    	updateVoiceName()	--[ get voice name and number ]--
                    --	--[ retrieve values ]---------------------------------
                    --	fetchVoiceTable()	--[ restore voice params ]--
                    --	------------------------------------------------------
                    --	fetchKeyTable()		--[ restore keyassgn params ]--
                    --	------------------------------------------------------
                    end

                    and the other part that works with it:

                    function kitSelect(mod,value)
                    	-- This variable stops index issues during panel bootup
                    	if panel:getRestoreState() == true or panel:getProgramState() == true then return end
                    -- ------------------------------------------------------------
                    	local function kselect()	--[ needs (mod,value) in main function ]--
                    		ksub=nil	--[ kit number ]--
                        	local kitName= L(mod:getName())
                    		ksub=tonumber(string.sub(kitName,-1)+1)	
                    		console(String("ksub="..ksub-1))
                    	end
                    -- -----------------------------
                    	kselect()	--[ get ksub ]--
                    -- -----------------------------
                    	findkit()	--[ get kitselct ]--
                    -- -----------------------------
                    	ksetcolour()
                    -- -----------------------------
                    	findpad()		--[ get padselct ]--
                    -- -----------------------------
                    	pgetcolour()
                    -- -----------------------------
                    	keynumber() --[ get keyselct ]--
                    -- ------------------------------------------------------------
                    --[ lcd display ]--	--[ optional ]-- --[ get pad letter ]--
                    	--panel:getComponent("tempdisplay"):setPropertyString("uiLabelText","key="..keysel)
                    --	panel:getComponent("tempdisplay2"):setProperty("uiLabelText","pad:"..(tbl_padalpha[pselect]).."/kit:"..(ksub-1).."/key:"..keysel,false)
                    -- ------------------------------------------------------------
                    --[ new library stuff ]--
                    	findVoice()
                    -- -----------------------------
                    	updateVoiceName()	--[ get voice name and number ]--
                    -- -----------------------------
                    --	fetchVoiceTable()	--[ restore voice params ]--
                    -- -----------------------------
                    --	fetchKeyTable()	--[ restore keyassgn params ]--
                    -- -----------------------------
                    end
                    • This reply was modified 6 years, 1 month ago by human fly. Reason: addendum
                    in reply to: Global Variable issue. It's drive me crazy. #83433
                    human fly
                    Participant
                      • Topics: 124
                      • Replies: 1070
                      • Total: 1194
                      • ★★★★

                      NRPNs are part of the MIDI spec’ same as any other
                      data normally published for a device. they’re classed
                      as MIDI CC’s afaik.

                      you could have got all the data from the device by sending
                      it a data request message.

                      unless you were privy to some confidential information about
                      a forthcoming product or firmware update, it seems hard to
                      justify a ban.

                      in reply to: local function? #83432
                      human fly
                      Participant
                        • Topics: 124
                        • Replies: 1070
                        • Total: 1194
                        • ★★★★

                        can’t tell if there’s a difference if i make a
                        ‘nested’ function ‘local’ or not. either seems to
                        work with this.

                        i suppose it keeps the function name local, so you
                        could have two functions with the same name, as
                        long as they are ‘local’ to the method.

                        that’s actually what i’ve got at the moment, re-ordering
                        the mess i’ve made.
                        – – –
                        update on the other thing, not being able to call external
                        functions from a Library method: that was user error, partly.
                        i had commented out a couple of lines because i forgot what
                        they were for – turned out they were needed.
                        however: it seems that some of my (remote?) functions work
                        from the Library, and others i have to keep within the method
                        for now: i can run them straight as part of the main script,
                        or break it down into little local functions (not much point
                        unless it’s called more than once?)
                        i’ll probably find out why eventually. i had merged several
                        operations sharing the same iteration – seemed like a good
                        idea at the time, but now it means having to separate it
                        again.

                        in reply to: Yamaha RX7 UI #83402
                        human fly
                        Participant
                          • Topics: 124
                          • Replies: 1070
                          • Total: 1194
                          • ★★★★

                          >>skip

                          in reply to: Global Variable issue. It's drive me crazy. #83401
                          human fly
                          Participant
                            • Topics: 124
                            • Replies: 1070
                            • Total: 1194
                            • ★★★★

                            this tells me that i don’t fully understand what a global
                            variable is, in the context described by Possemo.

                            but what do i know? so far i just called something local
                            if i want it local, or not if i want it accessible from
                            another script.

                            would it be any use to you to have a table of values that
                            you assign at startup? just have a script to send values
                            to your modulators – or is that not what you need?

                            in reply to: Yamaha RX7 UI #83381
                            human fly
                            Participant
                              • Topics: 124
                              • Replies: 1070
                              • Total: 1194
                              • ★★★★

                              cut it back to just the buttons to show better
                              how the thing holds together – have now put the
                              main elements in a Library method.
                              taking a fresh look at what i can do with it, and
                              looking for ways of doing it better, ideas, etc.

                              Attachments:
                              You must be logged in to view attached files.
                              in reply to: getName with 'on-click' method? #83312
                              human fly
                              Participant
                                • Topics: 124
                                • Replies: 1070
                                • Total: 1194
                                • ★★★★

                                good explanation – particularly distinction for
                                modulator or component – thanks.

                                (and so… : the finer points of Mouse events?)

                                in reply to: getName with 'on-click' method? #83289
                                human fly
                                Participant
                                  • Topics: 124
                                  • Replies: 1070
                                  • Total: 1194
                                  • ★★★★

                                  doing something with that as:
                                  (messing around with an array of labels as keyboard notes)

                                  function kybdOps(comp, event)
                                  	kbName	=nil
                                  	kbsub	=nil
                                   
                                  	kbName= L(comp:getOwner():getName())
                                  	kbsub=tonumber(string.sub(kbName,3))
                                  	--console(String(kbName..":"..kbsub))
                                  
                                  	matchkbsub()
                                  
                                  end

                                  where ‘matchkbsub’ does stuff with tables
                                  -trying to figure out a way to do a graphic keyboard,
                                  and if labels are viable – maybe buttons? but you have
                                  fewer text appearance options, so for now it’s labels,
                                  which will display what’s assigned to a key (eventually).

                                  in reply to: getName with 'on-click' method? #83288
                                  human fly
                                  Participant
                                    • Topics: 124
                                    • Replies: 1070
                                    • Total: 1194
                                    • ★★★★

                                    great, thanks for that insight 😉

                                    in reply to: getName with 'on-click' method? #83284
                                    human fly
                                    Participant
                                      • Topics: 124
                                      • Replies: 1070
                                      • Total: 1194
                                      • ★★★★

                                      comp:getOwner():getName()?

                                      in reply to: Garbage collecting in Lua… #83280
                                      human fly
                                      Participant
                                        • Topics: 124
                                        • Replies: 1070
                                        • Total: 1194
                                        • ★★★★

                                        This is a memory leak, you could be creating table duplicates, who knows. You have to find out where the memory is going.

                                        could you explain about deleting memory blocks, and show how?
                                        also curious about duplicate tables: my panel creates tables
                                        with _G[ "(table name)"..etc ] quite a lot, and i get the
                                        impression operations can slow down after a bit.

                                        i initialize and rebuild these tables each time they are used,
                                        eg:
                                        _G[ "(table name)"..etc ]={}
                                        before collecting values again, and re-doing table.insert,
                                        so i thought that would be ok. have not checked file size,
                                        doing this – how would i do that while the panel is running?

                                        in reply to: Yamaha RX7 UI #83253
                                        human fly
                                        Participant
                                          • Topics: 124
                                          • Replies: 1070
                                          • Total: 1194
                                          • ★★★★

                                          better version: now recalling edited voice parameters
                                          to controls when pad/key is clicked.
                                          putting most little functions into a single ‘Library’ method.

                                          • This reply was modified 6 years, 1 month ago by human fly.
                                          Attachments:
                                          You must be logged in to view attached files.
                                          in reply to: Yamaha RX7 UI #83237
                                          human fly
                                          Participant
                                            • Topics: 124
                                            • Replies: 1070
                                            • Total: 1194
                                            • ★★★★

                                            now have the UI working more or less as it should:
                                            pads and kits clicks update the display.

                                            2 methods mainly control this: padselect and kitselect.

                                            • This reply was modified 6 years, 1 month ago by human fly.
                                            Attachments:
                                            You must be logged in to view attached files.
                                          Viewing 20 posts - 81 through 100 (of 1,070 total)
                                          Ctrlr