File: cam_voice_midi_collage.sp

package info (click to toggle)
sitplus 1.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 23,636 kB
  • sloc: cpp: 34,437; ansic: 7,957; xml: 1,141; yacc: 326; lisp: 235; lex: 167; makefile: 107; sh: 5
file content (98 lines) | stat: -rwxr-xr-x 2,522 bytes parent folder | download | duplicates (2)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
type virtualinstrument
name _"Playing with voice + Virtual Instrument"

#
# Inputs
#

# Camera source
create camera_grabber grabber

# Background drawer
import lib/ipl2sdl.sps
create ipl2sdl_chk ipl2sdl_chk
connect grabber image ipl2sdl_chk image

# Camera motion tracker
import lib/camera_oflow_motion.sps
create camera_oflow_motion cam_tracker
connect grabber image cam_tracker image
# Enable checkbox
create fmul cam_enable
create widget_checkbox chk_enable_cam -v true -l _"Enable camera control"
create fcast cam_enable_cast
connect chk_enable_cam value cam_enable_cast in
connect cam_enable_cast out cam_enable b
connect cam_tracker motion cam_enable a

# Playing with the voice
import lib/pvoice.sps
create playingwithvoice pvoice
# Enable checkbox
create fmul pvoice_enable
create widget_checkbox chk_enable_voice -v true -l _"Enable voice control"
create fcast pvoice_enable_cast
connect chk_enable_voice value pvoice_enable_cast in
connect pvoice_enable_cast out pvoice_enable b
connect pvoice out pvoice_enable a

#
# Master sensitivity
#
create widget_slider sld_sens_master -l _"Master sensitivity" --min 0 --max 2 -v 1

#
# MIDI player
#
import lib/motion_midi_player.sps
create motion_midi_player player
create fmul sens_midi
connect sld_sens_master value sens_midi b
connect cam_enable result sens_midi a
connect sens_midi result player motion

#
# Collage
#
import lib/motion_collage.sps
create motion_collage motion_collage
connect ipl2sdl_chk surface motion_collage background

create send_main_async to_main

# Accumulate motion
# Motion from cam is sent to the main thread and is the one
# input that provides synchonization.
create fadd cam_voice_add
connect pvoice_enable result cam_voice_add b
connect cam_enable result cam_voice_add a
create fmul cam_voice_sens
connect sld_sens_master value cam_voice_sens b
connect cam_voice_add result cam_voice_sens a
connect cam_voice_sens result to_main in
connect to_main out motion_collage motion

begin_gui_layout
	layout_begin hbox
		layout_begin vbox
			layout_begin book
				layout_begin book_page _"Camera Tracker"
					component chk_enable_cam
					component cam_tracker
					component ipl2sdl_chk
				layout_end
				layout_begin book_page _"Voice Input"
					component chk_enable_voice
					component pvoice
				layout_end
			layout_end
#			component sld_sens_master
		layout_end
		layout_begin vbox _"MIDI Sound"
			component player
		layout_end
		layout_begin vbox _"Graphics"
			component motion_collage			
		layout_end
	layout_end
end_gui_layout