Some code for playing with the Teenage Engineering Ortho Remote

Overview

ortho-remote

C program for interfacing with the Teenage Engineering Ortho Remote.

  • Currently only implemented for macOS
  • Puts the remote into MIDI mode which means it has a fixed range of values

Usage

Either build and run the provided ortho program or copy the source files in src into your project and use the ortho.h interface.

Example

// malloc & free #include // printf static void onmsg(const OrthoMsg* msg, void* userdata) { switch (msg->ev) { case ORTHO_RESTING: printf("button is up\n"); break; case ORTHO_PRESSED: printf("button is down\n"); break; case ORTHO_VALUE: printf("value %f\n", msg->value); break; default: printf("%s\n", ortho_event_name(msg->ev)); } } int main(int argc, char *argv[]) { Ortho* ortho = ortho_create(malloc, free); if (!ortho) { return 1; } ortho_runloop(ortho, onmsg, NULL); ortho_free(ortho); return 0; } ">
#include "ortho.h"
#include <stdlib.h> // malloc & free
#include <stdio.h>  // printf

static void onmsg(const OrthoMsg* msg, void* userdata) {
  switch (msg->ev) {
    case ORTHO_RESTING: printf("button is up\n"); break;
    case ORTHO_PRESSED: printf("button is down\n"); break;
    case ORTHO_VALUE:   printf("value %f\n", msg->value); break;
    default:            printf("%s\n", ortho_event_name(msg->ev));
  }
}

int main(int argc, char *argv[]) {
  Ortho* ortho = ortho_create(malloc, free);
  if (!ortho) {
    return 1;
  }
  ortho_runloop(ortho, onmsg, NULL);
  ortho_free(ortho);
  return 0;
}

Build & run:

$ make
$ ./ortho
CONNECT
button is up
value 0.007874
value 0.000000
value 0.007874
value 0.015748
value 0.023622
value 0.031496
button is down
value 0.039370
value 0.047244
button is up
value 0.055118
...
You might also like...
React Native library that implements PayPal Checkout flow using purely native code (swift).
React Native library that implements PayPal Checkout flow using purely native code (swift).

react-native-paypal-swift React Native library that implements PayPal Checkout flow using purely native code (swift). Installation npm install react-n

The iOS pod which can collect profile data to detect code coverage.
The iOS pod which can collect profile data to detect code coverage.

CodeCoverageKit Installation CodeCoverageKit is available through CocoaPods.

Yumemi Co., Ltd. iOS engineer code check task
Yumemi Co., Ltd. iOS engineer code check task

株式会社ゆめみ iOS エンジニアコードチェック課題 概要 本プロジェクトは株式会社ゆめみ(以下弊社)が、弊社に iOS エンジニアを希望する方に出す課題のベースプロジェクトです。本課題が与えられた方は、下記の概要を詳しく読んだ上で課題を取り組んでください。 アプリ仕様 本アプリは GitHub の

How to use swiftlint to identify unused code or unused imports in a Swift codebase

Swift compilation database This repository demonstrates how to use swiftlint to identify unused code or unused imports in a Swift codebase. How to run

High-quality source code, easy implementation

High-quality source code, easy implementation

tuist, BDD - Test Code, CleanArchitecture, ReactorKit, Swinject
tuist, BDD - Test Code, CleanArchitecture, ReactorKit, Swinject

SwinjectReactorKitExample This is a Demo App for tuist, Swinject, Clean Architectue, ReactorKit and BDD 이 프로젝트를 실행시켜보려면 tuist를 깔고, generate해야함 실행해도 별거

A simple Swift sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema.

simpleP21ReadSample A simple sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema. by Tsutomu Yoshida, Minokamo Japan

A template to solve Advent of Code problems using Swift

Advent Of Code Swift Template This repository serves as a template for an Xcode project set up to solve the Advent of Code problems in Swift. No attem

Swift solutions for Advent of Code 2021

Advent Of Code Swift Template This repository serves as a template for an Xcode project set up to solve the Advent of Code problems in Swift. No attem

Owner
Rasmus
Personal Software, languages, compilers, Humans & Computers, and other fun things. Past professional life at Figma, Facebook, Spotify, Dropbox, etc.
Rasmus
Some helpful swift code snippets

HelpfulSwiftSnippets Some helpful swift code snippets Network Manager - a generic network manager that deals with downloading data from the internet u

null 2 Oct 17, 2021
An example implementation of using a native iOS Notification Service Extension (to display images in remote push notification) in Titanium.

Titanium iOS Notification Service Extension An example implementation of using a native iOS Notification Service Extension (to display images in remot

Hans Knöchel 8 Nov 21, 2022
A Swift Recreation of Attach-Detach, with some configurable options

Attach-Detach-Sw A Swift Recreation of Attach-Detach, with some configurable options Usage To use, you'll need to specify if you are attaching or deta

Dabezt 1 Dec 24, 2021
Package that extends Combine with some useful APIs

CombineExpanded Package that extends Combine with some useful APIs. New API: then shareReplay Future.deferred then Wait for completion of self, then f

Cogniteq 1 Nov 24, 2021
Mybook swiftui - A Facebook UI Clone with some capabilities like like/unlike, comment, scroll, show stories etc

mybook_swiftui ?? Trying to create a Facebook UI Clone with some capabilities li

mogolAyberk 1 Apr 16, 2022
Provides some Apple Wallet functionality, like adding passes, removing passes and checking passises for existing.

react-native-wallet-manager Provides some Apple Wallet's functionality, like adding passes, removing passes and checking passises for existing. Instal

dev.family 50 Nov 12, 2022
Command line tool for exporting resources and generating code from your Figma files

Fugen Fugen is a command line tool for exporting resources and generating code from your Figma files. Currently, Fugen supports the following entities

Almaz Ibragimov 69 Dec 17, 2022
OpenAPI/Swagger 3.0 Parser and Swift code generator

SwagGen SwagGen is a library and command line tool for parsing and generating code for OpenAPI/Swagger 3.0 specs, completely written in Swift. Swagger

Yonas Kolb 568 Jan 5, 2023
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Dec 31, 2022
SwiftTypeReader - You can gather type definitions from Swift source code.

SwiftTypeReader - You can gather type definitions from Swift source code.

omochimetaru 23 Dec 12, 2022