HISE Logo Forum
    • Categories
    • Register
    • Login

    How to use KeySwitch to trigger sampling?

    Scheduled Pinned Locked Moved General Questions
    24 Posts 5 Posters 379 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
      last edited by

      What does the key switch do? Is it to change the sample that you hear or something else?

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

      CatABCC 1 Reply Last reply Reply Quote 0
      • CatABCC
        CatABC @d.healey
        last edited by

        @d-healey To change the sample you hear

        //I am a new student at HISE._
        //Windows11 & MacOS Ventura 13.6.7_

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

          @CatABC In that case you need to trigger both samples together (probably in two samplers) and use the key switch to control the volume so that you only hear one at a time.

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

          CatABCC 2 Replies Last reply Reply Quote 0
          • CatABCC
            CatABC @d.healey
            last edited by

            @d-healey Thanks, I'll give it a try.

            //I am a new student at HISE._
            //Windows11 & MacOS Ventura 13.6.7_

            1 Reply Last reply Reply Quote 0
            • CatABCC
              CatABC @d.healey
              last edited by

              @d-healey I tried this, but when I switch to the second Sampler, the sample does not start playing from the beginning. What do I need to do to make the sample I switch to play from the beginning?

              //I am a new student at HISE._
              //Windows11 & MacOS Ventura 13.6.7_

              ChazroxC d.healeyD 2 Replies Last reply Reply Quote 0
              • ChazroxC
                Chazrox @CatABC
                last edited by

                @CatABC are you trying to achieve a mix fader effect between two samplers triggered by a midi event?

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

                  @CatABC said in How to use KeySwitch to trigger sampling?:

                  but when I switch to the second Sampler, the sample does not start playing from the beginning.

                  You don't need to switch samplers. Both samplers are active at the same time. The keyswitch changes the volume of the samplers so you only hear one at a time.

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

                  CatABCC 1 Reply Last reply Reply Quote 0
                  • CatABCC
                    CatABC @Chazrox
                    last edited by

                    @Chazrox Ah, I don't quite understand what you mean. I'm making a bowed string instrument and I want to be able to use KeySwitch to transition between multiple articulations on a single MIDI note.

                    //I am a new student at HISE._
                    //Windows11 & MacOS Ventura 13.6.7_

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

                      @CatABC Do you want each articulation to start from the beginning of the sample with a fresh attack?

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

                      CatABCC 1 Reply Last reply Reply Quote 0
                      • CatABCC
                        CatABC @d.healey
                        last edited by

                        @d-healey Yes, I mean when I switch to the second articulation, the sample of the second articulation does not start playing from the beginning

                        //I am a new student at HISE._
                        //Windows11 & MacOS Ventura 13.6.7_

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

                          @d-healey Yes, I want each articulation to start from 0

                          //I am a new student at HISE._
                          //Windows11 & MacOS Ventura 13.6.7_

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

                            @CatABC said in How to use KeySwitch to trigger sampling?:

                            the sample of the second articulation does not start playing from the beginning

                            @CatABC said in How to use KeySwitch to trigger sampling?:

                            @d-healey Yes, I want each articulation to start from 0

                            lol make up your mind.

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

                            CatABCC dannytaurusD 2 Replies Last reply Reply Quote 1
                            • CatABCC
                              CatABC @d.healey
                              last edited by

                              @d-healey
                              Can I set it, set it to 0 in onNoteOn, but I don't know how
                              e1428a85-9cb3-4f7a-9851-f6ed76621609-image.png

                              //I am a new student at HISE._
                              //Windows11 & MacOS Ventura 13.6.7_

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

                                @CatABC When they press the keyswitch you need to turn off the old note and play a new note. The stuff I said about changing volume doesn't apply if you want the samples to start from the beginning.

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

                                1 Reply Last reply Reply Quote 1
                                • dannytaurusD
                                  dannytaurus @d.healey
                                  last edited by

                                  @d-healey said in How to use KeySwitch to trigger sampling?:

                                  @CatABC said in How to use KeySwitch to trigger sampling?:

                                  the sample of the second articulation does not start playing from the beginning

                                  @CatABC said in How to use KeySwitch to trigger sampling?:

                                  @d-healey Yes, I want each articulation to start from 0

                                  lol make up your mind.

                                  @d-healey You may have misunderstood. I think these are 2 separate things. The first is what happens when the OP tried your method, which is not what they're after. The second is the result he's actually trying to get.

                                  Meat Beats: https://meatbeats.com
                                  Klippr Video: https://klippr.video

                                  1 Reply Last reply Reply Quote 0
                                  • dannytaurusD
                                    dannytaurus
                                    last edited by dannytaurus

                                    Your requirements aren't very clear.

                                    I understand you want the original sample to play when the note is played, then when the key switch is activated you want the second sample to play from the beginning.

                                    But what do you want to happen when the key switch is released?

                                    Do you want the original sample to [1] no longer play (meaning the second sample cuts it off) (I just read in your original post you want "continue to play the sound of the original key position"), [2] the original sample continues to play form wherever it would be without the key switch interaction, or [3] the original sample plays again from the start?

                                    Meat Beats: https://meatbeats.com
                                    Klippr Video: https://klippr.video

                                    CatABCC 1 Reply Last reply Reply Quote 1
                                    • CatABCC
                                      CatABC @dannytaurus
                                      last edited by

                                      @dannytaurus Thanks for paying attention to my question. I am still working on it. I will break down my logic:

                                      1. I mapped KeySwitch to C0-B0, default key position (such as C0 Sustain)
                                      2. Write a note C3 in the MIDI track
                                      3. Start playing C3 of Sustain
                                      4. The C3 note continues, and I write a KeySwitch on D0 (D0 is Tremolo)
                                      5. The sample of Sustain fades out, and the sample of Tremolo enters
                                      6. All MIDI ends, and the KeySwitch stays at Tremolo of D0. When there is no new KeySwitch trigger, the notes written afterwards are all "Tremolo"

                                      //I am a new student at HISE._
                                      //Windows11 & MacOS Ventura 13.6.7_

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

                                        @CatABC if I understand you right, you want to fade between several sound sources.

                                        This snippet will show you one way to do it, however keeping several sound sources activated will produce 3 voices when pressing just 1 key (one is sounding, the other 2 has a gain of -100dB)
                                        I don't know if it will give you any problem doing that, I suppose it depends on how demanding you project is on the cpu?

                                        HiseSnippet 2419.3oc6a01aSjjDdljLrXytHX0dZWcepk08AmEiW+Rdc41EGRbfHHIdwA3PHDamYZa2Ji6dtYZmPNDRmteY7o6y2Og6mv9OfqptmwdlDmPHh2OGgbltppqt5ppt5mZhoUnzkEEICsryuygALK6u1o8gBUuU6Q4BqMVyx9pN2kcXzAbkaORGpGKx5VGFPihXdV11SeaTL6byXo+4Ot4sn9TgKaDIKqGJ4tr6w6yUin1pwc499qCpaGd+TROWiMbkhUk9xAfIMsSEq.p6dztrsnnXS4XcGZTOK6ezY9Z0cmyaQuZ0le4EboKvVtCsSmp08latEVZ4p0WlN2RKvpLuk8EZ5wUxv1JpBLd6Ytkz6v18jGHLKvC4Q7c8Y3fpVsgU1PdcouGtEQpVq1i660JwWEYYY6zZjmaZim66b1j6wGRejG7JZFjQyHsCzdprl2zYLupoMuJoLuwXR1oLoYLlzUcZ6FxCTi3f1ykb1PnXgcnPbJsoXj0x9UNqJAADpx8o6wVODFLbBEWnRkRjZUpL6M5LP3p3RAQJ1RpXaKJNa9WjOW9WlmbTVc5LVd3xDJ88YgikMlZDdZSrnXP+cYgkH6S8GvFJHr8y5ScNYeZ5PtqYWmRPoXCAWsc.SbRIBVwtJ3oGrwZTEECDwz.4BXgJNZB1qw1GNFXBK4bViEsmRF.YzqJ6GHEnFryqzb+l3f18n6x7s3Pn4xooT054oOccX5AGv8T8FR3U+qF8X7t8Rct6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HxpZCoLRg9j0kg8SI2EajPrVZhPNYFkAiynoM4o9VW8euYSA904pMC14daG4BNFLIOcRaqA9QL8wwpom3Hx0RS9NzPOH3499+kMdgInQ+PhFs9DznSPi9kEZz5SPiNAM5DznedfF8L6F..NeZGo9dG.nUMhtPM4iSk5uTZe3CwZzm5FJeV72BUr96E0T.eqP++kobNahiIUsze6ZRGv5CfNelqaVUcrIV67Nw5m2IN24chyedm3Bm2It34chK8lmH1SvJCTx9lyePuQsZp+pIYaaZKReTz5+ATu7FKB
                                        

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

                                        d.healeyD CatABCC 2 Replies Last reply Reply Quote 0
                                        • d.healeyD
                                          d.healey @ulrik
                                          last edited by d.healey

                                          @ulrik said in How to use KeySwitch to trigger sampling?:

                                          if I understand you right, you want to fade between several sound sources.

                                          Link Preview Image
                                          Make the Gain knob smooth the gain?

                                          hey guys, i want to make the value of this knob smoothly gain from -100 to 0 (-100, -99, -98...-2,-1,0) instead of going directly from -100 to 0, how should ...

                                          favicon

                                          Forum (forum.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
                                          • CatABCC
                                            CatABC @ulrik
                                            last edited by

                                            @ulrik Thanks for the help. I implemented this function using a timer loop, but I think the CPU pressure will be very high.😂

                                            //I am a new student at HISE._
                                            //Windows11 & MacOS Ventura 13.6.7_

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

                                            28

                                            Online

                                            1.8k

                                            Users

                                            12.1k

                                            Topics

                                            105.2k

                                            Posts