HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansion - Access AdditionalSourcecode file

    Scheduled Pinned Locked Moved General Questions
    60 Posts 3 Posters 5.5k 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 @d.healey
      last edited by

      @d-healey path is good, I copied the json to that folder as well as the ASC folder

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

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

        @d-healey

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

        an empty array. []

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

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

          @danh So it's not finding your expansion's data files. Are your data files in your expansion's additional source code folder or your project's additional source code folder?

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

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

            @d-healey expansion only

            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
            https://dhplugins.com/ | https://dcbreaks.com/
            London, UK

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

              @danh zip your project (without samples, pool, and binaries folder) and send it to me

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

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

                I think you've found a bug. Might be related to this issue - https://forum.hise.audio/topic/5121/confusing-convolution/21

                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

                  @Christoph-Hart Here is a minimal example that demonstrates the problem. I think this is related to the other problem some of us have been having with accessing files when using expansions.

                  DataFileTest.zip

                  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

                    @DanH I was playing around with this some more today and it seems to load the data file correct (not sure if this is due to a recent change), but the getDataFileList() function is still returning an empty array.

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

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

                      @d-healey thanks. Would you mind sending me a snippet to look at please?

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        @DanH Yeah

                        datafiletest.zip

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

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

                          @d-healey coming back to this finally - it's working as you explained, and thanks for the project. I'm not massively familiar with using jsons - how do I get the value of "Value" into HISE script so I can assign it to something?

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

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

                            @DanH From the JSON file you'll just get a standard Javascript object inside your script, so you can use it like any other object. If you want to view the contents you can use the script watch table or just Console.print(trace(objName));

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

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

                              @d-healey that's what I hoped would happen 😆

                              So if the JSON just contains:

                              {
                                "NumberData" : "10"
                              }
                              

                              then in my script I should just be able to go:

                              reg = MyNewNumber;
                              
                              MyNewNumber = NumberData;
                              

                              Or no?!

                              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                              https://dhplugins.com/ | https://dcbreaks.com/
                              London, UK

                              LindonL 1 Reply Last reply Reply Quote 0
                              • LindonL
                                Lindon @DanH
                                last edited by

                                @DanH

                                Off the top of my head...

                                var myObj = Engine.loadFromJSON("somefile");
                                
                                Console.print(myObj.NumberData);
                                

                                HISE Development for hire.
                                www.channelrobot.com

                                DanHD 1 Reply Last reply Reply Quote 0
                                • DanHD
                                  DanH @Lindon
                                  last edited by

                                  @Lindon Thanks! :)

                                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                  https://dhplugins.com/ | https://dcbreaks.com/
                                  London, UK

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

                                    @d-healey @Lindon thanks both, that's working perfectly - in the case that the JSON file is missing how can I set "MyNewNumber" to a certain value? I'm already in an if / else statement. I can't seem to find a way out after calling

                                    var myObj = Engine.loadFromJSON("somefile");
                                    

                                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                    https://dhplugins.com/ | https://dcbreaks.com/
                                    London, UK

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

                                      @DanH You can use if (!isDefined(myObj)) to check if it's there or not.

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

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

                                        @d-healey ok trying. I'm not sure where to put "reg mrdata = cx.loadDataFile("maxrandomdata.json");" as if it goes before the if statement then I get an error, and if it goes in the else statement it gets ignored... I was trying:

                                        if (cx.loadDataFile("maxrandomdata.json") == undefined)
                                        

                                        before you wrote that... Where I'm at now is below:

                                        if (!isDefined(mrdata))
                                                {
                                                    maxrandom = 35;
                                                }
                                                
                                                else
                                                {
                                                    reg mrdata = cx.loadDataFile("maxrandomdata.json");
                                                    maxrandom = mrdata.maxrandomnumber;
                                                }
                                        

                                        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                        https://dhplugins.com/ | https://dcbreaks.com/
                                        London, UK

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

                                          @DanH Make a minimal snippet, we need to see some context.

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

                                          DanHD 1 Reply Last reply Reply Quote 0
                                          • LindonL
                                            Lindon @DanH
                                            last edited by

                                            @DanH

                                            var myObj = Engine.loadFromJSON("somefile");
                                            if (myObj)
                                            {
                                                  Console.print(myObj.NumberData);
                                            }else{
                                                myObj = {NumberData : 444};
                                            }
                                            

                                            HISE Development for hire.
                                            www.channelrobot.com

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

                                            29

                                            Online

                                            1.8k

                                            Users

                                            12.0k

                                            Topics

                                            104.1k

                                            Posts