Switch sample maps with combo box not working



  • Hi again guys,

    Not sure if something has changed in HISE since @d-healey's video on how to do this, but I've followed it along exactly 3 times now and I'm getting 2 errors in the console. It's saying that the backslash is an unexpected character and its showing up red in my script editor?

    I'll put the code and the errors below. Can anyone spot anything wrong? It should be ok?

    Screen Shot 2019-09-02 at 21.16.29.png

    Interface:! Line 11, column 44: Unexpected character '\' in source {SW50ZXJmYWNlfHwzMDd8MTF8NDQ=}
    
    Interface:! Line 21, column 35: Unexpected end-of-input in string constant {SW50ZXJmYWNlfHw0ODN8MjF8MzU=}
    
    Content.makeFrontInterface(600, 500);
    
    //Sampler
    consat var Sampler1 = Synth.getChildSynth("Sampler1");
    
    //Sample masp array
    const var sampleMaps = Sampler.getSampleMapList();
    
    //Combo Box
    const var cmbSampleMap = Content.getComponent("cmbSampleMap");
    cmbSampleMap.set("items”, sampleMaps.join("\n"));
    
    
    inline fucntion oncmbSampleMapControl(compnent, value)
    {
        Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]);
    };
    
    Content.getComponent("cmbSampleMap").setControlCallback(oncmbSampleMapControl);
    


  • It‘s funny how the syntax highlighting in this forum points you to the error 😉



  • @Christoph-Hart I have no idea what that means haha 🤣



  • @Christoph-Hart I did notice differences from how the code was in the video, to how it shows up in my console...

    The \n in line 11 shows up red and white, and the cmbConsoleMap at line 19 shows up in white on my script editor, where in the video its all brown. Is that what syntax highlighting is? (Please excuse my limited knowledge of the correct terms)

    The one in the video also compiles and mine doesn't, even though its identical.

    Confused .com 🤔



  • I've been stuck on this for a couple of weeks now. I thought it might be because I was on 1.6.0 still at the time so I got scriptnode installed in the end, but still the same errors. Really confused 😥



  • @SteveRiggs said in Switch sample maps with combo box not working:

    cmbSampleMap.set("items”, sampleMaps.join("\n"));

    Why does the quotation mark after items not look like the rest of the quotation marks 😉



  • @d-healey Haha. Oh dear. Taxiiiii! 🤣

    I'll change that in a minute then once my other ones finished compiling. Pretty sure that will fix it. Thanks, yet again!


Log in to reply
 

8
Online

502
Users

1.8k
Topics

13.6k
Posts