Interface:
Filter:
Classes (extension) | Libraries > crucial > Instr | Libraries > crucial > Players

Interface : AbstractPlayerProxy : AbstractPlayer : AbstractFunction : Object
ExtensionExtension

Sets up an environment in which you can build a player, a GUI and responders for midi and keyboard control
Source: Interface.sc

Description

This sets up an environment in which you can build a player, build a gui for that player, and respond to midi and keyboard control.

The gui is quite optional, and in fact non-screen-staring is one of its primary goals.

Class Methods

Interface.new(interfaceDef, args)

Arguments:

interfaceDef
args

Inherited class methods

Instance Methods

.interfaceDef

.args

.onPrepareToBundle

.onPrepareToBundle = value

.onPlay

.onPlay = value

.onStop

.onStop = value

.onFree

.onFree = value

.onNoteOn

.onNoteOn = value

.onNoteOff

.onNoteOff = value

.onCC

.onCC = value

the control change handler is installed (via CCResponder) when play starts and unistalled when play stops.

It can be a simple function:

a CCResponder that responds on a specific number. (note: tell it NOT to install itself, because the Interface will install and uninstall it when play starts or stops)

or a custom class:

whatever it is will be asked to respond to 'value' :

.guiFunction

.guiBodyFunction

.keyDownAction

.keyDownAction = value

.keyUpAction

.keyUpAction = value

.init(i, a)

Arguments:

i
a

.createArgs(argargs)

Arguments:

argargs

.prepareToBundle(agroup, bundle, private: false, bus, defWasLoaded: false)

Arguments:

agroup
bundle
private
bus
defWasLoaded

.didSpawn

.didStop

.freeToBundle(b)

Arguments:

b

.gui

.gui = f

From superclass: Object

Arguments:

f

.guiClass

.guiBody( ... args)

Arguments:

... args

.use(function)

Arguments:

function

.defer(function)

Arguments:

function

.storeArgs

.storeModifiersOn(stream)

Arguments:

stream

Inherited instance methods

Examples

GUI

You can set a custom gui function. This can use any combination of .gui style and normal Views The Interface can be placed on any other windows of any style. You may decline to customize your gui.

MIDI

If you set any of these handler functions: onNoteOn onNoteOff onPitchBend onCC then appropriate midi responders will be enabled when the player starts to play and disabled when it stops. This includes if the player is being started/stopped by external mixers, PlayerPool etc.

KeyDown/KeyUp keyDownAction keyUpAction (only when guied, only when focus is within the MetaPatch's views)

Interface is great for having no gui at all. Personally I use the gui stuff to set up parameters for performing, and then when performing I use no gui, only MIDI controllers and key commands.

The function that builds the player is actually an InterfaceDef. These can be created and stored in the same fashion as Instr and kept in the same folder. You can then address them by name, supply paramaters as you do for Patch and you will get an Interface which will use the gui and midi functions from the InterfaceDef.

onPlay onStop onFree