HISE Logo Forum
    • Categories
    • Register
    • Login

    Mono Sampler

    Scheduled Pinned Locked Moved General Questions
    21 Posts 2 Posters 1.0k 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 @Casmat
      last edited by

      @Casmat Have you tried using the hardcoded legato script that comes with HISE? That might do what you need without using my mono script.

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

      CasmatC 3 Replies Last reply Reply Quote 0
      • CasmatC
        Casmat @d.healey
        last edited by

        @d-healey not yet.. where can I find that?

        1 Reply Last reply Reply Quote 0
        • CasmatC
          Casmat @d.healey
          last edited by

          @d-healey just found it!

          1 Reply Last reply Reply Quote 0
          • CasmatC
            Casmat @d.healey
            last edited by

            @d-healey hm, this legato script in hise seems to continue playing notes even when I let them go, if I tap a note, it just plays on even when let go. And having a glide time setting is something I wanted, which the script in hise doesn’t have, or am I missing something, I can’t find any parameters for it

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

              @Casmat If the note continues playing that makes me think you have a long release time or the sampler is in one shot mode. The legato script doesn't have a glide setting, and as you've found, the one in my script needs some work for real-world use.

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

              CasmatC 2 Replies Last reply Reply Quote 0
              • CasmatC
                Casmat @d.healey
                last edited by Casmat

                @d-healey Woohoo!! After some long fought trial and error, I got the retriggering working for when the glide time is below zero:

                /*
                The MIT License (MIT)
                
                Copyright © 2017, 2018, 2019, 2020, 2021, 2022 David Healey
                
                Permission is hereby granted, free of charge, to any person obtaining
                a copy of this file (the “Software”), to deal in the Software without
                restriction, including without limitation the rights to use, copy,
                modify, merge, publish, distribute, sublicense, and/or sell copies of
                the Software, and to permit persons to whom the Software is furnished
                to do so, subject to the following conditions:
                
                The above copyright notice and this permission notice shall be included
                in all copies or substantial portions of the Software.
                
                THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
                OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
                THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
                */
                
                Content.setWidth(650);
                Content.setHeight(50);
                
                reg lastNote = -1;
                reg retrigger = -1;
                reg eventId;
                reg lastTuning = 0;
                reg vel;
                reg retriggerHold;
                
                //GUI
                const var bypass = Content.addButton("Bypass", 10, 10);
                
                const var time = Content.addKnob("Time", 160, 0);
                time.setRange(0, 2000, 0.01);
                function onNoteOn()
                {
                	vel = Message.getVelocity();
                	
                    if (!bypass.getValue())
                    {
                        if (lastNote == -1)
                        {
                            lastNote = Message.getNoteNumber();
                            eventId = Message.makeArtificial();
                        }
                        else
                        {
                            if (time.getValue() > 0 && eventId != -1)
                            {
                                Message.ignoreEvent(true);                
                                Synth.addPitchFade(eventId, time.getValue(), lastTuning + Message.getNoteNumber()-lastNote, 0);                    
                                lastTuning = lastTuning + Message.getNoteNumber()-lastNote;
                            }
                            else
                            {
                                if (eventId != -1) Synth.noteOffByEventId(eventId);
                                    
                                eventId = Message.makeArtificial();
                            }
                            retrigger = lastNote;
                            lastNote = Message.getNoteNumber();
                        }
                    }
                }
                function onNoteOff()
                {
                    if (!bypass.getValue())
                    {
                        Message.ignoreEvent(true);
                
                        if (eventId != -1 && Message.getNoteNumber() == lastNote)
                        {
                          if (Synth.isKeyDown(retrigger))
                          {
                              if(time.getValue() == 0)
                              {
                	              Synth.noteOffByEventId(eventId);
                	              Synth.addNoteOn(1, retrigger, vel, 0);
                	              lastTuning = 0;
                	              retriggerHold = retrigger;
                	              lastNote = retrigger;
                	              retrigger = -2;
                			  }
                			  else
                			  {
                	              Synth.addPitchFade(eventId, time.getValue(), 0, 0);
                	              lastTuning = 0;
                	              lastNote = retrigger;
                	              retrigger = -1;
                              };
                          }
                          else
                          {
                              Synth.noteOffByEventId(eventId);
                              if (retrigger == -2)
                              {
                              	Synth.addNoteOff(1, retriggerHold, 0);
                              }
                              eventId = -1; 
                          }
                        }
                
                        if (!Synth.getNumPressedKeys())
                        {
                            lastNote = -1;
                            lastTuning = 0;
                        }
                    }
                    else if (eventId != -1 && eventId != undefined)
                    {
                        Synth.noteOffByEventId(eventId);
                        eventId = -1;
                        lastNote = -1;
                        lastTuning = 0;
                    }
                }
                
                function onController()
                {
                	
                }
                 function onTimer()
                {
                	
                }
                 function onControl(number, value)
                {
                	
                }
                 
                

                I definitely feel like I overcomplicated things and is not the most efficient way haha

                If the note continues playing that makes me think you have a long release time or the sampler is in one shot mode.

                Yup, the oneshot mode was the problem, the script still is very buggy and needs work as the retrig pitch shifts an octave lower and whatnot

                1 Reply Last reply Reply Quote 1
                • CasmatC
                  Casmat @d.healey
                  last edited by

                  @d-healey scratch that, the retrig thing only works for “one pass through” if you continue “trilling” and let go of all the notes, the retrigger note still continues playing even when no notes are pressed. I had only accounted for one pass through. I was thinking I could make the retrigger note into an eventId, but I couldn’t find a way to do that from the addnoteon function. Is there a way to detect an anchor note (retrigger note) and then play that note when all others are let go except the original retrigger note?

                  Thanks!

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

                    @Casmat If you're not using the glide feature just use the hardcoded legato effect (if you turn off one shot mode).

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

                    CasmatC 2 Replies Last reply Reply Quote 0
                    • CasmatC
                      Casmat @d.healey
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • CasmatC
                        Casmat @d.healey
                        last edited by

                        @d-healey That's the thing I think I may have to build something from scratch since I'm actually thinking of using a legato that uses the samples position and transfer that position into the samples that are being glided to.

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

                        26

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.5k

                        Posts