Knob to modify the pitch of sample continuously, not in steps (semitones)?

I have some drum samples in a Halion program and I want to add some knobs to the Macro Page to alter the pitch of those samples, but being drum samples I want to be able to modify the pitch in a continuous fashion (like a pitch-bend wheel does) and not in steps (semitones). If I assign a knob on the macro page to the “Coarse” parameter (under Zone>Pitch or Layer>Pitch) when turning that knob the pitch gets increased or decreased in semitones, which is not what I’m looking for.

Any ideas?

You could try the Fine parameter instead of Coarse.

If you need more than 1 semitone I would probably try modulation matrix. Pitch as destination and layer quick control as source. You can set the amount of pitch modulation as needed. Then you can connect the layer quick control to a macro page knob. The disadvantage will be the value of the knob will show the quick control value not the actual pitch offset.

You could also use script to create a modulation source and use that instead of quick control.

maxPitch = 12 -- semitones - set to same value as pitch modulation amount in modulation matrix

defineModulation("Pitch", true) -- bipolar - range from -1 to +1
defineParameter("pitch", nil, 0, -maxPitch, maxPitch) -- parameter for macro page knob

function calcModulation()
    return pitch / maxPitch
1 Like

Thank you misohoza! You’re very helpful as always! :grin: :hugs:
I’m gonna try your suggestions right now.

I tried both your suggestions and indeed, as you said, using that little script to create a modulation source is better than using a QC as the knob in the MP will display the correct value of the pitch modulation and not just a generic value from 1 to 100.

But now I encounter another problem: let’s say I have a main layer that contains two sub-layers (A and B) and each sub-layer contain some samples. What I try to do is having 3 knobs on the macro page (knob 1, 2 and 3). Knob 1 to control the pitch of layer A, Knob 2 to control the pitch of layer B and Knob 3 (and here is the issue) to control both the pitch of layer A and layer B but in a relative way. So for example if Knob 1 is set to -3st and Knob 2 to +3st, when Knob 3 is set to +4st I expect to get a +1st pitch modulation for layer A and +7st pitch modulation for layer B.
Is it possible to accomplish this somehow?

If you try like this?

maxPitch = 12 -- semitones - set to same value as pitch modulation amount in modulation matrix

defineModulation("Pitch 1", true) -- bipolar - range from -1 to +1
defineModulation("Pitch 2", true)

defineParameter("pitch1", nil, 0, -maxPitch, maxPitch) -- parameter for macro page knob
defineParameter("pitch2", nil, 0, -maxPitch, maxPitch)
defineParameter("offset", nil, 0, -maxPitch, maxPitch)

function calcModulation()
    local p1 = (pitch1 + offset) / maxPitch
    local p2 = (pitch2 + offset) / maxPitch
    if p1 > 1 then
        p1 = 1
    elseif p1 < -1 then
        p1 = -1
    if p2 > 1 then
        p2 = 1
    elseif p2 < -1 then
        p2 = -1
    return p1, p2
1 Like

Yesss, it works! Thank you! :hugs: :hugs:
There’s just one little inconvenience: if, for example, one of the Pitch knobs (1 or 2) is fully turned to the right (+12st), turning the Offset knob to the right will have no effect, the pitch modulation will remain at +12st. I thought that turning the Offset knob fully to the right (when the Pitch 1 knob is also turned fully to the right) will result in a +24st pitch modulation.

Ah, nevermind! I found the solution: removing the “if” part from your script.
Now it works exactly as I need it! Yeyy! :grin: :partying_face: Thank you again!!

Good to hear it works.

I am a bit surprised though. According to documentation calcModulation should return values between -1 and +1. If you remove the “if” parts you can get values that exceed that range.

But if it does what you want and doesn’t give you any errors then it’s great.

Hmmm, indeed, the manual says that “the signal must be in the range from -1.0 to 1.0.”
But for some reason it works in my case and I didn’t get any errors. :thinking: The pitch modulation for the layer goes to +24st when both Pitch 1 knob and Offset knob are turned fully clockwise, and to -24st when both are turned fully anticlockwise. Now I’m quite curios how come I didn’t get an error message, but anyway I’m happy it works. :grin: