ObjectSpec:
Filter:
crucial-library/Classes (extension) | Spec | Libraries > crucial > Spec

ObjectSpec
ExtensionExtension

datatype for specifying untyped, unrestricted inputs

Description

This can be used for situations where a function (such as an Instr) returns an object (since obviously everything is an object, it most certainly is an object) but the class of that object could be many possible things.

Supercollider is an untyped language and the Spec system is a very rough system for specifying types.

The original purpose of ObjectSpec is to be a datatype for unhandled cases.

Class Methods

.new

Arguments:

defaultControl

This can be a function that will create a defaultControl as the other Spec classes do.

Instance Methods

.defaultControl

.storeArgs

Arguments:

stream

Examples

This example is by James Harkins. He's using the defaultControl function as a way to deliver what is needed for this particular piece. I'm not so fond of that approach, but it works.

In this patch, the Instr defines a filter structure, but leaves the choice of exciter up to the user. If the user doesn't provide an exciter, a default will be used.

Since the Formlet filter's impulse response is a sine wave, formHarmRatios and formHarmAmps accept arrays that create an additive array of Formlets. Formlet is a very efficient UGen, so the Patch is still CPU cheap!

The result resembles CHANT (IRCA/M, 1979).