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

      @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+JOPsbOvsbOfGvmxuxSb8rCnUZX6ObV4hfWKa30b4gmiE7VMGd2vcfuhGqqNwfsuzsmPCpgLLDXCqbYIq7nZtcknDB8lQrWA6qPhoZz3dMatAc6lMu8CWyCCCIZ5oLEcG5OQyRF1bDnyvVFUi0GvhhCAUq0mU9N1xWHy4JbWYzIxNxW2BUpDYlqQFEKEHQi0mJQllq4cm6P6QOiIzTsjZdDzA7nXftqR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+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
                                    • d.healeyD
                                      d.healey @DabDab
                                      last edited by d.healey

                                      @DabDab

                                      You have this B.setAttribute("OneShot", value);, which is not in the format Ulrik showed module.setAttribute(module.parameter, value))

                                      But in your case you don't want to pass value because that will be the value of the combobox, you need to pass either true or false.

                                      You should also use breaks after each case.

                                      You might find this document useful too - https://github.com/christophhart/hise_documentation/blob/master/scripting/scripting-in-hise/hise-script-coding-standards.md

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

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

                                        @d-healey I didn't find any help to switch between parameters like Normal and Oneshot. How to declare or write it?

                                        Laloo.jpg

                                        Where is oneshot or Normal parameter? Very confusing stuff. Either you guys are super genius or very bad teachers. One simple thing I am asking everybody is giving High voltage current 🤣 .
                                        Think and Answer in my Level. 🤣

                                        Need to switch between this laloo 2.jpg

                                        Bollywood Music Producer and Trance Producer.

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

                                          @DabDab see that thing in your png that says Sampler.LoopEnabled ......see if you can work out what that does...

                                          HISE Development for hire.
                                          www.channelrobot.com

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

                                            @DabDab
                                            You have to set Reversed true or false
                                            and Oneshot true or false, this will give you 4 different combinations

                                            HiseSnippet 1383.3oc4X01Sab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pw61oawmt.bgOVaEcqCdHSMzbDf6kVfyKbercGMC7zw6BSAuv068MdSGnnr8d85QcT4fcQ68e+8+zClP4GRfxSr6p.RIeFueZcT5Ldipp9GXFuf4dFuNRpmf31k86Fl8m0aFA4K43Z+i5wgpguHhOVrRQ9wz.JQo6zmu3R0O93WIEQAS50mdYbwxIRfWERElKjRnappkTDF1CNNw6Un4wuSjruNWkqYz2YFavgQ9vcOmS8zzfVVfx2FR020LmCHPyjKM2g3nT8DR78ML3arbsIj2XB4MmPdqIj2dB4mMg7yykSRnGPBzUF5AumfGeo4iGG1fND3HaXYSV+Qadhl7B3pnQo4XnXLYeWpRA2RgF6zTFU9AeUOI+WNV2ByGb+L+XihYXTOhsGcO94vWpfFMFeBzzqGIxSkocbViCDbQv.Am4L92EPcd+9ToI1m5ABFuB9rLWySqeL0iBitkq5Gq+FXLchb7O2uU4hZyetXV2WeucBbwZpN7+M5VV3+8cKmUp66R6UhgnKUekeO+P6X1crtY7+VP8XQjl9NqQmMzMrKLAfC0rm3B5g3Sjqpk0.pKk6FK7WvS5h0xZfpWrV1hHmrsBNao+c7H7VEnbc2j3g.8fVydlkzgvbFZHAM49hfRehiT7AmjefhFqKEqAPIO9+xUQ6Czx3Q+lDa6pqUE4C8p9fii9CgeBxvS2mMtC9r4cvmstC9r8cvmmcG7442Ae94Y5idLgFQJgeBIInnydIEVV6Mpvp.5uAb6GKn
                                            

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

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

                                            56

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts