1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Sorting voices from lower to higher MIDI values

Discussion in 'Building With Reaktor' started by playmodes, May 24, 2019.

  1. playmodes

    playmodes NI Product Owner

    Messages:
    118
    Hi all!
    I recovered an old post from user Jedinhopy regarding a feature i'm trying to implement:
    https://www.native-instruments.com/forum/threads/midi-voice-allocator-polyphony-bug.220580/

    Because this was an old post on the general forum, i'm re-activating this same question on the "building with reaktor" forum, as it seems more "correct" to have this question discussed here as a post on its own.... sorry for duplicities!

    So basically i would like to sort voices depending on the MIDI note value they hold.
    Lets say, for instance, that we have this list of voices/values:

    v1: 60
    v2: 72
    v3: 63
    v4: 67
    v5: 74
    .....

    but we would like to have them sorted from lower to higher, like this:

    v1: 60
    v2: 63
    v3: 67
    v4: 72
    v5: 74

    In addition, it would be great to have this working for an arbitrary number of voices.... not just a defined number of voices but any number of voices that the user defines in the properties of the instrument.

    I've been watching some instruments that perform voice sorting succesfully, mainly arpeggiators, but most of them are transforming a polyphonic stream into a monophonic sequence of notes. That is the case, for example, of salamanderanagram's arpeggiator in the UL (https://www.native-instruments.com/es/reaktor-community/reaktor-user-library/entry/show/8009/). The functionality on salamander's ensemble is close to what i'm looking for, but i would like to have this ordered notes in a single polyphonic message, but not in a stream of monophonic events.

    Do you know of any ensemble where this action is performed? or anyone found this specifical need and has something already implemented? or any clue on how may I start developing such a feature?

    Thank you guys for your help, as always....
     
  2. bolabo

    bolabo NI Product Owner

    Messages:
    402
    Attached is the 'Poly Note In' block from the toybox blocks packs, it sorts held voices from low to high for arpeggiators etc, maybe you can re-fashion this for your ensemble? It's only 6 voices but you could modify it to add more.. you might find salamander anagram's arpeggiator a better starting point as it uses an iterator for the sorting and so will better handle an arbitrary number of voices.
     

    Attached Files:

    • Like Like x 1
  3. playmodes

    playmodes NI Product Owner

    Messages:
    118
    Thank you bolabo!!!
    Great starting point, I'll see if i can adapt this for n voices... i'll keep you updated....
     
  4. kennz88

    kennz88 New Member

    Messages:
    1
    Yeah, I think you're right on that.
     
    • Informative Informative x 1
  5. playmodes

    playmodes NI Product Owner

    Messages:
    118
    Well... it's been some months since my last message on this thread, but I managed to build an "efficient" polyphonic midi note sorting macro, taking salamanderanagram's simple arp ensemble as starting point.

    I'm attaching a macro structure here, just in case it can be useful for anyone else.

    have fun!
     

    Attached Files:

    • Like Like x 3
  6. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    i remedied that situation quite serendipitously using the bubble sort that was graciously uploaded by an obscure reaktor elder god. everything went in mono and then was read polyphonically from another client of its event table. not a subtle technique but had zero problems with the annoying edge case crap that always seems to happen where something goes low or high in one specific situation and ruins everything.

    "get in line single file, i wasnt asking"