-
Notifications
You must be signed in to change notification settings - Fork 5
/
live-test.js
62 lines (51 loc) · 1.49 KB
/
live-test.js
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
autowatch = 1;
function log() {
for(var i=0,len=arguments.length; i<len; i++) {
var message = arguments[i];
if(message && message.toString) {
var s = message.toString();
if(s.indexOf("[object ") >= 0) {
s = JSON.stringify(message);
}
post(s);
}
else if(message === null) {
post("<null>");
}
else {
post(message);
}
}
post("\n");
}
log("___________________________________________________");
log("Reload:", new Date);
var liveObject = new LiveAPI("live_set");
// log(liveObject.info);
var isPlaying = liveObject.get('is_playing');
log(isPlaying);
liveObject.set('is_playing', 1 - Number(isPlaying));
//var tempo = liveObject.get('tempo');
// liveObject.set('tempo', parseFloat(tempo) + 10.0);
// var trackCount = liveObject.getcount('tracks');
//log(trackCount);
//log(liveObject.get('tracks'));
// log(liveObject.get('tracks')[0]);
//var track = new LiveAPI('live_set tracks 0');
var track = new LiveAPI(['live_set', 'tracks', 1]);
log(track.info);
log(track.get('name'));
post('\n\n---------------\n\n');
var mute = track.get('mute');
log(mute, typeof(mute), Number(mute), typeof(Number(mute)));
track.set('mute', 1 - Number(mute));
log(track.get('mixer_device'));
track.goto('mixer_device');
// Now it's a mixer.
log(track.info);
//track.goto('volume');
//log(track.info);
//log(track.get('value'));
//track.set('value', 0.25);
//var volume2 = new LiveAPI(['live_set', 'tracks', 1, 'mixer_device', 'volume']);
//log(volume2.get('value'));