Velocity scaling

Hello! I am not sure, but I guess this is a problem that would require some scripting.

I am looking for an easy way to scale velocity ranges. Example:

Incoming velocity 0-16 = Velocity 0-127
Incoming velocity 17-33 = Velocity 0-127
Incoming velocity 33-49 = Velocity 0-127

Any ideas? Any help would be greatly appreciated!

Did you try to use the normalized velocity option?

Maybe it will do what you need.

Sure, you can change the velocities by scripting but it also depends how your zones (layers) are mapped.

Thanks, misohoza! I must admit i wasn’t aware of the actual function of that option, so this is very useful.

To perform similarily on program level, i guess that would still require some scripting (along with a megatrig set to velocity limitations)?

Can you describe a bit more what are you trying to accomplish? Maybe a screenshot showing how are the samples mapped.

If you have a sample mapped to velocity 0 to 16 and you simply change the incoming velocity to cover the full range 0 to 127 it may trigger different sample than you intend.

1 Like

Thanks for following up on this! And sorry for providing no background in the first place.

So i am looking for a way to effortlessly switching between different ways of handling a sample mapped to the same key (regular playback, reverse, filtered, stretched and so on). Note that the way i make music is usually just plotting notes into a piano roll. Previous techniques for doing so (and the drawbacks of those techniques) have been

  • keyswitches (with and without keyswitch remote (which i find to be not so good for workflow, and i usually work with 128 samples per instrument, leaving no keys to use as switches))
  • having 8-16 different layers assigned to different velocity ranges that all represent one unique way of handling a sample (which works well, but is very time consuming in terms of mapping. Also i find it a bit difficult to keep an overview over such instruments, especially when individual layers have a few quick controls assigned to them).

I am trying to find a setup that is as modular as possible, and where the sample mapping in each Halion program is as simple as possible (1-127 ). I work in Reaper, so i can assign individual midi notes in the piano roll to different midi channels with a custom shortcut. I can also assign velocity ranges to several instances of the Halion vst on different tracks, but of course this is very cpu demanding.

So this is what i am trying to achieve (example):

  • 8 programs inside one instance of the Halion vst, all on the same midi channel.
  • in each program, all samples are mapped to velocity range 0-127
  • each program responds to notes in a unique velocity range (first program responds to notes with a velocity of 1-16, the second program responds to notes with a velocity of 17-33 and so on)
  • each program treats the incoming velocity range as 1-127 (scaling the velocity from for example 1-16 to 1-127). This is where i would need a script, i guess, along with an instance of megatrig to respond to the incoming velocity ranges.

I think a setup like this would be easier and more easily changable than having for example one single program with 8 layers responding to its assigned velocity range, but i might be wrong. I have a certain idea of how a script like that would look like after reading the documentation, but my Lua skills are pretty much none existent at this point.

I hope this makes sense!

You could try it like this:

layers = this.parent:findLayers()
layerVelocityRange = 127 / #layers
    

function onNote(e)
    local layerIndex, volume = math.modf(e.velocity / layerVelocityRange)
    layerIndex = layerIndex + 1
    if volume == 0 and e.velocity > 0 then
        volume = 1
        layerIndex = layerIndex - 1
    end
    local velocity = volume * 127
    print("Layer: ", layerIndex, " Original velocity: ", e.velocity, " Scaled velocity: ", velocity)
    playNote(e.note, velocity, -1, layers[layerIndex])
end

But this work for single program with several sublayers. The layers are mapped 0 to 127 but only one of them should play.

vs

Velocity Scale.vstpreset (8.8 KB)

1 Like

Wow, this is great! Thanks, misohoza! I guess this is as good as what i was trying to achieve, and pretty simple to deal with without having to spend much time mapping and remapping samples. Again, thanks a lot!