aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 04dfb8f65ad10d582219894ef6175fc170325f64 (plain)
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

   

Introduction

csound-jstick was created in response to the builtin joystick opcode being a bit inefficient and not ideal to use. This attempts to make it a bit easier by presenting the output in two arrays (buttons and axes). A maximum of 4 axes and 12 buttons is supported. The opcode uses evdev so only works on Linux.

Requirements

  • Csound development libraries
  • Cmake 2.8.12 or later

Building

Create a build directory at the top of the source tree, execute cmake .., make and optionally make install as root. If the latter is not used/possible then the resulting module can be used with the --opcode-lib flag in Csound. eg:

cd csound-jstick
mkdir build && cd build
cmake ..
make && sudo make install

Opcode overview

jstick

kaxes[] kbuttons[] jstick inum

Obtain joystick data at k-rate.

  • kaxes[] : array containing axis data normalised to between 0 and 1, size is 4
  • kbuttons[] : array containing button data normalised to between 0 and 1, size is 12
  • inum : the joystick number corresponding to /dev/input