Hi, i don't have enough knowledge about the hydrogen audio engine to answer your question, but you could try to have a look at sampler.cpp[1] and see if this helps for you.. Best Regards,
Sebastian [1]: https://github.com/hydrogen-music/hydrogen/blob/master/src/core/src/sampler/sampler.cpp On 2014-09-19 15:19, ju1ius wrote: > 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/hydrogen-devel ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Hydrogen-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hydrogen-devel
