How to fade out before noteOff?



  • I've made a very simple script that plays the note for a fixed duration and kills the previous note if a new one is pressed (so legato)
    The problem is that if the same note is played when the previous one is at about the maximum gain, then we can hear the transition which I don't want. This is because the release state is not triggered when coming from the same note, hence the hard transition...

    What would be the solution to overcome this?

    HiseSnippet 1066.3oc4W0siaSDEdbRFTigVnpHfKMWPUh5RjSaZYqhp5tIaRUDjMQaRKvUUSsONYz5LiwdRnQU8YfWIdD3Ef2g9F.yL1Ys8h2PHRzRE9BGOm+luyuyjwgbGHJhGhLpNcc.fL9H7j0Lw7tyITFZvIHiafGRhDPnULoNqCHQQfKxvn7STDLpVAoedyi6P7ILGHkDB8LN0A9N5BpHk53i9VpueehKLktHizsNZfCm0k6yWJwSYrMJf3bNYFbJQIVILx3C54RE7vIBh.hPFU5vcWOYN+mYwx+LZD8E9fZQSzDoghI2m66pPr5aT24Te2wa76HDx.ONMJTNNJ7o3gTW5EzSiFehlgUpFYiGFk1F7ZlEd1EBulE.OTFzUIFcRPvcW5SD4QlJcjvfxymoFvD.KhJVmMc8NEt2DOlJblWLdKU.dkIp+swaRx+53dddfiHErUv8+g2tY5aDCkODOgx.cGoFHelds02SVAVOAXPnJn1bKMk+1t1TFryMkibDxseZHgEEvixZ3ecBrfNkyTQjzc6oQP+P3mNSkkyRuKmDVHq2739RmrPclPDKC0kKGufujIxUdTNeNAe04jrCGx20jQ9+loFUdGL03evPMi+Ze3MwSbBoAhTNJrcqDponKe8TLWToe2.GByrXbAz1T8E0ssoo2RliJtYwYmJ4LhUqt4qttok7YnzXxg2MVPNGNNTP8nNThes5sMqtgEcFiGB8VALQMQ3Rnd6XUieS8rpQcst8s0ap0W9nKL4LPn1sSWt3EPXs50ekYUkB59jFJgG440Ys1tCbk1Xicec7O5WZadklrcrfUMqJQviRrLw0MwIadfV+Crdf8AV1JWxrZdY77REp0g11Jgdso0kiWRwjArsEQtjVc4LQH22WARkhWhsp4sXNIJVio8vCrVQ7kleifxhj7Ugl6VUnb1fbRsHifb1.FULJ.RNSdSgwFJMQW35YEJ0uxRU6NEHVJoBFi1MFSpQOCNgHHptgDZR4B.YsnxCMNAVImCF2aTEeBDctfG7eiya2yFcyX79w3oDog5wVA9R+M47VMMqMDy2jOjy3Ay4LpS1IpmAhP5rYPXVunPW6XgPdUsKnbzubzYfOPhxcPRrPZXnSKF8vsNrQ9mUit2Ka39P0mOrqd8O149mdmLqku7tSF4QI6TF69U361J0jWkdWNcTd2RGEjBJsikLeNNIDHqpsdu4lZeAdSD98JXu0KXV9+mWv7L9RAkMaHQ1W+R4Mjjm1MQduNGPhDFC7U2ZxnjZDZ7Za0Z88t.lqdweHeRX1Ts1HgYyMLeqrGKHNg7m6DeVfpC7ZZJR+lo+qhUk+mU4ZqlH8obR8v1MrQKjWB64NNpv8WKiOEqyc2Cct2dnSq8Pm6uG57f8PmuYOz4vspi59uGuTvWD2JJILtW7vZidL0jacUO5OAOZIaE.
    


  • Might it be solved using event IDs instead of direct note number?



  • Synth.addVolumeFade(int eventId, int fadeTimeMilliseconds, int targetVolume);

    If you set the target volume to -100 it kills the voice when it gets there (I think...).

    You could also try Synth.noteOffByEventId(); I can't remember if it triggers the envelope.



  • @d-healey Oh that's exactly a function I was looking for when searching in the API list but I got itchy eyes these days 😂



  • @ustk It's a useful function but there is no control over the curve, I think it's linear.



  • @d-healey yeah I that's what I'm using in that snippet but no, the release is not triggered...
    Trying your first solution 😉



  • @d-healey Strangely it does not work, is the mistake mine? 🤔

    HiseSnippet 1055.3oc4W8ziaTCE2SRLhLPApnB33bAorpoQIa2tzUqPM6lMoJBxtQaBKvoJ2YdIwZmwNLiSnQnJwE9bvWENwY9Tv49M.d1yjLSVFBQQzEUgO3Lu+Y+68768rS+PoKDEICIVkGtXJPrdW5fEB0jVSXbAo6YDq2hBh46SNcwTVTD3QrrJ9TsLqxkHlwqdxoLelvERYQHWI4tvWxC3pTt8a9Ebe+NLOXHOHi1GzrqqTzR5Kmg3nHsNYJy8Z1X3blVsBTDDs83JY3.ESAQDqRm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wlYG4QY2WuTPokrL4x3zPfpR196lsItBdVD96JXerKAU9Gykf1mGKorQ8Hp95WqVNe23.G0tGtfBILF3qtHrUI8XyD55ZZytA.yyP7Q0SpvFZZqTgMlI7D4NBHtB9ScSl+q6.OsgixuYlOmoJtml1tAx7lMkc35qWGEn1f3ott5v8uphOEayFqfM2bErYyUvlasB1b6Uvl6rB1b2i0F8xaaEK4AIshJF8amLr1pMSO41T0i9DPx.IrK
    


  • @d-healey Fade Time... silly me... 🙃
    Exactly what I needed! Thanks a lot Dave! 🤘



  • @d-healey Oh what is that? Try to play two notes at the same time it creates a very nasty artifact 🤔



  • @d-healey Simply solved by checking only one key is triggered at a time...



  • @d-healey Side remark, don't you think the Voices limit is weird?
    it limits the voices to 1 from a setting of 6, and if you set it to 1, it automatically comes back to a min of 2 after restart...



  • @ustk I hadn't noticed


Log in to reply
 

15
Online

1.1k
Users

3.6k
Topics

30.8k
Posts