HISE Logo Forum
    • Categories
    • Register
    • Login

    Drum articulation ROLL, FLAM, RUFF

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 223 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.
    • A
      aulicon
      last edited by

      Hi all,
      I'm trying to get create some midi articulations like roll, flam and ruff. at the moment I'm using the timer object for the roll...but I am not entirely sure this is scalable...I also don't know exactly how to manage it polyphonically. I know this is probably a mess but I would love some ideas on how to accomplish this the right way. Back in Kontakt I could have used the wait function and spelled every single repetition of the flam or the ruff and call it a day but HISE is a bit more sophisticated than that...

      code// roll function 
      reg timermidi = Engine.createTimerObject();
      
      timermidi.setTimerCallback(function () {
      
              Synth.playNote(Message.getNoteNumber(), Message.getVelocity());
       
         
      });
      
      function onNoteOn()
      {
      	
      	Message.ignoreEvent(true);
      	timermidi.startTimer(80);
      	
      			
      }
      function onNoteOff()
      {
      
          timermidi.stopTimer();
      }
      
      
      A 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        A timer is the way to go, but don't put it in your interface script, use a separate MIDI processor for stuff like this.

        You might also be able to do it using the MIDI file player module.

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

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

          @aulicon I tried the Midi player and I sort of got it working but now I have the problem of how to achieve this polyphonically. At the moment only the first Note On message gets processed...```
          function onNoteOn()
          {

          {

          // Check the current play state of the MIDIPlayer
          var playState = MIDIPlayer1.getPlayState();
          
          // If the MIDIPlayer is playing, ignore the event
          if (playState == 1)
          {
              
              return;
          }
          
          // Ignore the original note event
          Message.ignoreEvent(true);
          
          // Get the pressed note number
          var pressedNote = Message.getNoteNumber();
          
          // Get the event list from the MIDIPlayer
          var eventList = MIDIPlayer1.getEventList();
          
          // Iterate through the event list and replace all note-on and note-off events with the pressed note
          for (i = 0; i < eventList.length; i++)
          {
              var e = eventList[i];
              if (e.isNoteOn() || e.isNoteOff())
              {
                  e.setNoteNumber(pressedNote);
              }
          }
          
          // Flush the message list to apply changes
          MIDIPlayer1.flushMessageList(eventList);
          
          // Play the modified sequence
          
          MIDIPlayer1.play(0);
          MIDIPlayer1.setPlaybackPosition(0.62);
          

          }}

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

          34

          Online

          1.7k

          Users

          11.7k

          Topics

          102.1k

          Posts