HISE Logo Forum
    • Categories
    • Register
    • Login

    Audio Loop Player, Load Sample From Combobox Issue

    Scheduled Pinned Locked Moved Bug Reports
    6 Posts 3 Posters 338 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.
    • NatanN
      Natan
      last edited by

      Hey Folks

      Just Found this Annoying Problem That If I Select And Load My Samples From A Combo Box, Into The Audio Loop Player, The Start / End Of Sample Handles Wont Remember It's Last Position, After I Reopen My Project.
      And It Goes Back To Default Position.

      Is This A Bug?

      Here is The Code:

      Engine.loadAudioFilesIntoPool();
      
      // Loop Player
      const var AudioLoopPlayer = Synth.getAudioSampleProcessor("Audio Loop Player1");
      
      //My Combo Box
      const var ComboBox1 = Content.getComponent("ComboBox1");
      
      inline function LoadSamples(control, value)
      {
          AudioLoopPlayer.setFile("{PROJECT_FOLDER}Samples/"+ control.getItemText() + ".wav");
      }
      ComboBox1.setControlCallback(LoadSamples);
      
      1 Reply Last reply Reply Quote 0
      • callybeatC
        callybeat
        last edited by

        I have the same problem but using a knob, even in the preset the sample configuration is not saved when exporting the plugin echo the option to activate the loop is disabled because a function is missing but I don't understand which one
        😅
        this code is thanks to @MikeB 😎 :thumbs_up_medium_skin_tone:

        // Load Audiofiles into pool ----------------------------------------------------------------------------------------------
        Engine.loadAudioFilesIntoPool();
        //--------------------------------------------------------------------------------------------------------
        
        
        
        // const vars----------------------------------------------------------------------------------------------
        const var AudioLoopPlayer = Synth.getChildSynth("Sampler");
        const var Random = Content.getComponent("Random");
        const var Knob62 = Content.getComponent("Knob62");
        const var Next = Content.getComponent("Next");
        const var Prev = Content.getComponent("Prev");
        //--------------------------------------------------------------------------------------------------------
        
        // Array Samples in AudioFiles-Folder----------------------------------------------------------------------
        const var inst = ["sample1.wav","sample2.wav"];
        //--------------------------------------------------------------------------------------------------------
        
        
        
        //Knob1 Sample selection---------------------------------------------------------------------------------
        inline function onKnob62Control(component, value)
        {
            Synth.getAudioSampleProcessor("Sampler").setFile("{PROJECT_FOLDER}"+inst[value]);
            
        };
        Content.getComponent("Knob62").setControlCallback(onKnob62Control);
        //--------------------------------------------------------------------------------------------------------
        
        // Random Button------------------------------------------------------------------------------------------
        Random.setControlCallback(onRandom_Control);
        
        inline function onRandom_Control(component, value)
        {    
            if (value)
            {
                Knob62.setValue((Math.randInt(0, 70)));
                Knob62.changed();
            }
        };
        //--------------------------------------------------------------------------------------------------------
        
        
        
        // Prev-Button----------------------------------------------------------------------------------------------
        inline function onPrevControl(component, value)
        {
            if (value)
            {
                Knob62.getValue() > Knob62.get("min") ? Knob62.setValue(Knob62.getValue() - 1) : Knob62.setValue(Knob62.get("max"));
        	    Knob62.changed();
            }
        };
        Content.getComponent("Prev").setControlCallback(onPrevControl);
        //--------------------------------------------------------------------------------------------------------
        
        
        
        // Next-Button ----------------------------------------------------------------------------------------------
        inline function onNextControl(component, value)
        {
            if (value)
            {
        	    Knob62.getValue() < Knob62.get("max") ? Knob62.setValue(Knob62.getValue() + 1) : Knob62.setValue(Knob62.get("min"));
        	    Knob62.changed();
            }
        };
        Content.getComponent("Next").setControlCallback(onNextControl);
        //--------------------------------------------------------------------------------------------------------
        

        IBM Netvista A40 PIII 1000 MHz

        NatanN MikeBM 2 Replies Last reply Reply Quote 0
        • NatanN
          Natan @callybeat
          last edited by

          @callybeat said in Audio Loop Player, Load Sample From Combobox Issue:

          e the same problem but using a knob, even in the preset the sample configuration is not saved when exporting the plugin echo the option to activate the loop is disabled b

          If You Dont Call It Using Knob, Botton Or Combo Box, It Saves The Start/End States, But WIth Those Controls, Everything Gets Messed Up :/

          1 Reply Last reply Reply Quote 0
          • MikeBM
            MikeB @callybeat
            last edited by MikeB

            @callybeat @Natan

            I've noticed that too. But I don't need it in my current project, so I didn't pursue it any further.

            A possible workaround would be to put the loop position in knobs and then save them with the preset see snippet.
            The MagicNumber for loop on/off is 5 see screenshot - this should actually be saved in a button.

            HiseSnippet 1211.3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yyt.51lZFhdNAOgplXG22Hy6lW3de2dTUvnYi2Jy.uPo5aZ7ls8vxtcFLfDnJA6Rt67727qJXCkGjCESOTVCgFJEcGW8lbu5e9M4fkGBfmpoJaMueGJgYLT9P6PoAXGNF99CsEefPnzCUJk0yOcvmo6Db+TZSNiHSl1C6XybZ5ZRYTMcLo+jo230l8kY.SA4qS049g6VrB5R+qdEz2dLHUmO3dCaIWKGi8o5piN7yHLnjOi1Xax.7XlpPpMH2SvEwiDbZvzkRJIc3PhzF5y76YSkBJmKk7P+CHLBNwpl8i82EV0CKe8tgaQpn07mJttmqOzMEtd5lWu+aP7W8+mD+GHFq.Rz8vPgplJa+wQ8At2.BfDNmvzqB6TQuvW54l4zY8I7Pyg+B9K6xV5yNYW1J+x2JwHBGHEGGjtUptV9dFIv2M2PaWycO8Yuh8lccatdSfJOjdbPfNc+IsPnYayiV.a9zEvlGu.17jEvlmt.17YKfMabs1nmEs4XkHJsUDDzqi4eLvwoXDtSUzeadrsiK
            

            Bildschirmfoto 2021-06-21 um 08.04.48.png

            "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 1
            • callybeatC
              callybeat
              last edited by

              @MikeB said in Audio Loop Player, Load Sample From Combobox Issue:

              Snippet

              I love this Snippet I think it works for me a lot friend, I am seeing strange behavior with some samples smaller than 44100 samples, if the Star knob exceeds the number of samples when playing by accident it crashes Hise 😲 ., I can solve that by designing samples larger than 88200 samples not to exceed that mark is a somewhat rare solution but possible. The disadvantage may be for the end user when adding a sample less than 44100 or less 🤔

              IBM Netvista A40 PIII 1000 MHz

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

                Thank You, Dear @MikeB, Good Alternative Solution :folded_hands:
                I Discovered This Last Night,
                I Wish We Had This For Scriptnode's File Player :/

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

                45

                Online

                1.7k

                Users

                11.7k

                Topics

                101.8k

                Posts