HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansion - Access AdditionalSourcecode file

    Scheduled Pinned Locked Moved General Questions
    60 Posts 3 Posters 5.8k 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.
    • DanHD
      DanH @Lindon
      last edited by

      @lindon 😂 thanks

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

        @danh This function is for loading json data. Your file should contain a json object and the file extension should be .json.

        https://www.w3schools.com/whatis/whatis_json.asp

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

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

          Post a bigger code example so I can see what you're doing more fully, or post a minimal snippet

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

          DanHD 1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @d.healey
            last edited by

            @d-healey this is the crux of what I'm trying to do: switch expansions via combobox (fine), and change the value of 'maxrandom' via a json in each expansion.

            var maxrandom;
            
            inline function newcombobox(newExpansion)
            {
            
                   if(isDefined(newExpansion))
                    
                   
                {
                    maxrandom = newExpansion.loadDataFile("SMNUMBER.json");
                    Console.print(maxrandom);
                }
                else
                {
                    maxrandom = 313;
                }
            
            }
            
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @DanH
              last edited by

              @danh

              var maxrandom;

              Stop using vars :p

              Show us where you are getting newExpansion from.

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

              DanHD 1 Reply Last reply Reply Quote 0
              • DanHD
                DanH @d.healey
                last edited by DanH

                @d-healey said in Expansion - Access AdditionalSourcecode file:

                @danh

                var maxrandom;

                Stop using vars :p

                reg?

                Show us where you are getting newExpansion from.

                erm.... I'm not?

                Everything else is working though 😆
                Switching images, sample maps etc

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

                  @danh

                  reg?

                  In this case, yes.

                  erm.... I'm not?

                  Where are you calling your newcombobox function from?

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

                  DanHD 1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey interface script

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

                      @danh Show me

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

                      DanHD 1 Reply Last reply Reply Quote 0
                      • DanHD
                        DanH @d.healey
                        last edited by

                        This post is deleted!
                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @DanH
                          last edited by

                          @danh Can you show me where you are calling your function from

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

                          DanHD 1 Reply Last reply Reply Quote 0
                          • DanHD
                            DanH @d.healey
                            last edited by

                            @d-healey

                            expHandler.setExpansionCallback(newcombobox);
                            
                            newcombobox(undefined);
                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @DanH
                              last edited by

                              @danh Well there's your problem. undefined is not an expansion.

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

                              DanHD 1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @d.healey
                                last edited by

                                @d-healey thanks! ok I've commented that out (!) but error persists... hmmmmm

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

                                  @danh I'm seeing tiny little windows into your code so it's impossible for me to debug this. I suggest creating a minimal snippet that contains only what's necessary to demonstrate this problem.

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

                                  DanHD 2 Replies Last reply Reply Quote 0
                                  • DanHD
                                    DanH @d.healey
                                    last edited by

                                    @d-healey yep fair enough, will do

                                    1 Reply Last reply Reply Quote 0
                                    • DanHD
                                      DanH @d.healey
                                      last edited by

                                      @d-healey

                                      HiseSnippet 1288.3ocsW0sahaDEdbR71h6OZW0dSuyhapQJkEZR2VopUMABrA0.DAjs6pznUSrGfYy3YrrGu.pJOH80nOY8Mn8L1FaClMkfT8Efmyey24mYNGeouvlDDH7QZkFsvifz9b8gK3xoMmhobTmyPZeodWbfj3aFSpwBObP.wAoos+qTDzJc.J54u+kFXFlaSxHgPuVPsIWPcoxLpWdxuRYr1XGxHpaNoO9jN1BdSASDB3Ye8ZHOr8c3IjdXkX6oizdRKGpT3OThkj.PlFBmECmJlwik+0z.5sLhZQczPvPwjQMmRYNWtzWCPHsCtLyy2O1y+Z8tTGZJ8rHvSiXXloQ9Xf1dODjp+HfjVNHcPLjdl9PaepmLiiBOeldGNjPFigPcdnDKKZuu4SzaJ.I3xpt36Hs8gEoZX8hZ0NzD9oxOaX.g6.o4Gv9lj4dmi4NLHO+RyV7ITNopsOA7oVy8v7.pfmv2pfhwrC.EyrR0IDYplWPCjQpkie.QdJiIlQbRES4yAVWmSn1TFoAFbuCMML2lmb5F4wtDGJ3C6f5s319K7jDma.fuUJuofhpxUEXt9lXuOG0pdgASsJ29zli5O3skUgmwBeKhIk+vwwJFIPsfwHJogZEOhujBgxJUULSveN3kZvgDFwFJdADtrhArPSgqmfCKrJWPRENKPTkLsJSkD2fxGtNxdufxsJ+67xUTt3ye9ZrghZYOrLzGyrhEvriqGi3B6uobJIyblAynR6oFFTNCJOMGGxskJ5BdADo7FeAyxdoqbH33rPREi+vnDSXiYY1cj3BA1ABAoBqBBc.uYDYdTcaIiR.r9Mh4LbBnFS8gXoxiMkBSeBD.hnaG56q.dpwizLPXNiXxIDGkz1Sw7IPZVpVfgjsqmbgYfzmxmXThN1p.xd4ZwzqqcSEib0rq4GkKmjwKs54slwfKMXs9FAd58PFXqqDhrYbftIlwtEtr15imKTIWexDSW7be.SB2B2GjpYp03jYPR4Vwsh4w0F4HXExcHigBAEtKTSjWP38TSqJ.RBbPjlFbVrIVUlrfqQ9+gRGHalheHRezwvVuT13xJ64EtGrPbO2MJ4sVdLTkAIjyvRr5JPqxC616ptMZMn56CD7xeD8smusZAoj.AiT0Cp4jV1ySXcuQpuRXADibd9ZwiU12ipezJ5eetSl8DRReviUm6L.9qyZ73MxKolIpcyFXqlav+gTzhG5dKwO+odkfPi0U6V+jsqasc7QhbBJ3c3TYeORx51BlipKr58h81QImoTc4SPHHpLpG+SS5w2TUt1PLGQAy7U5ENFghbkbyVcB5pNpb8RiB1O6tef1YjO.ydEOHQI8yHA2IEdQxlbnFb+GIDlizz09KXuWnd4OgWf5.0qJLEc+OR6a0SZoYzn+fWY13zgCM51uW+gus2nyM505pA8Ou+fdvXfEF2AFzR3DxvxUm9RMlYBC.LqLxipIO.Q4h7ig9HFIq1CNR11Bwmoeopyzlw3da.iPJ6+CLlLH6Wn2Z7XHgkAvCza+lccp0+isefHTBMt5hg9WpRgdgtCg42sIvty4v0Hpxi8TGAhWWSsVEAFR3NQK9G3IgYc0ZsDl0WxDJxr8EuyN9fiZT4OMhBfIdzWFTB9DEXsY8kmQz0qUsFxElZ+c11J2+6piPaVmueGz4ncPmi2Ac9gcPmWrC57i6fN+zCpi5ClNMTJbiON.DtrUzcUZZs3XnxJpJD8u.SjMMJ.
                                      
                                      d.healeyD 1 Reply Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @DanH
                                        last edited by

                                        Place this at the top of the function and tell me what output it gives.

                                        Console.print(newExpansion.getRootFolder().toString(0));

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

                                        DanHD 1 Reply Last reply Reply Quote 0
                                        • DanHD
                                          DanH @d.healey
                                          last edited by

                                          @d-healey said in Expansion - Access AdditionalSourcecode file:

                                          Console.print(newExpansion.getRootFolder().toString(0));

                                          I get the path of the expansion folder on my drive

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

                                            @danh And the path is correct and that's the same root folder of where your data json file is?

                                            Also try this in the top of the function and tell me what the output is

                                            Console.print(trace(newExpansion.getDataFileList()));

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

                                            DanHD 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            29

                                            Online

                                            2.0k

                                            Users

                                            12.7k

                                            Topics

                                            110.2k

                                            Posts