Trouble-shooting, Program Modification



This document discusses how to:
These are just examples of things you can do. The Kyub is completely programmable and the program heavily commented with a companion document. If you have any questions about why a code line exists or what's going on send us a line.

I. Loading Kyub Programs


If you want to change the program running on the Kyub or start modifying it, or if you need to troubleshoot the Kyub, you'll want to download the free Arduino "Integrated Development Environment" (IDE) from the Arudino site and then augment it with the Teensy files.

(1) Start here by downloading the Arduino software:
http://arduino.cc/en/Main/Software You should select the version of the Arduino IDE for the operating system of your computer.

(2) Then download "Teensyduino" here:
https://www.pjrc.com/teensy/td_download.html
(3) Open the Arduino IDE and pull down the Tools menu; it should look like this:


Note that you want:

II. Checking if the Teensy Works


Go to the File menu/Sketches/Basics/link as shown below.


Load the Blink program into the Teensy using the File, Upload command. I'm assuming the Teensy is plugged into your computer using the provided USB cable (that's right the same one used for connecting to synths). After uploading, you should see the LED on the top of the Teensey blink once a second. This is not the colored LED of the Kyub, but the little yellow LED. If you have a wooden version you will, of course, have to open the Kyub housing up to see this.

III. Checking to see if the Kyub Pads are Correctly Wired


Load a Kyub program such as the Kyub-kulele program into the Arudino IDE. In the first few lines under "//Debugging settings" you will see the following line.

int consolemidimode=1; //consolemode=0 midimode=1 capacitive mode = 2 accelerometer=3

Change the value of consolemidimode to 2 as follows:

int consolemidimode=2; //consolemode=0 midimode=1 capacitive mode = 2 accelerometer=3

and then upload the program using the technique described above. After it has successfully uploaded, go to the Arduino Tools menu and open the Serial Monitor. Every time you touch the pad you should see new line print on your computer screen. Each line lists the Kyub pads by number and the raw capacitance (touch) value detected. As you touch each pad on the Kyub the value printed should go up noticeably. See the circle values as examples during a sequential touching of each pad:

To get the intended Kyub experience with diferent programs, the printed pad numbers should match those shown in Fig. 1 below.

If some pads are not active, there may be a break in the wiring or a disconnection (be particularly aware of possible bad solder joints). If you are new to soldering, check the joints very carefully and reheat those that look suspicious. The solder should wick onto the metal parts not bead up and should be shiny.

If two pins are active at the same time, there may be a short between the wiring on the board or elsewhere. Elsewhere would probably be a solder "bridge" between two pins. Getting rid of bridges is hard if you don't have the really cool tools that you could have (Solder Wick or a Solder Sucker). Try a wet paper towel rubbed across the bridge when the solder is molten. Watch your fingers and make sure you have eye protection (always good advice).

If you're not seeing anything and the Teensy is working, something mysterious has happened. Send us an e-mail.

IV. Checking If The Onboard Accelerometer Works


The pads may workand yet you still may not have volume control if the accelerometer isn't working. Go to the same line in the Kyub program described above and change the value of consolemidimode to 3 as follows:

int consolemidimode=3; //consolemode=0 midimode=1 capacitive mode = 2 accelerometer=3.

Upload the program and open the Serial Monitor. Every time you tap a pad you should see a bunch of acceleration numbers (this is a dump of the circular acceleration buffer) and at the very bottom X, Y, and Z, maximum and minimum accelerations circled below:


You should be able to make these values to change as you tap the Kyub pads on different faces. You'll will see multiple axis numbers changing (because the Kyub vibrates in multiple directions) but one number should be bigger. Now see if you can get the accelerations of this biggest number to match the diagram below:

If you see one axis that is not working (stays constant or zero) it is almost certainly some bad soldering on the Teensy or the Teesny socket (I say this because the supplier of the chips is pretty reliable and they were professionally installed). If you see two axes that seem to have the same value it's probably "Mister Solder Bridge" again. Check all of your solder joints carefully with a magnifying glass. If you have any doubts reheat them. Again, if this doesn't work, let us know and we can try to help.

DONT FORGET TO CHANGE "CONSOLEMIDIMODE BACK TO 1"--OTHERWISE THESE TROUBLESHOOTING MESSAGES WILL SLOW THE PLAYING DOWN

V. Adjusting the Kyub Sensitivity (Acceleration Curves)


Where you will probably use above accelerometer buffer dump, mostly, is if you want to change the Kyub acceleration curves. "Acceleration curve" is a fancy term which really means how the Kyub translates the raw acceleration values (printed out on the Serial Monitor) into a MIDI note velocity (loudness).

It's completely arbitrary. I noticed that when I tapped the Kyub at reasonable levels I get values between zero and 50. MIDI note velocities can be between zero and 127. So, I simply multiply the measured acceleration "padvolume [x]" (where X is the pad number) by four and then made sure the resulting value is somewhere between 2 and 127 (2 because I don't want any pads to be touched and be silent). Here's the actual code where notevolue is the MIDI volume of the note

notevolume=int((padvolume[x])*4); //!!!!room for improvement--mapping of accel to volume
if (notevolume>127) notevolume=127;
if (notevolume<2) notevolume=2; //was 10


This works pretty well for a number of instruments in PropellerHead Reason, especially the concert piano. I am sure that someone could come up with a much better function and you may want to tweak this for a particular synthesizer or instrument.

VI. Changing the Nodes in the Chords Played


The chords are set up in the Global Variables section under the heading//first court palette. ChordA0 is the chord use when both fingers are off of the 10 and 11 pads. Chord A1 is the chord used when one finger is down, Chord A2 is the chord used when the other finger is down, etc. The numbers you see in the array are MIDI note values. Here's a chart taken from: Blair School of Music at Vanderbilt University. :

Octave
C
C#/Db
D
D#/Eb
E
F
F#/Gb
G
G#/Ab
A
A#/Bb
B
-1
0
1
2
3
4
5
6
7
8
9
10
11
-1
12
13
14
15
16
17
18
19
20
21
22
23
0
24
25
26
27
28
29
30
31
32
33
34
35
1
36
37
38
39
40
41
42
43
44
45
46
47
2
48
49
50
51
52
53
54
55
56
57
58
59
3
60
61
62
63
64
65
66
67
68
69
70
71
4
72
73
74
75
76
77
78
79
80
81
82
83
5
84
85
86
87
88
89
90
91
92
93
94
95
6
96
97
98
99
100
101
102
103
104
104
106
107
7
108
109
110
111
112
113
114
115
116
117
118
119
8
120
121
122
123
124
125
126
127
-
-
-
-

You will see that the chords are imaginatively implemented :). Hopefully I'll have a short piece on music theory explaining why did it this way. You do not have to be so constrained.