HISE Logo Forum
    • Categories
    • Register
    • Login

    Fade in timer callback crash

    Scheduled Pinned Locked Moved Bug Reports
    10 Posts 2 Posters 1.4k 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

      Using a pitch or gain fade in the timer callback, even when the fade is shorter than the timer interval causes a crash.

      
      <Processor Type="ScriptProcessor" ID="Script Processor" Bypassed="0" Script="var id;function onNoteOn()&#10;{&#10;&#9;id = Message.getNoteNumber();&#13;&#10;&#9;Synth.startTimer(0.5);&#10;}&#10;function onNoteOff()&#10;{&#10;&#9;Synth.stopTimer();&#10;}&#10;function onController()&#10;{&#10;&#9;&#10;}&#10;function onTimer()&#10;{&#10;&#9;Synth.addPitchFade(id, 300, 1, 0);&#10;}&#10;function onControl(number, value)&#10;{&#10;&#9;&#10;}&#10;">
        <EditorStates BodyShown="1" Visible="1" Solo="0" contentShown="1" onInitOpen="0"
                      onNoteOnOpen="0" onNoteOffOpen="0" onControllerOpen="0" onTimerOpen="1"
                      onControlOpen="0"/>
        <ChildProcessors/>
        <Content/>
      </Processor>
      

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

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Ah yes, I am using the timestamp of the message that triggered the callback for the insertion time in the buffer but when there's no message (which is the case in either the onTimer or the onControl callback), it goes bogus. Nice catch!

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

          While your working on this would it be possible to make it so we can store the entire message in a variable to pass it around? Currently I'm having to basically create my own message object and put the various properties, note number, velocity, id, etc. in it one at a time.

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

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by Christoph Hart

            Yes, but this is a little bit more complicated than fixing this crash (which is literally two lines of code).

            What do you think about this way:

            reg myMessage = Message.createHolder(); // a custom object type (like MidiList that stores a message)
            
            function onNoteOn()
            {
                Message.store(myMessage); // stores the current message into the given holder object
            }
            
            function onTimer()
            {
                 local eventId = myMessage.getEventId(); // Uses the same methods as Message.XXX()
            }
            1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey
              last edited by

              Looks good to me :)

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

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

                This still seems to be an issue in the latest build, or I've done something wrong when I built it :p

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

                1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart
                  last edited by

                  I somehow can't reproduce this anymore, but I added the MessageHolder objects (create one using Engine.createMessageHolder() and use it like described above.

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

                    Thanks, I look forward to testing this out :)

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

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by

                      There is also a new function Synth.addMessageFromHolder(messageHolder), which simply adds the event as it is (this saves some typing).

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

                        This issue seems to be fixed now :)

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

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

                        46

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.8k

                        Posts