Safety:
Filter:
SafetyNet/Classes (extension) | Utilities

Safety
ExtensionExtension

protect ears and equipment from risky sound signals

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

.all

dict for all Safety objects

.enable

.disable

enable and disable all Safety objects at once

.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.

.synthDefFuncs

dict for all synthDef-generating functions Safety can use

.defaultDefName

get and set the name the default synthdef to use

.addSynthDefFunc

add a function to create a safety synthDef by name.

.synthDefFor

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

.useRootNode

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.

.new

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.

Instance Methods

.server

the server of this safety

.defName

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

the number of output channels of safety.server

.enabled

flag whether this safety is enabled

.enable

.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.

Examples