CVCenterKeyboardTouchOSC:
Filter:
Classes (extension) | Conductor > CVCenter | External Control > OSC

CVCenterKeyboardTouchOSC : Object
ExtensionExtension

A utility addon for CVCenterKeyboard,meant to simplitfy external OSC control

Description

CVCenterKeyboardTouchOSC is a simple utility whose instances hold a NetAddr referring to an external OSC device or application in the same network as the computer SuperCollider is running on. When you create a new CVCenterKeyboard instance a CVCenterKeyboardTouchOSC instance can be added in the new constructor, in newSynthDef or by calling addTouchOSC on the CVCenterKeyboard instance.

CVCenterKeyboardTouchOSC was written having the popular TouchOSC appliction in mind. A TouchOSC layout that should work out of the box with CVCenterKeyboard, respectively CVCenterKeyboardRecorder is included with the CVCenterKeyboard library. To upload this layout to TouchOSC you will need the TouchOSC layout editor: https://hexler.net/touchosc-mk1#resources

First code examples:

Class Methods

CVCenterKeyboardTouchOSC.new(keyboard, addr)

Create a new CVCenterKeyboardTouchOSC instance. It is not recommended to use this method directly as the new instance will not be stored in the instance var CVCenterKeyboard: -touchOSC. Rather create the instance in the CVCenterKeyboard: *new constructor, CVCenterKeyboard: *newSynthDef or a call to CVCenterKeyboard: -addTouchOSC.

Arguments:

keyboard

The CVCenterKeyboard instance to which the instance shall be added.

addr

A NetAddr referring to the IP address of the external OSC device or application and the listening port of the device or application.

CVCenterKeyboardTouchOSC.all

Returns:

An Event holding all current CVCenterTouchOSC instances.

CVCenterKeyboardTouchOSC.trackNums

CVCenterKeyboardTouchOSC.trackNums = value

An Array of Integers reflecting the number of tracks (= sequences) in the TouchOSC interface - by default 24. Trck numbering should always start at 0. CVCenterKeyboardTouchOSC.trackNums is used internally for bookkeeping of currently used tracks in the TouchOSC interface. Basiscally you can record as many sequences as you like using CVCenterKeyboardRecorder. However, the TouchOSC interface can only display as many tracks as determined by the size of CVCenterKeyboardTouchOSC.trackNums. Nevertheless, as long as you don't exceed that limit it should be guaranteed that the TouchOSC interface will display a recorded sequence and let you control it via its touch interface.

Predefined OSC commands

The included TouchOSC layout will work with a few predefined OSC commands that are also reflected in this class' classvars. Each of the following are getters and setters, meaning you may adapt them according to your needs. E.g. the commands stored in CVCenterKeyboardTouchOSC.seqAmpCmds will allow you to set the amplitude of sequences recorded by a CVCenterKeyboardRecorder. By default there are 24 for up to 24 different sequences defined. You may wish to in- or decrease that number or change the commands itself:

The above described calls can also be placed in the startup file to make changes permanent.

CVCenterKeyboardTouchOSC.seqAmpCmds

CVCenterKeyboardTouchOSC.seqAmpCmds = value

Set or get the class-wide commands for setting the amplitudes of sequences recorded by a CVCenterKeyboardRecorder instance.

CVCenterKeyboardTouchOSC.seqPauseResumeCmds

CVCenterKeyboardTouchOSC.seqPauseResumeCmds = value

Set or get the class-wide commands for pausing and resuming sequences recorded by a CVCenterKeyboardRecorder instance.

CVCenterKeyboardTouchOSC.seqNameCmds

CVCenterKeyboardTouchOSC.seqNameCmds = value

Set or get the class-wide commands for setting the names of sequences recorded by a CVCenterKeyboardRecorder instance in TouchOSC's user interface (the name will appear as a label on the sequence's amplitude slider).

CVCenterKeyboardTouchOSC.seqRemoveCmds

CVCenterKeyboardTouchOSC.seqRemoveCmds = value

Set or get the class-wide commands for removing sequences recorded by a CVCenterKeyboardRecorder instance.

CVCenterKeyboardTouchOSC.seqRemoveAllCmd

CVCenterKeyboardTouchOSC.seqRemoveAllCmd = value

Contrary to all other afor described classvars this is only a single commend which will remove all sequences recorded by a CVCenterKeyboardRecorder instance at once.

Inherited class methods

Instance Methods

.keyboard

Returns:

The CVCenterKeyboard instance the CVCenterKeyboardTouchOSC instance has been assigned to.

.addr

Returns:

The instance's NetAddr, referring to the IP address of the external OSC device or application.

Predefined OSC commands in instances

The following instance vars (all of them are getters and setters) work analog to their equivalent classvars. You may have more than one CVCenterKeyboard instance defined, for which you need different OSC command names (or namespaces).

.seqNameCmds

.seqNameCmds = cmdsList

Arguments:

cmdsList

.seqRemoveCmds

.seqRemoveCmds = cmdsList

Arguments:

cmdsList

.seqAmpCmds

.seqAmpCmds = cmdsList

Arguments:

cmdsList

.seqRemoveAllCmd

.seqRemoveAllCmd = cmd

Arguments:

cmd

.seqPauseResumeCmds

.seqPauseResumeCmds = cmdsList

Arguments:

cmdsList

Inherited instance methods