HISE Logo Forum
    • Categories
    • Register
    • Login

    ScriptPanel, check clicked ellipse

    Scheduled Pinned Locked Moved General Questions
    17 Posts 5 Posters 784 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      I don't have time to look at your snippet in detail at the moment but I've had a quick look at the code you posted.

      You need an array or an object to track the x/y of each of your ellipses (or is that what the knobs are for?).

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      1 Reply Last reply Reply Quote 0
      • C
        clumsybear
        last edited by clumsybear

        @d-healey Thanks for the suggestion. No not really, the knobs are there to control parameters later on, so the position of the ellipses updates the knob values.

        with the posted code the knobs can also update the position of the ellipses. But I'm still not sure how to drag only the selected ellipse.

        Even if I manage to store the x/y of each ellipse, how can I select only one of the ellipses?

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @clumsybear
          last edited by

          @clumsybear Just run a check to see if the x/y of the mouse cursor is within the x/y of one of the ellipses. You could do this in a loop to reduce the lines of code.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey
            last edited by

            I've gotta go out but I'll make a demo for you when I'm back

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            1 Reply Last reply Reply Quote 0
            • C
              clumsybear
              last edited by

              That's very appreciated, thanks :)

              I'll try my best to wrap my head around it until then.

              1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey
                last edited by d.healey

                Peek 2019-10-04 15-06.gif

                HiseSnippet 1054.3ocsVEtaaaCDlJwpq1adaEXO.b8GExHIFRc0cEvIaowwdvaKIFysECvvnfQh1hvzjBRzMVnH.6gZOX6MX6nnskriWVpAl.rgt69Nxu63w6Tu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rkr67665b5OApXlgM9BhJlA0R1WNaZeXnjOEXh.pvRz0L6oqpMxtZYcloOUDjI72vyBidZYqEF8VZDMk3GKeuu41p9iCdblFfShruQpL7wZfL1CkcCF7y1stKZJ7MKu22WmJNB3918446fOe2N3yK1AeZrC97xcvmueG74U2qO5OW70yTxolqIfhdsyZkYY0VPfprrJRz+.SJKAhA
                

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                ustkU 1 Reply Last reply Reply Quote 2
                • C
                  clumsybear
                  last edited by

                  Thank you so much @d-healey!

                  1 Reply Last reply Reply Quote 1
                  • ustkU
                    ustk @d.healey
                    last edited by

                    @d-healey +1 for the event "e" shortcut 😎

                    Can't help pressing F5 in the forum...

                    d.healeyD 1 Reply Last reply Reply Quote 2
                    • d.healeyD
                      d.healey @ustk
                      last edited by

                      @ustk said in ScriptPanel, check clicked ellipse:

                      @d-healey +1 for the event "e" shortcut 😎

                      Like all good things, I think I got that from Christoph :)

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 2
                      • C
                        clumsybear
                        last edited by

                        Still studying the code. I'm trying to control knobs from the position of the ellipses. But whatever I try, either I break the code or all ellipses are controlling the same knobs.

                        HiseSnippet 1382.3ocuW8zbaSDEeURTIwfaoyvG.QNzQljXjRSZYFmBt0wFBkj3VWJLiGOc1Hs1dSj20UZcq0TxL.m3BeF3L24qAm3Bm5E9Bv2.3s6ZYI6nDR5LEkII6912e98d5su2SMC4djnHdHxXkmDOjfLdOyVwLQ+Z8wTFZucQFW2bebjfDZoI8f3g3nHhOxvXwOWRvXkkPpm+9yd.N.y7HojPnmxodjuhNfJRo1r5CoAAMv9jmPGjg6sptmGmUiGvGA3YQSGzPr2I3djCvR1VvDYbs59TAOrk.KHQHikd.2OtUe9KYZ9eJMhdT.QtwE0BTjlbCdfuDwRpnZ8oA9MS76HDnkloQgE0QgOv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tgIzCxJk.JCTV9+L3APwzPp43jESffow2AaRLuowsgcCvoH+m9ipCxNa3VUQmMFbAAdkg+w2.CKszYmWBlZi6OJ.KlcTN47qSN.R1mYlI4bQrHpHN67suUlu6xB2aZ1jJ75mOdWHG7Jun7VFuSlVtnodVvTvtjYiu8Mcz37mb24RNZ7Jl0FE9BR8mqvwMLmY5zYfzAiFzfF.i+FkjiYr3rfbwKGHyIFomLrGzbKjJykAa0BF0yi.gHFbKWYxEjE0z6cRfPKByWs4efmIG5J2aL4P2jC+ewFCvdg7m4oqXJi3Kqn.9MS8MYq.ebHr2ZZcVY7X.7EROyySlErgKBkuDadkk31WYI15JKw1WYItyUVh6dkk3St.IjeN58GI3Cz0D.BMqqZQYXTmggrUUtN5eQ.7h7H
                        
                        C 1 Reply Last reply Reply Quote 0
                        • Christoph HartC
                          Christoph Hart
                          last edited by

                          @d-healey said in ScriptPanel, check clicked ellipse:

                          Like all good things, I think I got that from Christoph

                          Nah, that one's on you :)

                          BTW, I was going to comment on your Patreon video about the paint routines as this was the only "wrong" thing I found (after you've spotted the non-this reference to the panel in the mouse callback yourself, hehe).

                          It's not "wrong" in a sense that you absolutely mustn't do it. but that shortcut prevents the autocomplete from working:

                          autocomplete.gif

                          Unlike the rest of the variables, the parameter g of the paint routine and the event parameter can't be correctly resolved by the autocomplete parser because it can't access the scope of local function parameters: in fact in runs a little script in the background to catch expressions, but this only works with variables in the global scope (or API classes) but fails for locally scoped variables.

                          The solution was to hardcode these two names into the autocomplete, so whenever you type g and press Escape, you'll get the Graphics API (same with the event objects). It's not the cleanest solution but a reasonable trade-off and won't be noticed by people unless they get smart and try to change these autogenerated function stubs :)

                          d.healeyD 1 Reply Last reply Reply Quote 1
                          • C
                            clumsybear @clumsybear
                            last edited by clumsybear

                            @Christoph-Hart said in ScriptPanel, check clicked ellipse:

                            "Like all good things, I think I got that from Christoph"

                            Nah, that one's on you

                            I was wondering about that, too. :)

                            @clumsybear said in ScriptPanel, check clicked ellipse:

                            Still studying the code. I'm trying to control knobs from the position of the ellipses. But whatever I try, either I break the code or all ellipses are controlling the same knobs.

                            Finally figured it out, but I think it's not the most efficient way.
                            I had to do a lot of workarounds to make it work with my limited coding skills

                            Still have to figure out how to do 4 Bands :D

                            HiseSnippet 2071.3oc6Y07ajiTE2NIdYRCY2YDbAABYhPibmjtaW1tSmVYFnmIIMSX2LSylkgYUTzhic0cWSba2is6Y5VgHshSbfCbfqbhCbBIf+B.jVsWPnUveDbgCHAG31tupJ+Y+0zIL6p8vZkOb8p26U+deTux94V9dV3f.OeAwUemQ8wBheEoiG4F1cutlDWgC2WP70kNxLHD6KyIc+Q8MCBv1BhhK+8oDDWcEA10+96ceSGSWKbJIAgG6QrvuEoGILkZqFuIwwoooM9cH8xvsQiCs7b2yywa.fmkkTE5aZctYG7CMorsjjf3qcfMIzy+3PyPbff3J22ydzwc8dgKm+GSBHm4foCPBGCJhStomiMEwTpB60k3X2J1tCD.szJ0KrL2K70jNhXSRnm5MtIaB4TIx5ODWZdvCkEdpKN7Dy.uU3v6VRGa4S5GlNCEaeYoCcg.UaSHDjEVbdEV5itkzdd.Gtgk6YdNtoOLHQBksUU2RtppZwcWqvZEf.QPn7yM8kaY5Ct+PexyN3GhjuqLK8nbGb3AsaisBUVOGCqyEesB93NxCGA7exIUYJ9zsjOAQWC3OmdJiqJajcgN206r.p.7Ia64Kq7TXr5txOU9NxFv+1byhqU3h0JHCWL1O4omBbDaU.n1yqWeOWXfx5uIvv5ap7zMQEofJiHkCnL5F564rmoiyYPVlxSd2Vl1T9tbsBaTIuKfpIzbWGtcmWBs4Jg15bPwMF9ESSyDbnQQlQFt0lM2C4QhT9GGe5yEe5SwhLlqDFyvhzmIF0lhEYLatGlGQsLcwNyNrvmNJejOfp5VvN4v21aPHwEqzdfqUHwyUoSRdUmxsghS2ywQQcX0pMYWQnLZdF9n0n.NZ1TkckkigiNQ8T3G.YGYBaU7Mc6fU3wV.hO1zY.VonbEYMpjxaHG1kDPm4GSrC6pTbKY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+wFBKrvZoBew+5O7geqKTuBBqmJ7+8+U9at++4CtBBajJ7e409FN+9+7saH7iNbe3wGosiKxQ.NGntXHg52E2G+bhEl2btUk1GGbdnWeHdjzOBP07Ecs3V2QSDYq4Mj3IkBCSaE5iZLJYv6+CZ7B5yWlPnwEM5xdLwDJsFz.dyRuWD+9k.jdCo6AkFRIHjAJ23kF1.nHIR07n3ahffj3OEFDu7Rh5vndloH+m+OZzKaSgMZHLoOXNgb1B+ytFK7XqzMdo4GrU5qKFsRheVYhF7E92Hd8LwI6E7MkNxydfiYX91TSKqGMATIIW+fo870MfDNJau6+To20KJbukTKRnU2oi2klBdg8geZi2nuDvZR79bmB1UjZ9jqaa+m9WkP8k01+uZbkk8F3+b7AOigi2PJ2w04fzCGzqIwID6SOTPbYvxnGlqF4.a7q9NUZPIfhH7S90O7cYDzx+4bbs0GmfQJgaxDoZrR+mOYYFgsiH79+hK9kLB0FWG6LNg5iqTTBTKUZy+DiRLVa7a+6Gy4YBvhl.snbvUb47ApkWr.0TxS3MPtC7fH9D59Yveer2.eKLjl3BEyYt8knmZxGqFuU+XLKLHI9wvUzjn3BPzIQwS9YxZzyzx268r3GLRy5tAiBX2tru41pRGQGKmbPN0eziXSdOKK5NgRHAgoKg1UVB8qrDFWYIpdkkX6qrD0txRrybjf94Fu2fPud75h.gVGvdRDQwCbMgrU19cgOAZgpniB
                            
                            1 Reply Last reply Reply Quote 0
                            • Christoph HartC
                              Christoph Hart
                              last edited by

                              You know there's a floating tile that connects to the curve eq, right?

                              HiseSnippet 964.3ocuV8zaaTDEeF6LUX2FnUpomWEohRkRK65j31BGvM9OHKHoFbnBN.US1cr8nr6Lt6NaZshpTO1q8q.GQhCHwGfdhK7kfSbluAk2rytd20wJDrD0m76268l426u6LHT5xhhjgHbsilMkgvWiLblPMo8DJWf52Ag+PxAzHEKzx.s+roznHlGBiq9EZ.bs0PI+96OeepOU3xxgPnmH4truhGvU4nCZ8kbe+dTO1Q7fBVuaq9tRQaouLF3SUhMZJ08D5X1gTsYUHH7U55wUxvgJphEgvqsuza1vIxmKL1+DdD+XelVvAMDNHCbOoumlwZTT6IbeuAYwcDBNkA4YgplrvMIGv83ywyyFWOQgUtGEyG3JWD8b92om8xnGt.8VyPuaPF5Fxmpx0n41UI8EPgZDEJAEokwVD9sj1Rv.g5dAzSX8BAg4NrUSa6ss1y19Ne1nXgqhKEVRwgRE6whstS8ypWq9KqasnpQiVpN80DJ88YgKUstpGdQNtkHN3XV31VmR8iYyMDB+x42qd4xutlntfgRQeAW83orT4hMHYQclVaz7fsHTdLVDMIzVhY4Pmu.iRqJv+919cnJptlmhA1MkEp35nE2gcJLLY5.pQ5vhNQImlXavToPeB3qoRaeM07d9RphKFeDGxJbH.+HRQHGzKlO88pVslkOJ9isRIf41tEoSHc7XJjb6w8gVlATAyGc73rg0ZWoYylc0dxUrfbzM1di2UFsgFFP1QCmDs3GRNa85VVaNOoz2ayOEDogvbuJj+LqtesylamXSegG6Ef165rd8WhdN2SMAgI3MpfPSX7wSTZo13h23N5arQiy9AyxmyMLAizRuXepp7btd4VpBn4rz.kdpQDwUyJt76+vvu8kd2zkkt2fLfqbmrb9VYI7E5w9+luoqRWmzczHlqJmrqQ58cum2adyrol1wgmx59rzZb4VrRb5v3.SqdjtipJDZ6SEd1YYve+Ot0a0.No.+Y+OYbKMPixePT3syh.6lCb8DW1KEn0e882NAnYFvO+quIA39KdFOXQfGt3g5Lmp+xO8wFplw0W070+lwlyQVmywVmRzsWui5JzqAL0spkqaUub0skz17MxX8RoCnPs.1IQfr+PXz0kAcMBXUSRQnhdWoQ1VKqozPVRQgfeG7KUoiVFmpzIS46k6Hf5FJepqYoutI7CRPf3Vj7FlZvio.YKGTxm1.+H12yFE.uo3ott5Qi6BiUK2mFqfO6rB9r6J3ydqfOMWAet+J3yCtPezOm6QwJYfYsI.Lnq4yR3Bc5n+A6Z63WC
                              
                              1 Reply Last reply Reply Quote 2
                              • d.healeyD
                                d.healey @Christoph Hart
                                last edited by

                                @Christoph-Hart said in ScriptPanel, check clicked ellipse:

                                BTW, I was going to comment on your Patreon video about the paint routines as this was the only "wrong" thing I found (after you've spotted the non-this reference to the panel in the mouse callback yourself, hehe).

                                I shall mention that in Paint Routines Part Duex

                                Libre Wave - Freedom respecting instruments and effects
                                My Patreon - HISE tutorials
                                YouTube Channel - Public HISE tutorials

                                ulrikU 1 Reply Last reply Reply Quote 1
                                • ulrikU
                                  ulrik @d.healey
                                  last edited by

                                  @d-healey said in ScriptPanel, check clicked ellipse:

                                  I shall mention that in Paint Routines Part Duex

                                  Ahh...so there will be a follow up, nice! 👍

                                  Hise Develop branch
                                  MacOs 15.3.1, Xcode 16.2
                                  http://musikboden.se

                                  1 Reply Last reply Reply Quote 2
                                  • C
                                    clumsybear
                                    last edited by

                                    @Christoph-Hart said in ScriptPanel, check clicked ellipse:

                                    You know there's a floating tile that connects to the curve eq, right?

                                    Yeah, I know about it and it works great! But I can't costumize it, or can I?
                                    I want to limit the number of Bands and change how the numbered nodes of the bands look.

                                    Don't tell me this would have been possible with the floating tile after all I've been through .... :D

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    46

                                    Online

                                    1.7k

                                    Users

                                    11.7k

                                    Topics

                                    101.8k

                                    Posts