Sampler please play only one note



  • after the last problem is solved, here is the next one.

    I have a sampler - with one sample on C3 - a bass drum.
    I would like to play this on C3 with the velocity value 45.

    So I wrote the following.

    function onNoteOn()
    {
        Synth.playNote(60, 45);
    ;
    }
    

    Unfortunately the sample always plays - on all notes not only on C3

    A

     if (!Message.getNoteNumber() != 60)
            Message.ignoreEvent(true);
    

    does nothing either. No matter where it is. In the interface or in the ScriptProcessor

    The sample is always triggered on all keys
    I am really getting desperate.

    With two or three samplers it doesn't work either.
    The background is a drum sampler
    Bassdrum on C3
    Snare on D3
    etc.



  • @MikeB

    if (!Message.getNoteNumber() != 60)
            Message.ignoreEvent(true);
    

    is saying "if no note is playing, don't play note number 60", maybe that is the problem?



  • @ulrik what are you trying to achieve?



  • Actually quite simple

    in my Sampler 1 is a sample on C3 an Oneshot Bassdrum

    If I now press the note c3 on my keyboard, the bassdrum sounds - so far so good.

    If I press any other note, the bass drum will sound as well.
    And I don't want that - I want the bass drum to sound only at C3
    All other notes are silent for this sampler!



  • @MikeB

    function onNoteOn()
    {
        Message.getNoteNumber() == 60 ? Synth.playNote(60, 45): Message.ignoreEvent(true);
    }
    


  • @ulrik btw, you'll need something to kill the note as well, in the note off callback



  • Super thank you very much.
    So it worked with my 2 test samplers

    function onNoteOn()
    {
       //play Bassdrum on Sampler1
        Message.getNoteNumber() == 60 ? Synth.playNote(60, Wert1): Message.ignoreEvent(false);
    
        //play Snare on Sampler2
        Message.getNoteNumber() == 62 ? Synth.playNote(62, Wert2): Message.ignoreEvent(true);
       
        Console.print(Message.getNoteNumber());
       
    }
    

    Now of course the next problem appeared.
    When I hold the C3 key (60) the arpeggiator1 (Sampler1) plays the bassdrum
    If I hold the key D3 (62) at the same time the arpeggiator2 (Sampler2) plays the snare at the same time.
    But then suddenly both become slower!
    Its a Timingproblem?!



  • @MikeB do you have a snippet?



  • Put a sample on Sampler1 at C3 and a Sample on Sampler2 on D3
    Play C3 - the Arpeggiator1 is on
    Play D3 - the Arpeggiator2 is on
    then play C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xWDpUdvsQz1by+U9WhYU.tshn8ce6292yWzq2Pz924eoTeCDDJ6gwuEK4oCT+K4u7p8rNMfAXM91Khh5fq0AEfHcQmE3orCGmgOl6Pz.6XJF7egmnIyFeqH9jYimTdW9lgV4qCwPrz6ILu2H78Dl0EDj3GppfaIcGtGn0eh5I5mBDlnLT60wvYQIN.S+OjOltLChIpPOsFnPvB+48kye5Gz1ibFpnhZUkua2+LeSrsKsQOGiDmoeecWYRwJtcTKETEIY+YdfsaoHtDrJumE++BpuK16LhEEr1hdWzc3TowhptEmgrjBtHd7g544PZAE3cwlpMbed3SCG.GEgnYLtR9cvWWgBWHJdvdDoAUnGwEbHp2iDM3q3q8v1zDC5xDqneRtNJabD0JvF6uQ0.exIk04E80aiC8wd9aXyI0JhTiCN7EEarQT+a72nF1yP84D3s8sc0OgE9Nm5qf2dUtOdC9urjZ1Gu9o5cQECbsHFv9IeWeFZbVtKie2x2iabFBMuwYyab1kWiyF5miYdCzl2.s4MP6mEMPKL88nZd1fGolmcb2qplmMLHtz+o3O+lm8fjMOq0I7li0ZedyxHbUd.ebE930s3iYbHbzuedyyl27rehMOK27lmMu4Y+R5OPg48RXduDRzKgmJ2KgmJ2KgmNa8Rn8UYuDJV+vpYyLhVI7tXqvV2vi9JivTk7MjaHn.aENhU9RJU4iU6+mUnhRl0yfrga68JCC9o8GBtQilmby.OaNC77nYfmslAd1dF34wy.OOYh7vun8NALpcXl.fPsRgmdRUp+omzn+GfgRgVQ
    


  • Put your note filter scripts in each sampler instead of in the interface script.



  • exact the same
    the first arp play 1/16
    the second arp play 1/16
    together the second play 1/16 note the first 1/4



  • Seems to work fine for me.

    I'm using synths to test in this example because we don't have the same samples. Also I've adjusted your script, since you only need to change the velocity and not the note number there is no need to use playnote.

    HiseSnippet 1734.3oc6Z0sTaaDEVBXowPHAxOsclditnW.SRXrcBjzISJheLIThCdPDRlIWjHjVauCx6pHsh.sSmIcldUeJ5qS6M8tdceDxaP6YkrrVAxFYO.oM0hY738r64re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AbVqn3ePPsJgExopFwpL7nfx+PbmpRC
    


  • Sorry David in your example Arp1 (C3) stops playing when D3 is pressed.
    And also here both together don't play the same as one alone.

    It should just be a simple drum machine.
    C3 is bass drum
    D3 is snare
    etc.
    If I press C3 or call it by script Arp1 will be played with 1/16 for example.
    If I press D3 in addition C3 runs unchanged and D3 plays with Arp 2 e.g. also 1/16

    At the moment C3 changes when I press D3.



  • @MikeB Which version of HISE are you using?



  • HISE-ScriptNode-Build on Mac and PC

    Bildschirmfoto 2021-05-22 um 16.58.19.png



  • I can't recreate the issue you're describing



  • Exactly the same on the PC - I thought maybe it's the Mac

    You can have 2 arps playing at the same time without one slowing down?





  • I think I have found the error

    I have now created a new empty document and it works.
    I have noticed a few times that when I then open a new document or close HISE and continue working the next day that then strangely it works again!

    I will rebuild the again and see when and if the problem reappears.

    Thanks anyway for your help.



  • Command back!!!

    I have created a new document with three samplers - one sample each on C3, D3, E3
    The problem is back - it seems to be the sampler.
    You can try it with any sample.

    It doesn't matter if one arp or three - as soon as you play more than one note
    there is a timing problem.
    As soon as I press any other key than C3,D3,E3 it gets even slower.

    With the SineWavGenerator it works but not with the sampler.

    HiseSnippet 1927.3oc6Z0saaajElTxi2H63zjz.zBzt.7hhBafVYR+WVffhXIa4XgXYKH559yMdooFJMqolgkbnacWrOB8cYueuoOP6E4Mn8LCoDIkYToUsacikthyYlyOyYNy47cF619LabP.yWQsxwW5gUTeHx7RJu+N8sHTkl6pn9HTKq.N1WKhT8K8rBBvcUTUK+JAA0Jyonnr8Qz+2Kqa4ZQswwjj+NgQrwGPFP3ITau8qItt6Y0EeLYPpUuw1MsYzcXtrPvdJizU7rrO2pG9PKwxJgTTmuQWBm4axs33.E04py5doYe12SiV+Ij.xYtXw.CESPPQj2i41UXwhuU1oOwsa6g66.EEUT6DuP4HuvyPsHcIinm3MdrbBsDNR6OTKMIyyXJMuRW07VBUy2C2qGwBzV7oTJJFYspx2BVkxNLJGS4f889hO8YtvR4Rq6QHSaehGudHmynJj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