ExtensionCVCenterKeyboardTouchOSC 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:
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.
| 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. |
An Event holding all current CVCenterTouchOSC instances.
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.
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.
Set or get the class-wide commands for setting the amplitudes of sequences recorded by a CVCenterKeyboardRecorder instance.
Set or get the class-wide commands for pausing and resuming sequences recorded by a CVCenterKeyboardRecorder instance.
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).
Set or get the class-wide commands for removing sequences recorded by a CVCenterKeyboardRecorder instance.
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.
The CVCenterKeyboard instance the CVCenterKeyboardTouchOSC instance has been assigned to.
The instance's NetAddr, referring to the IP address of the external OSC device or application.
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).
| cmdsList |
| cmdsList |
| cmdsList |
| cmd |
| cmdsList |