HISE Logo Forum
    • Categories
    • Register
    • Login

    Changing the start point of the samples on reverse playback mode by code

    Scheduled Pinned Locked Moved General Questions
    35 Posts 7 Posters 1.2k 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.
    • Gabriel StroziG
      Gabriel Strozi
      last edited by Gabriel Strozi

      Actually, I'm struggling right now to simple change between Normal, One Shot, Reversed and Reverse One Shot. It seems to miss an attribute for that. It's possible to change between this settings by code?

      Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

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

        Use a different sampler and sample map for the reverse mode, then you can cut the samples exactly how you need them.

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

        Gabriel StroziG 1 Reply Last reply Reply Quote 1
        • Gabriel StroziG
          Gabriel Strozi @d.healey
          last edited by

          Use a different sampler and sample map for the reverse mode, then you can cut the samples exactly how you need them.

          I'll try it! And how can I switch between Normal and One Shot playback? I'm trying to use

          Sampler1.setAttribute("OneShot", value);
          

          But don't work. Any suggestions?

          Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

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

            @Gabriel-Strozi Try Sampler1.setAttribute(Sampler1.OneShot, value)

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

            1 Reply Last reply Reply Quote 0
            • Gabriel StroziG
              Gabriel Strozi
              last edited by

              @d-healey said in Changing the start point of the samples on reverse playback mode by code:

              @Gabriel-Strozi Try Sampler1.setAttribute(Sampler1.OneShot, value)

              Also didn't work. Nothing changes

              Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

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

                @Gabriel-Strozi You need to get the sampler as a child synth.

                HiseSnippet 1175.3ocyW0saaaCElJNJH1qKXsnWraFfPvtvAnKvtMMc.EC0wNNEFqIwvJqX2UvHQaSDIRARJu5MzGnc2dD1yvdR5av1gTR1TtFdNdsY0WXvyeje77KUeAOfHkbAxo5USSHHm645OkoF2YLlxP8NE4rm64XohH7xX0dZBVJIgHGmJuTyvo51Hyu2+h13HLKfLmEB8ZNMf7JZLUMma+V+HMJ5LbH4JZrk1G0pW.m0gGwSA7TwsAJAGbCdD4BrVssbQN6zMjp3BeEVQjfNs4gS8Gy+EVl9ulJoWGQzDMQ9vFkwF0YLMJrewcUhPNt8meyqjcyen64zP5L9y8.ekQf2bKr8ANasJH07V.IGKHscFjtuqefflnlKQimuvsGCBHCwfq1FJY5h152cb6vAMXpCiw2PNS.Dyrn9wMZ7HO3uCddsZf6Vp7lfEd933jHhno2O3Yh+GNhnLPzPUe+B46qMixhnLh2vTVfhxYdbV6TkhyZpOVAOpd.ONgy..7HXyiRIGT62pUsXKNTRTmnTB50oJR8YbujQ.21LKdds2AmTw8Pilh8r994m19Gn2p7yrCNJ5ZHco9hfA1IKfdAWQtjU2.nZuql2hhFNboxx2K.nKUrNOVrJCqyRiulHrcGZEg.c4rmcVurmfL2hkhbVOFUcYBIm9LdTnNqPu9Cy0P49UX0O06TrBqS+x4A5kPDJpFNNmRl.0uYIiUcOkHuQwSL5lGLfJIkQ5d4opYNeDMTaPdj.8VPMm+BNso5EgvBIdBoGquf.QPctK5CS9gxNdXZDVUtVT2zIW.3hKU.nSxYRpZpcSoaQAZiUVfttP79t8opfwKGiasDLBN+OEXLus1W51c3PRfZN.218redS6gs9G+2jc7Ov0WIH3XJaTdotAC0bKJ7+XLQIYsmn.YbQbbnO8WsT6Oa0NE7Qhxb+iVli5jXdJqzYki7AjDBVAgYKa1s0fAuTvSSVzp2+BSRwUBnEE3JrEj23y9N1Qvkxgv0wrWRaQ8SEiz9p4bFPlPDxx7tHMFh2LFIRpq3bzE5RhN9RCNGC8deqs1lSowUXSLFFyZnat.8iWf9IKPezBzOcA5iWf9YyoybnmiSzYF5w7KzUb20qqHrA8wvU1Ry1zQy17LNkaeXo5LetAWVOpvmnTPHSZo6RlduympGTr85UL9uzv+y+1qkd+S0BL5S0QutrIPYKvQiwG.ygFhSiTEbK2B4bNimLlynAkKRfj9QiHBaruzKD7zDnFcNmG1Z.IhfkVU4eaqWAu+AKJW6eq7E292Btz30W6lAWOceOu+Kws6zzrUNhrxZMh7iNd27wk2ott8xGb5AmtP8Ydb9dtlV8d5Iy+eA0A7Tc66hodtvnQe34.AD6AjaoG5lQ2PSqAjOgEZH9a3WtvlESS0BaVHDETrUvcKes4U0NUHL8zDyK+hf4zQ1ozR3QGZHAS7tSPYLNPveSP1Wjnw5tFN.JYlOvtJ7k9.sWSj4qT.6babXCTLLq5MAA5BguC7vK2lGuA17jMvli1.ad5FXywafMOaCr46WoM5mIbRphGm0jDXzuaVhkS2YIVUP+Cn97DG.
                

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

                1 Reply Last reply Reply Quote 0
                • Gabriel StroziG
                  Gabriel Strozi
                  last edited by

                  It worked! Now I just have to cut the samples and create new SampleMaps for the reverse Sampler.

                  Thank you so much!

                  Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

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

                    @Gabriel-Strozi Don't cut the samples. Just duplicate your sample map and rename it, then shift the start and end times inside HISE. That way you won't have to use extra disk space or RAM as it will share the same samples.

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

                    1 Reply Last reply Reply Quote 1
                    • DabDabD
                      DabDab
                      last edited by DabDab

                      @d-healey How do I use both Sample Start End Knob and OneShot/Normal button?
                      If I use const var Sampler1 = Synth.getChildSynth("Sampler1");

                      Start End Sample and Samplemap CB Not working..

                      If I use const var Sampler1 = Synth.getSampler("Sampler1");

                      Normal/Oneshot not working.... How to compensate both scenarios?

                      Bollywood Music Producer and Trance Producer.

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

                        @DabDab name them with other names

                        const var SSynth = Synth.getChildSynth("Sampler1");
                        
                        const var SSampler = Synth.getSampler("Sampler1");
                        

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

                        DabDabD 1 Reply Last reply Reply Quote 1
                        • DabDabD
                          DabDab @ulrik
                          last edited by

                          @ulrik Ok.. got the logic.. :) (y) Thank you.

                          Bollywood Music Producer and Trance Producer.

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

                            @DabDab or use the asSampler function

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

                            1 Reply Last reply Reply Quote 1
                            • Gabriel StroziG
                              Gabriel Strozi
                              last edited by

                              Getting the sampler with the Synth.getSampler("Sampler1") you can change between Normal/Oneshot using the parameter ID from Module Browser instead of using the parameter name:

                              Sampler1.setAttribute(10, value);
                              

                              The Sampler parameters are:
                              e2992980-ba47-4f92-a0ee-e041c9c7dfc3-image.png

                              It worked for me as well.

                              Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

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

                                @Gabriel-Strozi said in Changing the start point of the samples on reverse playback mode by code:

                                parameter ID from Module Browser

                                The reason you shouldn't do this is in case the numbers are changed in the future.

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

                                Gabriel StroziG 1 Reply Last reply Reply Quote 1
                                • Gabriel StroziG
                                  Gabriel Strozi @d.healey
                                  last edited by

                                  The reason you shouldn't do this is in case the numbers are changed in the future.

                                  Makes much sense! It's a relevant reason!
                                  Let's rewrite some code hahah

                                  Brazilian composer, music producer and mechanical engineer. Working in a steel idiophonic instruments sampler.

                                  1 Reply Last reply Reply Quote 0
                                  • DabDabD
                                    DabDab
                                    last edited by DabDab

                                    I am having an issue. I am little weak in Sampler stuff. My Two questions are how can I switch between Noram, OneShot and Reverse mode via ComboBox.

                                    const var A = Synth.getChildSynth("Sampler1");
                                    const var B = Synth.getSampler("Sampler1");
                                    const var ComboBox1 = Content.getComponent("ComboBox1");
                                    
                                    
                                    
                                    inline function onComboBox1Control(component, value)
                                    {
                                    	switch (value)
                                        {
                                              case 1:
                                              B.setAttribute(10,value);
                                              case 2:
                                              B.setAttribute(13,value);
                                              case 3:
                                              B.setAttribute("Normal",value);
                                        };
                                    	
                                    };
                                    
                                    Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
                                    
                                    

                                    Compiled OK. But Once it's changed nothing happened via ComboBox.

                                    how to fix it? What have I done wrong?

                                    And what is the value for Normal mode?

                                    Bollywood Music Producer and Trance Producer.

                                    1 Reply Last reply Reply Quote 0
                                    • Matt_SFM
                                      Matt_SF
                                      last edited by Matt_SF

                                      @DabDab Check the posts above : you have to write it like this :

                                      module.setAtrribute(module.parameter, value)
                                      

                                      And don't use the magic numbers.

                                      EDIT : Corrected.

                                      Develop branch
                                      Win10 & VS17 / Ventura & Xcode 14. 3

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

                                        @Matt_SF said in Changing the start point of the samples on reverse playback mode by code:

                                        @DabDab Check the posts above : you have to write it like this :

                                        module.setAtrribute(module.parameter(name, value)
                                        

                                        And don't use the magic numbers.

                                        I think it's this way

                                        module.setAttribute(module.parameter, value))
                                        

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

                                        Matt_SFM 1 Reply Last reply Reply Quote 2
                                        • Matt_SFM
                                          Matt_SF @ulrik
                                          last edited by Matt_SF

                                          @ulrik Haha yes you're right, my bad. :man_facepalming: I was not completely awake...
                                          @DabDab listen to what Ulrik said.

                                          Develop branch
                                          Win10 & VS17 / Ventura & Xcode 14. 3

                                          DabDabD 1 Reply Last reply Reply Quote 0
                                          • DabDabD
                                            DabDab @Matt_SF
                                            last edited by

                                            @Matt_SF @ulrik Not very clear to me though...

                                            To be precise here is my Snippet...

                                            HiseSnippet 1343.3oc4X80aSbDDeu3bT7UREfPp8kJsJpOXjRC1g.TUTEN1IA4BIXEGn8Mzl6Fauh618zd6kfKhuS8iP+Hw2f1Yu+3aswI3FUnn16kjY1Yl82N+OouR5CIIREwo9wShAhy0bGLQnG2cLiKH81k3349yoI5igDMoyjXVRBDPbbp8Xy4N0Wkj88tG0gExD9PEKB4ERtO7TdDWWwse6mvCC2mE.Gyirjd6187khtxPYJhkZtMIwL+WwFAGxLhshKw4J6Ev0R0.MSCIDmU6HClLXr7LQt7ufmvOIDLDsHCPCkydeYXfAwFtjti4gA8KeyIDhia+JOPsbOvsbOfGvmxuxSb8rCnUZX6ObV4hfWKa30b4gmiE7VMGd2vcfuhGqqNwfsuzsmPCpgLLDXCqbYIq7nZtcknDB8lQrWA6qPhoZz3dMatAc6lMu8CWyCCCIZ5oLEcG5OQyRF1bDnyvVFUi0GvhhCAUq0mU9N1xWHy4JbWYzIxNxW2BUpDYlqQFEKEHQi0mJQllq4cm6P6QOiIzTsjZdDzA7nXftqRFGf9YpdLSSOCSunImw09io4WM8.Y.jXT5YB.iHZ5FzCkpHV3FTlHfdDbJnR.yUvEgbAPGlJ70bofZxHK.gAiJYXC+R.tA9LBSgaul2aVyqdwM1njGE+dS9Ox+7YI.s0OZyh1YyDPuiVq3mjpgFqWfu0KM8CeOCr0EZfBW8l4uN9uAAmukt6RYoBeSkcn4Z8Vzf0Wy6sYAlOX3yX6B+WWVX3IXkci220Z.okm+PoFdlnws8diWcu25Qm+ngCW3YEFyj5sniMccTWjhMDoQm.pxGbofX42r02tme8sc6G+beikfRQOAW+rXPbdU8jBGpo9u.Unn5rp+qWT8W57H7.Sw+TeIIC11MlIOu2tLMqzXncw6JFTZt4Y3rKbJ1kNu0Rc2cgjWokwYxVDIINewRd0ut5ZOt8jJhmzNhgm45TCIhKen8BLyVJ6NP3ZHBwyW6hEAmwl3Uj44kmKiCNduFgX6XYPZHSOaOZyfohCv.6LMCMM7DIb8Da+yGkF2KKbugaeSeiEi2UV.dwv3Ga7VLFbM28FND70UfcU28+0O9y7rgx2lCka5NPq.VDWLpHeoXyjoYO+CrYR7RuYReEDJYACvFrUh8Gs6jh9K0rb+81YW0NQxTwL2UAxOBhAl1Lfp5vq19nidrRlFOuVu6QYIKGqv9mnqv9fhIG1r5pjIICwmSlsRre98SUiL9pJNk84s4cXZDF6EBHzztywAY87DvDq49GvvIEu1V5rao4wrr3MttVFcq4n2ZN56NG81yQeu4nu+bzOnhN2gd.K1jYXVWbt90dKW+Zz.8Y3S1RxN7QSMdNmpD3ljot4LnXsO5uvNEFhMurrz.Pqw.WhEq40ZA6.dkOqWQ8SWi4ZKGb+.aQWuDilkGCg8DmhEyHGCFuIN+aHKMTWxc1FKGHEx3wRA2e1RGrTXzHPYi8E9fv0qvJ2JN2p8QPHfKiUw56Z+TbATlZ1NB+s7EsVdewEEu9F2b3RMcCo+2XfZs+2OP8hbceUw3TJd6J8m4w4q4lM.fZlW+uETORlZZmWNKzEGXN.WRvGrGathYe9b5lFZCfF.hfLh+D+JNrU4LVygsJOj3WZJ7sU76Yay6TCDlQGY6IFhSuCsSoSvUQLPBmC9IAkQLek7k94+sJFrd0LNHJEY+6ap6dfglN8OOw0s4lMIQ3rpW56aJD9dzCuXc15RnycuD5r8kPm6cIz49WBcdvkPme3B0wrlvNoZYTdSRjQ+8xSrb1aZhUMxeUebkAH
                                            

                                            Can you correct me?

                                            Bollywood Music Producer and Trance Producer.

                                            d.healeyD ulrikU 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            48

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts