Simple Polyphonic Sample Player


    Jan 09 2020 | 5:39 pm
    Dear all, I hope you had a wonderful start into the new decade. For a quite complex upcoming project I'm currently searching for a dead simple poly-sampler. Unfortunately I tried to write it couple of attempts on my own but it's much more tricky than expected. I played around with poly~ / and regular poly objects and voice stealing and adsr~ trigger methods. What I want to build is a polypohnic sampler that allows me to simple add one wav sample per midi pitch value within the range of two octaves. (no re-pitching, just playing, nothing fancy) These samples should be triggered via global ADSR settings that would count for all notes. And if I trigger one sample multiple times it should be smart enough to do some "voice stealing magic" to avoid any "click-noises" when jumping back to beginning of the sample.
    Right now it just gives me headache. Maybe I'm having a major design concept flaw: How do I solve the follwing situation: my poly~ sampleplayer has 4 voices for the same long ambient sample: 1. MIDI Note on, comes in. ---> first poly starts playing 2. MIDI Note on, come in. ---> second poly starts playing 3. MIDI Note on, come in. ---> second poly starts playing 4. MIDI Note on, come in. --> fourth poly starts playing
    all good so far.
    now if I would send another MIDI ON note of course all polys would be still occupied. What would happen is that poly steals one voice and jumps back to sample-startposition and would start with the playback again. This moment of course would be heard as a short "hickup". In a way I need to have a more dynamic solution but I'm not sure how to solve it. How can I avoid this? It should pretty much work as the simplest version of the ableton sampler.
    I'm sure I'm not the only one who had the problem to trigger multiple wavs hat the same time. Maybe someone has solved this puzzle? Or has somebody a hint of decent max for live sampler that does the job? that would be the easiest way.
    I attached a maxpatch describing my misery. Maybe I'm just tired. Maybe someone can give me a hint?
    all the best Christian

    • Jan 09 2020 | 6:11 pm
      i am not looking at the patch because i am confused enough by the words. ;) what you basically want is that the release part of the oldest running generator is not cut off when the attack part of the next note starts, while beeing in a round robin situation with a fixed numbers of generators already. this can only be solved by raising the number of generators (i.e. the polyphony) to 5 or 8 (or even more.) try to add another layer of round robin to your system, where there are two samplepayers playing sample A, which are also triggered alternating. since it is already poly~, this should be really easy, no?
    • Jan 09 2020 | 6:26 pm
      Hey Roman,
      thanks for your response. I totally get your point of my confusing writing style. It's too late already. Sorry. :)
      I'll try to follow your instructions as soon my brain gives me some room. I need to check again the round robin idea.
      thanks so much. Greets Christian
    • Jan 09 2020 | 6:50 pm
      Roman, unfortunately I think I need to find another solution because adding poly layers might be a to much for my system. In the end I'm aiming to like to have 6 instruments a 24 notes.
      this would be in total 6 x 24 x (2 x 4) Polys = 1152 sfplay objects. :( I probably have to make a restriction that just filters out notes if they occur too often or if they are still occupied. not a good solution.
      anyway. I try to work it out.
    • Jan 09 2020 | 6:56 pm
      ya, i agree with Roman: raising the number of voices to 5 in your case will be the simplest solution(otherwise, you have to create a different 'voice-stealing' polyphonic system on your own). i also notice you didn't use 'thispoly~' in your poly~ patch(usually folks use this to help them keep track of busy voices, maybe you could look into that object too... but then again, it seems you won't even need it if you just up the number of voices in your poly~).
    • Jan 09 2020 | 7:17 pm
      you have sfplay~ objects in a sampler? that smells fishy. ;) but yes, with 1000 voices you are probably right with not doubling their number.