Adding Extensions to the General Distribution (and TopNFreq)

Hi all -

I’m a big fan of Nick Collins’ TopNFreq extension. I use it in a number of projects and I’m not sure there is a better way of doing what it is does.

Having said that, I believe it was only posted on the SC Mailing List as a “quick fix” and it hasn’t become part of the general library. It would be nice to be able to download SC onto a computer and have it already included!

I’m curious how extensions are added to the general library and if there is anything general purpose users can do to lobby for those types of inclusions.


In general, the core of SuperCollider is already too large to be efficiently + reasonably maintained by the development team. In general, things are much more likely to be REMOVED from the core rather than added. If some package were highly useful for a large number of users, and had a very low bar in terms of maintainability / low technical debt, or people on the core development team were actively maintaining it, then adding to the core would probably be reasonable to propose.

I haven’t looked at the extension you mention, but in general a lot of the Collins UGens are unmaintained and represent a very high level of technical debt (no tests, missing build tooling, unfixed bugs, etc) - probably these things would need to be resolved before this would get anywhere near the core lib.

The other option would be to take the extension as it is now, and package it as a quark with proper documentations and tests. If it requires a c++ build, I believe the supercollider plugin cookie cutter template is set up to enable automatic builds in the cloud. In combination,
these things would make it very easy to distribute the extension to users, which would at least get it out of the purgatory of an old mailing list message :slight_smile:


Could you leave a link to this extension? thanks.

Direct download link from Nick Collins’ personal website:

For those who don’t want to bother downloading but know what it’s doing, here’s a quote from the help file:

TITLE:: TopNFreq
summary:: Find top N amplitude frequency bins in spectrum and associated amplitudes
categories:: Undocumented classes, UGens>Undocumented, UGens>Unclassified
related:: Classes/SomeRelatedClass, Reference/SomeRelatedStuff, etc.

TopNFreq plugin with capacity to output the top N frequency bins and their associated amplitudes from an FFT analysis


(describe method here)

FFT UGen; output bin numbers only make sense with respect to FFT size

Choose how many frequency,amplitude tuples to return, the N in TopN

ARGUMENT:: nactive
Zero amplitudes for any bin of the topN > nactive. nactive = 0 would zero all amplitudes, 1 would keep only the top bin at its amplitude, nactive>= n would keep all etc

returns:: An array of alternating frequency bin numbers and associated amplitudes (* fftsize due to FFT scale factor)