#### <sup>[Ollin](../../index.md) → [Examples](../index.md) → Integration</sup>

---

## Integration

| [![DMXLoopback](https://media.ollin.art/examples/Integration/DMXLoopback/still-640.jpg?v=479b4033)](dmxloopback.md) | [![LaserPreview](https://media.ollin.art/examples/Integration/LaserPreview/still-640.jpg?v=f0a54584)](laserpreview.md) | [![MIDILoopback](https://media.ollin.art/examples/Integration/MIDILoopback/still-640.jpg?v=af43d088)](midiloopback.md) | [![OSCLoopback](https://media.ollin.art/examples/Integration/OSCLoopback/still-640.jpg?v=5a5bc5fc)](oscloopback.md) |
|---|---|---|---|
| [DMXLoopback](dmxloopback.md) | [LaserPreview](laserpreview.md) | [MIDILoopback](midiloopback.md) | [OSCLoopback](oscloopback.md) |
| [![TUIOSurface](https://media.ollin.art/examples/Integration/TUIOSurface/still-640.jpg?v=feb1fa97)](tuiosurface.md) | [![VirtualCamera](https://media.ollin.art/examples/Integration/VirtualCamera/still-640.jpg?v=1abb1500)](virtualcamera.md) |  |  |
| [TUIOSurface](tuiosurface.md) | [VirtualCamera](virtualcamera.md) |  |  |

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](../../docs/integration/osc.md), [TUIO](../../docs/integration/tuio.md), [MIDI](../../docs/integration/midi.md), [Link](../../docs/integration/link.md), [Serial](../../docs/integration/serial.md), [Bluetooth](../../docs/integration/bluetooth.md), [MQTT](../../docs/integration/mqtt.md), [Remote](../../docs/integration/remote.md), [Room](../../docs/integration/room.md), [DMX](../../docs/integration/dmx.md), [Laser](../../docs/integration/laser.md), [Syphon](../../docs/integration/syphon.md), [Virtual camera](../../docs/integration/virtualcamera.md), [Screen capture](../../docs/integration/screencapture.md), [Game controllers](../../docs/integration/controller.md), and [Haptics](../../docs/integration/haptics.md).

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.

| Example | What it shows |
|---|---|
| [OSCLoopback](oscloopback.md) | a 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`) |
| [OSCMonitor](oscmonitor.md) | listens 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()`) |
| [TUIOSurface](tuiosurface.md) | a 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`) |
| [MIDILoopback](midiloopback.md) | a 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) |
| [MIDIMonitor](midimonitor.md) | lists every MIDI source and prints and draws each message: connect a controller, touch each knob and pad, and see what it sends (`MIDIInput.messages()`) |
| [Timecode](timecode.md) | a 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:)`) |
| [Tempo](tempo.md) | visuals 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`) |
| [SerialLoopback](serialloopback.md) | the 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`) |
| [Firmata](firmata.md) | a 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 |
| [SerialMonitor](serialmonitor.md) | every 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:`) |
| [BluetoothRoom](bluetoothroom.md) | every 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`) |
| [BluetoothSensor](bluetoothsensor.md) | one 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`) |
| [MQTTRoom](mqttroom.md) | a 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`) |
| [OSCQuery](oscquery.md) | the 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`) |
| [RemoteSurface](remotesurface.md) | a 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`) |
| [RoomCanvas](roomcanvas.md) | one 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`) |
| [RoomLoopback](roomloopback.md) | the 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`) |
| [DMXLoopback](dmxloopback.md) | a 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`) |
| [LEDMapping](ledmapping.md) | the 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`) |
| [LaserPreview](laserpreview.md) | what 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`) |
| [SyphonLoopback](syphonloopback.md) | publishes 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`) |
| [SyphonViewer](syphonviewer.md) | subscribes to any external Syphon source (openFrameworks, Resolume, …) and draws it letterboxed, and while it waits it lists the sources it sees (`SyphonClient`, `availableServers`) |
| [VirtualCamera](virtualcamera.md) | publishes 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`) |
| [ScreenCapture](screencapture.md) | the 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`) |
| [ControllerInput](controllerinput.md) | a 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`) |
| [HapticRidges](hapticridges.md) | a 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`.
