HISE Logo Forum
    • Categories
    • Register
    • Login

    AudioLoopPlayer crashes

    Scheduled Pinned Locked Moved Bug Reports
    6 Posts 2 Posters 245 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.
    • MikeBM
      MikeB
      last edited by

      Maybe a little bug?

      in this example samples are loaded via a knob into the AudioLoopPlayer.
      There are 6 samples [0-6] in the array.
      If I set the knob to min 0 and max 7 it tries to load the 7th sample.
      So by mistake one sample more

      HISE crashes mercilessly and the file cannot be opened anymore.

      The AudioLoopPlayer can not catch this error with an error message

      HiseSnippet 1533.3oc4XstaaaCEVJNJq1qYncq+X+jvXCPFsNwt21v15pyEmgrF2XDmVTfhhLFIZahJQJPQmVut.rGk9nr2f8JrGg8FrwKRVRtxWpWcxvl.BPN7vCOe9b9Nj7v1LpCJLjxLLKd7v.jg4Us5Ljv6uSeHlXr+tFleoUsaW8wnWyq1lgNq5QPhK0Gr0.WL8.JMnsGbHhYr8v.XXHx0vzrvOHM0r3pFpu+7gaC8fDGTxPFFOkhcPGf8w7jQa23QXOu8ftniw9ol8caruCkrC0iNP.yBV0LBfNuD1C8XnbZqXYXtVSWLmx5vgbTng4paScG1oO8UD87eJNDepGRJT2niXgzCuG0yUhX4nF6zG641NNbDZXXZ0NI3TPGbtgUKrKdz3IAoqoT.RrHc7vbkoAu5ogWs4Gdlof2pZ3ccqNNLb.OQiDaer09DNh0EJRAogkdtFq7KW0ZGpXFD9F9vWh1iIDFYg88qU6Vf6UqVkuc8RqWZyMAGPgt5zeWrGJDfIbJHfR8.UWpeqWpIoGlf1vS..k+2S5eARosEd2VBvM2r5EzmLXDEPDjyPN3LHKbY6xQdZ7xu5fG.TksazCwUTEkjcY07.xIBhlYYYbJYghJme.HlBHW.pe.kHDrKqUOlMOhPOs9DMQocLKjaeLQCjJGa9xcZl37kJKewmsEY5sXL3PPGnefl3CRngUUUqrO7YZr7ed.34k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WODKM1y8GzVbtfOm9niiPdHXXJR6Wz3.wEagrwKGdOhE0m+XwzxWetkFt.Y0K3+FmBT3+mmBbDc.WrKZKnfnJ2K6wC76H170AIPBgf7j2K1bE48+zx0h2OqCh3pD9KwWjx5RYyHk0iUdg3CenCidhi9RpRt7UTiH9cST6aWzpkTFL5ZwVV01nlXubW7INNxvc05FF4aysW.atyBXycW.at2BXy8W.a9pEvludp1HOLZqAbputTTLP6lp1DLMGcFtYAi+157BCL
      

      "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

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

        Friend in the code that I adapted from your example I realized that it does not actually load without setting the knob to the number of samples, but it does not send me an error, it just does not load the sample and it does not block Hise in my case, it sent me an error when I wanted to rewrite the samples by typographical error but nothing else
        🙄

        Here I leave the lines that have been modified so that you can evaluate the changes..
        :beaming_face_with_smiling_eyes:

        // 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 = ["sample01.wav","sample02.wav","sample03.wav","sample04.wav","sample05.wav","sample06.wav","sample07.wav","CBsample2.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, 5)));
                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

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

          @callybeat said in AudioLoopPlayer crashes:

          Friend in the code that I adapted from your example I realized that it does not actually load without setting the knob to the number of samples, but it does not send me an error, it just does not load the sample and it does not block Hise in my case, it sent me an error when I wanted to rewrite the samples by typographical error but nothing else
          🙄

          You are on Windows or Mac?

          "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
          • MikeBM
            MikeB
            last edited by

            I have added the line to my example:
            The knob must be set to the number of samples - here 0-5.

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

              If the knob only adjusts it to the number of samples in relation to the number of samples in the audio files folder, but the code works very well, just do not modify the random function, I do not think I put it in the plugin

              by the way I am working under Win10

              :beaming_face_with_smiling_eyes:

              IBM Netvista A40 PIII 1000 MHz

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

                Yes - The random function must also be set to the number of samples - here 0-5
                Knob1.setValue((Math.randInt(0, 5)));

                "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
                • First post
                  Last post

                55

                Online

                1.7k

                Users

                11.7k

                Topics

                102.2k

                Posts