............................
The plugin developer will normally have a way to use midi to make these choices. For example use CC 07 (velocity) or CC11 (Expression) to select a volume sample. Another common method is to use notes outside the normal instrument range to select round robins or articulations.
No offense Jim but I would like to correct this so beginners don't get the wrong idea. CC7 is not velocity. CC7 is volume, as is CC2 (breath/wind controller) and CC11 (expression. Velocity is how soft or hard one plays a keyboard or blows into a breath/wind controller and it is a one time event. It may or may not influence volume. In a GM sound source it will influence the initial volume but you will need any of the above CCs to preform crescendos, sforzandos, forte-piano, etc. This is the same for many other sound sources.
However some software uses the mod wheel (CC1) for volume, thus velocity does nothing. Also in some software velocity will change the timbre; this depends on how many layers there are per note.
I just want to clear up the possible misunderstanding that CC7 is velocity.