nannou_touchosc
is a library for receiving OSC messages from TouchOSC controllers in Nannou.
TouchOSC is a cross-platform controller used extensively by artists. It provides an editor for quickly designing and publishing custom interfaces that can control other devices and applications using OSC. TouchOSC is available for Windows, MacOS, Linux, iOS, Android and some other unique environments.
Nannou is a creative coding framework written in Rust. Nannou aims to make it easy for artists to express themselves with simple, fast, reliable code.
nannou_touchosc is a Nannou library that makes it easy for artists and designers to quickly create custom interfaces and send values via OSC.
This library uses nannou
, nannou_OSC
and regex
crates. The library was tested using TouchOSC v1.1.3
. Note that nannou_touchosc
is not intended for mk1
.
this Cargo.toml
[dependencies]
nannou = "0.18.0"
nannou_osc = "0.18.0"
regex = "1.5.6"
inside Cargo.toml
of your workspace directory:
[workspace]
members = [
"your_nannou_sketchbook"
"nannou_touchosc",
"...etc"
]
included at the top of the sketch
use nannou_touchosc::TouchOscClient;
provide which OSC port to listen on
let mut touchosc = TouchOscClient::new(6555);
provide a unique address, as well as min, max and default values
touchosc.add_fader("/my-fader", 0.0, 1.0, 0.5);
check for new OSCmessages and update the client
touchosc.update();
read values using the previously assigned address
let fader_value = touchosc.fader("/my-fader");
println!("My fader value = {}", fader_value);
There is an example file that demonstrates all the different TouchOSC input types. See example/touchosc-client.rs
.
To run the example file:
cargo run --example touchosc-client
A TouchOSC binary is also included in the example folder. This file can be opened by a licensed TouchOSC application. The example OSC port is 6555
.
COMING SOON