MIDI problem

    Aug 01 2018 | 2:01 pm
    Hi guys I have this Sampler I made using some old code. There is a part in which I just take the last 10 seconds of audio that just happened (which are always writtenin a circular buffer). For some reason when I click with my mouse it's fine. When I click with a midi controller or key (in Ableton) it does some strange stuff. I checked for not off notes on but I can't explain it's just different. Anybody can help? It's labelled "Snapshot" in presentation mode. I really need it from a controller and not with the mouse.,,, Code attached

    • Aug 01 2018 | 2:52 pm
      Different behaviour of mouse vs. controller action usually happens because the events have different priority (low vs. high). Inserting [deferlow] in the controller input may help, but introduces latency. You are using some JS code which is generally not suited for real-time processing (as it runs at low priority). So perhaps it can't properly handle the high priority events from the controller.
    • Aug 01 2018 | 11:24 pm
      Overdrive must be on for midi use clearlow instead of clear to wipe buffer. Check all that pipes and priorities. Get rid of java ....
    • Aug 02 2018 | 8:33 am
      Hi guys thanks that solved the problem! I just don't understand deferlow and overdrive, should it be always used in the case of MIDI?
    • Aug 02 2018 | 8:49 am
      This article may be helpful. https://cycling74.com/articles/event-priority-in-max-scheduler-vs-queue
    • Aug 02 2018 | 10:54 am
      Overdrive on is a must when using midi. Even so, it can happen that high cpu usage might put midi into unusable state, resulting in terrible lag, on osx in first place. Turning overdrive off, and on usually fixes the problem. One can make a "resetter" by triggering overdrive off, and than on after 100 ms or so.
      clear message to buffer is executed in high priority and will disturb whatever is in exec cue. clearlow is "nice" meaning relaxed priority.