-d -Ma -b1024 -m0d
-odac
; Initialize the global variables.
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
;Author: zappfinger (2017)
;
; generic server, intended to run on the RPi
; can be used to trigger and control other instruments
;
gkpot0 init 0
gkpot1 init 0
gkpot2 init 0
gkpot3 init 0
gkpot4 init 0
gkpot5 init 0
gkpot6 init 0
gkpot7 init 0
gkswitch0 init 0
gkswitch1 init 0
gkswitch2 init 0
gkswitch3 init 0
gkswitch4 init 0
gkswitch5 init 0
gkswitch6 init 0
gkswitch7 init 0
gktoggle0 init 0
gktoggle1 init 0
gktoggle2 init 0
gktoggle3 init 0
gktoggle4 init 0
gktoggle5 init 0
gktoggle6 init 0
gktoggle7 init 0
gkled0 init 0
gkled1 init 0
gkled2 init 0
gkled3 init 0
gkled4 init 0
gkled5 init 0
gkled6 init 0
gkled7 init 0
gihandle OSCinit 7777
instr 1
;+++ listening for OSC messages
gk1 OSClisten gihandle, "/sliders","ffffffff",gkpot0,gkpot1,gkpot2,gkpot3,gkpot4,gkpot5,gkpot6,gkpot7
printk2 gkpot0
gk2 OSClisten gihandle, "/buttons","iiiiiiii",gkswitch0,gkswitch1,gkswitch2,gkswitch3,gkswitch4,gkswitch5,gkswitch6,gkswitch7
; not used currently
;gk3 OSClisten gihandle, "/toggles","iiiiiiii",gktoggle0,gktoggle1,gktoggle2,gktoggle3,gktoggle4,gktoggle5,gktoggle6,gktoggle7
gkled0 = gkswitch0 ; to return the status signal
printk2 gkswitch0
; ------------------------------------------------------
; this can be used for status feedback, notice the channnel!
; change localhost to the IP address of the client!
OSCsend gkled0+gkled1+gkled2+gkled3,"localhost",7778,"/status","iiiiiiii",gkled0,gkled1,gkled2,gkled3,gkled4,gkled5,gkled6,gkled7
;imidinn notnum
;iamp ampmidi 1
endin
f1 0 4096 10 1
i1 0 36000