Safety:
Filter:
Classes (extension) | Utilities

Safety : Object
ExtensionExtension

protect ears and equipment from risky sound signals
Source: Safety.sc

Description

Safety protects users from risky sound signals in two respects: It replaces bad values before they leave the software and enter the sound device, and it keeps the signal within +-1 (or a user-set lower limit) given by clipping, limiting, or other methods.

When the Safety quark is installed, it is on by default so that newbie users are safe; it can be turned off if desired. It puts itself at the tail of the rootnode; thus scope will be added after it, and master volume goes before it.

In ReplaceBadValues see esp. the method ugen.zap for suppressing bad numbers individually per synth.

First code examples:

Class Methods

Safety.all

dict for all Safety objects

Safety.enable

Safety.disable

enable and disable all Safety objects at once

Safety.addServers

detect all present servers, and make Safety objects for them. When creating server by hand, run this method to use Safety on them too.

Safety.synthDefFuncs

dict for all synthDef-generating functions Safety can use

Safety.defaultDefName

Safety.defaultDefName = value

get and set the name the default synthdef to use

Safety.addSynthDefFunc(defName, func)

add a function to create a safety synthDef by name.

Safety.synthDefFor(defName, numChans: 2)

make a synthDef from a named synthDefFunc for a given number of channels

Safety.useRootNode

Safety.useRootNode = value

get and set whether to add safety synth to tail of rootnode or not. true by default. if false, safety synth will run after server.defaultGroup.

Safety.new(server, defName, enable: true, numChannels)

make a new Safety, needed only when creating a custom server.

Arguments:

server

the server for which to make the safety

defName

the name of the synthdef it should use

enable

flag whether to enable this safety when making it.

numChannels

sets number of output channels to protect by Safety. Only needed if different from s.options.numOutputBusChannels.

Inherited class methods

Undocumented class methods

Safety.classLimit

Safety.limit

Safety.setLimit(val: 1.0)

Instance Methods

.server

the server of this safety

.defName

.defName = name

get and set the name of the synthdef to use for this safety

.synth

the synth running for this safety

.treeFunc

the function in ServerTree used to send safety synth when booting or after cmd-period.

.numChannels

.numChannels = num

the number of output channels of safety.server

.enabled

flag whether this safety is enabled

.enable(remake: false)

.disable

enable and disable safety.

.asTarget

When Safety.useRootNode is true, this returns the server's rootnode; when false, it returns the server. This is used as target to whose tail the safety's synth will be added.

Inherited instance methods

Undocumented instance methods

.limit

.setLimit(val)

Examples