HISE Logo Forum
    • Categories
    • Register
    • Login

    How to play a specified RR group based on the distance between two notes?

    Scheduled Pinned Locked Moved General Questions
    30 Posts 5 Posters 1.3k 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.
    • Christoph HartC
      Christoph Hart @aaronventure
      last edited by

      @aaronventure ah so just use setVelocity(targetNoteNumber) instead of setActiveGroup()? Yeah that could work and I also don't need to think about a solution for the UI problem of RR groups, so I guess everybody's happy now :)

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

        @Christoph-Hart said in How to play a specified RR group based on the distance between two notes?:

        ah so just use setVelocity(targetNoteNumber)

        This affects all velocity modulators further down the line - unless you use a global velocity modulator.

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

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @d.healey
          last edited by

          @d-healey If you put the script in the sampler it shouldn't affect its sibling samplers. If it's a global script, then sure.

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

            @Christoph-Hart
            When I press the key I get an error like this, what should I do?
            5502f434-fd55-48e9-a697-b041981ed765-image.png

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

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

              @CatABC you haven't declared activeGroup.

              Unlike the interface script where you can basically declare variables and constants wherever, with realtime, you should declare them in the on init part so that the note on function just needs to read them (as they would get destroyed after the function execution).

              declare activeGroup in the on init part of your realtime script. Use reg, as it's faster than var.

              reg activeGroup = -1;
              
              CatABCC 1 Reply Last reply Reply Quote 0
              • CatABCC
                CatABC @aaronventure
                last edited by

                @aaronventure Thank you very much, I solved this problem, but I have a new problem, how to play the correct RR group according to the interval?

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

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

                  @Christoph-Hart
                  Hi,Christoph, Thank you for providing me with the method,I tried using the script, but it seems like there is no way to change the group I want to play based on the interval? For example, I press C2-D2 and it plays RR48, I press C-D#2 and it still plays RR48,How can I improve this?And when my melody goes down, the descending legato should be played, which will overlap with the ascending legato RR group. This is a headache for me. Please help me.

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

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

                    @CatABC
                    I think I found the answer, thanks a lot to everyone who helped me,I love you all💗 💗 💗

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

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

                      @CatABC you know the rules, you gotta post the solution or the forum police comes knocking on your door.

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

                        @aaronventure Hahaha, thank you for your reminder. but I am still confirming whether it has achieved my expected purpose.

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

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

                          @CatABC I think I have confirmed that I can use fewer RR groups to achieve my purpose. I set up variables to store the key I pressed first, then calculated the interval, and set the group I wanted to play based on the interval. This should be simple for everyone. As a beginner in HISE, it took me a lot of effort. Anyway, thank you for your help!:growing_heart: Following is my test code

                          	local a = Message.getNoteNumber();
                          	
                          	if(Synth.isLegatoInterval())
                          	   {		  
                          			leginterval = a - lastNote;
                          			
                          			Message.setNoteNumber(lastNote);
                          			
                          			if (leginterval == 2)
                          			{
                          			 	Sampler.setActiveGroup(2);
                          			}		  
                          	   }
                          	else
                          	  {
                          	  		Sampler.setActiveGroup(-1);
                          	  }
                          	lastNote  = a;
                          

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

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

                          50

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          101.9k

                          Posts