Drum articulation ROLL, FLAM, RUFF
-
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 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.
-
@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);
}}