HISE Logo Forum
    • Categories
    • Register
    • Login

    Hell breaks loose if you kill real events artificially issue

    Scheduled Pinned Locked Moved Scripting
    8 Posts 4 Posters 250 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
      last edited by d.healey

      I have this simple little script. If I play the same note twice in a row I get the "all hell breaks loose" message on line 9 where I'm calling Synth.noteOffByEventId(eventIds.getValue(n));. Even though I'm checking beforehand that the artificial event is active. It's like that check is failing completely.

      function onNoteOn()
      {
      	local n = Message.getNoteNumber();
      	local v = Message.getVelocity();
      
      	Message.ignoreEvent(true);
      	
      	if (Synth.isArtificialEventActive(eventIds.getValue(n)))
      		Synth.noteOffByEventId(eventIds.getValue(n));
      		
      	eventIds.setValue(n, Synth.playNote(n, v));
      	
      	Synth.noteOffDelayedByEventId(eventIds.getValue(n), 1000);	
      }
      

      eventIds is a midi list declared in on init

      HiseSnippet 1326.3oc6Xs0aaTDEd1XOkZ2VDszG3EP6C7fCJJxqiyEDBgyEm1HhSshCQ7V0zYGaOpqmY0LyZvTw+I9IzeR7O.Nytqsm0woj5jBHD9AKetsmu4blyk0cURJSqkJjW0KlDyPdOD2ahvL7vgDt.cxQHumhUrHFQyLJ9fALkgoMnClDSzZVHxyqzyrZ5UoLJ8yu+cGPhHBJaNKD5RImxNkOhalysaqumGEcLIjcAeji1MacBUJNTFIS.TUBWGESnulLfcFwp1ZXzyI5gHuuBGFzLn+dTxN6EzrAk1Xuca706RYj98Y6Dr8tM2qey9DZ8FHu60NjajpdFBfdjW4CjgS5MT9ShLGbIWyeUDyRDf5AdNi8wxnP6QzxEc3PdTX2ogKMB4g6NO3UJK38TbGdHeF+4AwOIUf+bKbCfdqUDdkJ.u.W3U2AdKARdNPpbFjdLtGUwiMykXwyCvmHLLEDdXEfRltHu2hOTBJHLaNh7Z1wJfXlA01od8M7guV+a5mHnFtT3KEmIMrWH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3PNB89a2CvZXk9vmKg7vJX9CwZCrTqrKgqtRpAuzTyZ2pTCZDgpjujlMH2FrteJG.uhz+CoJ3NVZ+.T5vcWPOB1e6kTZwG0ULrwpZ3VqpgMWUC2dUMbmU0vcWUC26u1P6506mXjixlffPc51N6pnW6YWEKg9S.9VrqE
      

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

      clevername27C A 2 Replies Last reply Reply Quote 1
      • clevername27C
        clevername27 @d.healey
        last edited by

        @d-healey Yeah, that's a whole weird world with artificial notes.

        1 Reply Last reply Reply Quote 0
        • A
          aaronventure @d.healey
          last edited by

          @d-healey I think it's because your ignoreEvent call prevents it from going further down the tree (like into the queue), and noteOff wants to kill it, even though it

          • isn't there
          • is a real event

          Could be the combination of the two?

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

            @aaronventure ignore event just disregards the real event but it doesn't prevent the code progressing. If you remove the note off with delay call then the problem goes away.

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

            A 1 Reply Last reply Reply Quote 0
            • A
              aaronventure @d.healey
              last edited by

              @d-healey it doesn't prevent the code progressing, but it prevents the event front being added to the queue or for it to be propagated to child processors.

              And your noteOff method will only be executed in the child processors (I. E. The note off function would only fire in the child processors, not the processor you're calling it from) and once it gets past all of them, it will attempt to remove the event (by id) from the queue, but your event never ever made it to the queue.

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

                @aaronventure Not sure what you mean exactly. In this case there is no child processor beyond this script. I'm only working with artificial notes, so ignoring the message shouldn't make a difference - in fact if you remove the ignoreEvent line the issue still occurs.

                The line that checks if the event ID is artificial (which is must be because it is only ever populated from a call to Synth.playNote) seems to be returning the wrong response.

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

                A LindonL 2 Replies Last reply Reply Quote 0
                • A
                  aaronventure @d.healey
                  last edited by

                  @d-healey ah sorry, brain fart, I thought you were offing the real event.

                  1 Reply Last reply Reply Quote 1
                  • LindonL
                    Lindon @d.healey
                    last edited by

                    @d-healey yeah I've found these checks to be really unreliable....

                    HISE Development for hire.
                    www.channelrobot.com

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

                    22

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    102.4k

                    Posts