KmeansToBPSet1:
Filter:
sc3-plugins/Classes (extension) | UGens > Generators

KmeansToBPSet1
ExtensionExtension

K-means Oscillator

//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html 

Description

Uses succesive iterations of a k-means clustering algorithm on random data with random initial means to form break points in a 2-D space. These are then converted to wavetables in output synthesis based on the oscillator frequency.

Class Methods

.ar

Arguments:

freq

frequency of oscillator

numdatapoints

Initial number of data points

maxnummeans

Maximum number of means allowed

nummeans

current num means

tnewdata

If a trigger is received, reset source data (k-rate)

tnewmeans

If a trigger is received, reset means (k-rate)

soft

Proportion to soften means update. If 1.0, immediate update, 0.0 no update, proportion inbetween amount to move from the old mean position to the new mean of the allocated cluster (ie soft k-means).

bufnum

Number of a Buffer which contains positions for means and data points; see examples below

Examples