rearrange array : low to high

Official support for: loomer.co.uk
Post Reply New Topic
RELATED
PRODUCTS

Post

Can't seem to find a module that rearranges the elements array from low to high
Eyeball exchanging
Soul calibrating ..frequencies

Post

Currently, there isn't one. I did implement sort as a macro a while back but it was horrid in terms of speed and readability. It can be done, though, so I'm sure I can come up with a clean approach. In the meantime, you can use a Lua script module, provided your array elements have some natural ordering, i.e., numbers or strings.

Code: Select all

function arc.module.receive(inlet, object) 
  local t = object:pack()
  table.sort(t)
  arc.module.outlets[1]:send(arc.array.new(table.unpack(t)))
end
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post Reply

Return to “Loomer”