How to control Flex AHDSR Decay time with Velocity?
-
How do I control a Flex AHDSR module's decay time with note velocity?
With a regular AHDSR it's easily done by adding Velocity Modulator in the Module Tree, but the Flex AHDSR doesn't expose modulation slots for Attack Time, Decay Time, etc.
-
@dannytaurus You could script it, but the lack of modulation slots is a bummer
HiseSnippet 1097.3oc2W0raaaDDlTVLHRoMHIHnnGWXzCxAFthQp9GDTXYKYEaTKaASGmdKX0xQVKL4trjKUhPQO2Wi9nzGgdtmJZeAxaP6rj5GJKAGYUmFfxCBZmclc937M+rrcnjAQQxPCyhmOH.LL+LKmABUu58nbgwQMLLenUKZjBBIoh1eP.MJBbMLMW4kZAlExaj779c2m5QELXhHCiKjbFbL2mqlHscsui640j5Bmy8ync0ZGwjh5ROYLhmUrJaDPYWQuDNgpUKmkwgzndFlOyxF1t5Vtc1g0Yyp1Uqv1oZkcJ6tMsJzkAksc2oZmp6vJukg48NvkqjgNJpBhvCceo6.mdx2JRcvE7HdGOPuv1vA8bpXi583dtsGEbhLLLsZOITsRZn5oVs3t7wxmDxdTxFjIVjMnYl6lfj8s.RlYfT9TH8XKGVHOPMYGMddf0QBjA6RQtIKTR00H2aMspKQMDpM7oWAMCwEisnzlkKuNA+YsWTrHxOQJRSO3c6cXCmyNPzG7jAfM4aIIoMabInZIci8n3aXoU0JRRzjLV0UW6EciELEWJHRwIREbpnzZE+whE7jLpGoOdVsPri7t9zt.shwUCJgtuPwBy55Mh.0dJUHuSrBJMm8a.L5f0IUJiOjulX+7sHOizGOtepH45Hoa2Tnbs8zQmPomGDN2s0owg2jgkDw9cfv0I8odwvXEQZa5bg6sX4BrTxJihRwQBt5z.X35lROWMGq++rYNFCYa7eu5nFTEUmLMTFpW.Dp3Z3X1.5ikuooVErZ.QWojAXA7L4cXF+HVOaYftAwvMv3wT4d57KQDRrYafbKpMJei0FKJDerUath0a9XL2bvHFo9XfwgcT9bqC51EXpI.LuUyueYaer3t+got+AVNbAjTHm37uHYM40z9.4kf.B0AO6aXDvusni.BV3Q.mxTn6OOjJhBjQScvNfO+boPGElH7UQX+K3GNSylYkWWRCm6Vue2l3K4bswgphCSRK1yWFKTSkFrxz7P9Eqzc5JhL5Om964+DLx4tor5SXkuYtLXrvHL5v8C7fQyDRv3Sv9YcowdpwSJlBksjBYPOofyxx5mA3flKuDByh849BgijvKuLQxSqcF3AzrYveUsiwLOZHFmfkLVb6ugvb4quzJEtDc0H4eCukew3sOv7oLv9QiZMMdx9vVSy6tEejYvCQTm8rRtYwPA+xE+7uWyINRMogXsJU9qcuNq+qg0tNem5niA7kXVw0iC6mQ6+X2DmNizgtIqbxpq9m2c4R2ISTW4+2STOSFq3hKaQwTr2gexvIw9N3fLFfdWH.O7vsLyoGFkttrdc5jLgaxh+FeFtosds4vMsGs4+I9vmxBkugkd2Ucej6mHAeuEIeIVA7SBw0Daij6ylkK8woPugwl9nlwvmurFVYYMr5xZ32rrFt4xZ3VKqga+gMTeIg8hUR+zRSCiVsOH4C.LMOPPwr7jJBi+An1zRAK -
@David-Healey Great, thanks. I didn't realise it was okay to set attributes like that in the noteOn callback. Proper noob!

-
@dannytaurus Yeah it's fine, but I wouldn't do it from the Interface script in a real project. That script should be deferred. Add another script (midi processor) for this kind of thing.
-
@David-Healey So in general, you defer the main interface script and not use the noteOn/Off/etc callbacks at all? And put all MIDI stuff in separate, non-deferred MIDI processors?
Still wrapping may head around the way scripts are compiled at export.
-
@dannytaurus said in How to control Flex AHDSR Decay time with Velocity?:
not use the noteOn/Off/etc callbacks at all?
I use them when I have something on the UI that is affected by note events, such as keyswitches to change articulation and updating that visually on the UI.
Interface script for non-realtime.
Separate processors for individual realtime tasks.If you always defer your Interface script by default, which I think is a good habit, HISE will give you an error if you accidentality try to do any realtime stuff in it.
-
@dannytaurus
You could create a velocity modulator in the GlobalModulatorContainer and give the UI button that controls your envelope a matrixTargetId. Then you can do it via the modulation system. -
@Oli-Ullmann Thanks. I looked at the GlobalModulationContainer. I haven't used one yet so might be a time to try it, however I ended up getting what I needed with a simple TableEnvelope. It gives me great control over the curves.