HISE Logo Forum
    • Categories
    • Register
    • Login

    double notes get stuck

    Scheduled Pinned Locked Moved General Questions
    3 Posts 3 Posters 77 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.
    • MorphoiceM
      Morphoice
      last edited by

      I've discovered a strange behavior with my synth

      when the DAW sends two of the same notes, whereas the noteoff of the first one is "behind" the second note, the first note doesn't turn off but gets stuck indefinitely

      Screenshot 2025-02-26 at 08.03.15.jpg
      Here's what it looks like in Cubase.

      Any ideas how this can be prevented or why this even happens?

      I'm using a silent synth with faust networks to make the audio and the famous silent killer node

      https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

      d.healeyD SimonS 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @Morphoice
        last edited by d.healey

        @Morphoice said in double notes get stuck:

        why this even happens?

        I think the midi spec says that the same note on the same channel should never overlap.

        The sequence should be note on, note off, note on, note off. Once you have note on, note on, note off, note off things can get weird. Some daws will automatically trim overlapping notes to prevent this issue.

        I'm not sure what you can do from the HISE side to deal with it though.

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

        1 Reply Last reply Reply Quote 2
        • SimonS
          Simon @Morphoice
          last edited by Simon

          @Morphoice The solution I used was to keep track of all note on events, then if you ever receive two note ons in a row on the same note you know you've received some illegal MIDI.

          It's pretty easy if on noteOn you check and store the event ID to an array (or MIDIlist I suppose) like

          onNoteOn {
          	if (events[Message.getNoteNumber()]){
          		Console.print(You've just received some illegal MIDI!);
          	} else {
          		events[Message.getNoteNumber()] = Message.getEventId();
          	}
          }
          
          onRelease {
          	events[Message.getNoteNumber()] = undefined;
          }
          
          

          How you handle the lawbreakers is up to you, but at a minimum it's best to stop everything on that note, as this situation breaks the assumption that every note on will have a corresponding note off.

          In my case I'm using artificial events, so stopping them all is easy. I don't actually know how you'd go about stopping the normal events.

          Give Synth.allNotesOff() a try, I know that doesn't affect notes with a timestamp in the future but I assume it works on stuck regular events.

          It would be nice if we got this built in similar to setfixnoteonafternoteoff

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

          24

          Online

          1.7k

          Users

          11.8k

          Topics

          102.8k

          Posts