Dynamically remapping dynamic layers across velocity.
-
Hi there. I have a more conceptual question this time.
I'm trying to build a basic keyboard instrument with a sensitivity slider that does more than act as a LUT for incoming MIDI.
Imagine a soft/hard knob on an instrument with six dynamic layers. All the way soft would heavily weight incoming MIDI towards the lowest dynamic levels, and velocity 127 would trigger only dynamic level 3, with the highest two dynamic levels omitted entirely.
Same vice versa. With the knob all the way at "hard", incoming MIDI is weighted towards higher dynamics, and a note with velocity of 1 would trigger dynamic level 3, the quietest two dynamic levels being omitted entirely.
With the knob in the middle, you'd get a normal linear response.
If this were Kontakt, I would put each dynamic layer in a separate group and do the "which group to play from" decision making and velocity scaling in scripting. Each group would have a velocity>volume modulator with an upwards slanting curve such that each dynamic layer, when played with a velocity of 1, approximately matches the dynamic layer below it.
The idea is to be able to select one or multiple dynamic layers and map them across the velocity range without running into quantization like you'd get with a simple MIDI input LUT.
In HISE I'm guessing I could use separate samplers or rr groups to select which dynamic layer to play. Or maybe the velocity mapping secretly uses floats and there's a way to play with fractional velocities?
I'm asking now before exploring options thoroughly in case there's a very clever solution right off the bat. It's difficult to think outside the box when you've been stuck in Kontakt for years.
-
What's a fractional velocity? MIDI standard is integer based...
-
@d-healey Sure, but I had a vague hope that HISE would have a way around this limitation of Kontakt. For instance if a sample was mapped to a single velocity in the GUI, it might still be possible to scale the input velocity range of 1 - 127 down to that one velocity, while still having modulators affect the sample with 127 discrete levels.
Essentially you'd be applying a curve to the actual sample map itself, rather than to the input MIDI. From the perspective of a sample, this looks like fractional velocities.
I am guessing from your ellipses though that that's not even close to being the case.
-
I think you're confusing velocity and volume. You can trigger a sample mapped to one velocity level and control the gain of that sample with an independent curve using a velocity modulator (you can do the same in Kontakt too if I remember correctly).
-
In Kontakt, if the sample is mapped to one velocity, then the velocity modulator will only affect the sample when the output of that modulator is that exact velocity. You would need to control the gain of the sample via script with change_vol, at which point you don't need modulators at all anymore.
I'm guessing there's no way to do this with modulators and I'll just script it.
-
@Zorpley If you trigger the note with a script you can specify the velocity to trigger, if you use a global velocity modulator then you can get the real velocity to control the gain. There are other ways to do this but this is the simplest.
-
Here you go, just drop your samples in the sampler and it should work. Use the knob in the script to select the sample to trigger (this won't affect the gain modulator).
HiseSnippet 1365.3oc6X0uaaaCDWx1pMwqsnsqCXXCEUnX+gCPWfUZZyvBFhy2vn0IFVoA6+BnknsIhDofDUV8F16zdCVeD1iRdC1NRIYQ4H34ZzlFr0fhBeGui7Guu3cpaHyAGEwB0zW9jwAXM86XXOlxGs6HDgp0dOM86YzAEwwglIr1Yb.JJB6poqW8PAC8kqoI+6xs1A4gnN3bVZZmxHN3WS7I7btca8Jhm2AHW7IDeEoWuUaGFcWlGKFvSUilZAHmyQCwGgDhUwPS+V66R3rPaNhiizzqsCycr8H1uPSj+TRDouGVPXoYCaTB6CXdtBDK9s1tiHdtcyt2QZvl1M2JTMwJ7HiNDWxD94Vi6KWvLWCU6gdkYAOKU30rT3YUB7zTPWsDzAff4F6g3EQlvcjt.gUzS0lxwzHBerp65SJbefQWB2YT43sRI3EbTerwapy+tF6OX.1gmC1ZFG7yWud5kRfx2XbnGqOxK2.xnb.U3PItdb5xlSV2bh.VyHU8ul2T0f4NUUu5baQrlaKhds+SjZ9kWwME8AM678nVmtBjucBjqabJ1i4HNdAX+pIj4v05eGtuIBeBRhm7Hp1zKvgbgR471C6P5iEAz3YkaWc9tsejp+T8+m0e5wh4D5vNHdH4sZ5FGE6aCI3NX.ITJ1CNHC8JZBUkzMEzBKiMl5JI9a3uzEsDz5oKZksn508wIW2GZXyCwHe3jsQ9Ado01pajRY8gnmi4uPV2PH7G4ZS9UEwdWqchAeRXQt+QK4QssOKlV3rRQdOb.FwKFpuTqd8NLjEGLsVWtkLf7jPnmGvTntvwTL3a4p2wcCYQQCfqibuhTWpab3vh4b8vPdXTQdfuU0qJbTPJrHdh3jE.jKs7TZllfCMhIoslhdsone9TzqOE8Klh9kSQuQNchAsCJPDYHZDrVw3+aOekKfMnKBtxJRtCY3jMOgSw1nTDchMWhKk1NugzS4B9LPZUxGXX6DRB34qj7zUB2bzULcLYUsJOQ2.xih3lmS6O48ieR1MBlxWE459JJqeimls1SelYS3eqr4cqqnwpQXdODcHtArn0Za.+2JaNHl5H7DlL5QLN9XZiUp+a0WtCfFX1.gJYp2PcqFB7Qdw3Fqrxl0+85lSuMCFjrOSsl.wgLOH6szkEUOBmkhMnw98wgOy7BwgOQvqDwVe97iNIFPEAYz1TB+3.bZvWlUIiik1jKnpP42KUtxqSIhkypjmIRcphvnTwAQ4xfn6kFtX6Qbg53D2BsWHMIpkUzdS68PbT1NAaJbPAPOCDgIReO7EP40jvykM1CGcNmEHk0OfQEPP+Klmy8sYuSMN6GQ7wBa8sLDQkZ9DWWObWF7funQf7Ju+IL3aPwZ9WtkOJuz36NqUD7vfnXITUZ.wyOBJcFz1GhLEurAkTMcwCPwdbyHnrtlGgdN18DlT9aDi18dT0nR2q74BtugMQT8benUOOv0Iw6CAek7NmwsXMiNLJKXDiRbJ9HEX4FNDGpdOJ8xsMmCuQly4Qs5g8vnHEuz2050vLPnvhu8dU6xB2lYYUPK0280FIv0TjpYdiZ77zYL+1zoSj8x.GVHex0PdCdR1zKRALkRrfiFHDHaj.3YQASY9uHY.J.PwNIIfVyZt1err4S977C2r99EyxzcuzN6SBktg+cptigrWTSwnCepf50wbYNYaEb2R+cRpYULUjmJ+rbdvfDdpgzJO9csfRejSH6LmjtNDXcIIG.kT42HdYiNBZSqrdMLLZtZSwC7jybbDIBeOXgKWm0V.cd9Bny5KfNuXAz4kKfNar.57CyTGwnMaGyY9IEIAFc2OIvRe+IAVU09G.rii3z
-
@Zorpley said in Dynamically remapping dynamic layers across velocity.:
In Kontakt, if the sample is mapped to one velocity, then the velocity modulator will only affect the sample when the output of that modulator is that exact velocity. You would need to control the gain of the sample via script with change_vol, at which point you don't need modulators at all anymore.
I'm guessing there's no way to do this with modulators and I'll just script it.
is there a reason you are not applying a user-drawable velocity curve? Then every possible scenario is covered...?
-
Thank you David. Providing a snippet is above and beyond, as usual.
@Lindon In Kontakt, a velocity curve does not work well if you go to extremes like I described. There is no way that I am aware of to decouple the velocity that is sent to the sample map from the velocity sent to the vel > volume modulator.
Imagine this were a user-drawn velocity curve taking the lowest dynamic layer and spreading it across the full velocity range of the keyboard:
In a situation like this, your input with 127 values gets quantized to something like 10-20 values.
With the HISE global modulator, the velocity sent to the sample map is different from the velocity sent to the volume modulator, which is exactly what I was after.
-
so I just add this snippet to my script and its working like a charm, how I duplicate this? I need to duplicate the scripts just changing the knob name or there's also another way, thanx, I want to replicate this in 12 channels
thanx
im asking because maybe I dont need to duplicate 12 times,