How to control the parameters of each key individually?
-
I'm making an electronic drum plug-in and I want to give each key a volume control knob. How do I do that?
Please help me, I am a newbie, I will be very grateful
-
@BobCat
Here's a snippet, you have to place 2 samples at key 60 and 62 (Snippets doesn't include audio files)
HiseSnippet 1497.3oc4X80aaaCDWJNps1qqXsn.auL.hf8fCPWps6+FP1PbiSRmQqaMrSKVeYsLRzVDQhTfhJtdC8Cx1mh85dKeZ1y8av1QJoHJG2TWu9OroGB7cj2we2wi2OxzWvcIwwbgkc08mFQrrunyvoLoeGeLkY0cGkh6A+rOQbexTqsmFgiiIdV11UTpAyV0R+8ps1FGfYtjBUVVOgScIOfFRkEZ6299zff8vdj8ogFy9ls65xYc3A7D.MUbZXEgcODOl7PrZZq3XYetc8nRtXnDKIwV1qtM2a5Pe9DV57eBMldP.QIzzZH3nT06wC7THV8aqN9z.u94QcrkksS+hbPkzbvUc5Q8nmnuHW7E5APEVXlOrWoL7pTBdMecvaNPx1.RqlBoK6LzUPijEinvym4zkIIhQXHsaBkz4ZsxWtpSGNLClbiP7gj8DfvIVT+1MZbMD7m02rVsqe8pCHiHBBrChjbjzmfFhCiBHBDNN+m0fcnXI5HrHWSSzOfzELaLlHyzUes7AWKy0CIADWYLBGDfh0iEinLyEoVtIaDqm6PdByKt9Z4d3o7DDiP7TX6PFehx7I9TWeDW3AXT4pbOiEDTT.DgdnQBdHJIRYkGrQfpOUMN5.pDEKEX1Xx5Ju+iPfi5h7wGQPbVvTTqBmw7fQzKYWzDLSp7EjFjBdfxTyE9HdPRHAgknCISgLKZBU5iTmSZhpOAp5QGP.f6QdAp45ZOWXMXkxcZCaM6rardgqZoyGcfT4Av4CsJTypeawWMJKfxHnQILWIkyfHRCgNofttKOLhyfZhqAajAIPF3WqU0H8ml6gBsHhPNsdyqcxd8FOQGf41sYsWBaN4EXv9embOWeM8Jt15J2kst4HtdY3n1eOU.0xLdNynp0RFUMV5np0YEUsLipZFX8gbI4Qr5ZTU6k0PyNznQycrL2oNTMugUcPEmkg0YI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ple Gain module and add an ArrayModulator module in the GainModulation chain, I have never done it though, maybe there's someone around that can explain how to do it?
-
@ulrik I succeeded, thank you very much, give you :red_heart:
-
@ulrik I found a new problem. When I switch the Samplemap, the control of the knob will fail. I need to manually click Compile to make it work properly.I tried some things but no success
-
@BobCat if you're using my first example, you could try to select the sounds again when changing the sample map.
something like this:
call the function when changing the sample map, I think it needs to be executedbefore after changing mapinline function updateSelectedSounds() { // Selects all samples in the Sampler Sampler1.selectSounds(""); }
If you're using the other method, give me a snippet and I'll take look
-
@ulrik I succeeded,I put Sampler1.selectSounds(""); into oncmbSampleMapControl and it works fine
inline function onknbVolC1Control(component, value) { Sampler1.setSoundProperty(0, Sampler1.Volume, value); }; Content.getComponent("knbVolC1").setControlCallback(onknbVolC1Control); //change samplemap ------------- const var sampleMaps = Sampler.getSampleMapList(); const var fltPreset = Content.getComponent("fltPreset"); const var cmbSampleMap = Content.getComponent("cmbSampleMap"); cmbSampleMap.set("items", sampleMaps.join("\n")); inline function oncmbSampleMapControl(component, value) { GFRNB.asSampler().loadSampleMap(sampleMaps[value-1]); //updateSelectedSounds ---------- Sampler1.selectSounds(""); }; Content.getComponent("cmbSampleMap").setControlCallback(oncmbSampleMapControl);
-
@ulrik said in How to control the parameters of each key individually?:
@ulrik I think you can do it simpler by using a Simple Gain module and add an ArrayModulator module in the GainModulation chain, I have never done it though, maybe there's someone around that can explain how to do it?
Ok I found out how to do it using the Array Modulator
HiseSnippet 1427.3oc6Y80aSbDDeOaeTrokBTTUe7DhGLRzPr4uUnRbvIA4VBwJ1.suTzxcqiWk810cu0I3VgTU+7zOD7Qnu02pPpOWI9FzN6d246N6KINlDDfx8Pj2Y1c1eyryL6LaZKEtjf.gDYUt6nADj0mZ2YDW0uYeLkiZsBx5KsaJ3Jof8DAanOoMQ9Hghft+nA3f.hGxxp3Czy0pbIj46MKceLCycIIjPnmHntjGR8opDpsa78TFaMrGoK0O0ruQiVtBdSASLDvUQ6EQCvtai2h7HrdZErQVmZUOpRH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MTZbWlHEh18n3LeljtfnrQMoleN8pU53p8w2ogdu8YJJNav8.51sbLF6P8GvHqx2gvfKtLX7BvMU8vCYpXpYcxWWvEC5K3T2zd.aRTR5VaQjowdtJzxJk95swTtXiMILBNs27ka7PvKDKA6DYNsEG9N+y875qrCgqiNxz4iiL7E+HJC+g38mReje5wuFmw8+AwP4rQDbzT1ub6HzJDFNiA7oYqz3GajS1+VPDkT0VvvxIM+EOpbsKMy9HZU53xmdNOXriAb7i+Dh5n7RS9zVGLhSJbdkSZz8jFc+.qQ2ir66l06MzW8yRBwd++htKXaR69gCfOmcaL+8.3toXnhx2ZcLT1Fz8r8iF52AZyvk.PkyIr.8qFTP2pP33E0iC6yf6YF7evWDyZ5wVQLqEy7il8vG6JEOyM78hz2XcZCEv1xM+KyJautdrS1WYx74C8g7LW2rhZpEVedW30m2Edi4cg2bdW3sl2Ed64cg24fWntMwkGpD9gwhHz5sW0Tnfk0pbLDUYBKQ+O74k5lB
-
@ulrik - interesting - there's an occasional little "blip" note being played when the values are changed (not everytime ) - not sure why....but otherwise - cool.
-
@Lindon Yes, I know, this way of controlling volume per key is not working so well if you have samples with a long release because the other pressed key will adjust the volume on the first pressed ringing sample, it doesn't seem to be polyphonic