HISE Logo Forum
    • Categories
    • Register
    • Login

    Viewport

    Scheduled Pinned Locked Moved Scripting
    73 Posts 9 Posters 6.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.
    • d.healeyD
      d.healey
      last edited by

      This might be a good place to start - https://github.com/christophhart/hise_tutorial/tree/master/CustomUserPreset

      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 er... that doesnt even have a UI. That just read the file - I can do that with a JSON file, of if need be an array in the plugin itself - but I want to be able to scroll down the list of "names" and "favoratise" one or more and then return the name (so I can load a sample map) when the user selects one. Basically what I want is the presets panel functionality.

        So most frustrating thing here is that clearly the presets panel does all of this for a specifc folder(directory) in AppData, and then uses a file structure from xxxx.preset - I just want to use a differnt struct

        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 It does have a UI.

          9fa8530d-0cd3-4c36-a536-43115a9431a0-image.png

          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 Oh yes it does! sorry - still, its not what I'm looking for is it - I have this level of functionality with a viewport..... sigh - OK one more time (come everyone join in!) Christoph PLEASE PLEASE PLEASE make a version of the preset panel that reads a JSON file.

            In fact lets call it "SampleMap Browser.".. so it behaves just like the preset browser - looks thru folders -- only this time it looks for sample maps instead of presets. And instead of loading a preset it loads a sample map into a named Sampler.. in my example the sampler is called "heyMySampler"

            {
            "ProcessorId": "HeyMySampler",
            "Index": -1
            }

            This would be AWESOME functionality...

            HISE Development for hire.
            www.channelrobot.com

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

              The problem with this is that the Floating tiles can't restore data as the other UI elements (knobs et al.) do - they are just a wrapper around a UI element. So even if you have a element like this, you would need to resort to another (hidden) UI element managing the restoring / saving of your current samplemap and your back to zero in your efforts to make things more clear. Also then people want to customize the names in the list, sort them into categories, etc.

              However, the viewport is exactly tailored to do this and offers you the power of Javascript's array operations to create any item list you like. The basic behaviour you're after can be implemented in 8 lines of code:

              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);
              

              You can go from there, add a "favorites button" somewhere else and another "show only favorites" button next to it, which filters the list.

              LindonL 1 Reply Last reply Reply Quote 1
              • LindonL
                Lindon @Christoph Hart
                last edited by

                @Christoph-Hart thanks for this -interesting code.

                I'm not sure I understand when you say "you would need to resort to another (hidden) UI element managing the restoring / saving of your current samplemap" - do you mean floating tiles dont have callbacks that can be executed on click - if so I'm wondering how the preset browser manages to load presets when the user selects one. All I was asking for is a version of that I think.

                But in any case your code returns a simple list of samplemaps - which highlights I think my problems. Some background: If I am going to port a number of our ROMpler instruments to HISE then I am going to have up to (and occasionally over) 1,000 samplemaps in each product- yeah there are 1,000+ groups in the Kontakt instruments. These are often at least 2 "voice" instruments (sometimes 4) so I need a way to load each "voice"(Sampler in HISE) with a group/samplemap.

                Listing them is a nightmare - so I needed a "sound browser" - I built one in Kontakt that is not so far away from your preset browser.

                alt text

                It's a compromise but it works. This is what I was looking for as a floating tile option - because I think a lot of HISE developers will arrive at a place (ROMpler building) where you have a lot of samplemaps - and their end users will need some friendlier-than-a-bald-list approach to this.

                But lying awake last night thinking about this problem - what I'm looking for really is more like this:
                alt text

                Which looks similar but is really a meta data based browser. So I need a way to hold metadata for samplemaps (where "favourite" is just one element/attribute of meta-data) and display/filter them based on that meta data.

                Again this shows up all the time in (all) the NI products and those from other developers like Arturia etc. so there's a demand. I guess I will have to go build this myself then.

                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 Instead of the user loading sample maps think of it as the user loading presets and each preset is tied to a sample map. I'm doing this now for a synth project. It does mean creating 1000 presets manually though it seems but this allows you to use the standard preset browser to achieve the same goal - no meta handling though.

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

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

                    Instead of the user loading sample maps think of it as the user loading presets and each preset is tied to a sample map. I'm doing this now for a synth project. It does mean creating 1000 presets manually though it seems but this allows you to use the standard preset browser to achieve the same goal - no meta handling though.

                    Not sure about this. If you have to create 1000 things of something manually there has to be a smarter way.

                    I am using something like you are talking about in HEXERACT to display a sound browser and it splits the samplemaps into categories based on their folder, then shows it in two viewports - one for the category, one for the folder. In this case it is only two levels, but it shouldn't be too hard adapting the code to support multiple levels.

                    However your idea of attaching some kind of metadata to the samplemap makes sense - in fact there is already a bunch of metadata present (multimic IDs, round robin amount, etc), however if I do this I must be extremely careful not to break backwards compatitbility, which would add another pile of mess to the issues with samplemap loading at the moment :)

                    d.healeyD LindonL DalartD M 4 Replies Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @Christoph Hart
                      last edited by

                      @Christoph-Hart Sample Maps can be in subfolders! I never knew that.

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

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

                        @d-healey Dave this wont work. Even in the "simple" two voice ROMplers, the user selects from 1,000 sounds(samplemaps) for each voice - so that means 1,000 * 1,000 combinations so I'd have a smooth 1 Million presets to cater for all combinations

                        HISE Development for hire.
                        www.channelrobot.com

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

                          @Christoph-Hart Yes its no easy task to decide on the metadata here, and it has to be accessible, filterable, sort-able , useful...

                          As a starting input can I relate that we had a go at this (well I did) for the Kontakt implementations. It was all too hard in a land with no string comparison, but the one useful piece of information was I decided to define a set of "free-form" text fields, tags really - and I never got beyond 4 or 5 MAX no of tags for any given sound.

                          Perhaps if you added (say) 4 free-form text based tags to each sample map that would pretty quickly cater for almost every conceivable (reasonable) scenario. Sure there is going to be some ***ker who will start asking for more (likely to be me - fair warning ☺ ) but I think its 80-20 rule time for this sort of thing.
                          So you could "just" put 4 text fields on the Sample Settings tab - so that'd deal with the "manual entry" part of it. And some simple way to set a tag value programmatically:

                          Sampler.setSampleMapTag(, "value") <--so you can only set a tag for the currently loaded sample map

                          Then we need a way to harvest these tags for all sample maps in the instrument <--- here I'm leaving you the hard work

                          I may be waaaaay ahead of where we are at this point and possibly waaay off beam too, so I'll stop designing-on-the-fly and get out of the way.

                          HISE Development for hire.
                          www.channelrobot.com

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

                            I'd rather make an API like this:

                            // returns the metadata as big JSON object. keys are the IDs, and the value is a object that you can populate with anything that can be converted to a JSON string.
                            const var metadata = Sampler.getSampleMapMetadataList();
                            
                            const var currentMetadata = metadata[Sampler.getCurrentSampleMapId()];
                            
                            // read operation: check the tag for the currently loaded samplemap.
                            if(currentMetadata["tags"].contains("hardcore")
                            {
                                // Something...
                            }
                            
                            // write operation
                            currentMetadata["tags"] = ["Tag 1", "Tag 2", "Tag 3"];
                            
                            // "flush" the write operation. This will reload the pooled samplemap (asynchronously).
                            Sampler.writeMetadata(Sampler.getCurrentSampleMapId(), currentMetadata);
                            1 Reply Last reply Reply Quote 0
                            • DalartD
                              Dalart @Christoph Hart
                              last edited by

                              @Christoph-Hart said in Viewport:

                              Instead of the user loading sample maps think of it as the user loading presets and each preset is tied to a sample map. I'm doing this now for a synth project. It does mean creating 1000 presets manually though it seems but this allows you to use the standard preset browser to achieve the same goal - no meta handling though.

                              Not sure about this. If you have to create 1000 things of something manually there has to be a smarter way.

                              I am using something like you are talking about in HEXERACT to display a sound browser and it splits the samplemaps into categories based on their folder, then shows it in two viewports - one for the category, one for the folder. In this case it is only two levels, but it shouldn't be too hard adapting the code to support multiple levels.

                              However your idea of attaching some kind of metadata to the samplemap makes sense - in fact there is already a bunch of metadata present (multimic IDs, round robin amount, etc), however if I do this I must be extremely careful not to break backwards compatitbility, which would add another pile of mess to the issues with samplemap loading at the moment :)

                              The functionality of the viewport you described in Hexeract sounds like a solution I would be interested in and could use for some of the projects Im tinkering with.

                              Is there an example or snippet around here somewhere for the dual viewport view and category listing ? 🙏

                              JayJ 1 Reply Last reply Reply Quote 1
                              • JayJ
                                Jay @Dalart
                                last edited by

                                @Dalart Following

                                Joansi Villalona

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

                                  Yes I will include a snippet for this in the new fancy documentation I am working on right now.

                                  Also I realized it makes absolutely no sense storing the metadata in the samplemap file - just include a separate JSON file with the sample id as key names and do whatever you need to do using stock Javascript data processing.

                                  DalartD 2 Replies Last reply Reply Quote 3
                                  • DalartD
                                    Dalart @Christoph Hart
                                    last edited by

                                    @Christoph-Hart Thank You !
                                    I cant wait to test it out and try to learn how it works =)

                                    1 Reply Last reply Reply Quote 0
                                    • DalartD
                                      Dalart @Christoph Hart
                                      last edited by

                                      @Christoph-Hart said in Viewport:

                                      Yes I will include a snippet for this in the new fancy documentation I am working on right now.

                                      Is there an ETA for the new documentation and examples or are they on github already somewhere ?

                                      1 Reply Last reply Reply Quote 0
                                      • Dan KorneffD
                                        Dan Korneff
                                        last edited by

                                        Is there an API for the Viewport yet?
                                        Trying to figure out how to view the contents of a folder.... ultimately, midi files so I can load them into the new midi player.

                                        Dan Korneff - Producer / Mixer / Audio Nerd

                                        1 Reply Last reply Reply Quote 1
                                        • DalartD
                                          Dalart
                                          last edited by

                                          Im also still interested in how to view / sort the samplemaps into folders as talked about in this thread.

                                          1 Reply Last reply Reply Quote 0
                                          • ulrikU
                                            ulrik
                                            last edited by ulrik

                                            @Dalart @dustbro the "Registers & Chords" is a viewport

                                            Skärmavbild 2019-08-28 kl. 23.13.36.png

                                            I populated it using array
                                            this array

                                            const var ArtList = ["Stradella", "Freebass", "Tenor (Bass)", "Master (Bass)", "Alto (Bass)",
                                            "Low Shift (Bass)", "Master Shift (Bass)", "High Shift (Bass)",
                                            "Bassoon (Treble)", "Bandoneon (Treble)", "Master (Treble)", "Violin (Treble)", "Clarinet (Treble)",
                                            "Major (Chord)", "Minor (Chord)", "Seventh (Chord)", "Diminished (Chord)"];
                                            

                                            and making the array readable in the VP

                                            inline function onArtVpControl(component, value)
                                            {
                                                ArtVp.set("items", ArtVpList.join("\n"));
                                                uaccVp.setValue(uaccUserList[value]-1);
                                            };
                                            

                                            and accessing the value from another array called uaccUserList and sending it to the "uaccVp" which is an ComboBox

                                            So the "ArtVp" is the ViewPort now populated with the array "ArtVpList" and clicking on any of the items in the ArtVp will get you a value, the same value as the index of the array, if I remember right, maybe the value starts with 1 (and the first index in an array is 0)

                                            Hise Develop branch
                                            MacOs 15.3.1, Xcode 16.2
                                            http://musikboden.se

                                            Dan KorneffD 1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            50

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts