HISE Logo Forum
    • Categories
    • Register
    • Login

    Make the Gain knob smooth the gain?

    Scheduled Pinned Locked Moved General Questions
    72 Posts 3 Posters 881 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.
    • CatABCC
      CatABC @d.healey
      last edited by

      @d-healey Emmm, forgive my stupidity, I don't know how to use it. Should it be in the ScriptProcessor of Sampler1 or in the ScriptProcessor of Sampler2? How can it fade out the samples of Sampler1?

      //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 It depends on exactly what you want to do, but it should probably go outside of both the samplers.

        In the on note on callback you need to store the ID of each note in a midi list.

        Then when you want to fade out a particular note you can retrieve the ID and add the volume fade.

        If you only need to handle one note at a time (monophonic) then you can probably skip the MIDI list and just use a reg variable.

        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 CatABC

          @d-healey
          Thanks David, I tried a lot and I'm now clueless again,
          I think my logic is very confusing now. I hope to complete the KeySwitch switching on an uninterrupted note. When the new KeySwitch enters, fade out the sample of the previous Sampler and fade in the sample of the new Sampler. I hope that the faded-in sample is played from the beginning.
          Keyswitch.png

          so I made a snippet, could you help me with this?

          HiseSnippet 2326.3oc6aszaajbDdFJM1lzO1GYQPPNDzQHGnhYnHodGkEVun7JXIKESY4cgwhMiloIYCMr6IyzTxDF5XNji4ePtkqAA4PNt+.BxOh7Kv2xgbvopoGNOjHoFQ30aVYQXQntptq9qqt5p+pVv66Irn99BOM8BGzykpoeOiF83x1az1jw01dSM86Z7DZuFmxjVs0VumqouO0VSWehGicPO+jZAedyiV2zwjaQiEoocnfYQ2g0gIikt+pOg43rkoM8.VmD8dtU21Rv2P3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sF3a3K3G.+CpLv9FavEBd1PpBrPXXAOcXQxJUg5OGly8BaVb7Eoxew0EGABppv2SUcZ7tppyQkbZrpt68GWrIxFghK4UVy2GiMXcbcn04m.oP.IHF+TivRp5KMcltcEbgaaAmYkLQ5ynROVqVTujXefKn0jRnlrXIe1pOiBY9RxW3Wr5NPxRSucC31OV9hpY2WLp8qehgBtjf2K65AG5I9vjC8yDcwGTYWSHPEJAy.xL1.ntZQCKyFyunmCyDnZWAaq3txsCZfu+QnxpXa8PkU6qbb4oWaX7z+c+1m+29PgmNbjYhwJc+P4oeIjhuVwYu1O.3r+lG88Mm8ZCjy9+MmA4JRZmbAV6C4O1wkxWOegQwWejz0ggdUIqmUt5CjpdFYpmBVijj9kyQeroneEXnGSPOev2i3u1x6UZ12vw9CHN10tgi8Mbrugi8Uii8cTK2aa7TAyu+AqfeOCuAN4k+i+56dt0uq4vt2ITuSXzS+PhK6r2vkMCbYmcfbYm3cv6OO9u870Npr3aNeckMaFe13qLi1a3zdCm1.oydCm1qSbZycCm1uq3z99XN5XZ4I9FKUlSLV9NARf0MO3+sB4M1EaSpdQVJc.9BeikUZScgAVabG3ri6.mabG37i6.WXbG3hi6.W5xGHRmastRQG0QVMsc2udvUQ5504HWofSGZ+OhPWPzA
          

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

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

            @CatABC You don't need to put the midi processors within each sampler. Just use one below the interface script. You don't need a loop in on note on.

            Start really simple.
            Make a practice project with only one sampler.
            Every time you play a note the previous note is turned off.

            Once you have that working we can start getting more complicated.

            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 CatABC

              @d-healey When I only use one Sampler, it can achieve that when the second note appears, the previous note will no longer sound, but when I add a second Sampler, it needs to be triggered at the same time with the KeySwitch below, which makes the script completely illogical and gives me a headache.

              //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 said in Make the Gain knob smooth the gain?:

                When I only use one Sampler, it can achieve that when the second note appears, the previous note will no longer sound

                Share the snippet you have made for one sampler and we'll go from there.

                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
                  This is my method using only one Sampler, I used artificial notes

                  HiseSnippet 1352.3oc4Ws0aaTDEdVaOHrSnkhpP73REOjhJQdcb7EPQ04hcZTqaCYcaAwCUS1cV6QY8LK6NaRrphTE+R3m.Oxi7Sp+CfyryZ60tNEWqREB1Ghx41b9lybt4iCENznHQHxnTuQATjw5X6Qb4f8GPXbzQGfLVC+P5H6KXRmAn8FEPhhntHCi7GpTvnXATx2qu+dDeB2gNkEB8LAyg9H1PlbJ2ia8PlueGhKsGaXFsq15HGAeeguHF.SdbYT.w4LRe5iIJ0xgQOfDM.Y703sqrkSU25tUprcyZNjZzldDOOqsbqVsVilVa0jTsQMZ4sQFeTaWlTDZKIRZDxnvdB2Q1CDWv0N3YrH1o9TEgExF7rlcGguq5Jp3h1e.y283wQoHDx.e7zXVdcL613tLW1D9SiceZh.yoVjM.ZjaV3keF3YkEdky.uE.IiLPpfFR2Ba6DxBjSkneKOhKogdD3cJKTz5hx8JC79BPCtbygjyncBAhIVrQsxkumI7m69ckJUJj12jdNn4QtQl6X9MVJlvmWL2QxDbSA+wBI8I7MtaoWVpHyaiIZ+kJ0uaoh.6hIIaaxUZ54s2n1ZclnK3phWUrTwLdpKbcfzhD.tanj4wbXD+M.Mupj47d2yah6uN6L2YmIWjTPM28p3U.u4NcUXJT36SC0NXNwpb6EKI0vM3wCOkFdOyyI9wzIJBueylTfu9jhr4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pFbtaL7yNzkrHDrUdxOxwvnMm.Y7IUGn+Bn0aimN
                  

                  //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 You can use Message.getEventId() to get the event ID if you don't want to make the note artificial.

                    Now modify this script so that when you press a keyswitch key (whichever key you want), while another is held down already, it turns off the note that is held down and plays a new note of the one that was held.

                    For example, if you're holding down C3 and you play C0, you turn off C3. Then you play a new C3 note. - And you ignore the C0 note.

                    All of this in a single sampler, for now.

                    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
                      When I use Message.getEventId();, and play two different notes, the previous note does not close.And I don't know how to convert the events into notes🤡

                      function onNoteOn()
                      {
                      	if(eventIds != -1)
                      	{
                      		Synth.noteOffByEventId(eventIds);
                      	}	
                      	eventIds = Message.makeArtificial();
                      
                      	if (Message.getNoteNumber() == 36)
                      	{
                      		
                      		Message.ignoreEvent(true);	
                      		Synth.playNote(60, 20);
                      	}
                      	
                      }
                      function onNoteOff()
                      {
                      	if(Message.makeArtificial() == eventIds)
                      	{
                      		eventIds = -1;
                      	}
                      
                      	if(Message.makeArtificial() == 0)
                      	{
                      		Engine.allNotesOff();
                      	}
                      	
                      }
                      

                      //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

                        This returns an event ID that you need to store, so that you can turn the note off when the key is lifted. Otherwise you'll get hanging notes.

                        Synth.playNote(60, 20);

                        @CatABC said in Make the Gain knob smooth the gain?:

                        if(Message.makeArtificial() == eventIds)

                        Here you should use Message.getEventId() instead of makeArtificial

                        @CatABC said in Make the Gain knob smooth the gain?:

                        if(Message.makeArtificial() == 0)
                        {
                        Engine.allNotesOff();
                        }

                        What's this meant to do?

                        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

                          Synth.playNote(60, 20);
                          

                          The 60 here should be the note that was pressed before,

                          Synth.playNote("eventIds's note", 20);
                          

                          I can't stop the artificial notes

                          
                          function onNoteOn()
                          {
                          	
                          	if(eventIds != -1)
                          	{
                          		Synth.noteOffByEventId(eventIds);
                          	}	
                          	eventIds = Message.getEventId();
                          
                          	if (Message.getNoteNumber() == 36)
                          	{
                          		
                          		Message.ignoreEvent(true);	
                          		
                          		Synth.playNote(60, 20);
                          		
                          	}
                          
                          }
                          
                          function onNoteOff()
                          {
                          
                          
                          	if(Message.getEventId() == eventIds || Message.getEventId() == Message.makeArtificial())
                          	{
                          		eventIds = -1;
                          	}
                          	
                          	
                          }
                           
                           
                          

                          5505e20b-18d0-4802-82b3-4495df412210-image.png
                          In this case, the D3 note cannot be turned off

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

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

                            @CatABC said in Make the Gain knob smooth the gain?:

                            Synth.playNote(60, 20);

                            You need to store the ID of the note in a variable so that you can turn it off later.

                            @CatABC said in Make the Gain knob smooth the gain?:

                            Message.makeArtificial()

                            I think you're misunderstanding the purpose of this function.

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

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

                              @CatABC Here's a basic example using a sine-wave generator.

                              I've put everything in the interface script but in a real project it should be in a separate MIDI processor.

                              HiseSnippet 1122.3oc2Ws0aZbDEdVr2ntj1nlpnp73Vo9.T4ZAXLwnHqXaL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CatZit4mHxH+RtgcyOAW5+2yX0mvI+buKwYFF6yGEF.sEiw65PNFL9U39LeZbfdF27M1ckBY3PofyxV0u.zJ9fAfJK1WZ.cnViOebAmmcvEP.Py1A+sGbJ14QUXdBVybwC+MZKsd8b6T35ZlFc+u6F6M9+8F6KjwZtXPWJ1D9K3eJ.eHTebQICPuKDP.ZbaqBlkcozULzoaJEdID+A9Y5gUMzVSOr5rC+WwGinLk7crz2FY5S+rDNXbKR9uVN3e5CocqRRduT1Z4HbK26Xr7l5NJVacUbm0Uw5qqh6ttJ1XcU7Eqqh68Wqn4RnCi0xQoilDR2dsSdfokUaAE6xSlHH+IYKulm
                              

                              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 @d.healey
                                last edited by CatABC

                                @d-healey
                                I tested your snippet, but in this case the second C0 triggers the playing of C2 again, is it possible to not trigger the playing note when there is no note above?

                                a148739a-fa1d-45fb-b89f-0de9484836c3-image.png

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

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

                                  @CatABC said in Make the Gain knob smooth the gain?:

                                  is it possible to not trigger the playing note when there is no note above?

                                  Yes, this was just an example to get you started. Synth.isKeyDown() might help here.

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

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

                                    Have you messed with scriptnode fx at all? This seems like its pretty simple in scriptnodeFX. You can rig as many samplers as you need and trigger them with built in X-Fade nodes and so much more.... ??? Skim thru the documentation for the entire scriptnodeFX section and see all the stuff you have at your fingertips!

                                    Link Preview Image
                                    HISE | ScriptNode | Scriptnode

                                    An introduction to scriptnode

                                    favicon

                                    (docs.hise.dev)

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

                                      @CatABC for example....

                                      wanna fade between 3 samplers that start at the same time?....different times? You can do that too...either way check this method out. The fader node has different fade modes, blend & switch modes.

                                      Screenshot 2025-07-07 at 6.45.45 PM.png

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

                                        @Chazrox This looks like a good choice. I tried it, but there is a problem. When KeySwitch is triggered, it requires the Fade knob to automatically and smoothly go from 0 to 1. How can I control it?

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

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

                                          @d-healey This seems to be back to the HISE snippet I provided at the beginning😲

                                          function onNoteOn()
                                          {
                                          	local n = Message.getNoteNumber();
                                          	
                                          	local v = Message.getVelocity();
                                          
                                          	Message.ignoreEvent(true);
                                          	
                                          	for (i = 0; i < 127; i++) {
                                          			
                                          	       // turn off previous event
                                          	       local e = eventIds.getValue(i);
                                          	       	       
                                          	       if (e != -1)
                                          	           Synth.noteOffByEventId(e);
                                          		//Synth.addVolumeFade(e, 2000, -90);
                                          	       // play new note if key is down
                                          	       if (Synth.isKeyDown(i)) {
                                          		       
                                          	           local newNote = Synth.addNoteOn(1, i, v, 0);
                                          	           eventIds.setValue(i, newNote);
                                          	       }
                                          	       
                                          	   }
                                          
                                          }
                                          

                                          I don't know where to put Synth.addVolumeFade(); to make it succeed

                                          //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 Don't use that snippet, use the one I gave you as a starting point.

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

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

                                            30

                                            Online

                                            1.8k

                                            Users

                                            12.1k

                                            Topics

                                            105.4k

                                            Posts