What's new

Is there a way to use velocity to control dynamics on Spitfire longs?

mistermister

New Member
You could do this with a Kontakt multi-script such as this :

Code:
on midi_in
    if (($MIDI_COMMAND = $MIDI_COMMAND_NOTE_ON and $MIDI_BYTE_2 > 0))
        set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC, 1, $MIDI_BYTE_2)
    end if
end on
You can put that into a multiscript in Kontakt with the small KSP button on the right of the toolbar. Click it, click Edit, paste the script into the white box and hit Apply.

You're going to run into some problems treating instruments like this though - long notes in Spitfire (and other) libraries are written with real-time control in mind. For example, if you press down hard for one note, then release and instantly press softly, your new key press will affect the dynamics of the previously-released note that is still decaying. Holding chords will obviously not work, too, as each part of the chord will change the dynamics for all held notes.

You're also sacrificing a lot of control and realism using the instrument like this. String instruments never play at a consistent dynamic. They arc in and out, or crescendo/decrescendo depending on context.

That multi-script above should let you do something like what you're wanting, though.
 
Last edited:

angeruroth

Active Member
A small improvement over @mistermister ' code to make the transition between cc1 values a bit better and limit the cc possible values:
Code:
on init
    declare $i := 49
    declare $target
    declare $min := 49
    declare $max := 97
end on

on midi_in
    if (($MIDI_COMMAND = $MIDI_COMMAND_NOTE_ON and $MIDI_BYTE_2 > 0))
        $target := $MIDI_BYTE_2
        if($target < $min)
            $target := $min
        else
            if($target > $max)
                $target := $max
            end if
        end if

        if($i < $target)
            while($i < $target)
                inc($i)
                set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC, 1, $i)
                wait(50000)
            end while
        else
            while($i > $target)
                dec($i)
                set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC, 1, $i)
                wait(50000)
            end while
        end if
    end if
end on
 
OP
Virtual Virgin

Virtual Virgin

Active Member
"For example, if you press down hard for one note, then release and instantly press softly, your new key press will affect the dynamics of the previously-released note that is still decaying."

I'll have to try it but that doesn't quite sound right. I would think release samples would not be effected by incoming MIDI messages. The release portion of synthesizer/sampler envelopes do not behave in the way you describe.
 
OP
Virtual Virgin

Virtual Virgin

Active Member
A small improvement over @mistermister ' code to make the transition between cc1 values a bit better and limit the cc possible values:
Code:
on init
    declare $i := 49
    declare $target
    declare $min := 49
    declare $max := 97
end on

on midi_in
    if (($MIDI_COMMAND = $MIDI_COMMAND_NOTE_ON and $MIDI_BYTE_2 > 0))
        $target := $MIDI_BYTE_2
        if($target < $min)
            $target := $min
        else
            if($target > $max)
                $target := $max
            end if
        end if

        if($i < $target)
            while($i < $target)
                inc($i)
                set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC, 1, $i)
                wait(50000)
            end while
        else
            while($i > $target)
                dec($i)
                set_midi($MIDI_CHANNEL,$MIDI_COMMAND_CC, 1, $i)
                wait(50000)
            end while
        end if
    end if
end on

So this limits the dynamics to a range of 49-97?
Why cut off the rest?
 

mistermister

New Member
"For example, if you press down hard for one note, then release and instantly press softly, your new key press will affect the dynamics of the previously-released note that is still decaying."

I'll have to try it but that doesn't quite sound right. I would think release samples would not be effected by incoming MIDI messages. The release portion of synthesizer/sampler envelopes do not behave in the way you describe.
Orchestral samples work differently to synthesizers and traditional samples.

For example, in most orchestral libraries when you release a note it is triggering a new 'release' sample. This new sample also has to be modulated via the mod wheel, otherwise it won't match the dynamics that were playing while the long was held. Kontakt limitations mean that with built-in functionality that most developers use, there's no way to stop the dynamics further affecting this release sample. Some developers have workarounds, but it can be hit or miss.

There's also the polyphonic-notes-effecting-all-notes-the-same thing (ie play a soft C, hold it and play a loud D - both C and D become loud).

The more important thing, though, is that you're removing workflow functionality and sacrificing the realism of the orchestral samples. It's still worth experimenting - it might be that this is the kind of sound you're going for. However, you may be better of using a more traditional synthesizer or string pad.
 
OP
Virtual Virgin

Virtual Virgin

Active Member
Actually, realism is my priority here. What I should have mentioned is that I would hope to use both velocity and CC#1 to control dynamics. I would like to play initiate the dynamic I want with key velocity, then use the CC#1 to apply dynamic movement.

Also, I don't find it at all consistent with realism that natural hall decay samples would be scripted to respond to any new MIDI value after the release of a note. Volume swells of room ambience sound like a very poor choice if that is indeed what Spitfire have done. That would guarantee synthy tails when trying to reset your CC for the next attack for hairpins and the like.
 

mistermister

New Member
Also, I don't find it at all consistent with realism that natural hall decay samples would be scripted to respond to any new MIDI value after the release of a note.
This is usually down to a Kontakt limitation. There's no built in functionality to have CC modulation as a one-shot thing. Having said that, Spitfire is one of the companies that doesn't have this issue - it's other libraries I've used that do.

Actually, realism is my priority here
If realism is a priority, I'd say that it's best to steer clear of having velocity control dynamics on a long patch and get into a habit of programming or recording CC dynamics. Most libraries work this way and very few support a velocity + CC control style. Also, with Spitfire libraries, some long patches will have velocity control something like note attack and CC control dynamics (which this kind of script would interfere with).
 

angeruroth

Active Member
So this limits the dynamics to a range of 49-97?
Why cut off the rest?
Yes, but you can remove the limit using 0-127.
I usually avoid extreme values when programming CCs. Too high values may sound unrealistic, and too low values lowers the volume too much, although I change the limit depending on the composition and the instruments used. Sometimes I go 0-30, 70-100, 20-60...
Also, when layering cc1 driven instruments with velocity sensitive instruments (like BDT or EWQLSO) the limit improves the flow.
 
Top Bottom