HISE Logo Forum
    • Categories
    • Register
    • Login

    Weird behavior with Synth.isLegatoInterval() in noteOff

    Scheduled Pinned Locked Moved Scripting
    5 Posts 2 Posters 47 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.
    • T
      thrice801
      last edited by

      I am trying to use legato to load and play a new loop into my midi player, starting from the existing position; which seems to be accurate in the noteOn event, however I have the following code in my note off, which doesn't seem to be working. So I am holding C and then pressing D, then it loads the new loop, but when I let go of the first note, it is still hitting that Console.print("STOPPING PLAYER IN NOTE OFF"); block, even though D is still being pressed. Any idea what is going on here?

      function onNoteOff()
      {
          noteNumber = Message.getNoteNumber();
          velocity = Message.getVelocity();
          
          if(Globals.play_strategy == 0) {
            if(!Synth.isLegatoInterval()) {
      	Console.print("STOPPING PLAYER IN NOTE OFF");
      	Console.print(Synth.isLegatoInterval());
            	Player.stop(0);
            }
      	} else {
      	  Player.stop(0);
      	}
          
          Message.ignoreEvent(true);
      }
      

      Also, I can't seem to get the player to start the new loop at the players current position, according to the docs it seems like this should be working, but it resets back to the beginning each time, any idea what's happening there also? (the isLegatoInterval works as I expect in the noteOn callback)

      	  if(Synth.isLegatoInterval()) {
      	  	Console.print("NOTE BEING HELD");
      	  	Player.setFile(filePath.toString(0), true, true);
      	  	Console.print(Message.getTimestamp());
      	  	Player.play(Message.getTimestamp());
      	  } else {
      		Player.stop(0);
      		Player.setFile(filePath.toString(0), true, true);
      		Player.play(0);
      	  }
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @thrice801
        last edited by

        @thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:

        even though D is still being pressed.

        1 key down != legato.

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

        T 1 Reply Last reply Reply Quote 0
        • T
          thrice801 @d.healey
          last edited by

          @d-healey said in Weird behavior with Synth.isLegatoInterval() in noteOff:

          @thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:

          even though D is still being pressed.

          1 key down != legato.

          oh damn ya that had my brain all mixed up for some reason.

          any idea about the second issue?

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

            @thrice801 said in Weird behavior with Synth.isLegatoInterval() in noteOff:

            any idea about the second issue?

            No sorry, I haven't played with the MIDI player much.

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

            1 Reply Last reply Reply Quote 0
            • T
              thrice801
              last edited by

              np figured out a workaround with setPlaybackPosition instead

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

              8

              Online

              1.7k

              Users

              11.8k

              Topics

              102.3k

              Posts