File: p5glove.csd

package info (click to toggle)
csound 1%3A6.03.2~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 45,708 kB
  • ctags: 30,934
  • sloc: ansic: 166,298; cpp: 57,275; python: 9,433; xml: 1,302; yacc: 1,072; lex: 833; perl: 635; java: 618; lisp: 562; sh: 514; makefile: 459; tcl: 341
file content (69 lines) | stat: -rw-r--r-- 1,401 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<CsoundSynthesizer>
<CsOptions>
-+rtaudio=alsa -o dac:hw:0
</CsOptions>
<CsInstruments>
nchnls = 1
ksmps = 1000

#define P5G_BUTTONS     #0#
#define P5G_BUTTON_A    #1#
#define P5G_BUTTON_B    #2#
#define P5G_BUTTON_C    #4#
#define P5G_JUSTPUSH    #8#
#define P5G_JUSTPU_A    #9#
#define P5G_JUSTPU_B    #10#
#define P5G_JUSTPU_C    #12#
#define P5G_RELEASED    #16#
#define P5G_RELSED_A    #17#
#define P5G_RELSED_B    #18#
#define P5G_RELSED_C    #20#
#define P5G_FINGER_INDEX #32#
#define P5G_FINGER_MIDDLE #33#
#define P5G_FINGER_RING	 #34#
#define P5G_FINGER_PINKY #35#
#define P5G_FINGER_THUMB #36#
#define P5G_DELTA_X     #37#
#define P5G_DELTA_Y     #38#
#define P5G_DELTA_Z     #39#
#define P5G_DELTA_XR    #40#
#define P5G_DELTA_YR    #41#
#define P5G_DELTA_ZR    #42#
#define P5G_ANGLES      #43#

gka   init 0
gkp   init 0
instr 1  
      p5gconnect
  ka  p5gdata    $P5G_JUSTPU_A.
  kc  p5gdata    $P5G_BUTTON_C.
; If the A button is just pressed then activate a note
  if  (ka==0)    goto ee
  event          "i", 2, 0, 2

ee:
  gka p5gdata    $P5G_DELTA_X.
  gkp p5gdata    $P5G_DELTA_Y.
  printk2 gka
  printk2 gkp
  if  (kc==0)    goto ff
  printks "turning off (%d)\n", 0, kc 
  turnoff
ff:
endin

instr 2
  a1 oscil  ampdbfs(gkp), 440+100*gka, 1
;;  a1 oscil  10000, 440, 1
     out   a1
endin

</CsInstruments>

<CsScore>
f1 0 4096 10 1
i1 0 300

</CsScore>

</CsoundSynthesizer>