AbstractMIDIControl:
Filter:
ddwMIDI/Classes (extension) | External Control > MIDI

AbstractMIDIControl
ExtensionExtension

Abstract superclass of all ddwMIDI controllers

Description

This class implements behavior that is common to all MIDI controllers. You will not use this class directly in normal cases.

If you need to define a custom controller, inherit from this class.

NOTE: By default, continuous controllers do not respond until the incoming controller value either comes close to, or crosses, the existing value. This is to prevent the value in SuperCollider from jumping suddenly to a physical controller value that may be quite distant. You can disable this behavior globally by setting AbstractMIDIControl.syncByDefault = false. It is currently not supported to choose this behavior per responder.

Class Methods

.syncByDefault

A Boolean, determining whether future MIDI controllers will update immediately (if false) or wait until the new value is close to the old one (if true).

.new

Creates an instance of the socket subclass being invoked. Arguments are generic, and are forwarded to the subclass's init method.

Arguments:

chan

The messages' source. See ddwMIDI_Guide: Identifying MIDI channels.

num

The controller number. See ddwMIDI_Guide: Controller numbers.

destination

In general, controllers target another object. This target object is the destination.

... args

Additional arguments are up to the subclass.

Returns:

The controller instance.

Instance Methods

.ccnum

Returns:

The controller number. If the controller was automatically allocated, the return value may be an instance of CControl. Otherwise, the return value should be an Integer.

.controlType

A symbol, indicating the default controller type to look up, if no controller number is given. See CCAllocator for details.

.destValue

(Optionally supported by subclasses.) If the destination has a concrete value, return the value here.

.destinationChanged

Method not used at present.

.resync

Reset the controller-sync status -- i.e., force the next incoming MIDI CC message for this responder to update the active value, regardless of its distance from the previous value.

.setSync

Called internally by MIDIChannel. Implements the value-sync logic: If the new value is close to, or crosses, the old value, then update. Otherwise, ignore.

.spec

Returns:

The destination's ControlSpec, if it has one.

.free

Remove the controller completely from the ddwMIDI hierarchy.

.destination

Returns:

The controller's target object.

.parent

Returns:

The controller's parent MIDIChannel object. From this, you can get information about the device and channel from which the controller is receiving messages.

.clear

Subclasses may implement clear to keep the controller registered in the hierarchy, but become inactive.

.init

Subclasses should implement init for their specific requirements. Users should not call init directly.