OSCMapper is a Quark which intents to simplify the process of controlling SuperCollider with external OSC controllers such as TouchOSC.
Learn OSC controls
With OSCMapper it is possible to automatically create an OSCMapper layout according to the data it received which is often refered to as learning of controllers. Simply turn OSCMapper into learning mode
move the controllers (which should send its messages to the sclang standard port 57120, see NetAddr: *langPort) and once finished stop the learning process which will output a new controller
The detected mapping will be shown at the post video. There are
[key1, value1, key2, value2, ...]
(not supported via learning)which all use OSCMapperElement as foundation.
How to use the OSC values
Assuming you have a OSC controller which is sending on address /1/fader
and you have set up OSCMapper for this address you can access the value
Creating a layout manually
In case you do not want to learn OscMapper everytime you boot up SuperCollider you can also define the layout manually like
By providing an altName
you can access the value also via this name on the mapper, e.g.
See How to use the OSC values above for further infos.
Using a preset
The presets from TouchOSC are already provided and can be simply loaded via
See How to use the OSC values above for further infos.
Using def style access
Each OSCMapper needs to have a unique name. This is for internal reasons (as each Ndef also needs a unique address) but also to make the access to the OSCMapper easier.
Updating a layout
Lets say you want to change or modify an existing layout.
Then we can add another address on the fly by modifying the existing layout
And also modify the existing layout by adding a transformer or a callback.
and also remove an existing element
Will create a new OSCMapper. Will also add a Main: -addOSCRecvFunc which allows us to search trough all OSC messages.
name |
Should be unique as we also allow to access the instances in an Ndef manner. |
layout |
An Event where key is the OSC address and the value is a OSCMapperElement which accepts the value. |
port |
Defaults to nil which will listen to all ports entered in Main: -openPorts (which can be seen via |
Puts OSCMapper in capture mode. Should be followed by OSCMapper: *finishLearn
Will create a OSCMapper according to the messages that were received since OSCMapper: *learn was called.
name |
See OSCMapper: *new. |
Constructor with layout for TouchOSC preset Mix 2. For other args see OSCMapper: *new.
name | |
port |
Constructor with layout for TouchOSC preset Mix 2 iPad. For other args see OSCMapper: *new.
name | |
port |
Will return an Event with all registered OSCMappers where the key is the name.
Removes all instances of OSCMapper.
Allows to output the currently received OSC messages, like OSCFunc: *trace. This is useful to identify the touched controls.
echoBool |
if |
Allows to access the addresses via e.g. o['/1/fader1']
address |
The address or altname given. |
Allows to access and update the given layout. See Updating a layout above on how to use it.
Removes any server resources and also any callbacks in the language.
Multitoggles as step sequencer
The layout OSCMapper: *mix2iPad includes a 5x5
matrix which we can use as a 25 step sequencer. The OSC address for these is /1/multitoggleK/i/j
where K is the K-th multitoggle, i the column and j the row (so maybe a bit unintuitive but thats how it is in the interface).
Activate a ProxyChain
Play/Stop patterns