https://github.com/rsms/ortho-remote
Some code for playing with the Teenage Engineering Ortho Remote
https://github.com/rsms/ortho-remote
Last synced: about 1 year ago
JSON representation
Some code for playing with the Teenage Engineering Ortho Remote
- Host: GitHub
- URL: https://github.com/rsms/ortho-remote
- Owner: rsms
- License: isc
- Created: 2021-06-27T21:53:38.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-28T00:17:05.000Z (almost 5 years ago)
- Last Synced: 2025-04-11T15:26:34.002Z (about 1 year ago)
- Language: Objective-C
- Size: 26.4 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ortho-remote
C program for interfacing with the
[Teenage Engineering Ortho Remote](https://teenage.engineering/products/orthoremote).
- 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
```c
#include "ortho.h"
#include // 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;
}
```
Build & run:
```sh
$ 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
...
```