HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I load a midi script programmatically?

    Scheduled Pinned Locked Moved Scripting
    26 Posts 4 Posters 377 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 @Lindon
      last edited by d.healey

      @Lindon said in How do I load a midi script programmatically?:

      you are going to have to use different separators based on the OS in question
      fwd slash for mac os backslash for windows:

      You should be able to use the same on all OS and HISE will handle it. I think the issue here is you don't need to put a slash of any kind after {PROJECT_FOLDER} because that wildcard includes a slash.

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

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

        @d-healey said in How do I load a midi script programmatically?:

        @Lindon said in How do I load a midi script programmatically?:

        you are going to have to use different separators based on the OS in question
        fwd slash for mac os backslash for windows:

        You should be able to use the same on all OS and HISE will handle it. I think the issue here is you don't need to put a slash of any kind after {PROJECT_FOLDER} because that wildcard includes a slash.

        You should, but my experience is you cant...

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon How do you include files or fonts?

          I do this and it works on all systems

          Engine.loadFontAs("{PROJECT_FOLDER}Fonts/Text/Inter-Regular.ttf", "regular");

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

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

            @d-healey I do what i've always done and put the font in the images folder and call this:

            Engine.loadFontAs("{PROJECT_FOLDER}DIN Alternate Bold.otf", "DIN Alternate");

            works everywhere.

            Where it doesnt work is if you want to declare some sub-folder path i.e.

            {PROJECTS}\mysub\yoursub\afile.ext

            so its simple to work around:

            // on init
            const var WINDOWS = "WIN";
            const var MAC = "OSX";
            const var OS = Engine.getOS();
            
            
            //elsewhere...
            
            	if(OS == WINDOWS)
            	{
            		theLoopPlayers[pos].setFile(LP_LoopFileFolder + "\\"+ component.get("text") + ".wav");
            	}else{
            		theLoopPlayers[pos].setFile(LP_LoopFileFolder + "/"+ component.get("text") + ".wav");			
            	};	
            

            You of course will also want to check for Linux...

            HISE Development for hire.
            www.channelrobot.com

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

              @Lindon said in How do I load a midi script programmatically?:

              {PROJECTS}\mysub\yoursub\afile.ext

              You don't need a slash after the wildcard, and if you use forward slashes only it will work on all systems. Don't know about the lopp player though.

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

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

                @d-healey said in How do I load a midi script programmatically?:

                @Lindon said in How do I load a midi script programmatically?:

                {PROJECTS}\mysub\yoursub\afile.ext

                You don't need a slash after the wildcard, and if you use forward slashes only it will work on all systems. Don't know about the lopp player though.

                yeah that might work for you but as I say its at the very least unreliable for me, it might be cases of paths without {PROJECT_FOLDER} in them

                HISE Development for hire.
                www.channelrobot.com

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

                39

                Online

                1.7k

                Users

                11.9k

                Topics

                103.5k

                Posts