HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. CatABC
    3. Posts
    • Profile
    • Following 2
    • Followers 0
    • Topics 77
    • Posts 293
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Make the Gain knob smooth the gain?

      @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());
      	
      }
      
      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      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?

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @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.

      posted in General Questions
      CatABCC
      CatABC
    • RE: How to use KeySwitch to trigger sampling?

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

      @CatABC I guess that's how the eventData Envelopes work, if you trigger a key switch the fade will not be applied until you play next key
      It seems to work flawlessly when playing legato but as soon as you release a playing key, and the fade has not worked its way through, it will continue the fade as soon as you start playing a key again.
      It would be nice if the smoothing time will elapse even if no playing key is pressed

      @d-healey I set the Smooth value of the EventData Envelope of the current Articulation to 1 when triggering other KS to avoid the Xfade at the beginning, but when switching the third KS on the same note, I can't set the second EventData Envelope back to its original value, or do you have any idea to solve this problem?

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @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)

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @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

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

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

      but if KS is triggered at the same time as the note, the problem I described will occur

      Aha ok, I think you will run into an issue here because two notes triggered at the same time, how does it know which one to process first?

      // articulationSwitcher/onInit    add these
       const eventIds = Engine.createMidiList();
       eventIds.fill(-99);
       reg lastNote;
      
      // articulationSwitcher/onNoteOn    add these
      		if (eventIds.getValue(lastNote) != -99)
      		{
      			Synth.addVolumeFade(eventIds.getValue(lastNote), 500, -100);
      		}
      			
      		if (Synth.isKeyDown(lastNote))
      			eventIds.setValue(lastNote, Synth.playNote(lastNote, Message.getVelocity()));	
      		
      	}
      	lastNote = n;
      	eventIds.setValue(n, Message.makeArtificial());
      
      function onNoteOff()
      {
      	local n = Message.getNoteNumber();
      	
      	if (eventIds.getValue(n) != -99)
      	{
      		Synth.noteOffByEventId(eventIds.getValue(n));
      		eventIds.setValue(n, -99);
      	}
      }
       
      

      I combined the previous code, and the first two KS can work normally, but when the third KS is triggered, it can't transition normally. I'm stuck here.
      bbd75801-31f7-418c-8f7a-53aa31c86382-QQ_1752347821807.png

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

      @CatABC is that my keyswitcher on its own or your implementation of it?

      function onNoteOn()
      {
      	local n = Message.getNoteNumber();
      	
      	if (n >= knbLoKey.getValue() && n <= knbHiKey.getValue())
      	{
      		Message.ignoreEvent(true);	 
      		
      		knbArticulation.setValue( n - knbLoKey.getValue());
      		knbArticulation.changed();
      		changeArticulation(n - knbLoKey.getValue());
      	}
      }
      
      changeArticulation(n - knbLoKey.getValue());
      

      I just explored it and found that this line of code cannot be deleted. Keeping it will not cause articulation confusion.

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey is your code. I followed the video step by step to reproduce your operation.When KS is before the note, it works fine, but if KS is triggered at the same time as the note, the problem I described will occur

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

      @CatABC but the key switcher on its own works?
      KS is valid, in addition, the KS system you made on Patreon, in this case, it has some minor problems (cannot stop notes, can not normally switch the corresponding articulation)

      e9e8edd1-3c2c-48b0-a77a-9bced193a51b-QQ_1752345003530.png

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

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

      @CatABC I posted a video to Patreon at the start of the month about keyswitching using midi muters. It will probably help you here.

      Yes, I watched this video and followed it, but it didn't work.

      The problem at the moment is not with the MidiMuter, but with the third KS, it is not possible to trigger the playing of the pressed note again and the fading out of the previous note

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

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

      @CatABC I posted a video to Patreon at the start of the month about keyswitching using midi muters. It will probably help you here.

      Yes, I watched this video and followed it, but it didn't work.

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey
      This snippet implements the function of switching two Samplers on a note, but it will fail when the third KS is triggered on the same note.
      I didn't use the key method you used on Patreon because that seems to be a bit buggy. Here is the most basic method I used

      HiseSnippet 1721.3oc6aszaaaDDlTxLMRoORJBP5Q1fdPJvwPj5QhggQ7K4FiDGKX43zCEHXC4JoEhZWUxktQHv+.Z+ATfboH+IZ60bs+K5sdMnG501YIoDIsoTkUhSsBnArg2YmY14wtyLexvMrYFXGGlsjb9CFzGKI+wJMGP4c1rChPk1YKAgCYVt8vaiLwRaLnOxwAaJIKm8qEbHmaAIuudy81.YgnF3PRRRGxHF3GR5Q3gTar1CHVVBsc.oWDtqr1NFL5lLKlKXMYUJI0GYzE0F+HjfsLJR2G4zQR9VJU0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YKH4GkdaCS4NVXy9eOElsfwiEI2.ytVwynQOzre6M7Ql9veNUQcuDzPkBWgo.0SeEfFlhEnDVG5X2hXPPVPVdkIMMyz+13ztJMRfRDj7CPTe0uwf59BjnfdQjDcC+W1mZDrzwrRX9fqnLZP1fOXfvAoi2PH6T2PPaxSILxGjyDDYAV4dVymFzXveVZIhofTzwqk7h8Qa9JME53yTZQddStqQWw0RmDTxE+4Oi8wAjanM1jzquEtN8HnhLPQXieNjtagbs3CoFOOtKix52gQIFQmFYeLfqocarcTaOQGBP.gL5FR45qsO1BihNY0Ws1CgNvHaHNgmwXg1Y9iFIw70Wn3atphG2pyu3Fx9gMtg8YtbBs8tH3R3ygBnPiilv.7FX3zoTrknnpbFQoC+0kDq8mfmZ5s3efuB1TSrVNXSsgaF0EuwvReOAPFDCah93vlr1e8fe8bGahVhfShQ8DRnmnDwntELg.Mtp8IEiKQjXalcuH7c40FRTOJwFHZLkAqioocEYvgK+i6Umhf6.MwfmatmiADXDW6i9RqgqkC9IDSdGsnBFRVOJ46irMgTlw4OTpKMeCkR+r.kpZJTp4anTUlWgRclM6K.foRgRkBk5rAkROEJ0GDPozSgRkBkZd4OAyje8AyoewNKdCE.uftpWpT8+mb4EFbokGGtzWcqe7W9.EW5qd4Kq95Dvkd0jvkBvHmdboE+1+7cItTvP+8TboSKtzxSBW5ObBbo0RwkNugKc9GT5bxeVxTnnoPQmAnnkmCfhFntTnnS.JZ4TnnoPQSghlBE8cGTz2GmQOjgM6oF9U2EO5urGEvuod+GgjSYWwZUsS2SnGzB6oFFwU0oDTeVEr7rJXkYUvpypf0lUAuyrJ3c+uETLgw5tbVO+2F.h6F08FlQV1Grs2yDo+EPmCvVF
      

      8e0c8173-1b08-4ea4-9d01-44d3eecb8041-QQ_1752343395182.png

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey Yes, it's back to the previous problem. I need to switch the Sampler multiple times on a note. I made the switchers according to your video, but they don't apply to this problem.
      111f4356-cc68-49f6-aa12-b1f13c40d837-QQ_1752342774310.png

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey I studied the relevant videos you posted on Patreon, but they don't apply to the problem I'm facing now.

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey

      I upgraded the sampler to two and used MidiMuter to switch the KS. When C#0 was in, it worked fine, but when I switched back to C0 again, it couldn't reproduce the logic.

      HiseSnippet 1760.3oc6a0raaaDDlzxLMRoMMoH.oGYC5Ao.GCQpeRLLLh+StwHwwBQNN8PAB1PtRZgo1UkboaDB7CP6CPAxkh7Rz1q4ZeK5sdMnG501YIoDIkoTjksUsLjArQ1Y2Y2uYlcmY9jPpZyLvNNLaI4L60oMVR9SUp0gxatQSDgJs8lBA6yrbag2BYhkVuSajiC1TRVN02HVgb54k794CObcjEhZfCEIIsOiXfeBoEgGJs5pOlXYI1s8Hshr5hqtsAitAyh4BnIkRdo1HiCPMvOEIV1bJROB4zTR9tJkzKXTz79l55kVprApLdo5n500JXVrX4GrjVgkPEePYb9RRxWohIgyrqwQbrij77qyL6TqI6Gn9Gv9DGxqrvhAZR0fS1W7VLKSgIJjJsQShkY0ttIGII4OoZnSKkuS6VJ6PLI8jG57tg2DpgZD0AJOWb3kJF7zhBu7QfWBPRNBjl2GR2TolgMoMObFAdtlx1TN1tNxHdrzesRy8OoT1fAqfxWrE5.7V1vfdZjsb97KnB+I2xYx.wJGt5gHaUgEtiKrFM0UT8t7rXCLOlCI6cBWzc.sSPY8QQY8AnbgQQ4Bfx0coFbBipxnOkww6RylKyaxjIcZRc0r6.Z.22D6gXxm515UX6r4TWYEU8h4fE8F32zgVxhNX9ZbtM4UvvrQjSZPY130c4bFcAUg6Jpd5CPO89zSqO8JL.8JjndGMBFUow2nzFSiJ+4tQUdxaTiajJefQcTF09uXVut2Myz8Mm3woMyxRXsILsHip8vTLK0yUs.77wxE2agPVi3ohTFbpnnYJM7yUDYgL51TBe21X5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20w.bLhq8QeoU00xA+BhIuoVTECEqGU7iP1lPHy37mJ0UltoRoeRnRUZFUpoapTEmVoRchg8E.xTynRMiJ0IiJk9T.UpfsaFUpgPkReFUpYTolV9JXF9qOnO8K1Qwaq.7EzU8Bkp++DKuvvKsvf3k9t69S+5kTdou6susz6SfW5MRhWJPibz4kl669qyRdo.P+iKC7ROwv6TyQsvv3n9i8wQs7LNpSabTm9InNk7UTNiV5DkV5UNqnkN7T8STJpEl8s8cofhZgYTTO8TTmezhaejmuSN5pm43c7otNQccmdZrST3dlQo8rA0SB5sShynExvl8RC+JChDFW0SBX2Tu+WljVYGwXUsiWJnET96kFFw2pion93pXgwUwhiqhkFWEKOtJd+wUwG7wUTzcxZtbVK+2I.K9pU7ZDRV1m.u2SFo+CXHo9dI
      

      20d3f5d8-e394-461f-af33-ea15a851d03c-QQ_1752250667477.png

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey C0 will be a KeySwitch, and I will have many other keyswitch involved after this, so I need to trigger a KS first to ensure it is the articulation of C0

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey However, this error does not seem to affect what happened

      posted in General Questions
      CatABCC
      CatABC
    • RE: Make the Gain knob smooth the gain?

      @d-healey After playing it once completely, the MIDI will start to display when you play it again.

       onNoteOn() - Line 9, column 23: NoteOn with ID5 wasn't found 
      

      5c3f5916-44de-468f-b62b-203be5d15b5f-QQ_1752248899919.png

      posted in General Questions
      CatABCC
      CatABC