How to use piano pedals to switch between groups?
-
I am migrating one of my Piano SFZ instruments to HISE in order to make it standalone.
The original SFZ instrument utilizes two groups of samples: PedalUp and PedalDown. When Sustain Pedal is pressed, only the PedalDown group articulates; When Sustain Pedal is not pressed, only the PedalUp group articulates.
Is there any necessary scripting steps? I am totally new to HISE.
-
@ShikiSuen Yes this will require scripting. If you don't have round robin samples the simplest way would be to map the samples into two groups and write a little script to select the group based on the state of the sustain pedal.
If you do have round robins then I would use the groups for RR and separate the sustain/non-sustain using velocity.
-
Another way would be to put the samples in two different sampler modules and use the MidiMuter like this:
-
@Christoph-Hart Thank you for your reply. Unfortunately, when I copied the snipped and tried to load it in HISE on my Mac Pro (mojave 10.14.6 2nd supplemental update, latest HISE public release at this moment), HISE simply reloads a new blank preset.
-
Update: I wrote the following and put it into both "oninit" and "onController" of the preset, it works except very fast & frequent pedal movements with fast piano pieces.
var muteup = Synth.getMidiProcessor("muteup"); var mutedn = Synth.getMidiProcessor("mutedn"); function onController() { if (Synth.isSustainPedalDown() == true) { muteup.setAttribute(0, 0); mutedn.setAttribute(0, 1); } if (Synth.isSustainPedalDown() == false) { mutedn.setAttribute(0, 0); muteup.setAttribute(0, 1); } }
-
Update: The note stuck problem solved. Tick on "fix stuck notes" among all MidiMuters.