openmixer — generated API reference
    Preparing search index...

    Function sortBandsByFrequency

    • The same bands ordered by FREQUENCY and renumbered 1..n in that order — the whole of the sort operation, as a pure function of the list.

      RENUMBERING IS THE POINT, and this is the ONE place it is allowed. Everywhere else a number an operator is reading must not move under them: removing band 5 of six leaves 1,2,3,4,6 precisely so the survivors keep the names on their screen. Here the operator ASKED for the renumber, so the new naming is the result they wanted rather than a change they have to notice. The rule that covers both is "a number never changes without the operator having asked" — not "a number never changes".

      Ordering the ARRAY alone would carry nothing (#160: the band list is a SET and its arrangement has no meaning), which is why the ids are what actually move. Sorting the array too is for the benefit of anything that walks it in order — the ids and the order then agree, and neither is load-bearing on its own.

      Ties keep their previous relative order (a stable sort), so two bands at the same frequency do not swap names on a second press.

      Parameters

      Returns EqBand[]