Change a sample map in the same Sampler with MIDI Controller



  • function onController()
    {
    var noteNumber = Message.getNoteNumber();

    Console.print(""+noteNumber);
    
    if(noteNumber == 43)
    {
        Sampler.loadSampleMap(Pato);
    }
    
    if(noteNumber == 45)
    {
        Sampler.loadSampleMap(solocampana);
    }
    

    }

    of course doesn't work . I don't know How to call a samplemap or maybe , call another sampler it work too



  • @jhonder04 Don't change sample maps from within a MIDI callback. You should change them using a control like a button or menu.



  • ok but that I want and I need is something to play on live and change the sounds when you press a key or specific note on midi controller , Can I do that with buttons like you say?



  • @jhonder04 No, the sample maps aren't designed for this purpose. If you try to change sample map while playing you will get silence, or perhaps horrible noise. It sounds like what you need is closer to traditional key switching?



  • ok my point is . In kontakt 5 I can create a Instrument Bank and in each space drag and drop for examble in the 1st rectangule a Trumpet sound and 2nd rectangule a Piano sound ..... So them I can assign a range of keys to change the instrument for example C1-C#1 so when I press C1 I'm going to have the first instrument "Trumpet" when I press C#1 Piano instrument ... Actually I want to create a Hammond s6 standalone instrument , the thing is that organ have many Registers of sound the same Organ and to change that registers have it many buttons of course the real organ! but this organ only have 4 octave F2 to F5 so I can use others key of my midi controller to change this registers



  • @jhonder04
    I'm not sure what you mean by sample bank in Kontakt. Are you referring to Kontakt's groups? If so you can do the same in HISE but you have to code your own key switching system.



  • ok how I do my own key switching system? xD

    Is there any way to switch sampler with midi controller? no samplemap

    If a have 8 sampler ( each sampler with diference sounds of course) How I switch this sampler with midi controller ?



  • @jhonder04 Yes switching sampler is one way and 8 samplers is fine, 15 samplers is really the most you should ever use though to avoid performance issues. Add a MIDI muter to each sampler in its MIDI processor section. Then in your main interface script you can add buttons and link them to each MIDI muter, you can also add code in the note on callback to turn the buttons on and off. You should defer MIDI callbacks if you use this method, to improve performance.

    Another way is instead of using buttons on your interface you control the MIDI muters directly from your interface script in the on note callback. In this case you don't need to worry about deferring the script.



  • Actually ignore my button suggestion, I just realised that won't work.

    What you need to do in your main interface script is in on note, when a keyswitch is pressed, you enable all MIDI muters (so all samplers will be muted) then you disable the 1 muter selected by the keyswitch.



  • This post is deleted!


  • @d-healey ok that's better so when I do that and it works, I'll do a video tutorial explaining how to make an instrument of this type xD .. may return earlier than expected here





  • Here is an example of how to do it. For some reason, which I'm hoping Christoph can explain, it only works when the script is deferred.

    HiseSnippet 1770.3oc6Z81aSaDF2toFHgV1XhIs8hI40sIknBsIgRYrNDoMMkkAgFkTXSBgXWsOmbpN2YYeosYn9l8IZeD386KCeC5dt6bhsai5hQaCXyQhnbO+69cO2cOO+NTa6yrvAALeM876MxCqoufQ2QTd+58QDpVys0zuhQaeb.lqs0HOTP.1VSWO2CEZ0yOul7yadvVHWD0BGIRS6YLhE9wjADdjz10dDw0cGjMdOxfXVuVslVLZclKaHfjbFk07PVGf5geBRX1bFZ5WpgMgy76xQbbfl97awrG0sO6Hpx9mQBH66hECpn0EBjR7NLWaAhE+Vqdehqc6wq3.MM8K2NZ8mSs9ugQKhMYh7n7vGKUXF4Q77g9bWD7p7VBO8XvadE7ttQWKehGORi.aW0nIki8cPvVPbXorUat8yYTmAVP4qL.c.dGeXvDOJtd4x2zrZ4xk1XwBKVPt8uhM1A6WG45tOrQDTj6ODqT6i6YRfeA6WAbyCQ9lGfG08HB2pONv79lOu5ZPvtC7u0ewFlqtZcH10+JwWUh6z.HW1ZHf.oOuPFZGluYQBLt7FlDyuOdfWwES6w6CxWd4RKV3UKVvD9DEjmSdA3mB58v7DagEWp0X6VZYRoMJbhXxHTWBEa5LjZwILpoUeDsGdSeNwZnKRHpHgZiOVLavTolvUWsAEA6ilPhwrUysaZNPsFvGag83l79XSFDUdeD27HTfY.1Eaww1J2O6BLB+mY8ILNbMdt04JvcwM4bex9fjhPhUBSyu79lh0lvbX8cxj0Ei9DFGuKsXoBupfJjDGyhwysx.rqSwVP5BtyIRfBedxvA6i8KVpjH12pRIX02zwDI1VBjtJWgdPwgfwKvXXdJ4yzLmkjmcDoYQN87AaxFmZFOQ7UgSJb1ksiibcmOoJwcAelqqXlNuVQoI+Kv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ddUWTp6ZgrpLkzyeOeedACYOQSAus2UPsCan3Epi4DY.Dm5BjEsvwoOMmnLqZb4wOhsKlZKGHdLYnxJi4ZITVYrRMqwgBVag+V9FS8bX4+KQxmK3Br3biejN.njJfDz2e1YUWXLq5pYzpynUmQqNiV86czpq7A.sZfQbFs5LZ0YzpynUmQqNiVcDs5amQqNiVcFs5LZ0u2QqtZFs5LZ0YzpynUmQqNiV86VZ0+afxAHKe1KsTcSDX8JRI.Jox+TfyazRL1rx31Ghrq3uOxWZYItFbKH+NcOplZOtcp8XsT6wcRsGqmZOtap83au.ODLS1bHmMPUTDDztg5fjdiIGjxo8m.DFASx
    


  • @d-healey ok honestly I don't understand when you say defer ..

    What's mean that ? I'm a little lost in that part




Log in to reply
 

1
Online

325
Users

969
Topics

6.4k
Posts

Looks like your connection to Forum was lost, please wait while we try to reconnect.