HISE Logo Forum
    • Categories
    • Register
    • Login

    simple samplemap loading w folder categories via viewports

    Scheduled Pinned Locked Moved Scripting
    12 Posts 2 Posters 721 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.
    • M
      mwplugs
      last edited by

      i see alot of weirdly complex custom samplemap loading with regex based on text string etc. but i simply want 2 viewports. one to select category (which is populated by the folder names with the Samples folder) and the second viewport containing the actual samplemaps locatated in the folder selected which obviously loads upon selection

      im using this to load a samplemap below. but i need a another viewport next to it that list the categories (subfolders) within the samplemaps folder

      const var s = Synth.getSampler("MySampler");
      const var list = Sampler.getSampleMapList();
      const var Viewport1 = Content.getComponent("Viewport1");
      Viewport1.set("useList", true);
      Viewport1.set("items", list.join("\n"));
      
      inline function loadSampleFromViewport(component, value)
      {
          s.loadSampleMap(list[value]);
      }
      
      Viewport1.setControlCallback(loadSampleFromViewport);
      
      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @mwplugs
        last edited by

        @mwplugs You dont need to put the samplemaps in a folder structure, you can simply have them in category arrays and show these in your viewports, theres even an example I posted at some point - try searching the forum.

        HISE Development for hire.
        www.channelrobot.com

        M 1 Reply Last reply Reply Quote 1
        • M
          mwplugs @Lindon
          last edited by

          @Lindon thanks i did see something involving BD SD etc. But christopher brought up that can be used from subfolders very easily the same as userpresets. im just wondering what the code is to have a function two panel viewport for loading samplemaps. ive browsed every post in the forum about viewports and samplemap loading

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

            @mwplugs then you will have seen the example I posted. this is the only way I know how to do this - using scripting (and its pretty simple too)- you cant "reuse" the preset browser as far as I am aware.

            HISE Development for hire.
            www.channelrobot.com

            M 1 Reply Last reply Reply Quote 0
            • M
              mwplugs @Lindon
              last edited by

              @Lindon im trying to simplify it now by simply making manual viewport "categories" and then trying to figure out how to make that only show the samplemaps in a certain directory ex. a subfolder. any ideas?

              M LindonL 2 Replies Last reply Reply Quote 0
              • M
                mwplugs @mwplugs
                last edited by

                @mwplugs obv left viewport is cats and right would be samplemaps in the specified directory per cat folder when clicked

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

                  @mwplugs you already have an even simpler(better more flexible) script based approach pointed out by @christoph in this thread:

                  Link Preview Image
                  Viewport

                  @Dalart @dustbro the "Registers & Chords" is a viewport I populated it using array this array const var ArtList = ["Stradella", "Freebass", "Tenor (Bass)", ...

                  favicon

                  Forum (forum.hise.audio)

                  HISE Development for hire.
                  www.channelrobot.com

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    mwplugs @Lindon
                    last edited by

                    @Lindon yes but it just creates an object. i dont know how to split up the data into 2 seperate lists and them make them usable by the viewports. im on hour 20 of this..trying over an over every possible solution nothing works.

                    i cant take this and put into a viewport

                    {
                    "Brass": [
                    "FreshHornStaccato"
                    ],
                    "Guitar": [
                    "AcousticCampfire"
                    ],
                    "Keys": [
                    "DeepFuzzVibe",
                    "HorrorPianoFuzz"
                    ],
                    "Piano": [
                    "CloudyJazzPno",
                    "GoldenPiano",
                    "RustyPiano"
                    ],
                    "Strings": [
                    "ChamberTremelo",
                    "ChamberViolinPizz",
                    "ChamberViolinSpiccati",
                    "ChamberViolinTremble",
                    "MidMedSoloString",
                    "MovieStringStacc",
                    "SoloViolinLeg",
                    "ViolinPizz1",
                    "ViolinStaccato",
                    "ViolinStaccatoB"
                    ],
                    "Vox": [
                    "WhooMaleVox"
                    ]
                    }

                    matter of fact ive yet to be able to put anything in a viewport other than the standard list from samplemaps..it always returns and error about "join"

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

                      @mwplugs first look up (javascript) how to access object elements, then look up (here) how to load a list into a viewport.

                      HISE Development for hire.
                      www.channelrobot.com

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        mwplugs @Lindon
                        last edited by

                        @Lindon i just need to know how to do it. its a very simple thing but like most things here there is no set documentation. so how i have gotten this first is reverse engineering implementations. i know nothing about java. ive made alot of great things with hise. however certain things simply arent documented and i get stuck 100 hours on something someone can simply say heres 2 lines of code. from that point i understand what is going on by seeing the code and understanding what is happening.

                        1 Reply Last reply Reply Quote 0
                        • M
                          mwplugs
                          last edited by

                          im thankful for all the help ive gotten over the years here. im not a coder. im a producer that is good at sound design and gui's and marketing with a large customer base. i do things myself because i want to learn. but i dont see myself ever fully grasping java or c++ my brain is already stuffed. if there is solutions in the forum for things i cant figure out, i implement them and then reverse engineer why they work. maybe one day i wont need to ask a question in the forum everytime i try to do something. im just used to having definitive documentation and answers available at my disposal.

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

                            @mwplugs the definative documentation is available:

                            Link Preview Image
                            W3Schools.com

                            Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.

                            favicon

                            (www.w3schools.com)

                            HISE Development for hire.
                            www.channelrobot.com

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

                            31

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            102.0k

                            Posts