HISE Logo Forum
    • Categories
    • Register
    • Login

    AudioLoopPlayer load

    Scheduled Pinned Locked Moved General Questions
    51 Posts 6 Posters 2.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 @MikeB
      last edited by

      @MikeB Everything you need is here - https://docs.hise.audio/scripting/scripting-api/string/index.html :) time to have a problem.

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

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

        @d-healey Unfortunately this is of no use to me David - but thanks for your support.

        "One hour of trial and error can save 10 minutes of reading the manual."
        "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
        HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

          @MikeB

          Unfortunately this is of no use to me

          Tell me more...

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

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

            @d-healey
            As I said - this is my starting point
            I have two knobs - one calls up the folder (InstrumentID).
            the other calls the sample (VariationID)

            So at the moment it's like this via the knobs:
            a. The folder is selected for example "Kick

            b. the sample is selected "sample3.wav".

            and this is then loaded into the LoopPlayer.

            reg myList = Engine.loadAudioFilesIntoPool();
            Console.print(trace(myList));
            
            var InstrumentID_S1;
            var VariationID_S1;
            const var Instrument_S1 = ["Bass", "Kick", "Snare", "HiHat", "Tom", "Cymbal", "Crash", "Perc", "Electro", "FX" ];
            const var Sample_S1 = ["sample1.wav","sample2.wav","sample3.wav","sample4.wav","sample5.wav","sample6.wav","sample7.wav"];
            
            
            
            //Start Knob-KitSelector----------------------------------------------------------------------------------------------------------------------
            inline function onKitSelector_Knob_S1Control(component, value){
            	InstrumentID_S1 = parseInt(value);	
            	Synth.getAudioSampleProcessor("Audio Loop Player_S1").setFile("{PROJECT_FOLDER}"+Instrument_S1[InstrumentID_S1]+"/"+Sample_S1[VariationID_S1]); 
            };
            Content.getComponent("KitSelector_Knob_S1").setControlCallback(onKitSelector_Knob_S1Control);
            //End --------------------------------------------------------------------------------------------------------------------------------------
            
            //Start Knob-SampleSelector----------------------------------------------------------------------------------------------------------------------
            inline function onSampleSelector_Knob_S1Control(component, value){
            	VariationID_S1 = parseInt(value-1);		
               Synth.getAudioSampleProcessor("Audio Loop Player_S1").setFile("{PROJECT_FOLDER}"+Instrument_S1[InstrumentID_S1]+"/"+Sample_S1[VariationID_S1]);   	
            };
            Content.getComponent("SampleSelector_Knob_S1").setControlCallback(onSampleSelector_Knob_S1Control);
            //End --------------------------------------------------------------------------------------------------------------------------------------    
            
            
            

            "One hour of trial and error can save 10 minutes of reading the manual."
            "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
            HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

              Get the list of audio files with Engine.loadAudioFilesIntoPool. Then you can use a loop and the string functions to automatically split that list into two arrays, one for the folders and one for the samples.

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

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

                @d-healey Thanks David - that's what I meant - if I could do that I wouldn't ask here.

                "One hour of trial and error can save 10 minutes of reading the manual."
                "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                  @MikeB Which part are you stuck at?

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

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

                    @d-healey Folders and samples have names of different lengths. How can I separate them with string?
                    Besides, the user should not get a hi-hat sound if he has selected kick.
                    But only the samples from the Kick folder.

                    "One hour of trial and error can save 10 minutes of reading the manual."
                    "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                    HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                      @MikeB

                      If you have a string like const s = "{PROJECT_FOLDER}Kick/sample12.wav"

                      You can get the folder with const ss = s.substring(s.indexOf("}") + 1, s.indexOf("/"));

                      Ready for an hour of trial and error ;)

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

                      MikeBM 1 Reply Last reply Reply Quote 0
                      • NatanN
                        Natan
                        last edited by Natan

                        @MikeB Are you going to Include The Audiofiles into Dll?
                        Or ship With Zip File?

                        1 Reply Last reply Reply Quote 0
                        • NatanN
                          Natan
                          last edited by

                          Beaware!

                          This, Engine.loadAudioFilesIntoPool();
                          And include Audio Files in resources Will Add Weight to Your Components, Dll, Vst3 Files.
                          And You easily Will get Out Of Heap error.

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

                            @Natan I think you can ship the audio files as a separate data file.

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

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

                              @d-healey @Natan
                              I have asked several times in this forum whether the audio files for the AudioLoopPlayer can be installed separately and - more importantly - whether they are protected.

                              Both were answered with no.

                              Above all, there is no protection such as Monolith for samples used in the AudioLoopPlayer. - Or?

                              "One hour of trial and error can save 10 minutes of reading the manual."
                              "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                              HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                @MikeB said in AudioLoopPlayer load:

                                there is no protection such as Monolith for samples

                                Monolith isn't "protection" it's compression. HISE is open source, it wouldn't take an experienced programmer very long to reverse the compression.

                                But yes it is possible to ship asset files as a separate data file

                                Export Pooled Files to Binary Resource
                                Will collect all pooled Audio-, Image-, MIDI files and SampleMaps and save them as .dat files in a newly created PooledResources folder in your project.
                                

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

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

                                  @d-healey
                                  I'll leave it David. It's not enough for you to throw me little nibbles and then smugly say - now try a few hours.
                                  I know you mean well - but sorry

                                  "One hour of trial and error can save 10 minutes of reading the manual."
                                  "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                                  HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                    @d-healey
                                    I know that Monolith is not a protection - but a big obstacle against the use of the samples by the normal user - or

                                    Since it is not possible to protect the samples for the AudioLooPlayer against further use the only possibility at the moment is
                                    is to embed them.

                                    "One hour of trial and error can save 10 minutes of reading the manual."
                                    "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                                    HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                      @MikeB Well the audio files will be put into a .dat file, which I think is similar to a monolith. I could be wrong though.

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

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

                                        @d-healey
                                        Where and when are the audio files inserted into a dat.file????
                                        Is there a description?

                                        "One hour of trial and error can save 10 minutes of reading the manual."
                                        "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                                        HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                                          It's in the export menu, this is all it says in the docs:

                                          Export Pooled Files to Binary Resource
                                          Will collect all pooled Audio-, Image-, MIDI files and SampleMaps and save them as .dat files in a newly created PooledResources folder in your project.

                                          Link Preview Image
                                          HISE | Docs

                                          favicon

                                          (docs.hise.audio)

                                          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 @MikeB
                                            last edited by

                                            @MikeB said in AudioLoopPlayer load:

                                            It's not enough for you to throw me little nibbles

                                            Which part do you need? We've figured out how to get an array of audio file names, I've shown you how to use string functions to get the folders from those names, and you can use the same string functions with a slight adjustment to get the file names.

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

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

                                            12

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.2k

                                            Posts