selecting files using a slider



  • @Jay

    To put the file names in an array. First create an array, something like const var irs = [];

    Then add each file name to the array:

    irs[0 = "church";
    irs[1] = "hall";
    irs[2] = "pie-shop"
    etc.
    

    Then create a callback for your knob - if you don't know how to do this you need to watch my scripting 101 video.

    In the callback you can load the IR. Instructions are in the docs. The basic command is ConvolutionReverb1.setFile("{PROJECT_FOLDER}impulse.wav"); Just replace the word impulse with the name of your array, and use the your knob's value as the array index.



  • @d-healey

    HiseSnippet 1187.3ocuVslaaaDDdorYZsRcPSZN.D5Wx.oJj9QZABLhs0iT03GBVJooHH0cE4JoEZ4tDbW5XEC+u9idZ5In.M2gdB5Mn2f1Y4CQpZlTWAzPAC3cluY1uY1Ylc6EJbIRoHDYr1fYADjwmY1eFWMo4DLki51BYbGyivREIzJQzAyBvRIwCYXrxS0BLVaUT72e9jCvLL2kjKBgdgf5RNj5SU4R6s2ynLVGrGY.0u.5s2qqqf2TvDQ.eVwzFEfcmhGSNFqgUwDYbq1dTkHruBqHR.yABuY8mHdCOA+KnR5PFQuvA0GbThXTyITlWurXUhPFq1KOxWIIxuu4QTO5b44YfOOVgUtEEyAFUVjRqt.kbdeTpif4ocv6gdFEn2pIz6tl8cCoApbMZtcaytb3vYDFR6EoUBVTkeshYSAffqZ3imR5DBKlaQ8GYa+.qcrs23wqWU+CR+Rk04X3vVvOWvhTTA+Tx4jvgV6ZEWXzXLQ0dzHhqpdsqApVhixcCMTBF9pWGK9gOzZ2c20Ze+gTBTl3rdUP8qreMfnlsi0g3vwj4Za7F740dbBDmDHaZcDwiF4WJlMSvrkUeeLiUJjshg3roUSFA3VYP1NAxNV8HgtQRIDYYp0+nbFkSrFEwc0Askf+LtXniNCGJX0cE9ABNjqe.D7rHxFqW8x0qZAeWKS0PRTcnLR8ZW16zS911MGbVmSNrU6SuBnQbZ7J3uriNHm2Ly20qEum01P6hzctIDxCgdk5KRnri017w.savDXu8i7nB8FKgp.QOAv5MJDNGKTjS302n5kUWq5UUs9mpFMpTco6GiDVpZcad3Gxv57H+gjvrzVFPn1ewlqaeyZtbSRaE.J3c4T0IAjz04seZcIQclVaz7fsnn7Xrnz3PqDX4htd2MJ8XU2mmBGfph6xuSZWdeF0iDhn.G+Dy3yTTbto3rUzy61BqvYtA7HrKAjPEUmqLZQNGl8lL7XMyVD4TkHHFaZkDLr+ecSuX9F9iS2a17Eu6G1Sploy72JFHxm54wH8DRp9jsvkB+Fb2QPe5aiY9k2+Wd5e71e5I9Eu2.g7wWT7ZDYznQzKhG3Ohx7kJfac8g6APF2y74RhkGYDNhorjSA+.cjSIdCDw3QWetIL8V3EwvpEGoqu6JUglvEmcpmOxg.YVQR8eXNucoy4cJqR3FR26Z1ipbmTNeqTBegZh+u4a5slqalbaPNYW0ryK+HeE48x3Rg4rwb4KLu1j2EnVqvYK9Hlu+ceGQsnHD5Pf2b2ERuc8ChXRxgD9X0jh0IorpKOHRUTNT2d.LgdbnHh6MXRHA6Uze8BIdDFdg83anMK3ie922qE1OfxGWDSmNCR6vyEAS2m+ho3NMSi4cYI+KSHBfSiPUQAs4dYKMV4C8NKma96rPmJfTOe7QXnIVu8GG42GddmKApW3bBSp2xJ5YhIqsynPeB2KdweAeoJczqMRU5jo7ixd3icCEm4lLsVW98owRf3lGmpWCdkLr1Z9XZSS6F15whzybc0MEeoCBUtMatD1r0RXy1KgM6rD17nkvluZIr4q+f1ney99QJgex.SPPu1wWWZXzligp23A.n+F.7H.BH



  • Did you read the docs? The answer is right there in the example. Also irs is an array, so you need to give it an index [] when you use it, it's not a text string.



  • @d-healey I read it but can't get it to work



  • Show me your code that uses the example from the docs and I'll be able to help you more from there.



  • @d-healey ```

    const var ConvolutionReverb = Synth.getAudioSampleProcessor("ConvolutionReverb");
    Engine.loadAudioFilesIntoPool(); // Load All IR into memory to be pool

    const var irs = [];

    irs[0] = "01 Large Ambience.wav";
    irs[1] = "02 Medium Ambience.wav";
    irs[2] = "03 Small Ambience.wav";
    irs[3] = "12 Clear Ambience.wav";
    irs[4] = "15 Percussion.wav";

    inline function onKnob1Control(component, value)
    {
    ConvolutionReverb.setFile("{PROJECT_FOLDER}irs[0]");
    };
    Content.getComponent("Knob1").setControlCallback(onKnob1Control);



  • Looks like you're nearly there.

    This line ConvolutionReverb.setFile("{PROJECT_FOLDER}irs[0]");

    You are only loading impulse number 0. You need to load the impulse selected by the knob, which you can get from the value parameter of the callback. So swap irs[0] for irs[value] You also need to concatenate the ir name onto the end of the string because the array cannot be part of the string.

    So the final line should look something like this: ConvolutionReverb.setFile("{PROJECT_FOLDER}"+irs[value]);



  • @d-healey thank you, you're the man



  • @d-healey I put the names in an array, is there a way to display it?



  • @Jay I figure it out



  • @d-healey I have an array working fine, but I want to do now is to select anyone in the array and have a certain bottom to be on.

    ex:
    if I select 1 from array bottom 1 should do something, but if I select 8, bottom 2 should do something.


Log in to reply
 

10
Online

601
Users

2.4k
Topics

18.4k
Posts