Ollin

Integration

These sketches talk to the other apps and gear in a rig. Control comes in over OSC, MIDI, a shared network tempo session, a serial board, a Bluetooth device, a game controller, or a phone's browser. Visuals go out (and come in) over Syphon, as a system-wide virtual camera, as stage light, as LEDs, or as a laser. The Mac's own screen can be taken as material. Several machines can join into one room and draw one piece. Touch can go back under the hand as a felt pattern.

Each integration lives in its own library, so a sketch links only what it uses. The imports are import OllinOSC, import OllinMIDI, import OllinLink, import OllinSerial, import OllinBluetooth, import OllinMQTT, import OllinRemote, import OllinRoom, import OllinDMX, import OllinLaser, import OllinSyphon, import OllinCamera, import OllinScreen, import OllinController, import OllinHaptics. The references are OSC, TUIO, MIDI, Link, Serial, Bluetooth, MQTT, Remote, Room, DMX, Laser, Syphon, Virtual camera, Screen capture, Game controllers, and Haptics.

Several of these run both ends themselves, so they need no second app and no hardware. The round trip you watch travels over a real loopback connection.

ExampleWhat it shows
OSCLoopbacka self-contained round trip: the sketch sends an animated position to itself on 127.0.0.1 and draws the dot from what it receives, so the picture shows the round trip, and no second app is needed (OSCSender, OSCReceiver)
OSCMonitorlistens for OSC and prints and draws every message: point TouchOSC or any OSC source at this Mac to see what its controls send (OSCReceiver.messages())
TUIOSurfacea tangible surface with nothing plugged in: a stand-in tracker sends real TUIO frames to 127.0.0.1, and the touches, the turning marker, and the shape are all drawn from what comes back off the wire; turn simulate off and point a real table or phone app at port 3333 (TUIOReceiver, TUIOCursor, TUIOObject, TUIOBlob)
MIDILoopbacka self-contained loop: a virtual source sends stepped CC to itself, and a bound, smoothed @Param glides toward each step, so it runs with no hardware (MIDIOutput.openVirtual, MIDIInput.bind, @Param smoothing)
MIDIMonitorlists every MIDI source and prints and draws each message: connect a controller, touch each knob and pad, and see what it sends (MIDIInput.messages())
Timecodea sketch that chases a timeline: an internal deck sends MIDI Time Code quarter frames to itself through a virtual source, a TimecodeClock follows them, and cues flash under a scrolling timeline; point a real sender at the Mac and the same sketch chases that (TimecodeClock, Timecode, MIDIOutput.send(timecode:))
Tempovisuals locked to a beat from one of two clocks, and a parameter switches between them. The first is MIDI clock: an internal timer sends the sync messages to itself and a TempoClock follows them, and if you point a DAW or DJ mixer at the Mac, the clock follows that instead. The second is the network's shared tempo session, a LinkClock, so every Link-enabled app in the room lands on the same downbeat: run two copies and they pulse together, and alone it free-runs. A beat throb, bar dots, and an eight-beat orbit follow whichever clock is picked (TempoClock, MIDIOutput.openVirtual, LinkClock)
SerialLoopbackthe physical-computing loop with no board: a fake device on one side of a pty pair prints a sensor number thirty times a second, and a real SerialPort reads the other side, so the trace shows what arrived over the wire. A click writes a line back and the wave flips (SerialPort, latestLine)
Firmataa board with no firmware of your own: StandardFirmata's pins answer to the sketch, the analog pins as bars, digital pins as dots, a click flipping the LED, and the mouse setting a PWM duty
SerialMonitorevery serial device on this Mac, live: the first USB one opens by itself, its lines scroll up the screen, a numeric line also fills a value bar, and after an unplug it reconnects on its own. The keys 1-9 open a specific device, and space writes back (SerialPort.availableDevices(), matching:)
BluetoothRoomevery Bluetooth device around the Mac, drawn as a room: the Mac sits at the center and each device sits at the distance its signal suggests, so a phone carried past moves a dot. It needs no gear of your own, because a room is already full of devices announcing themselves (BluetoothScan, BluetoothPeripheral)
BluetoothSensorone Bluetooth device, connected and read: type part of a name into a parameter, and every value the device offers appears as it arrives. A heart rate drives the disc, and the battery is asked for on a timer (BluetoothDevice, readings(), poll)
MQTTRooma building's message bus drawn as a wall of dials: every topic the sketch hears becomes a dial filled by where its reading sits in the range that topic has covered, and the sketch publishes a wave and a mouse position of its own, so a bare broker with nothing else on it already shows the round trip. A click sends ON or OFF to a lamp topic, and the will says gone if the sketch is cut off (MQTTClient, subscribe(to:), messages(), MQTTWill)
OSCQuerythe sketch's parameters published for a control app to find: an OSCQueryServer serves every @Param as a namespace over HTTP and takes their values over OSC at the same port number, both advertised on the network, so TouchOSC or Chataigne builds the controls itself; the left column draws the namespace as served (OSCQueryServer, OSCQueryNode)
RemoteSurfacea tunable aurora served to your phone: a RemoteInspector on the extension seam starts a local-network server, so every @Param appears as a touch control in any browser on the same Wi-Fi, and changes travel live in both directions (RemoteInspector)
RoomCanvasone piece across several machines: two Macs on the same network find each other by the room's name alone, share every parameter, take one seat each so the beads travel across a wall as wide as the room, and run on one shared clock instead of each machine's own. Run alone, it is one seat of one (Room, room.time, room.seat)
RoomLoopbackthe room with no second machine: two rooms inside one sketch trade values over a transport that never leaves the process. The left panel sends where the pointer is, the right panel draws only what arrived, and the space bar cuts the wire (Room, RoomTransport)
DMXLoopbacka full DMX round trip on screen: a DMXSender chases color through universe 1 over sACN on loopback, and the drawn stage of pars is lit from the received channels. Point the sender at a node's IP and the same universe drives real lights (DMXSender, DMXReceiver, DMXFixture)
LEDMappingthe canvas sent out as LEDs: an LEDMap lays a 48-LED strip along a wave and a 12x8 matrix over the picture, samples the rendered pixels under them on the GPU each frame, and lights the drawn hardware from the universes that came back (LEDMap, DMXSender)
LaserPreviewwhat a show laser makes of a drawing: the optimized point stream is drawn the way the beam traces it, dark travel included, with the parameters that decide what a frame costs and a readout of the point budget (LaserFrame, LaserOptimizer, drawLaserPreview)
SyphonLoopbackpublishes its own frames as a Syphon source and subscribes to them, so the recursive feedback-tunnel inset shows the round trip. Open Syphon's Simple Client to see the same frames in another app (publishSyphon, SyphonClient)
SyphonViewersubscribes to any external Syphon source (openFrameworks, Resolume, …) and draws it letterboxed, and while it waits it lists the sources it sees (SyphonClient, availableServers)
VirtualCamerapublishes the sketch to the system-wide Ollin Camera, so Photo Booth, QuickTime, Zoom, and any browser read it as a live webcam. The scene is a broadcast-style "on air" picture, so the feed is obviously live. It needs the camera extension installed once, and it explains what to do when the extension is missing (publishVirtualCamera)
ScreenCapturethe Mac's own screen as material: a whole display, one app, or a single window arrives as a live image you can draw and filter, and the tunnel parameter keeps the sketch inside its own capture, so the picture recedes into itself (ScreenCapture)
ControllerInputa game controller as a drawing instrument: the left stick steers a pen that leaves ink, the trigger sets how heavy the line is, and the shoulder buttons turn its heading. On a pad that reports motion, tilting the pad tips the canvas, so the ink runs downhill (Controller, ControllerButton)
HapticRidgesa plate of ridges you drag across and feel: three strips of different spacing and crispness knock under the pointer as it crosses them, holding the button plays a hum whose strength follows the hand, and the bottom edge draws what the hardware was actually asked for (HapticPattern, playHaptic, TrackpadPlan)

Run one with swift run Example-Integration-<Name>, e.g. swift run Example-Integration-OSCLoopback.

↑↓ move ↩ open