Skip to content

Instantly share code, notes, and snippets.

@fredreichbier
fredreichbier / gist:3350742
Created August 14, 2012 16:42
How to use kluppe and osc

Since I couldn't find any documentation on that, here's a little help for people who are trying to use osc to control kluppe. The relevant file for osc is src/common/osc.c. The possible commands are implemented in lines 117-192.

Now, a little example how to make kluppe play the first looper:

oscsend localhost 1784 /kluppe/loop/1/Play i 1

The path /kluppe/loop should be the same for all messages, 1 is the looper index (starting at 1), Play is the command (all commands are implemented in the osc.c file), i 1 means that there is one integer parameter, 1, which means that the play status should be 1 (= playing).

import os/[Process, Pipe]
proc := Process new(["./print-stdin"])
proc setStdin(Pipe new())
proc executeNoWait()
proc communicate("hello world!", null, null)
import m2
global := "m1"
main: func {
global println()
testm2()
}
A: cover {
}
AA: cover from A {
}
AAA: cover from AA extends AA {
hello: func {
"hello" println()
}
Every sdk implements:
VarArgs: cover from Pointer {
// public api for retrieving varargs
getValue: func <T> (index: Int, T: Class) -> T
getClass: func (index: Int) -> T
count: SizeT {
get { ... }
}
import threading/Thread
local := ThreadLocal<Pointer> new()
setCell: func {
cell := Cell<Int> new(123)
"cell is %p" format(cell) println()
local set(cell)
}
HelloException: class extends Exception {
init: super func ~noOrigin
}
UnknownException: class extends Exception {
init: super func ~noOrigin
}
VeryFatalException: class extends Exception {
init: super func ~noOrigin
import structs/[ArrayList,HashMap]
A: class {
hello: String
init: func (=hello) {}
}
B: class extends A {
init: super func
}
rock_tmp/./vfdp.c: In function 'main':
rock_tmp/./vfdp.c:61:27: warning: unused variable 'a'
rock_tmp/./vfdp.c:63:56: error: 'a' undeclared (first use in this function)
rock_tmp/./vfdp.c:63:56: note: each undeclared identifier is reported only once for each function it appears in
C compiler failed, aborting compilation process
[FAIL]
rock_tmp/./vfdp.c: In function 'main':
rock_tmp/./vfdp.c:58:5: error: lvalue required as unary '&' operand
C compiler failed, aborting compilation process
[FAIL]