HISE Logo Forum
    • Categories
    • Register
    • Login

    Make the Gain knob smooth the gain?

    Scheduled Pinned Locked Moved General Questions
    78 Posts 3 Posters 1.6k 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 I tried your Snippet, and I don't know if you have the same problem. When the third KS is triggered, the note triggered by the third KS cannot be stopped. In addition, when switching from the first KS to the second KS, and then switching from the second KS back to the original KS, there will be no sound, but there is always a level display on the waveform generator. I searched for a long time, but I couldn't solve the problem. This problem is too frustrating.
      78de0978-090b-4ebd-a447-30862f5e9150-QQ_1752416294304.png

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

        the note triggered by the third KS cannot be stopped.

        Yeah this is the kind of hanging note issue I said you might run into. I'm just testing with my keyboard in realtime, haven't tried with MIDI in a daw but I expect it is less forgiving.

        You'll need to dig into the code to see how to mitigate the hanging notes.

        It's a bit cumbersome to work on because each time you make a change to one of the scripts you need to copy it over to the others. If you move it to an external file it might automatically update the others when it's compiled, I'm not sure though.

        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

          Aha, here is a free software loopMIDI, which can transfer DAW MIDI information to HISE in real time.

          loopMIDI | Tobias Erichsen

          favicon

          (www.tobias-erichsen.de)

          //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 There is a MIDI player built into HISE, you don't need to transfer it from the DAW. You could also build HISE as a plugin if you really wanted to work within the DAW.

            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

              @d-healey said in Make the Gain knob smooth the gain?:

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

              the note triggered by the third KS cannot be stopped.

              Yeah this is the kind of hanging note issue I said you might run into. I'm just testing with my keyboard in realtime, haven't tried with MIDI in a daw but I expect it is less forgiving.

              You'll need to dig into the code to see how to mitigate the hanging notes.

              It's a bit cumbersome to work on because each time you make a change to one of the scripts you need to copy it over to the others. If you move it to an external file it might automatically update the others when it's compiled, I'm not sure though.

              I added this line of code to each onNoteOff,

              	Synth.addVolumeFade(eventIds.getValue(lastNote), 500, -100);
              

              and it will have this error,

              ! onNoteOff() - Line 11, column 21: Event ID must be positive
              

              but the note can be stopped. In addition, there is currently a problem that the third note does not play the note pressed above, but the note of KS itself.

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

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

                @CatABC the last number is a delay time. You cant have a negative delay time. Thats saying you're trying to turn off a note that you havent played yet. Its usually 'zero' unless your compensating your a delayedNoteOn message in which case it should be a positive number equal to your delayed message amount / or more, hence your error.

                must be positive

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

                  @Chazrox I used Synth.noteOffByEventId() instead and it works fine now

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

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

                    78de0978-090b-4ebd-a447-30862f5e9150-QQ_1752416294304.png
                    4e35b4a3-650e-4fa4-9317-8642508125be-QQ_1752566058573.png
                    @d-healey

                    I found that KS will overwrite the value of lastNote. When the third KS is triggered, eventIds.setValue(lastNote, Synth.playNote(lastNote, Message.getVelocity())); does not play the original note value. Is it possible to write the lastNote value back to the first value in the onNoteOff function?

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

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

                      @CatABC I didnt know you can eventId.setValue(). That works?

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

                        @d-healey @Chazrox
                        I'm back. After many days, I reviewed the code again today and finally succeeded!
                        We need a loop!
                        I would also like to thank all my friends who provided me with help and various solutions! I love you all😘

                        function onNoteOn()
                        {
                        	local n = Message.getNoteNumber();
                        	local v = Message.getVelocity();
                        	if (n >= knbLoKey.getValue() && n <= knbHiKey.getValue())
                        		lastKs = n;		
                        
                        	if (Synth.isArtificialEventActive(eventIds.getValue(lastNote)))
                        		Synth.addVolumeFade(eventIds.getValue(lastNote), knbFadeTime.getValue(), -100);
                        
                        
                        for (i = 48; i < 127; i++) {
                        	local e = eventIds.getValue(i);
                        		       
                        	if (e != -1)
                        	    Synth.noteOffByEventId(e);
                        	    
                        		if (n == knbKs.getValue() && Synth.isKeyDown(i))
                        		{
                        			ADSR.setAttribute(ADSR.Attack, fadeIn.getValue());
                        
                        			lastKs = n;
                        			
                        			eventIds.setValue(i, Synth.playNote(i, v));	
                        				
                        			return Message.ignoreEvent(true);
                        		}else{
                        			ADSR.setAttribute(ADSR.Attack, knbResetAt.getValue());
                        		}
                        	}	
                        		lastNote = n;
                        		
                        		if (lastKs != knbKs.getValue())
                        			return Message.ignoreEvent(true);
                        	
                        		eventIds.setValue(n, Message.makeArtificial());
                        	
                        }
                        

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

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

                        17

                        Online

                        1.8k

                        Users

                        12.2k

                        Topics

                        106.0k

                        Posts