Forum
    • Categories
    • Register
    • Login

    Passing Lambda Variables not working in HISE?

    Scheduled Pinned Locked Moved Unsolved Scripting
    5 Posts 3 Posters 41 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.
    • HISEnbergH
      HISEnberg
      last edited by

      On both my systems I receive an error in the console when trying to pass a labmda variable (from inline function to function). This was prompted by the recent videos @David-Healey shared on the topic. The functions seem to work but I am not sure why I receive the error.

      Interface:! Line 6, column 60: Accessing parameter reference outside the function call
      

      The examples from the HISE docs are also producing the same error. I know I can script around this if necessary but I am curious to know if anyone else is experiencing the same issue?

      Wonder if this is a question for @Christoph-Hart ? Does using lambdas require a certain version of C++? In Visual Studio 2026 the C++ Language Standard is set to ISO C++20 Standard (/std:c++20) , so I think I should be covered here.

      Anyone else seeing these error messages?

      HiseSnippet 790.3ocsUstaSCCE1tqYhFtHlDO.Q6WcnwVur0QYHXr0VnBZWEsL.gPStNNKVKwNJwYiJzdR3kj2.33jrdgU1FUB+inbt4ymO96bbuPIkEEICQXyAiBXH78L5ORnbOvkvEn1MP3GXzgDoXgVop1eT.IJhYiv3kdsVAtPdTx5mubehGQPYSTgPGI4T1639b0Ds816sbOuVDa1.t+Tdu0dsoRwAROYLfmkLJgBHzSImv5Rztky.8FRjKB+XipCcpsEs7NCI6To9v50pUea6pN1jJUYzgCIUXf4s11oFBubSatRF1WQTrHDN+9R6Q8ckmKRSvQ7H9POlVnLpOj4T0sjd15inVK5.WtmcuKKTQHXW5MorsTZY6QFc317w5mT9dXhAqIQLcADmaV3szLvq7eCdyAR3ofT9THshQeZHOPMwhFO20ns.tMcHv8zzPI0WTtefMNPBdHTa3SNk0JDDFGQwZkJstE7YscMM4BOtfY4DKnJtTXEI8YsxDJxEAwp0L+tYgM2z5lVCb4QVg7SbUVtrP1yrd9SzqWXVno3DHGaDAkjOyh5J+HWXKOu3pC3JO1pqasZG3jALD32w33KI49qEkmtlYA..EfySjzisQPHWnxP1tlEt.9bAbNlA20gi13cRJ5JUrCEESNHlWXZ8mlbblqMcELT54wBmqYMsO75BrnH1eHKbcqyHdwrwNBWsyxWV91wWnoWnS4nTzVvUGFvxjudBOJiQ.+8g1MHJhlvkoC7KfEp3Z3favNCZ2SoeELZvhNUICfF9qvMgtBocrGQMaqhdfRlAndLC+TyAEQb0noG37Oz+T5Z6etsPbEidbE0c9XL2bvHTo9efwroN22noiCipl.v7Fs9zhNh4FR+6kwJt3jNDUH+aHrQ2X+9vjZJCxtPv7fM2.mSyVRkKok0Uf9LgchvufUlwxZYblwxWZD4SngxioocA54Z2IQCfIQxa.EfGi.YqxnjNioqy9vX1iozY2pqDXkEMvpKZfasnAt8hFXsEMvcVz.e5MGn9UvWEqj9osMHTmdMSFkfwMEDfAlvVQ+FVk6WTA
      

      Sonic Architect && Software Mercenary

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • HISEnbergH HISEnberg marked this topic as a question
      • Christoph HartC
        Christoph Hart @HISEnberg
        last edited by

        @HISEnberg haha don‘t mix up the extremely complex issue of C++ lambdas (where the C++ standard does in fact have an impact) with our little „lamda“ extension to HiseScript where you can just pass on some variables in a function to a sub function call.

        Usually you just need to rename and introduce a variable from a function parameter because you cannot pass on an incoming parameter from the outside function. However this might be another case of „var-local“-gate where I could easily patch things up internally so you and the robot overlords will not need that information in your context window…

        David HealeyD HISEnbergH 2 Replies Last reply Reply Quote 0
        • David HealeyD
          David Healey @Christoph Hart
          last edited by

          @Christoph-Hart He's using lambda's as expected in HISE - I'm not seeing the error he reports, do you see it?

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          1 Reply Last reply Reply Quote 0
          • HISEnbergH
            HISEnberg @Christoph Hart
            last edited by

            @Christoph-Hart hehe that makes sense, they seem super simple in HISE which doesn't appear to be true for C++ 😆

            @David-Healey is correct though, for some reason I am getting an error when using them. If I use his example I get that error message Accessing parameter reference outside the function call

            It doesn't seem to be a breaking change as the code still functions. But I see red in the Console and get nervous....

            Screenshot 2026-02-15 at 2.55.27 PM.png

            HiseSnippet 1128.3ocsV0uaaaCDmJNZq1asXsXO.Z9uj2BLrymMXXnowIY0XIoFyYYcnqnfR5jMWjHEHoRpQQd21izdC1NRIGK2XuUXrZXXq66e2wi2oARQHnTBIwowESx.hyW5NbBWOt2XJiS5eDw4QtmQUZP5Uv5vIYTkBhHNN09QCCm5qSre9qmcHMgxCgYrHjKErP3TVJSOi6fC9IVRxIzH3BVZEs29f9gBdOQhHGwSM2NjLZ3UzQv4TiZq4RdAUMl37staEDu61gc2Kft2l6Gr+t6t+NQaEGQ2bKHLHftIfh2dm3cINe1wQLsPNTS0fh3r9ghnICGKtgWDfKYJVPBXH5RFhQtf8IhjHSJZ3R5MlkDMXZgRQPuLXVYqVQY6qcOiEwti+rx2WYE3MyhpEPm0lGd0lCdcqBuNUf2BfjSEHsdAjdr6vPIKSOShAOegaeNdZFSwyopPoPWxZuulaOApAW2NkdEbhDItyB+s5zYCuM6zo022nAdVozdIAIliGuevapYi.cOQZlfiD9MKk2Dsnvf.M+4QQKU+BwF0KdpsxHlqkhjdzjj.rivWvKjUx2.FFOgwAu3bdnlI3defJ9gSivFdWSSxgVMdei5rXO+uojrNRWmFE0WCoWHNkoz9kP2.vKMJ42BiT85nKUhDncljwWlR213VDTkY70YF2szLtPrIiKdxjw9MYHNTM2vqYyEkdyCTM7NsMgNlOBUqsB6f9MPct3WY7HwM9Mw.GyjoF2Yp8Fe60z667LFh+gOqEd5wfWB5tmgpMMPu1nwa7kfBQqZZYxV2pvqdcInykbS0A+dMUZcDlwkYznYYTq1prDFR967lsJMv5Ol5HHFQejuw1VV2V5kW+lREMzsyxUiKR4owaAkMql+gfwKBj8LA+4V7PoQkljyEZ3kbeawCE58ghhiWnrxtpDPtPwlwZx+MC844oAfrZunQQ7p67yCbW97fpiqBK5qpnnf2myzuLC3KaHForYzL6nDUnpZ6jimTN4.htjA2jIjZBCGR7.2hJMwh5pS4I+R+inZ5TegtECUFH0LSV3bDbMtEnXpTc2i.0UZQFFs6tDfYZQjeXYjOkF.I1fV2s7FF4cUi3jpDllAbAl6KfIdixmnLI2cd9y+3xok489GbCKRiacbcZ5PHiA1nwy1k8mAGjq.qCbbVaAg8Qkg8vbsVvKCYwnoJgDcybIDvo3wrYwwo.UxMymUzqg97A3sNvDqZL0YhTLRT4Danu+7ebyiHJOgpmecjYoco.rmbtc.l47bESOo5R8+21Q8wBwG6NfoCGuXLt1BvH118o.ika1en6wwwPndF.W28jW8oYMN4mE4ZFezYTsjgsGtmmmNDeanP.iNmCIlYB3gswTKcGCsoBLD3QVh+F+TJrqg1oTX2oBIozPo3sgE24Mu6vCrbPLwsumUc7E9PZut2+ddJ1Q91vv4c08LbyU0vsVUC2dUMbmU0vcWUC2aUM7o+2FZFX77bsHs3ZCgb1fisykcbN1NQw1sR9GvO6lUp
            

            Sonic Architect && Software Mercenary

            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @HISEnberg
              last edited by

              @HISEnberg have you enabled the optimizations in the Scripting Settings?

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

              38

              Online

              2.2k

              Users

              13.4k

              Topics

              116.6k

              Posts