Hi,

I've found out that I can obtain much more convincing results by setting the layer's gain to the inverse of the desired maximum velocity:

|gain = round(1.0 / max_velocity, 7) |

However, there seems to be a +5dB limitation to the amount of gain one can apply to a layer. So the quietest layers, that needs between +10dB to +32dB are still too soft...



Le 19/09/2014 15:19, ju1ius a écrit :
Hi,

Thanks and congratulations for all the work you're doing on Hydrogen!

I have a question concerning instrument layers and gain compensation.
I'm making an Hydrogen drumkit, sampled from another hardware instrument.

I isolated (by ear) the different samples of each instrument, recorded them at their maximum velocity, and put all the info in a JSON file, that look like this:

|
{
        "instruments": [
                "Snare": {
                        "key": 33,
                        "layers": [
                                {
                                        "sample": "samples/Snare_layer1.flac",
                                        "min_velocity": 126,
                                        "max_velocity": 127,
                                        "peak_level": -2.92
                                },
                                {
                                        "sample": "samples/Snare_layer2.flac",
                                        "min_velocity": 111,
                                        "max_velocity": 125,
                                        "peak_level": -3.84
                                },
                                {
                                        "sample": "samples/Snare_layer3.flac",
                                        "min_velocity": 96,
                                        "max_velocity": 110,
                                        "peak_level": -4.86
                                },
                                // ... 7 more layers
                        ]
                }
        ]
}
|

Then I generated the drumkit XML file using a python script.
The problem is that, since Hydrogen applies runtime gain compensation according to note velocity, the "velocity envelope" of the instrument ends up being incorrect. The gain decreases too quickly with velocity, and layers with a maximum velocity inferior to 0.5 (MIDI 64) are inaudible.

So here's my question: *what is the formula to compute the layer gain compensation so that the original "velocity envelope" of the instrument is preserved ?* By this I mean that the ratio between the output peak levels of two notes, belonging to two adjacent layers and played at their maximum layer velocity, should remain roughly the same.

I tried to do something like this in my python script, but it didn't produce satisfying results:

|
        max_velocity = round(max_velocity / 127, 7)
        gain = 1.0 + (1.0 - max_velocity)
|

It would be very useful to know since this problem is likely to occur when sampling any real world instrument at different velocities.

------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Hydrogen-devel mailing list
Hydrogen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to