rearrange array : low to high
-
gentleclockdivider gentleclockdivider https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=203660
- KVRAF
- Topic Starter
- 6224 posts since 22 Mar, 2009 from gent
Can't seem to find a module that rearranges the elements array from low to high
Eyeball exchanging
Soul calibrating ..frequencies
Soul calibrating ..frequencies
-
- KVRAF
- 2701 posts since 25 Aug, 2003 from Bournemouth, UK
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.