Crossfading between velocity layers

I’ve searched the forums, so I know this has been talked about, and I haven’t found a way of doing this in a satisfactory way.

Let’s say I have three samples for the same note, one for each of three velocity ranges:

sample p (instrument played “piano”, quietly)
sample m (instrument played with moderate strength)
sample f (instrument played “forte”; with full strength).

Is it possible to achieve a smooth transition between the samples by using modulation or other instrument configurations?

Example: let’s say I write the following in the patter editor (a note is played with volume 0; then it increased gradually until reaching maximum volume).

F-4 00
---- 01
---- 02
---- 03
---- 04
---- 05
---- 06

---- 7D
---- 7E
---- 7F

Is it possible to configure the instrument so that, e.g. from volume 00 to 40 both samples p and m are played, but with sample p playing louder than sample m at the beginning and gradually giving way to sample m, until at volume 40 we only hear sample m, and then from 40 to 7F both samples m and f play, but with sample m gradually giving way to sample f until we only hear sample f at volume 7F?

I managed to do something similar, but only with two samples. I copied a tutorial by danoise in the blog (the electric piano tutorial). I added a volume tracker with min 127 and max 0 for the first sample, and min 0 and max 127 for the second sample. I left the VEL->VOL button on, unlike danoise in the tutorial, because I did not want to lose ability to control volume with the volume column. With this I achieved this “cross fading” effect. But with three samples or more, is it possible?

It seems that it is only possible to do it with 2 samples. If you use 3, the intermediate can only cross with that fade with the one above or the one below, not with both.

You could repeat the intermediate sample. That is, load 4 samples, repeating the middle one. Something like that:

  1. Sample A
  2. Sample B1
  3. Sample B2
  4. Sample C

Sample B1=Sample B2

A-B1 cross
B2-C cross

On the other hand, if what you want is to make a piano sound more realistic, it is best to opt for at least 5 samples per note, not just 3. The instrument will have many more samples, but it will be closer to the reality, and you will not use any cross-sample.

I can recommend a specific piano with 5 samples per note, which sounds very good, and is free. You can build your XRNI piano better than crossing samples.

Thanks. It’s what I suspected. I thought about the repeating samples solution. I’m not sure it will work, because the modulation will still span the whole velocity range, unless I use “clamp”. That could work.

I actually was trying to do this with instruments like, e.g. french horns, so that when there’s a crescendo in a single note, the sound will “morph” from a smooth note to a bright, buzzy note.

Your mention of the piano is intriguing to me. It’s the second time while looking into this subject that I see someone mention a piano and percussion in relation to crossfading layers, and that was precisely the kind of instrument I was not thinking about, because these instruments don’t sustain notes, so I don’t need the sound of a note to change based on how the volume of the note changes. The use I do see for layer crossfades for instruments like these is to provide more realistic samples for velocities for which one does not have a sampe: e.g. one has samples for velocities 20, 40 and 80, and one wants to mix samples for velocities 40 and 80 so that, when the instrument is played at velocity 60, its sound like it has a little bit of both. Were you talking about something like that?

What’s the free piano you would suggest, by the way?

If the objective is to define an instrument (a grand piano or any other orchestral instrument) so that it sounds as real as possible, the best way is to use several levels of the same note.

The explanation is very simple and the grand piano is the perfect example to understand it. When the piano hammers a note, the resulting sound texture is different according to the velocity of the note. The sound is clearly different. It is not that one sounds stronger than the other, but that the texture is totally different. Following this premise, crossing two sounds of different texture will result in an unreal sound in that cross section of note.

Therefore, it is best to use a well-recorded sample library. On a grand piano, that I have seen, 5 levels per note is the minimum. In this case there are 5 samples per note, multiplied by 88 notes are 440 samples.

The free grand piano is the “Piano in 162” of Ivy Audio, ivyaudio.com. Is a library of a Steinway Model B grand piano, recorded by Simon Dalzell (University of Arizona). This man has really done a magnificent job with this piano.

Download the library, is free. Extract all the samples and build your XRNI instrument with them. The result may look like this in the Keyzones:
image

You will get 5 levels (samples) per note:

  1. Forte
  2. MezzoForte
  3. MezzoPiano
  4. Piano
  5. Pianissimo

You only have to adjust the velocity range for each sample of each note, without crossing, and correct the volume per level (each sample) so that the level change is subtle. In the Keyzones you can select all samples of the same level to correct the volume.

You can add a bit of very subtle reverb on the instrument, or directly on the track, but better not to modify too much. The sound of the piano must be natural. It is perfectly recorded, even with its well-defined stereo field (bass on the left, treble on the right).

Here is a song that I composed with this grand piano. You can hear the nuances of the different textures clearly: Ulneiz-bajando-un-peldano-320kbps.mp3

The same can be applied to any wind instrument, or string. The trick is to find the best sample libraries, and most are for Kontakt.

1 Like

Ok, thanks. I know what you are saying about how the sound is different depending on the loudness. It’s just that if you have 5 levels per note, but you have 120 possible velocities, I think the transition between, say, level 4 and level 5 may sound smoother if I cross fade the corresponding samples instead of “jumping” from one to the other, especially in a continuous sound (e.g. a sustained note in a horn). I think some sample libraries do this. Thanks for the link.

Crossfading natural samples will most probably not result in an intermediary sound, but a sound that mixes both sounds together to something muddy. This greatly reduces fidelity of the sounds. A spectral morph would be something different.

I’d greatly welcome a feature for crossfading depending on velocity or other parameters though, as sound design tool. Not for natural samples, but for synthetic experiments where it is possible to align transients and phase in a ways that will make reasonably well fading possible. Thinking of single cylce sounds blending them between each other. Or synthetic drum hits with different timbre, so a sharp velocity hit will have more harmonics than a soft one. It is already possible to do such crossfading, but it is limited and not obvious how to do it, it would be a nice addition to have such a feature available in more simple ways.

I think some orchestral sample libraries do this kind of crossfading I’m talking about. Of course it’s better to have more samples per note, but sometimes that’s not possible. If that’s the case, which is better? To abruptly transition between layers or to do a crossfade? I think, probably, a crossfade, at least if you have few samples per note. If you have a lot, then samples probably are similar enough for the transition not to be abrupt. I know you can achieve crossfades with SFZ, and I know of people who use it.

I don’t say it isn’t possible to work this way with natural samples. It is just that those samples have to be processed with extra care, aligning all kinds of features they have which will not always be possible, else the result will be suboptimal.